/* ═══════════════════════════════════════════════════════════════
   TEAMSYNC — ADMIN/MEMBER LIGHT THEME
   Clean professional SaaS — white surfaces, teal accent
   ═══════════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────── */
:root {
  --navy:          #0A1628;
  --navy-2:        #0F2040;
  --teal:          #0D9488;
  --teal-light:    #14B8A6;
  --teal-dim:      rgba(13,148,136,.1);
  --teal-border:   rgba(13,148,136,.2);
  --blue-light:    #3B82F6;
  --surface:       #FFFFFF;
  --surface-2:     #F8FAFC;
  --surface-3:     #F1F5F9;
  --surface-4:     #E8EEF4;
  --border:        #E2E8F0;
  --border-2:      #CBD5E1;
  --text-1:        #0F172A;
  --text-2:        #334155;
  --text-3:        #64748B;
  --text-4:        #94A3B8;
  --green:         #059669;
  --green-bg:      #D1FAE5;
  --green-border:  #A7F3D0;
  --amber:         #D97706;
  --amber-bg:      #FEF3C7;
  --amber-border:  #FDE68A;
  --red:           #DC2626;
  --red-bg:        #FEE2E2;
  --red-border:    #FECACA;
  --sky-bg:        #DBEAFE;
  --sky:           #1D4ED8;
  --purple-bg:     #EDE9FE;
  --purple:        #7C3AED;
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --shadow-xs:     0 1px 2px rgba(15,23,42,.04);
  --shadow-sm:     0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:        0 4px 16px rgba(15,23,42,.08), 0 1px 4px rgba(15,23,42,.04);
  --shadow-lg:     0 16px 48px rgba(15,23,42,.12), 0 4px 16px rgba(15,23,42,.06);
  --sidebar-w:     248px;
  --topbar-h:      64px;
  --transition:    all .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-2);
  color: var(--text-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
input, select, textarea, button { font: inherit; }
textarea { resize: vertical; min-height: 96px; }
.hidden  { display: none !important; }
.w100    { width: 100%; }
.text-muted { color: var(--text-3); }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary, .btn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--teal); color: #fff; border: none; border-radius: var(--radius);
  padding: 10px 20px; font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: var(--transition); white-space: nowrap; letter-spacing: -.01em;
}
.btn-primary:hover, .btn-cta:hover {
  background: var(--teal-light); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,148,136,.25);
}
.btn-text  { background: none; border: none; cursor: pointer; color: var(--teal); font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: var(--radius-sm); transition: var(--transition); }
.btn-text:hover { background: var(--teal-dim); }
.btn-ghost { background: var(--surface); border: 1.5px solid var(--border); color: var(--text-2); border-radius: var(--radius); padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: var(--transition); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--border-2); color: var(--text-1); }
.btn-danger { background: var(--red-bg); border: 1.5px solid var(--red-border); color: var(--red); border-radius: var(--radius); padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: var(--transition); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ── Form fields ────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  letter-spacing: .04em; text-transform: uppercase;
}
.field input, .field select, .field textarea {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; font-size: 13.5px;
  color: var(--text-1); outline: none; transition: var(--transition); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim);
}
.field input:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-4); }
.form-stack  { display: flex; flex-direction: column; gap: 16px; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-3col  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.field-full  { grid-column: 1 / -1; }
.form-error  { color: var(--red); font-size: 12px; font-weight: 500; }

/* ── Auth ───────────────────────────────────────────────── */
.auth-screen { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-visual {
  background: var(--navy);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(13,148,136,.15) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 20%, rgba(30,64,175,.2) 0%, transparent 50%);
  display: flex; align-items: center; justify-content: center; padding: 60px;
  position: relative; overflow: hidden;
}
.auth-visual-inner { position: relative; z-index: 1; max-width: 400px; }
.av-logo { display: flex; align-items: center; margin-bottom: 48px; }
.brand-wordmark { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.auth-visual-inner h1 { font-size: 38px; font-weight: 800; color: #fff; line-height: 1.2; letter-spacing: -.03em; margin-bottom: 20px; }
.auth-visual-inner p  { font-size: 16px; color: rgba(255,255,255,.55); line-height: 1.7; margin-bottom: 40px; }
.av-features { display: flex; flex-direction: column; gap: 14px; }
.av-feat { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.7); font-size: 14px; font-weight: 500; }
.auth-form-panel { background: #fff; display: flex; align-items: center; justify-content: center; padding: 60px 48px; }
.auth-form-inner { width: 100%; max-width: 400px; }
.auth-tabs { display: flex; margin-bottom: 40px; border-bottom: 2px solid var(--border); }
.atab { flex: 1; background: none; border: none; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition); }
.atab.active { color: var(--teal); border-bottom-color: var(--teal); }
.aform { display: none; flex-direction: column; gap: 20px; }
.aform.active { display: flex; }
.aform-head h2 { font-size: 26px; font-weight: 800; color: var(--text-1); letter-spacing: -.02em; margin-bottom: 4px; }
.aform-head p  { font-size: 14px; color: var(--text-3); }
.auth-client-note { background: var(--amber-bg); border: 1px solid var(--amber-border); border-radius: 9px; padding: 10px 14px; font-size: 12.5px; color: var(--amber); font-weight: 500; margin-top: -8px; display: none; line-height: 1.5; }
.auth-client-note.visible { display: block; }

/* ── App shell ──────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--navy);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
  transition: transform .3s cubic-bezier(.4,0,.2,1); z-index: 100;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.sb-logo .brand-wordmark { color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.sb-close { display: none; background: rgba(255,255,255,.08); border: none; border-radius: 8px; padding: 6px; cursor: pointer; color: rgba(255,255,255,.5); }
.sb-nav { padding: 8px 12px; flex: 1; }
.sb-section-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.22); padding: 0 8px; margin: 14px 0 5px; }
.sb-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: none;
  background: transparent; color: rgba(255,255,255,.45); padding: 9px 11px;
  border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer;
  text-align: left; transition: var(--transition); margin-bottom: 1px;
}
.sb-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); }
.sb-item.active { background: rgba(13,148,136,.18); color: #5EEAD4; }
.sb-item.active svg { stroke: #5EEAD4; }
.sb-user { padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.06); margin-top: auto; }
.sb-avatar { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--teal), #0284C7); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-info strong { display: block; font-size: 13px; color: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-role-chip { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; background: rgba(13,148,136,.18); color: #5EEAD4; padding: 2px 7px; border-radius: 99px; display: inline-block; margin-top: 2px; }
.sb-logout { background: none; border: none; color: rgba(255,255,255,.3); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; transition: var(--transition); }
.sb-logout:hover { color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); }
.sb-badge-dot { display: none; }

/* ── Topbar ─────────────────────────────────────────────── */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); }
.topbar {
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-xs);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h1 { font-size: 16px; font-weight: 700; color: var(--text-1); letter-spacing: -.02em; }
.topbar-left p  { font-size: 12px; color: var(--text-4); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 6px; border-radius: 8px; display: none; }
.search-wrap { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 7px 13px; transition: var(--transition); }
.search-wrap:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); background: var(--surface); }
.search-wrap input { border: none; background: transparent; outline: none; width: 200px; font-size: 13.5px; color: var(--text-1); }
.search-wrap input::placeholder { color: var(--text-4); }

/* ── Page ───────────────────────────────────────────────── */
.page-content { padding: 24px 28px; flex: 1; min-width: 0; overflow-x: hidden; }
.view { display: none; }
.active-view { display: block; }

/* ── Stat tiles ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; overflow: hidden;
}
.stat-tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-tile::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 0; }
.stat-tile:nth-child(1)::before { background: var(--blue-light); }
.stat-tile:nth-child(2)::before { background: var(--amber); }
.stat-tile:nth-child(3)::before { background: var(--teal); }
.stat-tile:nth-child(4)::before { background: var(--green); }
.st-icon { width: 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center; flex-shrink: 0; }
.st-blue  { background: var(--sky-bg);    color: var(--sky); }
.st-amber { background: var(--amber-bg);  color: var(--amber); }
.st-teal  { background: var(--teal-dim);  color: var(--teal); }
.st-green { background: var(--green-bg);  color: var(--green); }
.stat-tile p  { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.stat-tile h2 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--text-1); }

/* ── Section card ───────────────────────────────────────── */
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow-sm); min-width: 0; }
.sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.sc-head h3 { font-size: 14px; font-weight: 700; color: var(--text-1); }
.sc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge-count { background: var(--surface-3); color: var(--text-3); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border); }

/* ── Dashboard layouts ──────────────────────────────────── */
.dash-cols    { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; min-width: 0; }
.admin-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.profile-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.profile-side { display: flex; flex-direction: column; gap: 18px; }

/* ── Task items ─────────────────────────────────────────── */
.task-stack, .team-stack, .team-list { display: flex; flex-direction: column; gap: 6px; }
.task-item, .member-row {
  display: flex; align-items: flex-start; gap: 14px; padding: 13px 15px;
  border-radius: var(--radius); transition: var(--transition); border: 1px solid transparent;
}
.task-item:hover, .member-row:hover { background: var(--surface-2); border-color: var(--border); }
.task-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.dot-todo { background: var(--blue-light); }
.dot-in-progress { background: var(--amber); }
.dot-done { background: var(--green); }
.task-body { flex: 1; min-width: 0; }
.task-body h4 { font-size: 13.5px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-body p  { font-size: 12px; color: var(--text-3); }
.task-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.task-actions  { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.task-timestamps { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.task-timestamps span { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-4); font-weight: 500; }

/* ── Badges ─────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-todo        { background: var(--sky-bg);    color: var(--sky); }
.badge-in-progress { background: var(--amber-bg);  color: var(--amber); }
.badge-done        { background: var(--green-bg);  color: var(--green); }
.badge-high        { background: var(--red-bg);    color: var(--red); }
.badge-medium      { background: var(--amber-bg);  color: var(--amber); }
.badge-low         { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }
.badge-due         { background: var(--surface-3); color: var(--text-3); }
.badge-green       { background: var(--green-bg);  color: #065F46; }
.badge-blue        { background: var(--sky-bg);    color: var(--sky); }
.badge-amber       { background: var(--amber-bg);  color: #92400E; }
.badge-red         { background: var(--red-bg);    color: #991B1B; }

/* ── Member / Avatar ────────────────────────────────────── */
.m-avatar { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, var(--navy-2), var(--teal)); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.m-info { flex: 1; min-width: 0; }
.m-info strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-info small   { font-size: 12px; color: var(--text-4); }

/* ── Info rows ──────────────────────────────────────────── */
.info-rows { display: flex; flex-direction: column; }
.info-row  { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; gap: 12px; }
.info-row:last-child { border-bottom: none; }
.ir-label { color: var(--text-3); font-weight: 500; }
.ir-val   { font-weight: 600; text-align: right; word-break: break-all; max-width: 200px; }

/* ── Filter select ──────────────────────────────────────── */
.filter-sel { border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 7px 11px; font-size: 13px; color: var(--text-1); outline: none; cursor: pointer; transition: var(--transition); }
.filter-sel:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }

/* ── Charts ─────────────────────────────────────────────── */
.chart-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.chart-card h3 { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 16px; text-transform: uppercase; letter-spacing: .04em; }
.chart-wrap  { position: relative; height: 220px; }
.charts-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.charts-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.stat-grid   { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card   { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-top    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-label  { font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.stat-icon   { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; }
.stat-icon.blue   { background: var(--sky-bg);    color: var(--sky); }
.stat-icon.green  { background: var(--green-bg);  color: var(--green); }
.stat-icon.amber  { background: var(--amber-bg);  color: var(--amber); }
.stat-icon.teal   { background: var(--teal-dim);  color: var(--teal); }
.stat-value  { font-size: 26px; font-weight: 800; color: var(--text-1); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-sub    { font-size: 11.5px; color: var(--text-4); margin-top: 4px; }
.stat-trend  { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; margin-top: 5px; }
.stat-trend.up   { background: var(--green-bg); color: #065F46; }
.stat-trend.down { background: var(--red-bg);   color: #991B1B; }

/* Priority bars (reports) */
.priority-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.p-bar-row { display: flex; flex-direction: column; gap: 5px; }
.p-bar-meta { display: flex; justify-content: space-between; font-size: 12px; }
.p-bar-meta .lbl { font-weight: 600; color: var(--text-2); }
.p-bar-meta .cnt { color: var(--text-3); }
.p-bar-track { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.p-bar-fill  { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1); }

/* Table */
.table-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 18px; overflow: hidden; }
.table-head  { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.table-head h3 { font-size: 13px; font-weight: 700; color: var(--text-2); }
.tbl-wrap    { overflow-x: auto; }
table        { width: 100%; border-collapse: collapse; }
thead tr     { background: var(--surface-2); border-bottom: 1px solid var(--border); }
th { padding: 9px 14px; font-size: 10.5px; font-weight: 700; color: var(--text-3); text-align: left; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
th.c, td.c   { text-align: center; }
td { padding: 11px 14px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--surface-3); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.rank-cell   { display: flex; align-items: center; gap: 6px; }
.rate-pill   { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.medal       { font-size: 15px; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,22,40,.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1000; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: var(--radius-xl); padding: 26px 28px; width: min(520px,100%); box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: scaleIn .2s cubic-bezier(.34,1.56,.64,1); }
@keyframes scaleIn { from { opacity:0; transform:scale(.96) translateY(8px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; color: var(--text-3); display: flex; transition: var(--transition); }
.modal-close:hover { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }
.update-modal { width: min(560px,100%); }
.update-modal-body { margin-top: 12px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.update-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ── Toast ──────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: rgba(255,255,255,.92); padding: 12px 18px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; z-index: 9999; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; max-width: 340px; }

/* ── Role visibility ────────────────────────────────────── */
.admin-only, .member-only, .non-client-only { display: none; }
.role-admin  .admin-only        { display: flex; }
.role-admin  .non-client-only   { display: flex; }
.role-member .member-only       { display: flex; }
.role-member .non-client-only   { display: flex; }
.role-admin  .sb-section-label.non-client-only,
.role-member .sb-section-label.non-client-only,
.role-admin  .sb-section-label.admin-only  { display: block; }
.role-client .sb-section-label.client-only { display: block; }
.role-client .client-only       { display: flex !important; }
.role-client .admin-only        { display: none !important; }
.role-client .member-only       { display: none !important; }
.role-client .non-client-only   { display: none !important; }
.role-client #btnNewTask        { display: none !important; }
.role-client .search-wrap       { display: none !important; }
.role-admin  #view-admin-clients { display: block; }

/* ── Admin Client Manager — Professional Redesign ───────── */
.acm-shell { display: flex; gap: 0; height: calc(100vh - 140px); min-height: 600px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow); }

/* Left panel — client list */
.acm-left { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--surface-2); }
.acm-left-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.acm-left-header h3 { font-size: 14px; font-weight: 700; color: var(--text-1); }
.acm-left-header p  { font-size: 12px; color: var(--text-4); margin-top: 2px; }
.acm-search { margin: 12px 16px; position: relative; }
.acm-search input { width: 100%; padding: 8px 12px 8px 34px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; color: var(--text-1); outline: none; transition: var(--transition); }
.acm-search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.acm-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-4); }
.acm-client-list { flex: 1; overflow-y: auto; padding: 8px; }
.acm-client-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; cursor: pointer; transition: var(--transition); border: 1.5px solid transparent; margin-bottom: 3px; }
.acm-client-item:hover { background: var(--surface); border-color: var(--border); }
.acm-client-item.active { background: var(--surface); border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.acm-avatar { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--navy-2), var(--teal)); display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; flex-shrink: 0; }
.acm-client-meta { flex: 1; min-width: 0; }
.acm-client-meta h4 { font-size: 13.5px; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acm-client-meta p  { font-size: 11.5px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.acm-add-btn { margin: 12px 16px 16px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--teal); color: #fff; border: none; border-radius: 10px; padding: 10px; font-size: 13px; font-weight: 700; cursor: pointer; transition: var(--transition); letter-spacing: -.01em; }
.acm-add-btn:hover { background: var(--teal-light); box-shadow: 0 4px 12px rgba(13,148,136,.25); }

/* Right panel — tabbed content */
.acm-right { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.acm-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--surface); padding: 0 24px; flex-shrink: 0; }
.acm-tab { background: none; border: none; padding: 14px 18px; font-size: 13px; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: var(--transition); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.acm-tab:hover { color: var(--text-1); }
.acm-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.acm-tab-icon { font-size: 14px; }
.acm-content { flex: 1; overflow-y: auto; padding: 24px; }
.acm-panel { display: none; }
.acm-panel.active { display: block; }

/* New client form — redesigned */
.acm-new-client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.acm-new-client-grid .field-full { grid-column: 1/-1; }
.acm-section-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; }
.acm-section-divider span { font-size: 10.5px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.acm-section-divider::before, .acm-section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.acm-platform-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; background: var(--surface-2); border-radius: var(--radius); padding: 14px; border: 1px solid var(--border); }
.acm-platform-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--surface); border: 1.5px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: var(--transition); user-select: none; }
.acm-platform-pill.selected { border-color: var(--teal); background: var(--teal-dim); color: var(--teal); }
.acm-platform-pill input[type=checkbox] { display: none; }

/* Stats grid inside acm */
.acm-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acm-stats-section { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.acm-stats-section-title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.acm-stats-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Empty state for acm */
.acm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; color: var(--text-4); padding: 48px; text-align: center; }
.acm-empty-icon { font-size: 40px; opacity: .6; }
.acm-empty p { font-size: 14px; line-height: 1.6; }

/* ── Attendance ─────────────────────────────────────────── */
.attendance-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.attendance-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 14px 0 16px; }
.att-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; }
.att-box span { display: block; font-size: 10.5px; color: var(--text-3); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.att-box strong { font-size: 18px; color: var(--text-1); font-weight: 700; }
.attendance-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.att-record, .leave-card, .leave-admin-row { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.att-record-top, .leave-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.att-record-top h4, .leave-top h4 { margin: 0; font-size: 14px; color: var(--text-1); font-weight: 600; }
.att-record-top p, .leave-top p, .leave-reason { margin: 3px 0 0; color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
.att-record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.att-mini { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.att-mini span { display: block; font-size: 10px; color: var(--text-4); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .06em; }
.att-mini strong { font-size: 14px; color: var(--text-1); font-weight: 700; }
.leave-note { background: var(--surface-2); border: 1px dashed var(--border-2); color: var(--text-2); font-size: 13px; padding: 10px 12px; border-radius: 10px; }
.leave-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Calendar ───────────────────────────────────────────── */
:root {
  --fc-border-color: var(--border);
  --fc-page-bg-color: transparent;
  --fc-today-bg-color: var(--teal-dim);
  --fc-event-bg-color: var(--teal);
  --fc-event-border-color: var(--teal);
  --fc-button-bg-color: var(--surface-3);
  --fc-button-border-color: var(--border);
  --fc-button-text-color: var(--text-1);
  --fc-button-hover-bg-color: var(--surface-4);
  --fc-button-active-bg-color: var(--teal);
  --fc-button-active-border-color: var(--teal);
}
#view-calendar .section-card { padding: 18px; border-radius: var(--radius-xl); }
.calendar-shell { margin-top: 12px; width: 100%; }
#teamCalendar { width: 100%; }
#teamCalendar { min-height: 680px; }
.fc { font-family: 'Plus Jakarta Sans', sans-serif; }
.fc .fc-toolbar-title { font-size: 1.35rem; font-weight: 800; color: var(--text-1); letter-spacing: -.03em; }
.fc .fc-button { border-radius: var(--radius-sm) !important; padding: .55rem .9rem !important; font-weight: 700; transition: all .18s ease; box-shadow: none !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--teal) !important; color: #fff !important; border-color: var(--teal) !important; }
.fc .fc-col-header-cell-cushion { padding: 11px 8px; color: var(--text-3); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.fc .fc-day-today { background: var(--teal-dim) !important; }
.fc .fc-scrollgrid { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border) !important; }
.fc .fc-event { border: none; border-radius: 10px; box-shadow: var(--shadow-sm); }
.fc-event-card { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; color: #fff; }
.fc-event-title { font-size: 11px; font-weight: 700; line-height: 1.3; }
.fc-event-meta  { font-size: 10px; opacity: .85; }

/* ── Reports filter bar ─────────────────────────────────── */
.filter-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.filter-bar label { display: block; font-size: 10.5px; font-weight: 700; color: var(--text-3); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; }
.filter-bar select { width: 100%; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-1); background: var(--surface); outline: none; cursor: pointer; transition: var(--transition); }
.filter-bar select:focus { border-color: var(--teal); }
.btn-export { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; background: var(--teal); color: #fff; font-size: 13px; font-weight: 600; border: none; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.btn-export:hover { background: var(--teal-light); transform: translateY(-1px); }
.loading-wrap { display: flex; align-items: center; justify-content: center; min-height: 50vh; flex-direction: column; gap: 12px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; padding: 48px 20px; color: var(--text-4); gap: 8px; }
.empty svg { opacity: .3; }
.empty p { font-size: 13px; }

/* ── Sidebar overlay (mobile) ───────────────────────────── */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(10,22,40,.4); z-index: 90; display: none; }
.sidebar-overlay.active { display: block; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .dash-cols, .profile-layout { grid-template-columns: 1fr; }
  .profile-side { display: grid; grid-template-columns: 1fr 1fr; }
  .charts-row-3 { grid-template-columns: 1fr 1fr; }
  .acm-shell { height: auto; flex-direction: column; }
  .acm-left  { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .acm-client-list { max-height: 280px; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 240px; }
  .admin-layout { grid-template-columns: 1fr; }
  .field-row, .field-grid, .field-3col { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sb-close { display: flex; }
  .menu-btn { display: flex; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .search-wrap input { width: 140px; }
  .profile-side { grid-template-columns: 1fr; }
  .charts-row, .charts-row-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .acm-new-client-grid { grid-template-columns: 1fr; }
  .acm-platform-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-panel { padding: 36px 20px; }
  .search-wrap { display: none; }
  .profile-side { flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Task Cards Grid — 3 per row ──────────────────────── */
#allTaskList {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  #allTaskList { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  #allTaskList { grid-template-columns: 1fr; }
}

/* Task modal: scrollable inner content */
#taskModal .modal, #taskDetailModal .modal,
#taskChatModal .modal, #taskHistoryModal .modal {
  width: min(600px, 100%);
}

/* ── Task list — single column, professional cards ─────── */
#allTaskList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 0;
  cursor: pointer;
  transition: all .18s;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.task-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-2);
  transform: translateX(3px);
}
.task-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
}
.task-card-left-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.task-card-content { flex: 1; min-width: 0; }
.task-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-card-desc {
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.task-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.task-act-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-3);
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.task-act-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-dim); }
.task-act-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }

/* ── Meetings tabs ──────────────────────────────────────── */
.mtg-tab {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.mtg-tab.active {
  background: var(--surface);
  color: var(--text-1);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* ── Assign tabs ────────────────────────────────────────── */
.assign-tab { transition: all .15s; }
.assign-tab.active { background: var(--surface) !important; color: var(--text-1) !important; }

/* ── Recurring day pills ────────────────────────────────── */
.rec-day-pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid #BFDBFE;
  color: #1D4ED8;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.rec-day-pill:hover { border-color: var(--sky); }

/* ── Meetings view responsive ─────────────────────── */
#view-meetings > div:last-child {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  #view-meetings > div:last-child {
    grid-template-columns: 1fr;
  }
  #meetingFormPanel { position: static; }
}