/* ==========================================================================
   MarkerOps — team app design system
   Marker Media: dark ink surfaces, lime as the single accent.

   Layers, in order:
     1  tokens + reset
     2  primitives      buttons, inputs, chips, pills, avatars, bars
     3  shell           topbar, sidenav, view frame
     4  auth            splash, login, forced PIN
     5  dashboard
     6  board
     7  drawer          task detail
     8  clients
     9  members + account
    10  overlays        modals, toasts, empty/skeleton states
    11  motion
    12  responsive
   ========================================================================== */

/* ------------------------------------------------------------ 1. tokens */

:root {
  --lime:   #DAFD1B;
  --lime-d: #b9d90f;
  --ink:    #0B0B0C;
  --panel:  #131317;
  --panel2: #191920;
  --panel3: #202028;
  --line:   #26262c;
  --line2:  #33333c;
  --paper:  #F7F7F5;
  --mut:    #9a9aa2;
  --faint:  #6d6d76;

  --danger: #fb7185;
  --warn:   #fbbf24;
  --info:   #38bdf8;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --sh:      0 1px 2px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.35);
  --sh-lg:   0 24px 70px rgba(0,0,0,.6);
  --glow:    0 0 0 1px rgba(218,253,27,.35), 0 10px 34px -12px rgba(218,253,27,.4);

  --f-head: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-body: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;

  --topbar-h: 62px;
  --nav-w:    212px;

  --ease: cubic-bezier(.22,.61,.36,1);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  /* a very soft lime bloom behind everything, so the ink never reads flat */
  background-image:
    radial-gradient(900px 520px at 82% -12%, rgba(218,253,27,.07), transparent 62%),
    radial-gradient(700px 460px at -8% 108%, rgba(218,253,27,.045), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3, h4, .num, .f-head { font-family: var(--f-head); font-weight: 700; letter-spacing: -.015em; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
::placeholder { color: var(--faint); opacity: 1; }
.lime { color: var(--lime); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2f2f38; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #3d3d48; }
::-webkit-scrollbar-track { background: transparent; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------- 2. primitives */

.inp, .sel, .txa {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  color: var(--paper);
  outline: none;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.inp:hover, .sel:hover, .txa:hover { border-color: var(--line2); }
.inp:focus, .sel:focus, .txa:focus {
  border-color: var(--lime);
  background: var(--panel3);
  box-shadow: 0 0 0 3px rgba(218,253,27,.14);
}
.txa { resize: vertical; min-height: 96px; line-height: 1.6; }
.inp[readonly] { color: var(--mut); background: var(--panel); }

.sel {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9aa2' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.sel option { background: var(--panel2); color: var(--paper); }

.inp-pin { letter-spacing: .5em; font-family: var(--f-head); font-size: 18px; text-align: center; padding: 12px; }

label, .lbl {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 6px;
}
.field { margin-bottom: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--faint); margin-top: 6px; line-height: 1.5; }

/* checkbox / switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 42px; height: 24px; border-radius: 999px; flex: none;
  background: var(--panel3); border: 1px solid var(--line2);
  position: relative; transition: background .18s var(--ease), border-color .18s var(--ease);
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--mut);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.switch input:checked + .switch-track { background: rgba(218,253,27,.22); border-color: var(--lime); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--lime); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--lime); outline-offset: 2px; }
.switch-label { font-size: 13.5px; color: var(--paper); font-weight: 500; text-transform: none; letter-spacing: 0; }
.switch-label small { display: block; color: var(--faint); font-size: 12px; font-weight: 400; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-sm); padding: 10px 18px;
  font-family: var(--f-head); font-weight: 600; font-size: 14px;
  background: var(--panel3); color: var(--paper);
  border: 1px solid var(--line2);
  white-space: nowrap;
  transition: transform .12s var(--ease), background .16s var(--ease),
              border-color .16s var(--ease), box-shadow .18s var(--ease), color .16s var(--ease);
}
.btn:hover { background: #2a2a33; border-color: #43434f; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

.btn-lime { background: var(--lime); color: var(--ink); border-color: var(--lime); font-weight: 700; }
.btn-lime:hover { background: #e6ff45; border-color: #e6ff45; box-shadow: var(--glow); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--mut); }
.btn-ghost:hover { background: var(--panel2); color: var(--paper); }
.btn-danger { background: transparent; border-color: rgba(251,113,133,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(251,113,133,.14); border-color: var(--danger); color: #ffd0d8; }
.btn-solid-danger { background: var(--danger); border-color: var(--danger); color: #2b0a12; font-weight: 700; }
.btn-solid-danger:hover { background: #ff8ea0; border-color: #ff8ea0; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
  background: transparent; border-color: transparent; color: var(--mut); font-size: 15px;
}
.btn-icon:hover { background: var(--panel3); color: var(--paper); border-color: var(--line); transform: none; }
.btn-icon.danger:hover { color: var(--danger); background: rgba(251,113,133,.12); }

.btn-spin { position: relative; color: transparent !important; pointer-events: none; }
.btn-spin::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: var(--ink); animation: spin .7s linear infinite;
}
.btn-ghost.btn-spin::after, .btn:not(.btn-lime).btn-spin::after { color: var(--paper); }

/* chips, pills, dots */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 10px;
  font-size: 11.5px; font-weight: 600; font-family: var(--f-head);
  border: 1px solid var(--line2); color: var(--mut); background: var(--panel2);
  max-width: 100%;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.chip-client { border-color: transparent; }
.chip-client .dot { box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-family: var(--f-head); font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; font-family: var(--f-head); }
.prio-pip { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); flex: none; }

.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-head); font-size: 10.5px; font-weight: 700;
  color: #0b0b0c; letter-spacing: .02em;
}
.avatar.lg { width: 38px; height: 38px; font-size: 13.5px; }
.avatar.ghost { background: var(--panel3) !important; color: var(--faint); border: 1px dashed var(--line2); }

.unread {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--lime); box-shadow: 0 0 0 0 rgba(218,253,27,.55);
  animation: pulse 2.4s infinite;
}

/* progress bars */
.bar { height: 7px; border-radius: 999px; background: var(--panel3); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--lime-d), var(--lime));
  transition: width .95s var(--ease);
}
.bar-fill.full { box-shadow: 0 0 14px -2px rgba(218,253,27,.7); }
.bar.sm { height: 5px; }

/* cards & panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 15px; }
.panel-head .grow { flex: 1; }
.panel-body { padding: 18px; }

.sec-title {
  font-family: var(--f-head); font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 12px;
}

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

/* ------------------------------------------------------------- 3. shell */

.app { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: rgba(11,11,12,.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .grow { flex: 1; }

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo { height: 22px; width: auto; }
.brand-fallback { font-family: var(--f-head); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-sep { width: 1px; height: 22px; background: var(--line2); }
.brand-app {
  font-family: var(--f-head); font-weight: 600; font-size: 13px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--lime);
}

.period-pick {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 6px 4px 14px;
}
.period-pick .lbl { margin: 0; font-size: 10.5px; }
.period-pick input {
  background: none; border: none; outline: none; color: var(--paper);
  font-family: var(--f-head); font-weight: 600; font-size: 13px; width: 132px;
}
.period-pick input::-webkit-calendar-picker-indicator { filter: invert(.65); cursor: pointer; }

.userchip {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 14px 4px 5px;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.userchip:hover { border-color: var(--line2); background: var(--panel3); }
.userchip-name { font-family: var(--f-head); font-weight: 600; font-size: 13px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip-role { font-size: 10px; color: var(--lime); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

.layout { display: flex; align-items: stretch; min-height: calc(100vh - var(--topbar-h)); }

.sidenav {
  width: var(--nav-w); flex: none;
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(19,19,23,.4);
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 13px; border-radius: var(--r-sm);
  font-family: var(--f-head); font-weight: 600; font-size: 14px;
  color: var(--mut); text-align: left;
  position: relative; overflow: hidden;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.nav-item .ico { width: 20px; text-align: center; font-size: 15px; flex: none; }
.nav-item:hover { background: var(--panel2); color: var(--paper); }
.nav-item.active { background: rgba(218,253,27,.12); color: var(--lime); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--lime);
}
.nav-count {
  margin-left: auto; background: var(--panel3); color: var(--mut);
  border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700;
}
.nav-item.active .nav-count { background: rgba(218,253,27,.2); color: var(--lime); }
.nav-spacer { flex: 1; }
.nav-foot { padding: 10px 13px; font-size: 11px; color: var(--faint); line-height: 1.5; }

.view { flex: 1; min-width: 0; padding: 26px 26px 90px; }

.view-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.view-head h1 { font-size: 26px; line-height: 1.15; }
.view-head .sub { color: var(--mut); font-size: 13.5px; margin-top: 3px; }
.view-head .grow { flex: 1; }

/* -------------------------------------------------------------- 4. auth */

.boot {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
}
.boot-mark { display: flex; gap: 6px; }
.boot-mark span {
  width: 10px; height: 26px; border-radius: 3px; background: var(--lime);
  animation: bounceBar 1s var(--ease) infinite;
}
.boot-mark span:nth-child(2) { animation-delay: .12s; opacity: .75; }
.boot-mark span:nth-child(3) { animation-delay: .24s; opacity: .5; }
.boot-text { color: var(--faint); font-size: 13px; letter-spacing: .04em; }

.auth {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  position: relative; overflow: hidden;
}
.auth-glow {
  position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(218,253,27,.16), transparent 66%);
  top: -180px; right: -160px; pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 34px 30px 30px;
  box-shadow: var(--sh-lg);
  animation: riseIn .5s var(--ease) both;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-brand .brand-logo { height: 26px; }
.auth-pane h1 { font-size: 23px; margin-bottom: 6px; }
.auth-sub { color: var(--mut); font-size: 13.5px; margin-bottom: 22px; line-height: 1.55; }
.auth-pane label { margin-top: 15px; }
.auth-pane label:first-of-type { margin-top: 0; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 20px; margin: 12px 0 4px; }
.auth-pane .btn-block + .btn-block { margin-top: 10px; }
.auth-foot { color: var(--faint); font-size: 12px; text-align: center; margin-top: 16px; }
.auth-legal { position: relative; z-index: 1; color: var(--faint); font-size: 11.5px; margin-top: 22px; letter-spacing: .05em; }

/* --------------------------------------------------------- 5. dashboard */

.stat-grid {
  display: grid; gap: 14px; margin-bottom: 26px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
  position: relative; overflow: hidden; text-align: left; width: 100%;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.stat::after {
  content: ''; position: absolute; inset: auto -30% -70% auto;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(218,253,27,.1), transparent 70%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.stat:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: var(--sh); }
.stat:hover::after { opacity: 1; }
.stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase;
  color: var(--mut); display: flex; align-items: center; gap: 7px;
}
.stat-num { font-family: var(--f-head); font-size: 38px; font-weight: 700; line-height: 1.1; margin-top: 8px; }
.stat-foot { font-size: 12px; color: var(--faint); margin-top: 4px; }
.stat.alert .stat-num { color: var(--danger); }
.stat.warn .stat-num { color: var(--warn); }
.stat.accent .stat-num { color: var(--lime); }

.statusbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--panel3); }
.statusbar span { transition: flex-grow .8s var(--ease); }
.status-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.status-legend .lg-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--mut); }
.status-legend b { color: var(--paper); font-family: var(--f-head); }

.dash-cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }

.client-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.cprog {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; text-align: left; width: 100%; position: relative; overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.cprog::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--lime)); opacity: .85;
}
.cprog:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: var(--sh); }
.cprog-top { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.cprog-name { font-family: var(--f-head); font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cprog-pct { margin-left: auto; font-family: var(--f-head); font-weight: 700; font-size: 15px; color: var(--lime); }
.cprog-meta { font-size: 12px; color: var(--faint); margin-bottom: 11px; }

.duelist { display: flex; flex-direction: column; }
.duerow {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 4px; border-bottom: 1px solid var(--line);
  transition: background .15s var(--ease), padding-left .15s var(--ease);
}
.duerow:last-child { border-bottom: none; }
.duerow:hover { background: var(--panel2); padding-left: 9px; }
.duerow-title { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duerow-sub { font-size: 11.5px; color: var(--faint); }
.due-tag { font-family: var(--f-head); font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; flex: none; }
.due-tag.over { background: rgba(251,113,133,.16); color: var(--danger); }
.due-tag.today { background: rgba(251,191,36,.16); color: var(--warn); }
.due-tag.soon { background: var(--panel3); color: var(--mut); }

/* ------------------------------------------------------------- 6. board */

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px 13px; margin-bottom: 18px;
}
.toolbar .sel, .toolbar .inp { width: auto; min-width: 132px; padding: 8px 12px; font-size: 13.5px; }
.toolbar .sel { padding-right: 30px; }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap .inp { width: 100%; padding-left: 34px; }
.search-wrap .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; pointer-events: none; }
.toggle-mine {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--mut);
  font-family: var(--f-head); font-weight: 600; font-size: 13px;
  transition: all .16s var(--ease);
}
.toggle-mine:hover { border-color: var(--line2); color: var(--paper); }
.toggle-mine.on { background: rgba(218,253,27,.14); border-color: var(--lime); color: var(--lime); }

.board {
  display: flex; gap: 14px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 14px; scroll-snap-type: x proximity;
}
.bcol {
  flex: 0 0 286px; max-width: 286px;
  background: rgba(19,19,23,.6); border: 1px solid var(--line);
  border-radius: var(--r); scroll-snap-align: start;
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 190px);
}
.bcol-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 13px; border-bottom: 1px solid var(--line);
  font-family: var(--f-head); font-size: 12.5px; font-weight: 600;
  letter-spacing: .04em; position: sticky; top: 0;
  background: var(--panel); border-radius: var(--r) var(--r) 0 0; z-index: 2;
}
.bcol-head .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bcol-head .count {
  margin-left: auto; background: var(--panel3); color: var(--mut);
  border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700;
}
.bcol-cards { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; }
.bcol-empty { color: var(--faint); font-size: 12.5px; text-align: center; padding: 20px 8px; line-height: 1.6; }

.tcard {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; width: 100%; text-align: left;
  position: relative; overflow: hidden;
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.tcard::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--line2)); opacity: .9;
}
.tcard:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: var(--sh); }
.tcard.urgent { border-color: rgba(251,113,133,.32); }
.tcard-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.tcard-title {
  font-size: 13.5px; font-weight: 500; line-height: 1.42;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 10px; padding-left: 4px;
}
.tcard-foot {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding-left: 4px; font-size: 11.5px; color: var(--faint);
}
.tcard-foot .grow { flex: 1; }
.tcard-count { display: inline-flex; align-items: center; gap: 3px; }
.tcard-hold {
  margin: 0 0 9px 4px; padding: 7px 9px; border-radius: 8px;
  background: rgba(148,163,184,.1); border-left: 2px solid #94a3b8;
  font-size: 11.5px; color: var(--mut); line-height: 1.45;
}
.tcard-due { font-family: var(--f-head); font-weight: 600; }
.tcard-due.over { color: var(--danger); }
.tcard-due.today { color: var(--warn); }

/* ------------------------------------------------------------ 7. drawer */

.drawer {
  margin-left: auto; width: min(720px, 100%); height: 100%;
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  animation: slideIn .26s var(--ease) both;
  box-shadow: var(--sh-lg);
}
.drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px 15px; border-bottom: 1px solid var(--line);
}
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 18px; line-height: 1.32; word-break: break-word; }
.drawer-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.drawer-id { font-family: var(--f-head); font-size: 11.5px; color: var(--faint); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 13px 20px; background: var(--panel2); }

.status-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.status-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--mut);
  font-family: var(--f-head); font-size: 12.5px; font-weight: 600;
  transition: all .16s var(--ease);
}
.status-opt .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.status-opt:hover { border-color: currentColor; transform: translateY(-1px); }
.status-opt.on { color: var(--ink); font-weight: 700; }

/* Read-only drawer: a member viewing a task they neither created nor own.
   The controls stay visible (so the state is legible) but are inert. */
.drawer--readonly .status-opt:disabled,
.drawer--readonly [data-patch]:disabled {
  opacity: .55; cursor: default;
}
.drawer--readonly .status-opt:disabled:hover { border-color: var(--line); transform: none; }
.drawer--readonly .drawer-body::before {
  content: "View only — you're not the owner or assignee of this task.";
  display: block; margin-bottom: 14px; padding: 9px 13px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  color: var(--mut); font-size: 12.5px;
}

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 13px; margin-bottom: 20px; }
.meta-cell { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.meta-cell .lbl { margin-bottom: 7px; }
.meta-cell .sel, .meta-cell .inp {
  background: transparent; border: none; padding: 0; font-family: var(--f-head);
  font-weight: 600; font-size: 13.5px; background-position: right 2px center;
}
.meta-cell .sel:focus, .meta-cell .inp:focus { box-shadow: none; background: transparent; }
.meta-cell .sel { padding-right: 20px; }
.meta-static { font-family: var(--f-head); font-weight: 600; font-size: 13.5px; }
.meta-cell input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }

.brief-box {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; white-space: pre-wrap; word-break: break-word;
  font-size: 13.8px; line-height: 1.65; color: #dedee2; margin-bottom: 20px;
}
.brief-box.empty { color: var(--faint); font-style: italic; }

/* attachments */
.dropzone {
  border: 1.5px dashed var(--line2); border-radius: 12px;
  padding: 16px; text-align: center; color: var(--faint); font-size: 12.5px;
  transition: all .18s var(--ease); margin-top: 10px;
}
.dropzone.over { border-color: var(--lime); background: rgba(218,253,27,.07); color: var(--lime); }
.dropzone b { color: var(--paper); font-family: var(--f-head); }
.dropzone.over b { color: var(--lime); }

.filelist { display: flex; flex-direction: column; gap: 8px; }
.filerow {
  display: flex; align-items: center; gap: 11px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.filerow:hover { border-color: var(--line2); background: var(--panel3); }
.file-ico {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  background: var(--panel3); display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.file-main { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: 11.5px; color: var(--faint); }

/* comments */
.thread { display: flex; flex-direction: column; gap: 13px; }
.cmt { display: flex; gap: 11px; animation: fadeUp .3s var(--ease) both; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.cmt-author { font-family: var(--f-head); font-weight: 600; font-size: 13px; }
.cmt-when { font-size: 11px; color: var(--faint); }
.cmt-text {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 13px; font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.cmt.client .cmt-text { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.07); }
.cmt.client .cmt-author::after {
  content: 'CLIENT'; margin-left: 7px; font-size: 9.5px; letter-spacing: .1em;
  background: rgba(251,191,36,.2); color: var(--warn); padding: 1px 6px; border-radius: 999px;
}
.cmt.sys { gap: 9px; align-items: center; }
.cmt.sys .cmt-text {
  background: none; border: none; padding: 0;
  color: var(--faint); font-size: 12.5px; font-style: italic;
}
.cmt-sysdot {
  width: 26px; flex: none; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 12px;
}
.composer { display: flex; gap: 10px; align-items: flex-end; }
.composer .txa { min-height: 44px; max-height: 160px; padding: 11px 13px; }

/* ----------------------------------------------------------- 8. clients */

.ccard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; text-align: left; width: 100%; position: relative; overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.ccard::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--accent, var(--lime));
}
.ccard:hover { transform: translateY(-4px); border-color: var(--line2); box-shadow: var(--sh); }
.ccard-top { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; }
.ccard h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-ind { font-size: 12.5px; color: var(--faint); margin-bottom: 14px; }
.ccard-stats { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; font-size: 12.5px; color: var(--mut); }
.ccard-stats b { font-family: var(--f-head); font-size: 17px; color: var(--paper); }

.cdetail-head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
}
.cdetail-mark {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-head); font-weight: 700; font-size: 20px; color: #0b0b0c;
}
.cdetail-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.prog-row { margin-bottom: 16px; }
.prog-row:last-child { margin-bottom: 0; }
.prog-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.prog-name { font-family: var(--f-head); font-weight: 600; font-size: 13.5px; }
.prog-nums { margin-left: auto; font-size: 12.5px; color: var(--mut); }
.prog-nums b { font-family: var(--f-head); color: var(--paper); font-size: 14px; }
.prog-open { font-size: 11.5px; color: var(--faint); margin-top: 5px; }

/* deliverable editor rows */
.drow { display: grid; grid-template-columns: 1fr 84px 106px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.drow .inp { padding: 8px 11px; font-size: 13.5px; }
.drow-head { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* file library */
.fgroup { margin-bottom: 18px; }
.fgroup:last-child { margin-bottom: 0; }
.fgroup-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 9px;
  font-family: var(--f-head); font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--mut);
}
.fgroup-title .count { color: var(--faint); font-weight: 500; letter-spacing: 0; text-transform: none; }

/* portal panel */
.portal-panel { border-color: rgba(218,253,27,.28); }
.portal-panel .panel-head { border-color: rgba(218,253,27,.18); }
.linkbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px 4px 4px 13px;
}
.linkbox code {
  flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--lime);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.warnbox {
  background: rgba(251,113,133,.08); border: 1px solid rgba(251,113,133,.28);
  border-radius: 10px; padding: 11px 13px; font-size: 12.5px; color: #ffc3cd; line-height: 1.55;
}
.pin-callout {
  background: rgba(218,253,27,.1); border: 1px solid rgba(218,253,27,.4);
  border-radius: 12px; padding: 16px; text-align: center;
}
.pin-callout .code {
  font-family: var(--f-head); font-size: 34px; font-weight: 700; color: var(--lime);
  letter-spacing: .22em; margin: 8px 0 12px; user-select: all;
}

/* -------------------------------------------------- 9. members + account */

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 620px; }
table.tbl th {
  text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 0 14px 10px; white-space: nowrap;
}
table.tbl td { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
table.tbl tbody tr { transition: background .14s var(--ease); }
table.tbl tbody tr:hover { background: var(--panel2); }
table.tbl td.right, table.tbl th.right { text-align: right; }
.who { display: flex; align-items: center; gap: 10px; }
.who-name { font-family: var(--f-head); font-weight: 600; }
.who-sub { font-size: 11.5px; color: var(--faint); }
.role-tag {
  font-family: var(--f-head); font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  padding: 2px 9px; border-radius: 999px; background: var(--panel3); color: var(--mut);
}
.role-tag.admin { background: rgba(218,253,27,.16); color: var(--lime); }
.inactive-row { opacity: .5; }

/* --------------------------------------------------------- 10. overlays */

.overlays { position: relative; z-index: 90; }
.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5,5,6,.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; animation: fadeIn .18s var(--ease);
}
.overlay.center { align-items: center; justify-content: center; padding: 20px; }

.modal {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-xl); width: 100%; max-width: 520px;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  box-shadow: var(--sh-lg); animation: popIn .2s var(--ease) both;
}
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 0; }
.modal-head h2 { font-size: 18px; flex: 1; }
.modal-body { padding: 18px 24px 22px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 0 24px 22px;
}
.modal-foot .grow { flex: 1; }

.toasts {
  position: fixed; z-index: 120; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 9px; align-items: center;
  pointer-events: none; width: min(420px, calc(100vw - 24px));
}
.toast {
  background: var(--panel3); color: var(--paper);
  border: 1px solid var(--line2); border-left: 3px solid var(--lime);
  border-radius: 12px; padding: 11px 16px; font-size: 13.5px;
  box-shadow: var(--sh-lg); animation: toastIn .26s var(--ease) both;
  max-width: 100%; word-break: break-word;
}
.toast.err { border-left-color: var(--danger); }
.toast.out { animation: toastOut .2s var(--ease) both; }

.empty {
  text-align: center; padding: 52px 20px; color: var(--faint);
  border: 1px dashed var(--line2); border-radius: var(--r-lg); background: rgba(19,19,23,.4);
}
.empty-ico { font-size: 32px; margin-bottom: 12px; opacity: .8; }
.empty h3 { font-size: 15.5px; color: var(--paper); margin-bottom: 6px; }
.empty p { font-size: 13px; max-width: 340px; margin: 0 auto 16px; line-height: 1.6; }

.skel {
  background: linear-gradient(100deg, var(--panel2) 30%, var(--panel3) 50%, var(--panel2) 70%);
  background-size: 220% 100%; animation: shimmer 1.3s linear infinite;
  border-radius: 10px;
}
.skel-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.skel-stat { height: 106px; }
.skel-line { height: 13px; margin-bottom: 9px; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%; margin: 30px auto;
  border: 2px solid var(--line2); border-top-color: var(--lime);
  animation: spin .7s linear infinite;
}

/* ----------------------------------------------------------- 11. motion */

@keyframes fadeIn   { from { opacity: 0; } }
@keyframes popIn    { from { opacity: 0; transform: scale(.965) translateY(6px); } }
@keyframes slideIn  { from { opacity: .4; transform: translateX(44px); } }
@keyframes riseIn   { from { opacity: 0; transform: translateY(14px); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(7px); } }
@keyframes toastIn  { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes spin     { to   { transform: rotate(360deg); } }
@keyframes shimmer  { to   { background-position: -120% 0; } }
@keyframes bounceBar {
  0%, 100% { transform: scaleY(.55); }
  50%      { transform: scaleY(1.25); }
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(218,253,27,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(218,253,27,0); }
  100% { box-shadow: 0 0 0 0 rgba(218,253,27,0); }
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-40px, 40px) scale(1.12); }
}

/* staggered entrance — set --i on each child */
.enter { animation: fadeUp .38s var(--ease) both; animation-delay: calc(var(--i, 0) * 42ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------- 12. responsive */

@media (max-width: 1080px) {
  .dash-cols, .cdetail-cols { grid-template-columns: 1fr; }
  .view { padding: 22px 18px 96px; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar { padding: 0 13px; gap: 9px; }
  .brand-sep, .brand-app { display: none; }
  /* the period stays reachable everywhere — it just loses its label */
  .period-pick { padding: 3px 4px 3px 8px; }
  .period-pick .lbl { display: none; }
  .period-pick input { width: 108px; font-size: 12px; }
  .userchip { padding: 4px 6px; }
  .userchip-name, .userchip-role { display: none; }

  .layout { display: block; }
  .sidenav {
    position: fixed; z-index: 50; bottom: 0; left: 0; right: 0; top: auto;
    width: auto; height: auto; flex-direction: row; gap: 2px;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--line);
    background: rgba(11,11,12,.94);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .nav-item {
    flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 10.5px;
    letter-spacing: .01em; justify-content: center; text-align: center;
  }
  .nav-item .ico { font-size: 17px; width: auto; }
  .nav-item.active::before { left: 50%; right: auto; transform: translateX(-50%); top: 0; bottom: auto; width: 26px; height: 3px; border-radius: 0 0 3px 3px; }
  .nav-count { display: none; }
  .nav-spacer, .nav-foot { display: none; }

  .view { padding: 18px 14px 100px; }
  .view-head h1 { font-size: 21px; }
  .stat-num { font-size: 31px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }

  .toolbar { padding: 10px; gap: 8px; }
  .toolbar .sel, .toolbar .inp { min-width: 0; flex: 1 1 132px; }
  .search-wrap { flex: 1 1 100%; }

  .board {
    margin: 0 -14px; padding: 0 14px 14px;
    scroll-snap-type: x mandatory;
  }
  .bcol { flex-basis: 82vw; max-width: 82vw; max-height: none; }
  .bcol-cards { max-height: 62vh; }

  .drawer { width: 100%; border-left: none; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 15px; padding-right: 15px; }
  .meta-grid { grid-template-columns: 1fr 1fr; gap: 9px; }

  .modal { max-width: 100%; border-radius: var(--r-lg); }
  .modal-head { padding: 18px 18px 0; }
  .modal-body { padding: 15px 18px 18px; }
  .modal-foot { padding: 0 18px 18px; }
  .modal-foot .btn { flex: 1; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .drow { grid-template-columns: 1fr 68px 36px; }
  .drow .drow-unit { grid-column: 1 / 3; }
  .auth-card { padding: 26px 20px 24px; }
  .toasts { bottom: 84px; }
}
