/* ============================================================
   Quiet Work Client Portal — stylesheet
   Brand blue: #4a5eda · Sidebar navy: #0f1729
   ============================================================ */

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

:root {
    --brand: #4a5eda;
    --brand-dark: #3445b8;
    --brand-soft: #eef0ff;
    --brand-glow: rgba(74, 94, 218, .25);

    --ink-900: #0b1020;
    --ink-800: #1a1f33;
    --ink-700: #2a3148;
    --ink-600: #4b5266;
    --ink-500: #6b7280;
    --ink-400: #9ca3af;
    --ink-300: #d1d5db;
    --ink-200: #e7e9ee;
    --ink-100: #f0f2f6;
    --ink-50:  #f7f8fb;

    --paper: #ffffff;
    --canvas: #f7f8fb;

    --success: #15a05c;
    --success-soft: #e1f5ec;
    --warning: #b56500;
    --warning-soft: #fdf2dc;
    --danger:  #c4344a;
    --danger-soft: #fce4e7;
    --info: var(--brand);
    --info-soft: var(--brand-soft);

    --sidebar-bg: #0f1729;
    --sidebar-width: 252px;

    --radius: 10px;
    --radius-lg: 14px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 41, .04), 0 1px 3px rgba(15, 23, 41, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 41, .06);
    --shadow-lg: 0 20px 40px -16px rgba(15, 23, 41, .18);
}

html, body { height: 100%; }
body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--canvas);
    color: var(--ink-800);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* ===== Auth pages ===== */
.auth-page { background: linear-gradient(160deg, #f3f5ff 0%, #fafbff 60%, #ffffff 100%); min-height: 100vh; }
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--paper);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--ink-100);
}
.auth-card.error-card { text-align: center; }
.auth-logo { height: 26px; margin-bottom: 1.5rem; filter: invert(11%) sepia(33%) saturate(2200%) hue-rotate(214deg) brightness(45%); }
.auth-card h1 { font-size: 1.5rem; font-weight: 600; color: var(--ink-900); margin-bottom: .35rem; }
.auth-sub { color: var(--ink-500); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form label { display: flex; flex-direction: column; gap: .35rem; }
.auth-form label span { font-size: .8rem; font-weight: 500; color: var(--ink-700); }
.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
    padding: .65rem .75rem;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: var(--ink-900);
    transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}
.auth-row { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .25rem; }
.auth-footnote { margin-top: 1.25rem; font-size: .8rem; color: var(--ink-500); text-align: center; }

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    padding-bottom: .5rem;
}
.sidebar-header { padding: 1.5rem 1.25rem .5rem; }
.sidebar-brand { display: block; }
.sidebar-logo { height: 22px; width: auto; display: block; }
.sidebar-company {
    margin-top: .85rem;
    font-size: .75rem;
    color: var(--ink-400);
    letter-spacing: .02em;
}

.nav-section-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(255, 255, 255, .35);
    padding: 1.25rem 1.35rem .5rem;
    font-weight: 600;
}
.nav-menu { list-style: none; padding: 0 .5rem; }
.nav-menu li a {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .85rem;
    color: rgba(255, 255, 255, .65);
    font-size: .85rem;
    font-weight: 450;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}
.nav-menu li a:hover {
    background: rgba(255, 255, 255, .06);
    color: white;
    text-decoration: none;
}
.nav-menu li a.active {
    background: rgba(74, 94, 218, .18);
    color: #cdd4fa;
}
.nav-menu li a.active .nav-svg { color: #cdd4fa; }
.nav-svg { width: 18px; height: 18px; flex-shrink: 0; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-footer {
    margin-top: auto;
    padding: .85rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-user {
    display: flex; align-items: center; gap: .45rem;
    color: rgba(255, 255, 255, .65);
    font-size: .8rem;
    text-decoration: none;
}
.sidebar-user:hover { color: white; text-decoration: none; }
.btn-logout {
    color: rgba(255, 255, 255, .45);
    font-size: .75rem;
    padding: .25rem .55rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all .15s;
}
.btn-logout:hover { color: white; background: rgba(255, 255, 255, .08); text-decoration: none; }

/* ===== Main content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem 4rem;
    min-height: 100vh;
}
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.content-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -.01em;
}
.content-body { display: flex; flex-direction: column; gap: 1.5rem; }

/* ===== Alerts ===== */
.alert {
    padding: .85rem 1rem;
    border-radius: var(--radius);
    font-size: .85rem;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}
.alert-success { background: var(--success-soft); border-color: #b5e6cb; color: #0d6d40; }
.alert-error { background: var(--danger-soft); border-color: #f4b9c1; color: #8b1a2b; }
.alert-warning { background: var(--warning-soft); border-color: #ecd092; color: #7a4400; }
.alert-info { background: var(--info-soft); border-color: #c8cffb; color: var(--brand-dark); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1rem;
    font-size: .85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-800);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: white; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: white; }
.btn-outline { background: var(--paper); color: var(--ink-700); border-color: var(--ink-200); }
.btn-outline:hover { border-color: var(--ink-300); color: var(--ink-900); }
.btn-ghost { color: var(--ink-500); padding: .35rem .55rem; }
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-800); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn-block { width: 100%; padding: .75rem; font-size: .9rem; }

/* ===== Card ===== */
.card {
    background: var(--paper);
    border-radius: var(--radius);
    border: 1px solid var(--ink-100);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.4rem;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.card-header h3 {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -.005em;
}
.form-card { max-width: 520px; }
.empty-card { text-align: center; padding: 2.5rem 1.5rem; }
.empty-card h3 { font-size: 1rem; font-weight: 600; color: var(--ink-800); margin-bottom: .35rem; }

.empty-state { color: var(--ink-500); font-size: .85rem; padding: .25rem 0 .75rem; }
.muted { color: var(--ink-500); font-size: .8rem; }

/* ===== Hero card ===== */
.hero-card {
    background: linear-gradient(135deg, #0f1729 0%, #1f2960 55%, #4a5eda 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.hero-card::after {
    content: "";
    position: absolute;
    top: -80px; right: -80px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
    z-index: 1;
}
.hero-eyebrow {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, .55);
    margin-bottom: .5rem;
}
.hero-title { font-size: 1.85rem; font-weight: 600; letter-spacing: -.01em; }
.hero-sub { font-size: .95rem; color: rgba(255, 255, 255, .75); margin-top: .5rem; max-width: 38ch; }

.hero-stats { display: flex; gap: 1.75rem; }
.hero-stat-value { font-size: 1.6rem; font-weight: 600; }
.hero-stat-label { font-size: .7rem; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255, 255, 255, .55); margin-top: .15rem; }
.hero-stat-warning .hero-stat-value { color: #ffd587; }

/* ===== Dashboard sections ===== */
.dashboard-section { display: flex; flex-direction: column; gap: 1rem; }
.section-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ink-500);
}

/* ===== Project tiles ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.project-tile {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.project-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #c8cffb;
    text-decoration: none;
}
.project-tile-head { display: flex; gap: .35rem; margin-bottom: .85rem; flex-wrap: wrap; }
.project-tile-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: .35rem;
    letter-spacing: -.005em;
}
.project-tile-desc {
    font-size: .82rem;
    color: var(--ink-500);
    margin-bottom: 1rem;
    min-height: 2.5em;
}
.project-tile-meta {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    color: var(--ink-500);
    margin-top: .65rem;
}
.project-tile-muted { background: #fbfbfd; }
.project-tile-muted .project-tile-title { color: var(--ink-700); }

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .015em;
    text-transform: none;
}
.badge-soft { background: var(--ink-100); color: var(--ink-700); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-status.status-in_progress { background: var(--info-soft); color: var(--brand-dark); }
.badge-status.status-pending     { background: var(--ink-100); color: var(--ink-600); }
.badge-status.status-on_hold     { background: var(--warning-soft); color: var(--warning); }
.badge-status.status-completed   { background: var(--success-soft); color: var(--success); }
.badge-status.status-cancelled   { background: var(--danger-soft); color: var(--danger); }
.invoice-status-paid    { background: var(--success-soft); color: var(--success); }
.invoice-status-sent    { background: var(--info-soft); color: var(--brand-dark); }
.invoice-status-draft   { background: var(--ink-100); color: var(--ink-600); }
.invoice-status-overdue { background: var(--danger-soft); color: var(--danger); }
.invoice-status-cancelled { background: var(--ink-100); color: var(--ink-500); }

/* ===== Progress bar ===== */
.progress {
    height: 6px;
    background: var(--ink-100);
    border-radius: 999px;
    overflow: hidden;
}
.progress-sm { height: 4px; }
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand) 0%, #6f80ee 100%);
    border-radius: 999px;
    transition: width .4s ease;
}

/* ===== Project detail hero ===== */
.project-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--paper);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-sm);
}
.project-hero-main { flex: 1; min-width: 0; }
.back-link {
    font-size: .8rem;
    color: var(--ink-500);
    display: inline-block;
    margin-bottom: .65rem;
}
.back-link:hover { color: var(--brand); text-decoration: none; }
.project-hero-row { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; margin-bottom: .5rem; }
.project-hero-title { font-size: 1.65rem; font-weight: 600; color: var(--ink-900); letter-spacing: -.01em; }
.project-hero-desc { color: var(--ink-600); font-size: .9rem; max-width: 60ch; margin-bottom: .9rem; }
.project-hero-meta { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.project-hero-meta > div { display: flex; flex-direction: column; gap: .15rem; }
.meta-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--ink-500); font-weight: 600; }
.meta-value { font-size: .9rem; color: var(--ink-800); font-weight: 500; }

/* Progress ring */
.project-hero-progress { flex-shrink: 0; }
.ring {
    --p: 0;
    width: 110px; height: 110px;
    border-radius: 50%;
    background:
        conic-gradient(var(--brand) calc(var(--p) * 1%), var(--ink-100) 0);
    display: grid; place-items: center;
    position: relative;
}
.ring-inner {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: var(--paper);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-pct { font-size: 1.4rem; font-weight: 600; color: var(--ink-900); }
.ring-label { font-size: .65rem; color: var(--ink-500); letter-spacing: .02em; text-align: center; }

/* ===== Project detail 2-col ===== */
.project-grid-2col {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1.25rem;
}
.project-col-main { display: flex; flex-direction: column; gap: 1.25rem; }
.project-col-side { display: flex; flex-direction: column; gap: 1.25rem; }

/* ===== Milestone list ===== */
.milestone-list { list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.milestone {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .25rem;
    border-bottom: 1px solid var(--ink-100);
    font-size: .9rem;
    color: var(--ink-800);
}
.milestone:last-child { border-bottom: none; }
.milestone-check {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--ink-300);
    background: var(--paper);
    display: grid; place-items: center;
    flex-shrink: 0;
    color: white;
    transition: all .15s;
}
.milestone-done .milestone-check { background: var(--success); border-color: var(--success); }
.milestone-done .milestone-title { text-decoration: line-through; color: var(--ink-500); }
.milestone-title { flex: 1; min-width: 0; }
.milestone-date { font-size: .75rem; color: var(--ink-500); }
.milestone-actions { display: flex; gap: .25rem; }

.inline-form { display: flex; gap: .5rem; margin-top: 1rem; }
.inline-form input { flex: 1; padding: .55rem .75rem; border: 1px solid var(--ink-200); border-radius: var(--radius-sm); font-size: .85rem; }
.inline-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

.stacked-form { display: flex; flex-direction: column; gap: .55rem; margin-top: 1rem; }
.stacked-form input,
.stacked-form select,
.stacked-form textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    background: var(--paper);
    font-family: inherit;
    color: var(--ink-900);
}
.stacked-form input:focus,
.stacked-form select:focus,
.stacked-form textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}
.stacked-form button { align-self: flex-end; }
.stacked-form-wide label { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .15rem; }
.stacked-form-wide label span { font-size: .8rem; font-weight: 500; color: var(--ink-700); }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .75rem; }

/* ===== Update list ===== */
.update-list { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; }
.update-item {
    padding-left: 1rem;
    border-left: 2px solid var(--brand-soft);
    position: relative;
}
.update-item::before {
    content: "";
    position: absolute;
    left: -6px; top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.update-meta {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
    color: var(--ink-500);
    margin-bottom: .25rem;
}
.update-title { font-size: .95rem; font-weight: 600; color: var(--ink-900); margin-bottom: .25rem; }
.update-body { font-size: .88rem; color: var(--ink-700); line-height: 1.55; }

/* ===== Team list ===== */
.team-list { list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.team-item {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .55rem .25rem;
    border-bottom: 1px solid var(--ink-100);
}
.team-item:last-child { border-bottom: none; }
.team-info { flex: 1; min-width: 0; }
.team-name { font-size: .9rem; font-weight: 500; color: var(--ink-900); }
.team-role { font-size: .75rem; color: var(--ink-500); }
.team-email { font-size: .75rem; color: var(--brand); }

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, #6f80ee 100%);
    color: white;
    display: grid; place-items: center;
    font-weight: 600;
    font-size: .85rem;
    flex-shrink: 0;
}

/* ===== File list ===== */
.file-list { list-style: none; display: flex; flex-direction: column; gap: .15rem; }
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .25rem 0;
    border-bottom: 1px solid var(--ink-100);
}
.file-item:last-child { border-bottom: none; }
.file-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem 0;
    color: var(--ink-800);
    flex: 1;
    min-width: 0;
}
.file-link:hover { color: var(--brand); text-decoration: none; }
.file-icon {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    background: var(--ink-100);
    color: var(--ink-700);
    display: grid; place-items: center;
    font-size: .75rem;
    font-weight: 600;
    flex-shrink: 0;
}
.file-icon-drive { background: #fff4d6; color: #b56500; }
.file-icon-dropbox { background: #e3edff; color: #0061ff; }
.file-icon-figma { background: #ffe5dc; color: #d04827; }
.file-icon-github { background: var(--ink-900); color: white; }
.file-icon-pdf { background: var(--danger-soft); color: var(--danger); }
.file-label { font-size: .88rem; font-weight: 500; }

/* ===== Money / invoices ===== */
.money-bar { margin-bottom: .85rem; }
.money-bar-track {
    height: 10px;
    background: var(--ink-100);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
}
.money-bar-paid {
    position: absolute;
    height: 100%;
    background: var(--success);
    border-radius: 999px 0 0 999px;
}
.money-bar-invoiced {
    position: absolute;
    height: 100%;
    background: #c8cffb;
}
.money-stats { list-style: none; display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; color: var(--ink-700); }
.money-stats li { display: flex; align-items: center; gap: .5rem; }
.money-stats li strong { margin-left: auto; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.money-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.money-dot-paid { background: var(--success); }
.money-dot-outstanding { background: #c8cffb; }
.money-dot-budget { background: var(--ink-300); }

.invoice-list { list-style: none; margin-top: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.invoice-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: .65rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--ink-100);
}
.invoice-item:last-child { border-bottom: none; }
.invoice-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.invoice-ref { font-size: .85rem; font-weight: 500; color: var(--ink-900); }
.invoice-date { font-size: .72rem; color: var(--ink-500); }
.invoice-amount { font-size: .9rem; font-weight: 600; color: var(--ink-900); font-variant-numeric: tabular-nums; }

/* ===== Admin lists ===== */
.admin-list { list-style: none; display: flex; flex-direction: column; }
.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--ink-100);
    flex-wrap: wrap;
}
.admin-list-item:last-child { border-bottom: none; }
.admin-list-meta { display: flex; gap: 1rem; align-items: center; font-size: .8rem; color: var(--ink-600); }
.admin-list-meta-progress { gap: .65rem; }
.admin-list-actions { display: flex; gap: .35rem; }
.company-cell { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.company-logo { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: contain; background: white; padding: 2px; border: 1px solid var(--ink-100); }
.company-name { font-size: .95rem; font-weight: 500; color: var(--ink-900); }
.user-cell { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.user-name { font-size: .95rem; font-weight: 500; color: var(--ink-900); display: flex; align-items: center; gap: .5rem; }
.user-email { font-size: .78rem; color: var(--ink-500); }
.project-link { font-size: .95rem; font-weight: 500; color: var(--ink-900); }
.project-link:hover { color: var(--brand); text-decoration: none; }

.admin-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat-card {
    background: var(--paper);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 1.65rem; font-weight: 600; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.stat-label { font-size: .75rem; color: var(--ink-500); text-transform: uppercase; letter-spacing: 1.2px; margin-top: .15rem; }
.stat-warning .stat-value { color: var(--warning); }

.invite-copy { display: flex; gap: .5rem; margin-top: .65rem; }
.invite-copy input {
    flex: 1;
    padding: .5rem .75rem;
    border: 1px solid #c8cffb;
    border-radius: var(--radius-sm);
    background: white;
    font-size: .8rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    color: var(--ink-700);
}

/* ===== Mobile ===== */
.mobile-topbar { display: none; }
.mobile-overlay { display: none; }
.mobile-menu-btn { display: none; }

@media (max-width: 900px) {
    .project-grid-2col { grid-template-columns: 1fr; }
    .project-hero { flex-direction: column; align-items: stretch; }
    .project-hero-progress { align-self: flex-start; }
    .hero-inner { align-items: flex-start; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 4.25rem 1rem 3rem; }
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: .75rem;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 56px;
        background: var(--paper);
        border-bottom: 1px solid var(--ink-100);
        z-index: 90;
        padding: 0 1rem;
    }
    .mobile-menu-btn {
        display: grid; place-items: center;
        width: 36px; height: 36px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--ink-200);
        background: var(--paper);
        color: var(--ink-700);
    }
    .mobile-topbar-title { font-size: .9rem; font-weight: 600; color: var(--ink-900); }
    .mobile-overlay {
        display: block;
        position: fixed; inset: 0;
        background: rgba(15, 23, 41, .35);
        z-index: 99;
    }
    .content-header { flex-direction: column; align-items: flex-start; }
    .content-header h1 { font-size: 1.25rem; }
    .hero-card { padding: 1.5rem 1.4rem; }
    .hero-title { font-size: 1.4rem; }
    .hero-stats { gap: 1.25rem; }
    .hero-stat-value { font-size: 1.3rem; }
    .project-hero { padding: 1.25rem; }
    .project-hero-title { font-size: 1.3rem; }
}

/* ===== Pull-to-refresh indicator ===== */
.ptr-indicator {
    position: fixed;
    top: -50px; left: 50%;
    transform: translateX(-50%) translateY(-50px);
    background: var(--ink-900);
    color: white;
    padding: .4rem 1rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 500;
    z-index: 999;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
}
.ptr-indicator.ptr-ready { color: var(--brand); }
@media (min-width: 769px) { .ptr-indicator { display: none; } }
