/* H1 — főstílusok
   Színpaletta: Sight design system (mint off-white + ink midnight + electric purple).
   Mobile-first. Tipográfia: Nunito (display) + Inter (UI). */

:root {
  --bg:        #F4F9F8;     /* sight mint off-white */
  --surface:   #FFFFFF;
  --surface-2: #ECF2F1;
  --line:      #DCE5E3;
  --line-2:    #E6EDEB;

  --ink:       #030630;     /* sight midnight ink */
  --ink-2:     #2D3158;
  --ink-3:     #6A6F8C;
  --ink-4:     #A6AABF;

  --accent:    #6805E1;     /* sight electric purple */
  --accent-d:  #5004B5;
  --accent-l:  #EEE0FC;

  --ok:        #1AAA9B;     /* sight teal */
  --ok-l:      #D5EFEC;
  --warn:      #FFBD3B;     /* sight yellow */
  --warn-l:    #FFEDC4;
  --danger:    #F15922;     /* sight orange */
  --danger-l:  #FCDDD0;

  --info:      #1482FA;     /* sight blue */
  --info-l:    #D6E8FE;
  --lime:      #B2DE78;
  --coral:     #F68069;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(3,6,48,0.05), 0 1px 1px rgba(3,6,48,0.03);
  --shadow-2: 0 6px 18px rgba(3,6,48,0.08), 0 2px 4px rgba(3,6,48,0.04);
  --shadow-3: 0 24px 60px rgba(3,6,48,0.20), 0 6px 12px rgba(3,6,48,0.10);

  --max-w: 1280px;

  font-family: 'Nunito', 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--surface-2);
  color: var(--ink);
  font-family: 'Nunito', 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
.mono { font-family: 'Inter', ui-monospace, monospace; font-feature-settings: 'tnum'; letter-spacing: -0.01em; }
.num  { font-variant-numeric: tabular-nums; font-family: 'Inter', system-ui, sans-serif; font-weight: 600; letter-spacing: -0.01em; }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ============== APP SHELL ============== */
.app {
  position: relative;
  margin: 0 auto;
  max-width: 100%;
  min-height: 100vh;
  background: var(--bg);
}

@media (min-width: 900px) {
  .app, .app-mobile {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    max-width: 1280px;
    margin: 0 auto;
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    min-height: 100vh;
    max-height: 100vh;
  }
  .app .topbar {
    grid-column: 2;
    grid-row: 1;
    background: var(--surface);
    padding: 18px 32px;
  }
  .app > .main {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    padding: 28px 40px 40px;
    overflow-y: auto;
  }
  /* Bottom nav becomes left sidebar on desktop */
  .app > .bottomnav {
    grid-column: 1;
    grid-row: 1 / span 3;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-direction: column;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-auto-rows: auto;
    align-content: start;
    gap: 4px;
    padding: 24px 14px;
    border-top: none;
    border-right: 1px solid var(--line);
    background: var(--bg);
  }
  .app > .bottomnav::before {
    content: 'H1';
    display: block;
    padding: 6px 12px 18px;
    font-family: 'Nunito';
    font-weight: 800;
    font-size: 18px;
    color: var(--ink);
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
  }
  .app > .bottomnav button {
    flex-direction: row;
    justify-content: flex-start;
    padding: 11px 14px;
    font-size: 14px;
    gap: 12px;
    text-align: left;
  }
  .app > .bottomnav button.active {
    background: var(--accent);
    color: white;
  }
  .app > .bottomnav button.active .label,
  .app > .bottomnav button.active .ico {
    color: white;
  }
  .app > .bottomnav .ico { width: 20px; height: 20px; }
  .app > .bottomnav .label { font-weight: 500; flex: 1; }

  /* FAB stays on the right edge of content */
  .fab {
    position: fixed;
    right: max(32px, calc((100vw - 1280px) / 2 + 32px));
    bottom: 32px;
  }

  /* Multi-column dashboard on desktop */
  .desk-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .desk-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .main h2 { font-size: 28px; }

  /* Modals center on desktop */
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--r-xl); }
}

@media (min-width: 1100px) {
  .app, .app-mobile {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .app > .main { padding: 36px 56px 48px; }
}

/* ============== TOP BAR ============== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 899px) {
  .topbar { background: #fff; }
}
.topbar h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.topbar .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.brand-mark { height: 44px; width: auto; display: block; object-fit: contain; margin-left: 6px; background: #fff; padding: 4px 8px; border: 1px solid var(--line); border-radius: 2px; box-sizing: content-box; }
.brand-logo { height: 44px; width: auto; display: block; object-fit: contain; margin-left: 6px; background: #fff; padding: 4px 10px; border: none; border-radius: 2px; box-sizing: content-box; }

/* ============== CHAT ============== */
.chat-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: stretch; justify-content: center;
  animation: slideUp 0.18s ease-out;
}
.chat-backdrop { display: none; }
.chat-window {
  flex: 1;
  background: var(--bg);
  display: flex; flex-direction: row;
  min-height: 0; min-width: 0;
}
.chat-sidebar { display: none; }
.chat-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.chat-back-btn { display: inline-flex; }
.chat-close-btn { display: none; }

@media (min-width: 900px) {
  .chat-overlay {
    background: rgba(15, 12, 10, 0.45);
    backdrop-filter: blur(4px);
    align-items: center;
    padding: 32px;
  }
  .chat-backdrop {
    display: block; position: absolute; inset: 0; cursor: pointer;
  }
  .chat-window {
    position: relative;
    flex: 0 1 1100px;
    height: min(820px, calc(100vh - 64px));
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: 0 24px 60px -12px rgba(15, 12, 10, 0.4), var(--shadow-3);
    border: 1px solid var(--line);
  }
  .chat-sidebar {
    display: flex; flex-direction: column;
    width: 280px; flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    padding: 18px 12px 24px;
    gap: 16px;
  }
  .chat-back-btn { display: none; }
  .chat-close-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    color: var(--ink-3);
    transition: background 0.15s;
  }
  .chat-close-btn:hover { background: var(--line-2); color: var(--ink); }
}

.chat-sidebar-head {
  padding: 4px 8px 0;
}
.chat-sidebar-section { display: flex; flex-direction: column; gap: 2px; }
.chat-sidebar-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 0 8px 6px; display: flex; align-items: center; gap: 6px;
}
.chat-sidebar-section-title span {
  background: var(--line-2); color: var(--ink-3);
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  font-weight: 500;
}
.chat-member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 8px;
  background: none; border: none; color: inherit;
  cursor: pointer; transition: background 0.12s;
  width: 100%;
}
.chat-member-row:hover { background: var(--surface-2); }
.chat-member-row:hover svg:last-child { color: var(--warn); }
.chat-member-row svg:last-child { color: var(--ink-3); transition: color 0.12s; }
.chat-member-avatar { position: relative; }
.chat-online-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--surface);
}
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-avatars { display: flex; align-items: center; }
.chat-avatar-more {
  margin-left: -8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: var(--ink-3);
}
.chat-stream {
  flex: 1; overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface-2);
}
.chat-day {
  display: flex; align-items: center; justify-content: center;
  margin: 8px 0 4px;
}
.chat-day span {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 11px; color: var(--ink-3);
  font-weight: 500;
}
.chat-row {
  display: flex; align-items: flex-end; gap: 8px;
}
.chat-row.mine { justify-content: flex-end; }
.chat-bubble {
  border-radius: 16px;
  padding: 9px 13px;
  font-size: 14px; line-height: 1.4;
  box-shadow: var(--shadow-1);
}
.chat-bubble.other { background: var(--surface); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-bubble.mine { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.has-ask.other { border-left: 3px solid var(--warn); }
.chat-bubble.has-ask.mine { border-right: 3px solid #fbb74e; }

.chat-ask-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255, 189, 59, 0.15);
  color: var(--warn); 
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 500;
  margin-bottom: 4px; margin-left: 4px;
}
.chat-row.mine .chat-ask-tag { margin-left: 0; margin-right: 4px; }

.chat-attach {
  border-radius: 10px; overflow: hidden;
}
.chat-attach-file {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.05);
  border-radius: 8px;
}
.chat-bubble.mine .chat-attach-file { background: rgba(255,255,255,0.18); color: #fff; }
.chat-attach-image-stub {
  background: var(--line-2); border-radius: 8px;
  padding: 22px; text-align: center; color: var(--ink-3);
}

.chat-composer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
  flex-shrink: 0;
}
.chat-composer-row {
  display: flex; align-items: flex-end; gap: 6px;
}
.chat-icon-btn {
  width: 38px; height: 38px; padding: 0;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.chat-icon-btn.active {
  background: rgba(255, 189, 59, 0.18);
  color: var(--warn);
}
.chat-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 9px 14px;
  font-family: inherit; font-size: 14px;
  resize: none; outline: none;
  max-height: 120px; min-height: 38px;
  line-height: 1.4;
  color: var(--ink);
}
.chat-input:focus { border-color: var(--accent); background: var(--surface); }
.chat-send-btn {
  width: 38px; height: 38px; padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-send-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.chat-send-btn:disabled { opacity: 0.4; }

.chat-attach-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 8px;
}
.chat-attach-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 4px 4px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}
.chat-attach-pill button { padding: 2px; color: var(--ink-3); }

.chat-ask-pending {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: rgba(255, 189, 59, 0.12);
  color: var(--warn);
  border: 1px solid rgba(255, 189, 59, 0.3);
  border-radius: 8px;
  font-size: 12px;
}
.chat-ask-pending b { color: var(--ink); font-weight: 600; }
.chat-ask-pending button { margin-left: auto; color: var(--ink-3); }

.bottomnav .nav-dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); border: 2px solid var(--surface);
}

.chat-reactions {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
  position: relative;
}
.chat-reactions.mine { justify-content: flex-end; }
.chat-reactions .chat-reaction-add {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 24px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.chat-row:hover .chat-reactions .chat-reaction-add { opacity: 0.7; }
.chat-reactions .chat-reaction-add:hover { opacity: 1; background: var(--line-2); color: var(--ink); }
@media (max-width: 720px) {
  .chat-reactions .chat-reaction-add { opacity: 0.5; }
}
.chat-reaction-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; height: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px; line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.chat-reaction-pill .emo { font-size: 13px; }
.chat-reaction-pill .num { font-weight: 600; color: var(--ink-2); font-size: 11px; }
.chat-reaction-pill:hover { background: var(--line-2); }
.chat-reaction-pill:active { transform: scale(0.94); }
.chat-reaction-pill.mine {
  background: color-mix(in oklab, var(--accent) 14%, var(--surface));
  border-color: color-mix(in oklab, var(--accent) 35%, var(--line));
}
.chat-reaction-pill.mine .num { color: var(--accent-d); }
.chat-reaction-picker {
  position: absolute;
  bottom: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  display: flex; gap: 2px;
  box-shadow: var(--shadow-2);
  z-index: 5;
}
.chat-reactions.other .chat-reaction-picker { left: 0; }
.chat-reactions.mine .chat-reaction-picker { right: 0; }
.chat-reaction-choice {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none; background: none;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.chat-reaction-choice:hover { background: var(--line-2); transform: scale(1.15); }

.topbar .badge-btn { position: relative; }
.topbar-chat-btn { padding: 8px 10px !important; }
.topbar .badge-btn .badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  font-family: 'Inter';
}

.role-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px 5px 5px; background: var(--ink); color: var(--bg);
  border-radius: var(--r-pill); font-size: 12px; font-weight: 500;
  border: none;
}
.role-chip .dot { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: white; }

/* ============== BOTTOM NAV ============== */
.bottomnav {
  position: sticky; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 4px 2px calc(env(safe-area-inset-bottom, 6px) + 4px);
}
.bottomnav button {
  background: none; border: none; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--ink-3); border-radius: var(--r-md);
  transition: color 0.15s, background 0.15s;
  min-width: 0;
}
.bottomnav button.active { color: var(--ink); background: var(--surface-2); }
.bottomnav .ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.bottomnav .ico svg { width: 20px; height: 20px; }
.bottomnav .label {
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
@media (max-width: 380px) {
  .bottomnav button { padding: 6px 1px; font-size: 9px; }
  .bottomnav .ico, .bottomnav .ico svg { width: 18px; height: 18px; }
}

/* Side nav (desktop) */
.sidenav { display: none; }
@media (min-width: 720px) {
  .sidenav { display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; border-right: 1px solid var(--line); background: var(--surface-2); }
  .sidenav .brand { padding: 6px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
  .sidenav button { background: none; border: none; padding: 9px 12px; text-align: left; display: flex; align-items: center; gap: 10px; border-radius: var(--r-md); color: var(--ink-2); font-size: 14px; }
  .sidenav button.active { background: var(--ink); color: var(--bg); }
  .sidenav button:hover:not(.active) { background: var(--line-2); color: var(--ink); }
  .bottomnav.hide-on-desktop { display: none; }
}

/* ============== TYPOGRAPHY ============== */
h2 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.015em; }
h3 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.dim   { color: var(--ink-4); }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 600; }

/* ============== CARDS ============== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
}
.card.flat { box-shadow: none; }
.card.lift { box-shadow: var(--shadow-1); border-color: transparent; }
.card.glow { background: linear-gradient(180deg, var(--accent-l) 0%, var(--surface) 70%); border-color: transparent; box-shadow: 0 1px 0 rgba(104,5,225,0.06); }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.stack-2 { display: flex; flex-direction: column; gap: 8px; }
.stack-4 { display: flex; flex-direction: column; gap: 14px; }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--r-md); border: 1px solid transparent;
  font-size: 14px; font-weight: 500;
  background: var(--surface); color: var(--ink); border-color: var(--line);
  transition: transform 0.05s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.accent  { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 1px 0 rgba(80,4,181,0.2); }
.btn.accent:hover { background: var(--accent-d); }
.btn.ghost   { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger  { background: var(--danger); color: white; border-color: var(--danger); }
.btn.ok      { background: var(--ok); color: white; border-color: var(--ok); }
.btn.lg      { padding: 16px 20px; font-size: 16px; border-radius: var(--r-lg); }
.btn.full    { width: 100%; }
.btn.sm      { padding: 7px 11px; font-size: 12px; border-radius: var(--r-sm); }

.fab {
  position: fixed; right: 18px; bottom: calc(72px + env(safe-area-inset-bottom, 0));
  z-index: 40;
  background: var(--accent); color: white; border: none;
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(104,5,225,0.45), inset 0 -4px 4px rgba(0,18,121,0.4), inset 0 -4px 8px rgba(104,5,225,0.6);
}
.fab:active { transform: scale(0.95); }

/* ============== STICKY CTA ============== */
.sticky-cta {
  position: sticky; bottom: 0; z-index: 20;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0) + 12px);
  background: linear-gradient(180deg, transparent 0%, var(--bg) 30%);
  margin-top: auto;
}

/* ============== INPUTS ============== */
.input, .textarea, .select {
  width: 100%; padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: 16px; color: var(--ink);
  transition: border 0.15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ink); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.4; }
.label { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.04em; }
.field { display: flex; flex-direction: column; }

/* Stepper */
.stepper {
  display: inline-flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden;
}
.stepper button {
  background: var(--surface); border: none; padding: 0 16px; min-width: 44px;
  font-size: 22px; color: var(--ink-2);
}
.stepper button:active { background: var(--line-2); }
.stepper input { width: 60px; text-align: center; border: none; background: var(--surface); font-size: 22px; font-weight: 700; padding: 12px 0; -moz-appearance: textfield; font-family: 'Inter', monospace; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ============== CHIPS / TAGS ============== */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line);
}
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.accent { background: var(--accent-l); color: var(--accent-d); border-color: transparent; }
.chip.ok { background: var(--ok-l); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-l); color: #8A6200; border-color: transparent; }
.chip.danger { background: var(--danger-l); color: var(--danger); border-color: transparent; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ============== AVATARS ============== */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: white;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }

/* ============== PROGRESS ============== */
.bar { height: 6px; border-radius: var(--r-pill); background: var(--line-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ink); border-radius: var(--r-pill); }
.bar.thick { height: 10px; }

/* ============== STATUS DOT ============== */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; }
.status.pending  { color: #8A6200; }
.status.pending  .dot { background: var(--warn); }
.status.approved { color: var(--ok); }
.status.approved .dot { background: var(--ok); }
.status.rejected { color: var(--danger); }
.status.rejected .dot { background: var(--danger); }
.status.paid     { color: var(--info); }
.status.paid     .dot { background: var(--info); }

/* ============== PAGE LAYOUT ============== */
.chip-row {
  display: flex; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  padding: 6px 2px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > * { flex-shrink: 0; }
@media (min-width: 720px) {
  .chip-row { flex-wrap: wrap; overflow: visible; }
}

.main {
  padding: 16px 16px 80px;
  display: flex; flex-direction: column; gap: 16px;
  min-height: calc(100vh - 60px);
}

/* ============== SCREEN TRANSITIONS ============== */
.fade-in { animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(31, 27, 22, 0.5); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.18s;
}
@media (min-width: 720px) { .modal-overlay { align-items: center; } }
.modal {
  background: var(--bg); width: 100%; max-width: 560px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 16px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (min-width: 720px) { .modal { border-radius: var(--r-xl); } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--ink-4); margin: 4px auto 14px; }

/* Photo placeholder */
.photo-ph {
  background:
    repeating-linear-gradient(45deg,
      rgba(31,27,22,0.04) 0 8px,
      rgba(31,27,22,0.07) 8px 16px);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-family: 'Inter', monospace; font-size: 11px;
  border: 1px dashed var(--line);
}

/* Phase color stripe */
.phase-stripe { width: 4px; border-radius: 2px; align-self: stretch; }

/* ============== UTILITIES ============== */
.spacer { flex: 1; }
.tap { -webkit-tap-highlight-color: transparent; }
.visually-hidden { position: absolute; left: -9999px; }
button.bare { background: none; border: none; padding: 0; color: inherit; }

.divider { height: 1px; background: var(--line); margin: 4px 0; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--line-2); border-radius: var(--r-md); }
.tabs button { flex: 1; background: none; border: none; padding: 9px 10px; border-radius: calc(var(--r-md) - 2px); font-size: 13px; font-weight: 500; color: var(--ink-3); }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* Login screen */
.login-bg {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(104,5,225,0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(20,130,250,0.10) 0%, transparent 40%);
}
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--r-xl); padding: 32px 24px 28px; box-shadow: var(--shadow-2); }
.brand-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: 'Nunito'; font-size: 18px; box-shadow: inset 0 -4px 4px 0 #001279, inset 0 -4px 8px 0 #6805E1; }

.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.login-logo { width: 72px; height: 72px; object-fit: contain; display: block; margin-bottom: 12px; }
.login-title { font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.login-subtitle { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

.login-search { position: relative; margin-bottom: 12px; }
.login-search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; }
.login-search .input { padding-left: 38px; padding-right: 36px; }
.login-search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 6px; cursor: pointer; color: var(--ink-3); display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); }
.login-search-clear:hover { background: var(--surface-2); color: var(--ink); }

.login-user-list { max-height: 360px; overflow-y: auto; margin: 0 -4px; padding: 2px 4px; display: flex; flex-direction: column; gap: 6px; }
.login-user-row { display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-align: left; cursor: pointer; transition: border-color 0.12s, background 0.12s, transform 0.05s; color: inherit; font: inherit; }
.login-user-row:hover { border-color: var(--ink-4); background: var(--surface-2); }
.login-user-row:active { transform: scale(0.99); }
.login-user-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.login-user-meta { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }

.login-selected { padding: 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 18px; background: var(--surface-2); border-radius: var(--r-md); }
