/* ============================================================
   Studio Fritz Board — Design System
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
  /* Brand accent — fuchsia/magenta, same family as Fritz.OS */
  --accent:        #c026d3;
  --accent-soft:   #c026d314;
  --accent-strong: #a21caf;
  --ok:      #30b46c;
  --warn:    #e0a13a;
  --danger:  #e0533a;
  --info:    #3a8de0;

  --radius:   16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --gap: 20px;
  --shadow: 0 1px 2px rgba(16,18,27,.03), 0 6px 18px rgba(16,18,27,.04);
  --shadow-lg: 0 16px 50px rgba(16,18,27,.14);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --t: .2s cubic-bezier(.32,.72,0,1);
}

html[data-theme="light"] {
  /* Cool slate neutrals — same family as Fritz.OS */
  --bg:        #f1f5f9;
  --bg-2:      #e2e8f0;
  --surface:   #ffffff;
  --surface-2: #f1f5f9;
  --text:      #0f172a;
  --text-2:    #475569;
  --muted:     #94a3b8;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --field:     #ffffff;
}

html[data-theme="dark"] {
  /* Cool slate/navy blacks — same family as Fritz.OS (bg-slate-950) */
  --bg:        #020617;
  --bg-2:      #010206;
  --surface:   #0f172a;
  --surface-2: #1e293b;
  --text:      #f1f5f9;
  --text-2:    #94a3b8;
  --muted:     #64748b;
  --border:    #1e293b;
  --border-2:  #334155;
  --field:     #0f172a;
  --accent: #d946ef;
  --accent-soft: #d946ef24;
  --accent-strong: #e879f9;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 50px rgba(0,0,0,.6);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t), color var(--t);
}
h1,h2,h3,h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
a { color: var(--accent); text-decoration: none; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 10px; color: var(--text);
  background: var(--surface-2); transition: all var(--t);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-soft); }
.btn--primary:hover { background: var(--accent-strong); }
.btn--ghost { background: transparent; border-color: var(--border-2); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--subtle { background: var(--accent-soft); color: var(--accent); }
.btn--sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; justify-content: center; }
.icon-btn {
  background: transparent; border: none; cursor: pointer; color: var(--text-2);
  font-size: 19px; width: 38px; height: 38px; border-radius: 9px; transition: var(--t);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--field); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 10px 12px; transition: var(--t); width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 600; }

/* ---------- Auth / public screens ---------- */
.auth-screen {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: 24px; overflow: auto; z-index: 5;
}
.auth-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -8%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 500px at 110% 10%, var(--accent-soft), transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 34px; box-shadow: var(--shadow-lg);
}
.auth-card--wide { max-width: 620px; }
.auth-title { font-size: 24px; margin-top: 22px; }
.auth-sub { color: var(--text-2); margin: 6px 0 22px; }
.auth-hint { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; }
.auth-foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip {
  border: 1px solid var(--border-2); background: var(--surface-2);
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer;
  transition: var(--t); display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.request-thanks { text-align: center; padding: 20px 0; }
.thanks-mark {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 6px;
  background: var(--ok); color: #fff; font-size: 32px; display: grid; place-items: center;
}
.request-thanks .btn { margin: 6px; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff; font-weight: 800; letter-spacing: .5px;
  display: grid; place-items: center; box-shadow: 0 4px 14px var(--accent-soft);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 11.5px; color: var(--muted); }
.brand--lg .brand-mark { width: 52px; height: 52px; border-radius: 50%; font-size: 19px; }
.brand--lg .brand-text strong { font-size: 18px; }

/* ---------- App layout ---------- */
.app { position: relative; min-height: 100vh; --sb-w: 248px; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 16px; gap: 22px;
  position: fixed; left: 0; top: 0; height: 100vh; width: var(--sb-w);
  overflow-y: auto; overflow-x: hidden;
  z-index: 45; transition: transform var(--t);
}
/* Menu is an OVERLAY (FritzOS-style): content stays full-width and blurs
   behind the menu when it slides in — it is not pushed aside. */
.main { margin-left: 0; min-width: 0; }
.app.nav-collapsed .sidebar { transform: translateX(-100%); }
.app:not(.nav-collapsed) .sidebar { box-shadow: var(--shadow-lg); }

/* Blur scrim over the content while the menu is open; click to close. */
.nav-scrim {
  position: fixed; inset: 0; z-index: 44; background: rgba(2, 6, 23, .35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity var(--t);
}
.app:not(.nav-collapsed) .nav-scrim { opacity: 1; pointer-events: auto; }

/* Pull-out tab — vertically centered, fuchsia, rides the menu's right edge */
.sidebar-tab {
  position: fixed; top: 50%; left: var(--sb-w); transform: translateY(-50%);
  width: 22px; height: 66px; z-index: 46; cursor: pointer; padding: 0;
  background: var(--accent); color: #fff; border: none;
  border-radius: 0 11px 11px 0; box-shadow: 2px 0 12px var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  transition: left var(--t), width var(--t), background var(--t);
}
.sidebar-tab:hover { background: var(--accent-strong); width: 26px; }
.sidebar-tab .icn { transform: rotate(90deg); transition: transform var(--t); }   /* ‹ — push in */
.app.nav-collapsed .sidebar-tab { left: 0; }
.app.nav-collapsed .sidebar-tab .icn { transform: rotate(-90deg); }               /* › — pull out */
/* nav sizes to its content; the whole sidebar scrolls if it's tall, so the
   user card sits directly under the last menu item (not pinned to the bottom). */
.nav { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; margin: 0 -4px; padding: 0 4px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 8px 4px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: 10px; color: var(--text-2); cursor: pointer; transition: var(--t);
  font-weight: 550; font-size: 14px; border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-item .ni-icon { width: 22px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.icn { display: block; }
.theme-toggle__icon { display: inline-flex; align-items: center; justify-content: center; }
.uc-caret { display: inline-flex; align-items: center; }
.icon-btn .icn { margin: 0 auto; }
.nav-item .ni-badge {
  margin-left: auto; background: var(--accent); color: #fff; font-size: 11px;
  font-weight: 700; padding: 1px 7px; border-radius: 999px;
}
.nav-item .ni-ext { margin-left: auto; color: var(--muted); display: inline-flex; }
.nav-item:hover .ni-ext { color: var(--accent); }
.sidebar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.brand-col { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.sidebar-date { display: flex; align-items: baseline; gap: 8px; padding-left: 3px; line-height: 1.2; }
.sidebar-date .sd-date-line { font-size: 12.5px; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.sidebar-date .sd-time { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.theme-btn { font-size: 18px; flex: none; }
.theme-btn:hover { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot { display: flex; flex-direction: column; gap: 12px; }
.theme-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; color: var(--text-2); font: inherit; font-size: 13px; transition: var(--t);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-2); }
.user-card {
  display: flex; align-items: center; gap: 4px; padding: 5px;
  border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border);
}
.uc-main {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  background: transparent; border: none; cursor: pointer; font: inherit; color: inherit;
  text-align: left; padding: 5px; border-radius: 10px; transition: var(--t);
}
.uc-main:hover { background: var(--surface); }
.uc-main:hover .uc-info strong { color: var(--accent); }
.uc-caret { color: var(--muted); font-size: 14px; margin-left: auto; padding: 0 2px; }
.user-card .uc-info { flex: 1; min-width: 0; line-height: 1.2; }
.user-card .uc-info strong { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .uc-info span { font-size: 11px; color: var(--muted); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 3;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 20px; }
.page-sub { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.search { position: relative; display: flex; align-items: center; }
.search-icn { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--accent); display: inline-flex; pointer-events: none; }
.search input { width: 300px; padding-left: 34px; }

/* Top-bar AI assistant popover */
.ask-popover { position: absolute; top: calc(100% + 8px); right: 0; width: 460px; max-width: 88vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 14px 16px; z-index: 30; animation: pop .15s; }
.ask-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ask-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; color: var(--accent); }
.ask-more { margin-left: auto; font-size: 12px; }
.ask-x { width: 28px; height: 28px; }
.ask-q { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 8px 0; border-top: 1px solid var(--border); }
.ask-a { font-size: 13.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; max-height: 50vh; overflow: auto; }
.view { padding: 28px; }

/* ---------- Avatars ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
}
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 46px; height: 46px; font-size: 16px; }
.avatar--img { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }

/* Icon color + upload picker (Account panel) */
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch-btn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); cursor: pointer; transition: var(--t); padding: 0; }
.swatch-btn:hover { transform: scale(1.12); }
.swatch-btn.on { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.12); }
.swatch-color { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 1px dashed var(--border-2); cursor: pointer; position: relative; display: inline-block; }
.swatch-color input { position: absolute; inset: -4px; width: 34px; height: 34px; border: none; padding: 0; cursor: pointer; background: transparent; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; }
.card-head .ch-sub { font-size: 12.5px; color: var(--muted); }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: var(--accent-soft); }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-trend { font-size: 12px; font-weight: 600; }
.trend-up { color: var(--ok); } .trend-down { color: var(--danger); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--planning { color: var(--info); }
.badge--progress { color: var(--accent); }
.badge--review  { color: var(--warn); }
.badge--hold    { color: var(--muted); }
.badge--done    { color: var(--ok); }
.badge--new     { color: var(--info); }
.badge--accepted{ color: var(--ok); }
.badge--declined{ color: var(--danger); }
.badge--converted{ color: var(--accent); }
.badge--reviewing{ color: var(--warn); }
.pri { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.pri--Low { color: var(--muted); background: var(--surface-2); }
.pri--Medium { color: var(--info); background: #3a8de01a; }
.pri--High { color: var(--warn); background: #e0a13a1a; }
.pri--Critical { color: var(--danger); background: #e0533a1a; }

/* ---------- Progress / meters ---------- */
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s; }
.meter--over .meter__fill { background: var(--danger); }
.meter--high .meter__fill { background: var(--warn); }
.meter--ok .meter__fill { background: var(--ok); }

/* ---------- Project cards ---------- */
.proj-card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: var(--t); }
.proj-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.proj-card .pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.proj-card h4 { font-size: 15px; }
.proj-card .pc-client { font-size: 12.5px; color: var(--muted); }
.proj-card .pc-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-2); }
.proj-card .pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; color: var(--text-2); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.row-click { cursor: pointer; transition: var(--t); }
.tbl tr.row-click:hover { background: var(--surface-2); }
.cell-user { display: flex; align-items: center; gap: 9px; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: var(--t); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Weekly Workload ---------- */
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-label { text-align: center; min-width: 130px; line-height: 1.1; }
.week-label strong { font-size: 14.5px; display: block; }
.week-label span { font-size: 11px; color: var(--accent); font-weight: 600; }
.checkin-summary { position: sticky; top: 78px; z-index: 2; }
#weekly-body > .card { margin-bottom: 18px; }
.wl-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.wl-row__main { flex: 1; min-width: 140px; display: flex; flex-direction: column; line-height: 1.2; }
.wl-row__main strong { font-size: 13.5px; }
.wl-row__main span { font-size: 11.5px; }
.wl-row__grow { flex: 1; min-width: 180px; }
.wl-mini { display: flex; flex-direction: column; gap: 3px; }
.wl-mini > span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.wl-mini input, .wl-mini select { width: 84px; padding: 7px 9px; font-size: 13px; }
.wl-note { flex: 1; min-width: 120px; padding: 7px 10px; font-size: 13px; }
.chip--on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }

/* Member check-in tiles */
.member-tile { display: flex; flex-direction: column; gap: 12px; }
.mt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-toggle { width: 100%; background: transparent; border: none; cursor: pointer; font: inherit; color: inherit; text-align: left; padding: 0; display: flex; align-items: center; gap: 8px; }
.mt-toggle:hover .mt-name { color: var(--accent); }
.mt-chev { color: var(--muted); display: inline-flex; flex: none; transition: transform .2s; }
.member-tile:not(.collapsed) .mt-chev { transform: rotate(180deg); }
.member-tile.collapsed .mt-details { display: none; }
.mt-details { display: flex; flex-direction: column; gap: 12px; }
.mt-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mt-sub { font-size: 12px; color: var(--text-2); }
.mt-meter { margin-top: 2px; }
.mt-sec { display: flex; flex-direction: column; gap: 6px; }
.mt-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); }
.mt-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.mt-item__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.mt-item__meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.phase-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.like-pill { font-size: 10px; font-weight: 700; padding: 1px 7px; border: 1px solid; border-radius: 999px; flex: none; }
.mt-block { display: flex; gap: 7px; font-size: 12.5px; color: var(--text-2); align-items: flex-start; }
.mt-block span:first-child { color: var(--danger); }
.mt-note { background: var(--surface-2); border-radius: 11px; padding: 10px 12px; }
.mt-note p { margin: 5px 0 0; font-size: 12.5px; color: var(--text); line-height: 1.45; }

/* AI report */
.ai-report { background: linear-gradient(180deg, var(--accent-soft), transparent 120px), var(--surface); }
.ai-narrative { font-size: 14.5px; line-height: 1.6; color: var(--text); margin: 0; }
.insight { display: flex; align-items: center; gap: 11px; padding: 9px 0; font-size: 13.5px; color: var(--text-2); }
.insight__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex: none; }

/* ---------- Export ---------- */
.export-list { display: flex; flex-direction: column; gap: 6px; }
.export-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; transition: var(--t); }
.export-row:hover { border-color: var(--border-2); background: var(--surface-2); }
.export-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.export-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.export-count { font-size: 12px; }
.btn .icn { margin: 0; }

/* Report preview (on-screen before download) */
.report-preview { border: 1px solid var(--border); border-radius: 14px; padding: 22px 26px; max-height: 600px; overflow: auto; background: var(--surface-2); }
.report-preview h1 { font-size: 20px; margin: 0 0 2px; }
.report-preview .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.report-preview h2 { font-size: 14px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 5px; margin: 20px 0 8px; }
.report-preview .narr { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 11px 14px; border-radius: 8px; margin: 8px 0 6px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.report-preview table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin: 8px 0; }
.report-preview th, .report-preview td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.report-preview th { background: var(--surface); font-weight: 650; }
.report-preview ul { margin: 4px 0 10px; padding-left: 20px; font-size: 13px; }
.report-preview li { margin: 3px 0; }

/* ---------- AI chat ---------- */
.ai-chat { display: flex; flex-direction: column; gap: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; }
.chat-bubble { max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; }
.chat-bubble--user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.chat-bubble--ai { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 5px; display: flex; gap: 9px; align-items: flex-start; }
.chat-ai-mark { flex: none; }
.chat-typing { display: flex; gap: 4px; padding: 3px 0; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.chat-typing span:nth-child(2) { animation-delay: .2s; } .chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:.25} 40%{opacity:1} }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 7px; }
.chat-input { display: flex; gap: 10px; }
.chat-input input { flex: 1; }

/* ---------- Modal ---------- */
.modal-host { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal-host::before { content:""; position: absolute; inset: 0; background: rgba(10,12,20,.5); backdrop-filter: blur(3px); animation: fade .15s; }
.modal {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 24px; animation: pop .18s;
}
.modal--wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 19px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Assignment editor ---------- */
.assign-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow: auto; padding-right: 4px; }
.assign-row { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--border); transition: var(--t); }
.assign-row.on { border-color: var(--accent); background: var(--accent-soft); }
.assign-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.assign-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.assign-name span { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.assign-hours { display: flex; align-items: center; gap: 6px; }
.assign-hours input { width: 64px; text-align: center; }
.assign-hours span { font-size: 11.5px; color: var(--muted); }
input[type="range"] { accent-color: var(--accent); padding: 0; }
input[type="checkbox"] { width: auto; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; bottom: 22px; right: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-lg); border-radius: 11px; padding: 12px 16px; min-width: 240px; max-width: 360px;
  font-size: 13.5px; animation: slidein .25s; display: flex; gap: 10px; align-items: center;
}
.toast--ok { border-left-color: var(--ok); }
.toast--warn { border-left-color: var(--warn); }
.toast--danger { border-left-color: var(--danger); }
.toast .t-icon { font-size: 16px; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }

/* ---------- Charts ---------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-tip {
  position: fixed; z-index: 90; pointer-events: none; background: var(--text); color: var(--bg);
  padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-lg);
  transform: translate(-50%, -130%); white-space: nowrap;
}
.barh { display: flex; flex-direction: column; gap: 12px; }
.barh-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 12px; }
.barh-label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barh-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.barh-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.32,.72,0,1); }
.barh-val { font-size: 12.5px; font-weight: 650; text-align: right; color: var(--text); }
.seg:hover { stroke-width: 30px; }
.bar:hover { opacity: .82; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.legend .swatch { width: 11px; height: 11px; border-radius: 3px; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .e-mark { font-size: 40px; margin-bottom: 10px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 26px 0 14px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .lr-main { flex: 1; min-width: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }

/* ---------- Responsive ---------- */
.only-mobile { display: none; }
@media (max-width: 920px) {
  /* (Sidebar already overlays at all sizes; shadow is applied when open.) */
  .only-mobile { display: inline-flex; }
  .search input { width: 150px; }
  .form--grid { grid-template-columns: 1fr; }
  .view { padding: 18px; }
  .topbar { padding: 14px 18px; }
}

/* ---- Help / Guide view ---- */
.help-hero { background:
    linear-gradient(180deg, var(--accent-soft), transparent 160px),
    var(--surface); }
.help-mark { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.help-ficon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.help-feature { transition: transform .12s ease, border-color .12s ease; }
.help-feature:hover { transform: translateY(-2px); border-color: var(--accent); }
.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.help-steps li { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.help-steps li strong { color: var(--text); }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: none; cursor: pointer; text-align: left; padding: 15px 14px;
  font-size: 14px; font-weight: 600; color: var(--text); }
.faq-q:hover { color: var(--accent); }
.faq-chev { color: var(--muted); transition: transform .18s ease; flex: 0 0 auto; }
.faq-item.open .faq-chev { transform: rotate(180deg); color: var(--accent); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .22s ease; }
.faq-item.open .faq-a { max-height: 240px; }
.faq-a p { margin: 0; padding: 0 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }

/* ---- Weekly check-in compliance roster ---- */
.compliance .cmp-group { margin-bottom: 14px; }
.cmp-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; display: block; margin-bottom: 8px; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cmp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 3px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 550; color: var(--text); }
.cmp-chip .avatar { width: 22px; height: 22px; font-size: 9px; flex: 0 0 auto; }

/* ---- Time Off view ---- */
.to-pill { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  border: 1px solid; white-space: nowrap; }
.to-week { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.to-week:last-child { border-bottom: none; }
.to-week__label { font-size: 12.5px; font-weight: 650; color: var(--text-2); min-width: 96px; flex: 0 0 auto; padding-top: 3px; }
.to-week__people { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }

/* ---- Performance / actuals import ---- */
.perf-preview { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 4px; }
.perf-prow { display: grid; grid-template-columns: 1.3fr 1.4fr auto; gap: 12px; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.perf-preview .perf-prow:last-child { border-bottom: none; }
.perf-prow--head { background: var(--surface-2); font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 700; color: var(--muted); }
.perf-prow--proj { grid-template-columns: 1.2fr 1.4fr 1fr auto; }
.perf-prow--warn { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.perf-name { font-weight: 600; }
.perf-msel { width: 100%; }

/* ---- Help & About: 'what we track' list ---- */
.help-why { margin: 0; padding-left: 20px; display: grid; gap: 9px; }
.help-why li { font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.help-why li strong { color: var(--text); }

/* ---- Performance reports ---- */
.perf-scope { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.seg-btn { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--t); }
.seg-btn:hover { border-color: var(--accent); color: var(--accent); }
.seg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.perf-ptable { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.perf-ptable .perf-prow:last-child { border-bottom: none; }

/* ---- Projects: by-person view ---- */
.person-stack { display: flex; flex-direction: column; gap: 16px; }
.person-projects { margin-top: 12px; border-top: 1px solid var(--border); }
.person-projects .list-row { border-bottom: 1px solid var(--border); }
.person-projects .list-row:last-child { border-bottom: none; }

/* ---- Admin editing a member's check-in + member notice ---- */
.admin-edit-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 6; }
.admin-edit-notice { border: 1px solid var(--accent); background: var(--accent-soft); }
.aen-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: #fff; flex: 0 0 auto; font-size: 15px; }
.aen-note { margin: 9px 0 0; font-size: 13px; color: var(--text); font-style: italic; }
.admin-edit-note-ro { border-left: 3px solid var(--accent); }
.admin-edit-note-ro p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.mt-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

/* ---- Clickable stat tiles (drill-down) ---- */
.stat--link { cursor: pointer; }
.stat--link:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat--link { transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.list-row.row-click:hover { background: var(--surface-2); border-radius: 8px; }

/* ---- Helper tooltips (hover bubbles) ---- */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%) translateY(4px);
  background: var(--text); color: var(--bg);
  padding: 8px 11px; border-radius: 9px; font-size: 12px; font-weight: 500; line-height: 1.45;
  white-space: normal; width: max-content; max-width: 230px; text-align: left;
  box-shadow: var(--shadow-lg); z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
[data-tip]::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--text);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .14s ease;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
[data-tip]:hover::before { opacity: 1; }
.tip { cursor: help; border-bottom: 1px dotted var(--muted); }
.tip-i {
  display: inline-flex; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--border-2); color: var(--muted); font-size: 9px; font-weight: 800;
  align-items: center; justify-content: center; margin-left: 5px; cursor: help;
  vertical-align: middle; line-height: 1; font-style: normal;
}
.tip-i:hover { color: var(--accent); border-color: var(--accent); }

/* Read-only phase display in the weekly check-in (phase is owned by Fritz.OS) */
.wl-phase { display: flex; align-items: center; gap: 7px; min-width: 84px; height: 34px;
  font-size: 13px; font-weight: 650; color: var(--text); padding: 0 2px; }
