/* ============================================================
   Maalcards Tasks — single stylesheet for auth + app shells.
   Identity: engineering-ops. Sora (display) / IBM Plex Sans (body)
   / IBM Plex Mono (data). Role duality: manager = amber signal,
   developer = teal signal, carried from login through the app.
   ============================================================ */

:root {
    --ink:      #0c1120;
    --ink-2:    #121a2f;
    --ink-3:    #1a2440;
    --bg:       #f3f5fa;
    --surface:  #ffffff;
    --line:     #e4e8f1;
    --text:     #1c2438;
    --muted:    #6b7590;
    --primary:  #4f46e5;
    --primary-2:#4338ca;

    --amber:    #e8a33d;   /* manager signal   */
    --amber-2:  #8a5a13;
    --teal:     #14b8a6;   /* developer signal */
    --teal-2:   #0f766e;

    --ok:       #10b981;
    --warn:     #f59e0b;
    --danger:   #ef4444;
    --info:     #3b82f6;

    --radius:   14px;
    --shadow:   0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .12);
    --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-disp: 'Sora', var(--font-body);
    --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   AUTH SHELL — the sign-in room
   ============================================================ */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 480px at 12% -8%, var(--glow-a, rgba(232, 163, 61, .16)), transparent 60%),
        radial-gradient(820px 460px at 95% 110%, var(--glow-b, rgba(20, 184, 166, .14)), transparent 60%),
        var(--ink);
    color: #e8ecf5;
    transition: background .6s ease;
}
.auth-body[data-role="manager"]   { --glow-a: rgba(232, 163, 61, .26); --glow-b: rgba(232, 163, 61, .07); --accent: var(--amber); --accent-ink: #241703; }
.auth-body[data-role="developer"] { --glow-a: rgba(20, 184, 166, .09); --glow-b: rgba(20, 184, 166, .28); --accent: var(--teal);  --accent-ink: #03201c; }

/* faint blueprint grid over the ink */
.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 78%);
    pointer-events: none;
}

.auth-wrap {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 64px;
    width: min(980px, 100%);
    align-items: center;
}
@media (max-width: 860px) {
    .auth-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; justify-items: center; }
    .auth-side { text-align: center; }
}

/* Left: brand voice */
.auth-side .brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-disp);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .4px;
}
.auth-side .brand-mark .logo-dot {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent, #e8a33d), var(--primary));
    color: #fff;
    font-size: 16px;
    transition: background .6s ease;
}
.auth-side h1 {
    font-family: var(--font-disp);
    font-size: clamp(30px, 4.4vw, 44px);
    line-height: 1.12;
    font-weight: 700;
    margin: 26px 0 14px;
    letter-spacing: -.5px;
}
.auth-side h1 em {
    font-style: normal;
    color: var(--accent, var(--amber));
    transition: color .5s ease;
}
.auth-side p.lede { color: #9aa5c0; max-width: 46ch; font-size: 15.5px; }
.auth-side .ticker {
    margin-top: 34px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #7d89a8;
    display: flex; flex-direction: column; gap: 8px;
}
.auth-side .ticker span::before { content: '› '; color: var(--accent, var(--amber)); transition: color .5s ease; }
@media (max-width: 860px) { .auth-side .ticker { display: none; } }

/* Right: the card */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 20px;
    padding: 30px 28px 26px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55);
}
.auth-card h2 {
    font-family: var(--font-disp);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}
.auth-card .sub { color: #9aa5c0; font-size: 13.5px; margin-bottom: 22px; }

/* Signature element: the role switch. A sliding thumb picks the desk
   you sit at — and the whole room's light follows. */
.role-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 22px;
}
.role-switch .thumb {
    position: absolute;
    top: 4px; bottom: 4px; left: 4px;
    width: calc(50% - 4px);
    border-radius: 9px;
    background: var(--accent, var(--amber));
    transition: transform .28s cubic-bezier(.65, 0, .35, 1), background .4s ease;
}
.auth-body[data-role="developer"] .role-switch .thumb { transform: translateX(100%); }
.role-switch label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 6px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 13.5px;
    color: #aab4cd;
    cursor: pointer;
    transition: color .25s ease;
    user-select: none;
}
.role-switch input { position: absolute; opacity: 0; pointer-events: none; }
.auth-body[data-role="manager"]   .role-switch label[data-role="manager"],
.auth-body[data-role="developer"] .role-switch label[data-role="developer"] { color: var(--accent-ink, #241703); }
.role-switch .glyph { font-size: 15px; line-height: 1; }

.role-hint {
    font-size: 12.5px;
    color: #8d99b8;
    margin: -12px 0 20px;
    min-height: 18px;
    font-family: var(--font-mono);
}

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .3px;
    color: #aab4cd;
    margin-bottom: 6px;
}
.field .control { position: relative; }
.field input {
    width: 100%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: #eef1f8;
    padding: 11px 13px;
    font-size: 14.5px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.field input::placeholder { color: #66718e; }
.field input:focus {
    outline: none;
    border-color: var(--accent, var(--amber));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #e8a33d) 22%, transparent);
}
.peek {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    background: none; border: 0;
    color: #8d99b8;
    font-size: 12px;
    font-family: var(--font-mono);
    padding: 4px 6px;
}
.peek:hover { color: #e8ecf5; }

.btn-signin {
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 0;
    border-radius: 10px;
    font-family: var(--font-disp);
    font-weight: 600;
    font-size: 15px;
    color: var(--accent-ink, #241703);
    background: var(--accent, var(--amber));
    transition: background .4s ease, transform .12s ease, box-shadow .2s ease;
    box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--accent, #e8a33d) 65%, transparent);
}
.btn-signin:hover { transform: translateY(-1px); }
.btn-signin:active { transform: translateY(0); }

.auth-alert {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .35);
    color: #fecaca;
    font-size: 13.5px;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 18px;
}

.auth-foot {
    margin-top: 20px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: #66718e;
}

/* ============================================================
   APP SHELL — sidebar + topbar
   ============================================================ */

.app-body { display: flex; min-height: 100vh; }
.app-body[data-role="manager"]   { --accent: var(--amber); --accent-deep: var(--amber-2); }
.app-body[data-role="developer"] { --accent: var(--teal);  --accent-deep: var(--teal-2); }

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--ink);
    color: #c6cee2;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-disp);
    font-weight: 700; font-size: 15px; color: #fff;
    padding: 2px 8px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 16px;
}
.sidebar .brand .logo-dot {
    width: 30px; height: 30px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    font-size: 14px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: #aab4cd;
    transition: background .15s ease, color .15s ease;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.09); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.sidebar .spacer { flex: 1; }

.sidebar .whoami {
    display: flex; align-items: center; gap: 10px;
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar .whoami .meta { min-width: 0; }
.sidebar .whoami .name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .whoami .role {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--accent);
}
.sidebar .logout-btn {
    margin-top: 8px;
    width: 100%;
    background: none;
    border: 1px solid rgba(255,255,255,.14);
    color: #aab4cd;
    border-radius: 9px;
    padding: 8px;
    font-size: 12.5px;
}
.sidebar .logout-btn:hover { border-color: rgba(255,255,255,.3); color: #fff; }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }

.avatar {
    width: 32px; height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head h1 {
    font-family: var(--font-disp);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
}
.page-head .crumb {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 3px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 9px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.btn:hover { border-color: #c9d0e0; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #17110288; color: rgba(20,16,2,.85); }
.btn.danger-ghost { color: var(--danger); border-color: #f6caca; background: #fff; }
.btn.danger-ghost:hover { background: #fef2f2; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }

/* Stat tiles */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.stat .k {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--muted);
}
.stat .v {
    font-family: var(--font-disp);
    font-size: 26px;
    font-weight: 700;
    margin-top: 2px;
}
.stat.tone-progress .v { color: var(--info); }
.stat.tone-review  .v { color: var(--warn); }
.stat.tone-done    .v { color: var(--ok); }
.stat.tone-overdue .v { color: var(--danger); }

/* Cards / panels */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}
.panel .panel-head h2 {
    font-family: var(--font-disp);
    font-size: 15px;
    font-weight: 600;
}
.panel .panel-body { padding: 18px; }

/* Layout: manager dashboard columns */
.dash-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}
@media (max-width: 1080px) { .dash-cols { grid-template-columns: minmax(0, 1fr); } }

/* Filters bar */
.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.filters select, .filters input[type="text"] {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--text);
}
.filters input[type="text"] { min-width: 170px; }

/* Task table */
.task-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.task-table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--muted);
    font-weight: 500;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.task-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table tbody tr { transition: background .12s ease; }
.task-table tbody tr:hover { background: #f8f9fd; }
.task-table .t-title { font-weight: 600; color: var(--text); display: block; }
.task-table .t-title:hover { color: var(--primary); }
.task-table .t-sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.table-scroll { overflow-x: auto; }

/* Chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.p-low     { color: #55627c; background: #eef1f6; }
.chip.p-medium  { color: #1d4ed8; background: #e8effd; }
.chip.p-high    { color: #b45309; background: #fdf1dc; }
.chip.p-urgent  { color: #b91c1c; background: #fde4e4; }
.chip.s-todo        { color: #55627c; background: #eef1f6; }
.chip.s-in_progress { color: #4338ca; background: #e9e8fd; }
.chip.s-review      { color: #b45309; background: #fdf1dc; }
.chip.s-done        { color: #047857; background: #dcf5ec; }

/* Progress bar */
.prog { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.prog .bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: #e9edf5;
    overflow: hidden;
}
.prog .bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .35s ease;
}
.prog .pct { font-family: var(--font-mono); font-size: 11px; color: var(--muted); min-width: 34px; text-align: right; }

/* Due date states */
.due { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.due.overdue { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--warn); font-weight: 600; }

/* Team list (manager sidebar) */
.team-list { display: flex; flex-direction: column; }
.team-list .member {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
}
.team-list .member:last-child { border-bottom: 0; }
.team-list .m-meta { flex: 1; min-width: 0; }
.team-list .m-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-list .m-load { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.team-list .m-count {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    background: #eef1f6;
    border-radius: 8px;
    padding: 3px 8px;
}

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed .item {
    display: flex; gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
}
.feed .item:last-child { border-bottom: 0; }
.feed .item b { color: var(--text); font-weight: 600; }
.feed .item .when { font-family: var(--font-mono); font-size: 10.5px; margin-top: 1px; }
.feed .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}

/* ============================================================
   KANBAN (developer board)
   ============================================================ */

.board {
    display: grid;
    grid-template-columns: repeat(4, minmax(230px, 1fr));
    gap: 14px;
    align-items: start;
}
@media (max-width: 1180px) { .board { grid-template-columns: repeat(2, minmax(230px, 1fr)); } }
@media (max-width: 640px)  { .board { grid-template-columns: minmax(0, 1fr); } }

.lane {
    background: #eceff6;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    min-height: 160px;
}
.lane.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.lane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 10px;
}
.lane-head h3 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    display: flex; align-items: center; gap: 7px;
}
.lane-head h3::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--lane-color, #94a3b8); }
.lane[data-status="todo"]        { --lane-color: #94a3b8; }
.lane[data-status="in_progress"] { --lane-color: var(--primary); }
.lane[data-status="review"]      { --lane-color: var(--warn); }
.lane[data-status="done"]        { --lane-color: var(--ok); }
.lane-head .count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 1px 7px;
}
.lane .cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }

.card-task {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 12px 13px;
    box-shadow: 0 1px 2px rgba(16,24,40,.06);
    cursor: grab;
    transition: box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}
.card-task:hover { box-shadow: 0 6px 18px -8px rgba(16,24,40,.25); transform: translateY(-1px); }
.card-task.dragging { opacity: .45; cursor: grabbing; }
.card-task .c-title { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.card-task .c-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-task .c-steps { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.card-task .prog { margin-top: 10px; min-width: 0; }
.lane .empty-hint {
    font-size: 12px;
    color: #9aa4bd;
    text-align: center;
    padding: 14px 6px;
    border: 1px dashed #d4dae8;
    border-radius: 10px;
}

/* ============================================================
   TASK DETAIL
   ============================================================ */

.task-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}
@media (max-width: 1080px) { .task-cols { grid-template-columns: minmax(0, 1fr); } }

.task-desc { color: #3c4661; white-space: pre-wrap; font-size: 14.5px; }
.task-desc.empty { color: var(--muted); font-style: italic; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.meta-grid .mk {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
}
.meta-grid .mv { font-size: 13.5px; font-weight: 600; }

/* Strategy checklist */
.steps { display: flex; flex-direction: column; }
.step-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
}
.step-row:last-child { border-bottom: 0; }
.step-row .tick {
    width: 21px; height: 21px;
    flex-shrink: 0;
    border-radius: 7px;
    border: 2px solid #c9d0e0;
    background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    color: transparent;
    font-size: 12px;
    transition: all .15s ease;
}
.step-row .tick.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-row .s-title { flex: 1; font-size: 14px; }
.step-row .s-title.done { color: var(--muted); text-decoration: line-through; }
.step-row .s-del { background: none; border: 0; color: #c2cadd; font-size: 15px; padding: 2px 6px; }
.step-row .s-del:hover { color: var(--danger); }
.step-add { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.step-add input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 13.5px;
}
.steps-empty { padding: 20px 18px; font-size: 13px; color: var(--muted); }

/* Comments */
.comments { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.comment { display: flex; gap: 10px; }
.comment .c-body {
    flex: 1;
    background: #f6f8fc;
    border: 1px solid var(--line);
    border-radius: 4px 12px 12px 12px;
    padding: 9px 12px;
    font-size: 13.5px;
}
.comment .c-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.comment .c-name { font-weight: 700; font-size: 12.5px; }
.comment .c-role { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.comment .c-when { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-left: auto; }
.comment-form { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.comment-form textarea {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13.5px;
    resize: vertical;
    min-height: 42px;
}

/* Progress slider */
.prog-editor { display: flex; align-items: center; gap: 12px; }
.prog-editor input[type="range"] { flex: 1; accent-color: var(--accent-deep, var(--primary)); }
.prog-editor .val { font-family: var(--font-mono); font-size: 13px; font-weight: 600; min-width: 42px; text-align: right; }

/* Status stepper on task page */
.status-row { display: flex; gap: 7px; flex-wrap: wrap; }
.status-row .st {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}
.status-row .st:hover { border-color: #c9d0e0; color: var(--text); }
.status-row .st.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ============================================================
   TEAM PAGE
   ============================================================ */

.role-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .8px;
    border-radius: 6px;
    padding: 3px 8px;
    font-weight: 600;
}
.role-tag.manager   { color: var(--amber-2); background: #fdf1dc; }
.role-tag.developer { color: var(--teal-2); background: #d9f4f0; }
.inactive-row td { opacity: .5; }

/* ============================================================
   MODALS / FORMS / TOASTS
   ============================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 17, 32, .55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 7vh 18px 18px;
    z-index: 60;
}
.modal-backdrop.open { display: flex; }
.modal {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45);
    animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal .modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.modal .modal-head h3 { font-family: var(--font-disp); font-size: 16px; font-weight: 600; }
.modal .modal-head .x { background: none; border: 0; font-size: 18px; color: var(--muted); padding: 2px 8px; }
.modal .modal-body { padding: 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.f-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 5px;
}
.f-input, .f-select, .f-textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    padding: 9px 11px;
    font-size: 13.5px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.f-input:focus, .f-select:focus, .f-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .13);
}
.f-textarea { resize: vertical; min-height: 84px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Toasts */
.toast-root {
    position: fixed;
    right: 18px; bottom: 18px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 80;
}
.toast {
    background: var(--ink);
    color: #eef1f8;
    border-radius: 11px;
    padding: 11px 16px;
    font-size: 13.5px;
    box-shadow: 0 14px 34px -12px rgba(0,0,0,.5);
    display: flex; align-items: center; gap: 9px;
    animation: toast-in .22s ease;
    max-width: 380px;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.ok::before  { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.toast.err::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--muted);
}
.empty-state .glyph { font-size: 30px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* Errors pages */
.error-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--ink);
    color: #e8ecf5;
    font-family: var(--font-body);
    text-align: center;
    padding: 24px;
}
.error-body .code {
    font-family: var(--font-mono);
    font-size: 60px;
    font-weight: 600;
    color: var(--amber);
}
.error-body p { color: #9aa5c0; margin: 10px 0 22px; }
.error-body a {
    color: var(--ink);
    background: var(--amber);
    border-radius: 9px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: 14px;
}
.error-body pre {
    text-align: left;
    max-width: 760px;
    overflow: auto;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 14px;
    font-size: 12px;
    margin-top: 22px;
    color: #fca5a5;
}

/* Mobile shell */
@media (max-width: 820px) {
    .app-body { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
    }
    .sidebar .brand { border: 0; margin: 0; padding: 0; }
    .sidebar nav { flex-direction: row; flex: 1; overflow-x: auto; }
    .sidebar .whoami { border: 0; padding: 0; }
    .sidebar .whoami .meta, .sidebar .logout-btn { display: none; }
    .main { padding: 18px 14px 50px; }
}
