/* akroVA — Style */

:root {
  --bg:          #0f1117;
  --bg2:         #1a1d27;
  --bg3:         #242838;
  --border:      #2d3148;
  --text:        #e2e4ef;
  --text-muted:  #7b82a0;
  --accent:      #6366f1;
  --accent-dark: #4f52cc;
  --success:     #22c55e;
  --warn:        #f59e0b;
  --danger:      #ef4444;
  --radius:      8px;
  --font:        'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ===================== OVERLAY / LOGIN ===================== */

.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 1.5rem;
}

.logo-text {
  font-size: 2rem; font-weight: 800;
  letter-spacing: -1px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.login-step { display: flex; flex-direction: column; gap: 1rem; }
.login-step h2 { font-size: 1.1rem; font-weight: 600; }
.login-step label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--text-muted); }

input[type="text"], input[type="password"], input[type="email"],
textarea, select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .5rem .75rem;
  font-size: .9rem;
  width: 100%;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.hint       { font-size: .85rem; color: var(--text-muted); }
.hint-small { font-size: .75rem; color: var(--text-muted); word-break: break-all; }
.error-msg  { color: var(--danger); font-size: .85rem; }

/* QR Code placeholder */
#qrCodeContainer {
  display: flex; justify-content: center;
  background: white; padding: 1rem; border-radius: var(--radius);
}
#qrCodeContainer img { width: 160px; height: 160px; }

/* ===================== BUTTONS ===================== */

.btn {
  padding: .45rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  transition: opacity .15s, background .15s;
}
.btn:hover { opacity: .85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); opacity: 1; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg3); opacity: 1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sync   { background: var(--bg3); border-color: var(--border); color: var(--text); }
.btn-sm { padding: .25rem .6rem; font-size: .8rem; }

button[type="submit"] { background: var(--accent); color: #fff; padding: .55rem 1.2rem; border: none; border-radius: var(--radius); cursor: pointer; font-size: .9rem; font-weight: 500; }
button[type="submit"]:hover { background: var(--accent-dark); }

/* ===================== APP SHELL ===================== */

#app { display: flex; flex-direction: column; height: 100vh; }

.app-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: 52px;
  flex-shrink: 0;
}

.app-logo {
  font-size: 1.2rem; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.tab-nav { display: flex; gap: .25rem; flex: 1; }
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: .4rem .75rem;
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.header-right { display: flex; align-items: center; gap: .5rem; }
.sync-area    { display: flex; align-items: center; gap: .5rem; }
.sync-status  { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

/* ===================== TAB CONTENT ===================== */

.tab-content { display: none; flex: 1; overflow-y: auto; padding: 1.25rem; flex-direction: column; gap: 1rem; }
.tab-content.active { display: flex; }

.tab-toolbar {
  display: flex; flex-direction: column; gap: .75rem;
  flex-shrink: 0;
}

.filter-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.filter-row select { width: auto; flex: none; }

/* ===================== STATS BAR ===================== */

.stats-bar {
  display: flex; gap: .5rem; flex-wrap: wrap;
}

.stat-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .25rem .65rem;
  font-size: .8rem;
  display: flex; align-items: center; gap: .4rem;
}
.stat-chip .cat-badge { font-weight: 600; }
.stat-chip .progress-mini {
  background: var(--border);
  border-radius: 4px;
  height: 4px;
  width: 60px;
  overflow: hidden;
}
.stat-chip .progress-mini-fill { height: 100%; background: var(--accent); border-radius: 4px; }

/* ===================== ITEM LIST ===================== */

.item-list { display: flex; flex-direction: column; gap: .5rem; }

.item-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  display: flex; align-items: flex-start; gap: .75rem;
  transition: border-color .15s;
}
.item-card:hover { border-color: var(--accent); }
.item-card.done { opacity: .55; }

.item-card input[type="checkbox"] {
  width: 1rem; height: 1rem; margin-top: .1rem;
  accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
}

.item-content { flex: 1; min-width: 0; }
.item-title { font-weight: 500; word-break: break-word; }
.item-title.done { text-decoration: line-through; }
.item-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.item-desc { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }

.item-actions { display: flex; gap: .35rem; flex-shrink: 0; }

/* ===================== BADGES ===================== */

.badge {
  display: inline-block;
  border-radius: 4px;
  padding: .1rem .45rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.badge-kritisch  { background: rgba(239,68,68,.2);  color: #fca5a5; }
.badge-wichtig   { background: rgba(245,158,11,.2); color: #fcd34d; }
.badge-planung   { background: rgba(99,102,241,.2); color: #a5b4fc; }
.badge-optional  { background: rgba(123,130,160,.15); color: #7b82a0; }
.badge-offen     { background: rgba(239,68,68,.2);  color: #fca5a5; }
.badge-in-recherche { background: rgba(245,158,11,.2); color: #fcd34d; }
.badge-geklaert  { background: rgba(34,197,94,.2);  color: #86efac; }
.badge-hoch      { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge-normal    { background: rgba(99,102,241,.15); color: #a5b4fc; }
.badge-niedrig   { background: rgba(123,130,160,.15); color: #7b82a0; }
.badge-ausstehend { background: rgba(123,130,160,.15); color: #7b82a0; }
.badge-aktiv      { background: rgba(245,158,11,.2); color: #fcd34d; }
.badge-erreicht   { background: rgba(34,197,94,.2);  color: #86efac; }
.badge-default   { background: var(--bg3); color: var(--text-muted); }

/* ===================== MILESTONE GRID ===================== */

.milestone-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.milestone-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex; flex-direction: column; gap: .75rem;
}

.milestone-header { display: flex; align-items: flex-start; gap: .5rem; }
.milestone-header h3 { flex: 1; font-size: .95rem; font-weight: 600; }

.milestone-progress {
  background: var(--bg3);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.milestone-progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }

.milestone-criteria { display: flex; flex-direction: column; gap: .35rem; }
.criterion-row { display: flex; align-items: center; gap: .5rem; font-size: .875rem; }
.criterion-row input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.criterion-row.done span { text-decoration: line-through; color: var(--text-muted); }

.milestone-footer { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--text-muted); }

/* ===================== CARD GRID (Contacts, Notes) ===================== */

.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.contact-card, .note-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
}

.contact-name, .note-title { font-weight: 600; font-size: .95rem; }
.contact-meta { font-size: .82rem; color: var(--text-muted); display: flex; flex-direction: column; gap: .2rem; }
.contact-meta a { color: var(--accent); text-decoration: none; }
.contact-meta a:hover { text-decoration: underline; }

.note-content { font-size: .875rem; color: var(--text-muted); white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto; }
.note-footer { font-size: .75rem; color: var(--text-muted); display: flex; justify-content: space-between; }

.card-actions { display: flex; gap: .35rem; margin-top: auto; }

/* ===================== MODAL ===================== */

.modal-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
  z-index: 900;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%; max-width: 520px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 1.25rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-full { display: flex; flex-direction: column; gap: .35rem; }
.form-full label, .form-row label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--text-muted); }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; }

textarea { resize: vertical; min-height: 100px; }

/* ===================== TOAST ===================== */

.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1.25rem;
  font-size: .875rem;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: slideIn .2s ease;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger); }

@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ===================== USER LIST ===================== */

.user-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-info { flex: 1; }
.user-info strong { display: block; font-size: .9rem; }
.user-info span { font-size: .8rem; color: var(--text-muted); }

/* ===================== EMPTY STATE ===================== */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ===================== SCROLLBAR ===================== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===================== HIDDEN ===================== */
[hidden] { display: none !important; }
