/* ============================================================
   Kimayco — Minimal Design System
   ============================================================ */

:root {
    --bg:            #f7f6f3;
    --surface:       #ffffff;
    --surface-raised: #fbfaf7;
    --border:        #e2dfd8;
    --border-light:  #eceae4;
    --text:          #1a1a1a;
    --text-muted:    #5c5c5c;
    --text-faint:    #8a8a8a;
    --accent:        #0d6e6e;
    --accent-hover:  #0a5858;
    --accent-light:  rgba(13, 110, 110, 0.08);
    --radius:        10px;
    --radius-sm:     6px;
    --shadow:        0 1px 2px rgba(26, 26, 26, 0.04);
    --shadow-md:     0 16px 48px rgba(26, 26, 26, 0.08);
    --sidebar-w:     228px;
    --topbar-h:      60px;
    --admin-sans:    'DM Sans', system-ui, -apple-system, sans-serif;

    /* badge tokens */
    --badge-red-bg:    #fef2f2;
    --badge-red-text:  #b91c1c;
    --badge-red-border:#fecaca;
    --badge-blue-bg:   rgba(13, 110, 110, 0.1);
    --badge-blue-text: #0d6e6e;
    --badge-blue-border: rgba(13, 110, 110, 0.22);
    --badge-amber-bg:  #fffbeb;
    --badge-amber-text:#b45309;
    --badge-amber-border:#fde68a;
    --badge-green-bg:  #f0fdf4;
    --badge-green-text:#15803d;
    --badge-green-border:#bbf7d0;
    --badge-gray-bg:   #f5f4f1;
    --badge-gray-text: #374151;
    --badge-gray-border:#e2dfd8;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--admin-sans);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Badges (override Bootstrap) ─────────────────────────── */
.badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0;
    border: 1px solid transparent;
}

.badge.bg-danger {
    background-color: var(--badge-red-bg) !important;
    color: var(--badge-red-text) !important;
    border-color: var(--badge-red-border);
}
.badge.bg-primary {
    background-color: var(--badge-blue-bg) !important;
    color: var(--badge-blue-text) !important;
    border-color: var(--badge-blue-border);
}
.badge.bg-warning {
    background-color: var(--badge-amber-bg) !important;
    color: var(--badge-amber-text) !important;
    border-color: var(--badge-amber-border);
}
.badge.bg-warning.text-dark {
    color: var(--badge-amber-text) !important;
}
.badge.bg-success {
    background-color: var(--badge-green-bg) !important;
    color: var(--badge-green-text) !important;
    border-color: var(--badge-green-border);
}
.badge.bg-secondary {
    background-color: var(--badge-gray-bg) !important;
    color: var(--badge-gray-text) !important;
    border-color: var(--badge-gray-border);
}
.badge.bg-info {
    background-color: var(--badge-blue-bg) !important;
    color: var(--badge-blue-text) !important;
    border-color: var(--badge-blue-border);
}
.badge.bg-info.text-dark { color: var(--badge-blue-text) !important; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow);
}

.card-header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border-light);
    padding: 14px 18px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.card-body { padding: 18px; }
.card-body.p-0 { padding: 0; }
.card-body.p-4 { padding: 24px; }

/* ── Tables ───────────────────────────────────────────────── */
.table {
    font-size: 13.5px;
    color: var(--text);
    margin-bottom: 0;
}

.table th {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    background: #f5f4f1 !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 10px 16px;
}

.table td {
    padding: 11px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

.table tbody tr:last-child td { border-bottom: none; }

.table-hover tbody tr:hover td {
    background: var(--bg);
}

/* ── Buttons (override Bootstrap) ────────────────────────── */
.btn {
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    transition: opacity .15s, background .15s;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--border);
}
.btn-outline-primary:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

.btn-outline-danger {
    color: var(--badge-red-text);
    border-color: var(--border);
}
.btn-outline-danger:hover {
    background: var(--badge-red-bg);
    border-color: var(--badge-red-border);
    color: var(--badge-red-text);
}

.btn-secondary {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}
.btn-secondary:hover {
    background: var(--border);
    border-color: var(--border);
    color: var(--text);
}

.btn-sm { font-size: 12px; padding: 4px 10px; }
.btn-lg { font-size: 15px; padding: 10px 20px; }

/* ── Form controls ────────────────────────────────────────── */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface);
    padding: 8px 12px;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: none;
}

.form-control::placeholder { color: var(--text-faint); }
.form-label { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-control-lg { font-size: 15px; padding: 11px 14px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    border-width: 1px;
}

.alert-success  { background: var(--badge-green-bg); color: var(--badge-green-text); border-color: var(--badge-green-border); }
.alert-danger   { background: var(--badge-red-bg);   color: var(--badge-red-text);   border-color: var(--badge-red-border); }
.alert-warning  { background: var(--badge-amber-bg); color: var(--badge-amber-text); border-color: var(--badge-amber-border); }
.alert-info     { background: var(--badge-blue-bg);  color: var(--badge-blue-text);  border-color: var(--badge-blue-border); }
.btn-close { opacity: .5; }

/* ── Modals ───────────────────────────────────────────────── */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
}
.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 14px 20px;
}
.modal-body { padding: 20px; }
.modal-title { font-size: 15px; font-weight: 600; }

/* ── ════════════════════════════════════════════════════════
   ADMIN SIDEBAR LAYOUT
   ════════════════════════════════════════════════════════ */

.admin-body {
    background: var(--bg);
    display: flex;
}

/* Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: #18181b;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 18px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-decoration: none;
    line-height: 1.25;
}

.sidebar-brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: color-mix(in srgb, var(--accent) 85%, #fff);
    color: #fff;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand i { color: #818cf8; font-size: 16px; }
.sidebar-brand:hover { color: #ffffff; }

.sidebar-section {
    padding: 18px 12px 8px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #52525b;
    padding: 0 8px;
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13.5px;
    color: #a1a1aa;
    font-weight: 400;
    margin-bottom: 2px;
    transition: color .15s, background .15s;
    text-decoration: none;
}

.sidebar-link i { font-size: 15px; width: 18px; flex-shrink: 0; }

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,.06);
}

.sidebar-link.active {
    color: #ffffff;
    background: rgba(79,70,229,.35);
    font-weight: 500;
}

.sidebar-link.active i { color: #818cf8; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13px;
    color: #71717a;
    transition: color .15s, background .15s;
}

.sidebar-footer a:hover {
    color: #f87171;
    background: rgba(239,68,68,.08);
}

/* Light-mode sidebar */
.admin-body:not(.admin-dark) .admin-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.admin-body:not(.admin-dark) .sidebar-brand {
    color: var(--text);
    border-bottom-color: var(--border);
}

.admin-body:not(.admin-dark) .sidebar-brand-mark {
    background: var(--accent);
    color: #fff;
}

.admin-body:not(.admin-dark) .sidebar-brand i {
    color: var(--accent);
}

.admin-body:not(.admin-dark) .sidebar-brand:hover {
    color: var(--text);
}

.admin-body:not(.admin-dark) .sidebar-label {
    color: var(--text-faint);
}

.admin-body:not(.admin-dark) .sidebar-link {
    color: var(--text-muted);
    position: relative;
}

.admin-body:not(.admin-dark) .sidebar-link:hover {
    color: var(--text);
    background: var(--bg);
}

.admin-body:not(.admin-dark) .sidebar-link.active {
    color: var(--accent);
    background: var(--accent-light);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}

.admin-body:not(.admin-dark) .sidebar-link.active i {
    color: var(--accent);
}

.admin-body:not(.admin-dark) .sidebar-footer {
    border-top-color: var(--border);
}

.admin-body:not(.admin-dark) .sidebar-footer a {
    color: var(--text-muted);
}

.admin-body:not(.admin-dark) .sidebar-footer a:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.08);
}

.admin-body:not(.admin-dark) .admin-topbar {
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
    backdrop-filter: blur(8px);
}

.admin-body:not(.admin-dark) .topbar-admin {
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    gap: 8px;
}

.admin-body:not(.admin-dark) .topbar-admin-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.admin-body:not(.admin-dark) .console-hero {
    box-shadow: none;
}

.admin-body:not(.admin-dark) .stat-card-link:hover {
    box-shadow: none;
}

.admin-body:not(.admin-dark) .dash-inbox-item:hover {
    box-shadow: var(--shadow);
}

/* Settings — theme selector */
.theme-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.theme-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-option:hover {
    border-color: var(--accent);
}

.theme-option.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.theme-option-preview {
    display: flex;
    width: 100%;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.theme-preview-sidebar {
    width: 28%;
    flex-shrink: 0;
}

.theme-preview-main {
    flex: 1;
}

.theme-option-preview--light .theme-preview-sidebar {
    background: #ffffff;
    border-right: 1px solid #e4e7ec;
}

.theme-option-preview--light .theme-preview-main {
    background: #f5f6f8;
}

.theme-option-preview--dark .theme-preview-sidebar {
    background: #18181b;
}

.theme-option-preview--dark .theme-preview-main {
    background: #080a0f;
}

.theme-option-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.theme-option-label i {
    font-size: 14px;
    color: var(--text-muted);
}

.theme-option.is-selected .theme-option-label i {
    color: var(--accent);
}

/* Main content area */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.admin-topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    cursor: pointer;
    color: var(--text-muted);
    display: none;
}

.topbar-spacer { flex: 1; }

.topbar-admin {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-admin i { font-size: 15px; }

.topbar-admin-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-admin-name {
    font-weight: 500;
}

/* Page content */
.admin-content {
    padding: 28px 28px;
    flex: 1;
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}

@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .topbar-toggle { display: flex; }
    .sidebar-overlay.active { display: block; }
}

/* ── ════════════════════════════════════════════════════════
   CLIENT / PUBLIC LAYOUT
   ════════════════════════════════════════════════════════ */

.client-body {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.client-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 54px;
    display: flex;
    align-items: center;
}

.client-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.client-brand {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}

.client-brand i { color: var(--accent); }
.client-brand:hover { color: var(--text); }

.client-nav-link {
    font-size: 13px;
    color: var(--text-muted);
}
.client-nav-link:hover { color: var(--accent); }

.client-main {
    flex: 1;
    padding: 40px 0;
}

.client-footer {
    border-top: 1px solid var(--border);
    padding: 18px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-faint);
}

/* Admin login (no sidebar) */
.auth-body {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

/* ── Page components ──────────────────────────────────────── */

/* Landing hero */
.search-card {
    max-width: 440px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.search-card .logo-icon {
    width: 52px; height: 52px;
    background: var(--accent-light);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent);
    font-size: 22px;
}

/* ── Project page ─────────────────────────────────────────── */

.project-page {
    max-width: 760px;
    margin: 0 auto;
}

.project-breadcrumb {
    margin-bottom: 20px;
}

.project-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}

.project-breadcrumb a:hover { color: var(--accent); }

/* Hero */
.project-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow);
}

.project-hero-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.project-code-pill {
    font-size: 11.5px;
    font-weight: 600;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--text-muted);
}

.project-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
    line-height: 1.3;
}

.project-hero-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
    max-width: 520px;
}

.project-live-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Stats row */
.project-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.project-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: center;
}

.project-stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.project-stat-num.text-warning-stat { color: #d97706; }
.project-stat-num.text-success-stat  { color: #16a34a; }

.project-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Tabs */
.project-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.project-tab {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.project-tab i { font-size: 14px; }

.project-tab:hover {
    color: var(--text);
    background: var(--bg);
}

.project-tab.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 28%, transparent);
}

.tab-count {
    font-size: 10px;
    font-weight: 600;
    background: rgba(255,255,255,.25);
    padding: 1px 6px;
    border-radius: 999px;
}

.project-tab:not(.active) .tab-count {
    background: var(--bg);
    color: var(--text-muted);
}

/* Panels */
.project-panel {
    display: none;
}

.project-panel.active {
    display: block;
    animation: panelIn .2s ease;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.panel-intro {
    margin-bottom: 24px;
}

.panel-intro h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}

.panel-intro p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
}

/* Panel empty state */
.panel-empty {
    text-align: center;
    padding: 56px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.panel-empty-icon {
    width: 52px; height: 52px;
    background: var(--bg);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 22px;
    color: var(--text-faint);
}

.panel-empty h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text);
}

.panel-empty p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0 0 20px;
}

/* Feedback form */
.feedback-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.form-section { margin-bottom: 22px; }

.form-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.required { color: #dc2626; }
.optional { font-weight: 400; color: var(--text-faint); font-size: 12px; }

.form-section-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-actions {
    padding-top: 4px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
    padding-top: 20px;
}

/* Type picker */
.type-picker {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 640px) {
    .type-picker {
        grid-template-columns: repeat(4, 1fr);
    }
}

.type-option { cursor: pointer; margin: 0; }

.type-option input { position: absolute; opacity: 0; pointer-events: none; }

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 16px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .15s, background .15s, box-shadow .15s;
    height: 100%;
}

.type-card i {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.type-card strong {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

.type-card small {
    font-size: 11px;
    color: var(--text-faint);
    line-height: 1.3;
}

.type-option input:checked + .type-card {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.type-option input:checked + .type-card i { color: var(--accent); }

.type-option:hover .type-card {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* Feedback cards (submissions list) */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.feedback-card-badges { display: flex; gap: 5px; flex-wrap: wrap; }

.feedback-card-date {
    font-size: 11.5px;
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

.feedback-card-title {
    font-size: 14.5px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text);
}

.feedback-card-body {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0 0 12px;
    line-height: 1.6;
}

.feedback-card-resolved,
.feedback-card-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
}

.feedback-card-resolved {
    background: var(--badge-green-bg);
    color: var(--badge-green-text);
    border: 1px solid var(--badge-green-border);
}

.feedback-card-progress {
    background: var(--badge-amber-bg);
    color: var(--badge-amber-text);
    border: 1px solid var(--badge-amber-border);
}

.feedback-card-open {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Updates list */
.updates-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.update-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
}

.update-card-latest {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, #fff) 0%, #fff 100%);
}

.update-latest-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.update-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text);
}

.update-card-date {
    display: block;
    font-size: 11.5px;
    color: var(--text-faint);
    margin-bottom: 10px;
}

.update-card-body {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.65;
}

@media (max-width: 640px) {
    .project-stats { grid-template-columns: repeat(2, 1fr); }
    .type-picker { grid-template-columns: 1fr; }
    .form-section-row { grid-template-columns: 1fr; }
    .project-hero { padding: 18px 20px; }
    .feedback-form { padding: 18px 20px; }
    .project-tab { font-size: 12px; padding: 8px 10px; }
}

/* Legacy (keep for admin) */
.project-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

/* Timeline */
.timeline-item {
    position: relative;
    padding: 0 0 20px 16px;
    border-left: 2px solid var(--border);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px; top: 5px;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.timeline-meta  { font-size: 11.5px; color: var(--text-muted); margin: 3px 0 6px; }
.timeline-body  { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* Feedback items */
.feedback-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    margin-bottom: 10px;
    transition: box-shadow .15s;
}

.feedback-item:hover { box-shadow: var(--shadow); }
.feedback-item:last-child { margin-bottom: 0; }

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    color: var(--text-muted);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.upload-zone:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.upload-zone.paste-flash {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.upload-zone i { font-size: 24px; margin-bottom: 6px; display: block; }
.upload-zone p { font-size: 13px; margin: 0; }
.upload-zone small { font-size: 11.5px; color: var(--text-faint); display: block; margin-top: 4px; }

/* Previews */
.preview-thumb-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.preview-thumb {
    width: 72px; height: 72px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid var(--border);
}

.preview-thumb-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.preview-thumb-remove:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* Stat cards */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; color: var(--text); }
.stat-value.danger  { color: #dc2626; }
.stat-value.warning { color: #d97706; }
.stat-value.success { color: #16a34a; }

/* Empty states */
.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-faint);
    font-size: 13.5px;
}

.empty-state i { font-size: 28px; display: block; margin-bottom: 10px; }

/* Utility */
.code-display { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .04em; }
.page-title   { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.page-sub     { font-size: 13px; color: var(--text-muted); }

/* Task hub & detail */
.project-stats-3 { grid-template-columns: repeat(3, 1fr); }

.project-stat-highlight {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 5%, #fff), #fff);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-head h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.section-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 999px;
}

.section-close {
    font-size: 22px;
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1;
}

.task-form-section {
    margin-bottom: 28px;
}

.task-list-section { margin-bottom: 28px; }

.task-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.task-card-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: border-color .15s, box-shadow .15s;
}

.task-card-link:hover .task-card-item {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: var(--shadow-md);
}

.task-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.task-card-top time {
    font-size: 11.5px;
    color: var(--text-faint);
    white-space: nowrap;
}

.task-card-item h3 {
    font-size: 14.5px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text);
}

.task-card-url {
    font-size: 12px;
    color: var(--text-muted);
}

.task-card-action-hint {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
}

.updates-collapse {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 24px;
}

.updates-collapse summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.task-detail-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 20px;
}

.task-detail-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
}

.task-detail-meta {
    font-size: 12.5px;
    color: var(--text-muted);
}

.task-page-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    margin-top: 10px;
    word-break: break-all;
}

.task-thread {
    margin-bottom: 24px;
}

.thread-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.thread-message {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 12px;
}

.thread-message-admin {
    border-left: 3px solid var(--accent);
}

.thread-message-client {
    border-left: 3px solid #94a3b8;
}

.thread-message-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.thread-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.thread-message-head time {
    font-size: 11.5px;
    color: var(--text-faint);
}

.thread-message-body {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
}

.thread-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.thread-attachments img {
    height: 88px;
    width: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: cover;
}

.thread-proof-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.verify-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.verify-section h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.verify-section > p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.verify-reopen {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.verify-reopen h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.task-approved-banner,
.task-waiting-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}

.task-approved-banner {
    background: var(--badge-green-bg);
    color: var(--badge-green-text);
    border: 1px solid var(--badge-green-border);
}

.task-waiting-banner {
    background: var(--badge-amber-bg);
    color: var(--badge-amber-text);
    border: 1px solid var(--badge-amber-border);
}

.upload-zone-sm {
    padding: 16px;
}

.upload-zone-sm i { font-size: 18px; }

.ai-summary-box {
    background: var(--accent-light);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 12px;
    font-size: 13px;
}

.ai-summary-box p { margin: 6px 0 0; color: var(--text-muted); }

.groq-result {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.groq-text {
    font-size: 12.5px;
    white-space: pre-wrap;
    margin: 0;
    max-height: 240px;
    overflow-y: auto;
    color: var(--text);
    font-family: inherit;
}

@media (max-width: 640px) {
    .project-stats-3 { grid-template-columns: 1fr; }
}

/* AI Chat helper */
.ai-chat-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px 18px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
}

.ai-chat-intro {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: -8px 0 16px;
}

.ai-chat-window {
    max-height: 380px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 92%;
}

.ai-msg-user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.ai-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

.ai-msg-assistant .ai-msg-avatar {
    background: var(--accent-light);
    color: var(--accent);
}

.ai-msg-user .ai-msg-avatar {
    background: #e2e8f0;
    color: var(--text-muted);
}

.ai-msg-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.55;
}

.ai-msg-assistant .ai-msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.ai-msg-user .ai-msg-bubble {
    background: var(--accent);
    color: #fff;
}

.ai-msg-typing .ai-msg-bubble {
    color: var(--text-muted);
    font-style: italic;
}

.ai-chat-input {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-chat-attach {
    height: 42px;
    width: 42px;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-pending {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.ai-chat-pending .ai-chat-pending-thumb {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
}

.ai-chat-pending .preview-thumb {
    width: 56px;
    height: 56px;
}

.ai-chat-pending img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.ai-msg-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ai-msg-images img {
    max-height: 120px;
    max-width: 160px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.3);
    object-fit: cover;
    cursor: pointer;
}

.ai-msg-assistant .ai-msg-images img {
    border-color: var(--border);
}

.ai-msg-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.ai-msg-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-msg-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.ai-msg-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-soft, #eef2ff);
}

.ai-msg-option-all {
    font-weight: 600;
    border-color: var(--accent);
    background: var(--accent-soft, #eef2ff);
}

.ai-msg-options-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.ai-msg-option-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.4;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin: 0;
}

.ai-msg-option-check:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft, #eef2ff);
}

.ai-msg-options-single .ai-msg-option {
    position: relative;
    padding-left: 36px;
}

.ai-msg-options-single .ai-msg-option::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: #fff;
}

.ai-msg-options-multi .ai-msg-option-check input {
    margin-top: 3px;
    flex-shrink: 0;
}

.ai-msg-submit-selected {
    align-self: flex-start;
    margin-top: 4px;
}

.ai-msg-option-other {
    margin-top: 4px;
}

.ai-msg-option:disabled {
    opacity: .55;
    cursor: default;
}

.ai-msg-other-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.ai-msg-other-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
}

.ai-msg-other-input {
    font-size: 13px;
    resize: vertical;
    min-height: 72px;
}

.ai-msg-other-send {
    align-self: flex-end;
}

.ai-msg-bubble:empty {
    display: none;
}

.ai-chat-input textarea {
    flex: 1;
    resize: none;
    font-size: 13.5px;
}

.ai-chat-input .btn {
    height: 42px;
    width: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-error {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--badge-red-bg);
    color: var(--badge-red-text);
    border: 1px solid var(--badge-red-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

body.ai-task-draft-open {
    overflow: hidden;
}

.ai-task-draft-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ai-task-draft-overlay.d-none {
    display: none !important;
}

.ai-task-draft-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ai-task-draft {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    max-height: min(80vh, 640px);
    display: flex;
    flex-direction: column;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2dfd8);
    border-radius: 16px;
    padding: 0;
    margin: 0;
    box-shadow: 0 20px 50px rgba(26, 26, 26, 0.18);
    overflow: hidden;
}

.ai-task-draft-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-light, #eceae4);
    flex-shrink: 0;
}

.ai-task-draft-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ai-task-draft-close {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted, #5c5c5c);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ai-task-draft-close:hover {
    background: var(--bg, #f7f6f3);
    color: var(--text, #1a1a1a);
}

.ai-task-draft-head {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 650;
    color: var(--accent, #0d6e6e);
    margin: 0;
}

.ai-task-draft-head i {
    font-size: 14px;
}

.ai-task-draft-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent, #0d6e6e);
    background: var(--accent-light, rgba(13, 110, 110, 0.08));
    border-radius: 6px;
    padding: 3px 8px;
    white-space: nowrap;
}

.ai-task-draft-type-select {
    width: auto;
    min-width: 8.5rem;
    max-width: 11rem;
    font-size: 11px;
    font-weight: 650;
    color: var(--accent, #0d6e6e);
    background: var(--accent-light, rgba(13, 110, 110, 0.08));
    border-color: transparent;
    padding-block: 0.2rem;
}

.ai-task-draft-body {
    font-size: 13px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px;
}

.ai-task-draft form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    flex: 1;
}

.draft-title {
    font-family: var(--landing-serif, Georgia, serif);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text, #1a1a1a);
    margin: 0 0 10px;
    line-height: 1.3;
}

.draft-issues-head {
    display: none;
}

.draft-issues-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 10px;
}

.draft-issues-note {
    display: none;
}

.draft-issue {
    background: var(--bg, #f7f6f3);
    border: 1px solid var(--border-light, #eceae4);
    border-radius: 8px;
    padding: 8px 10px;
}

.draft-issue-vague {
    border-color: rgba(180, 83, 9, 0.25);
    background: rgba(245, 158, 11, 0.08);
}

.draft-issue-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent, #0d6e6e);
    background: var(--accent-light, rgba(13, 110, 110, 0.08));
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.draft-issue-summary {
    display: flex;
    align-items: flex-start;
    gap: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text, #1a1a1a);
}

.draft-issue-hint {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin-top: 6px;
    font-size: 11.5px;
    color: #92400e;
    line-height: 1.4;
}

.draft-issue-hint i {
    margin-top: 1px;
    flex-shrink: 0;
}

.draft-issue-add-comment {
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 6px;
}

.draft-issue-comment-wrap {
    margin-top: 6px;
}

.draft-issue-comment-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #5c5c5c);
    margin-bottom: 4px;
}

.draft-issue-comment {
    font-size: 12.5px;
}

.ai-task-draft-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 0;
}

.ai-task-draft-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    padding: 12px 16px;
    margin: 0;
    border-top: 1px solid var(--border-light, #eceae4);
    background: var(--surface, #fff);
}

.ai-task-draft-note {
    font-size: 11.5px;
    color: var(--text-faint, #8a8a8a);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.ai-task-draft-foot .btn {
    flex-shrink: 0;
    font-weight: 600;
    border-radius: 8px;
    padding: 7px 14px;
}

@media (max-width: 700px) {
    .ai-task-draft-fields {
        grid-template-columns: 1fr;
    }

    .ai-task-draft-foot {
        flex-direction: column;
        align-items: stretch;
    }
}

.draft-issue-vague .draft-issue-num {
    color: #92400e;
    background: rgba(245, 158, 11, 0.18);
}

.context-entries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.context-entry {
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.context-entry-task { border-left: 3px solid var(--accent); }
.context-entry-client_chat { border-left: 3px solid #0ea5e9; }
.context-entry-admin { border-left: 3px solid #22c55e; }

.context-entry-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.context-entry-meta {
    color: var(--text-muted);
    white-space: nowrap;
}

.context-entry-body {
    margin: 0;
    line-height: 1.5;
    color: var(--text);
}

/* ── Admin project cards & hub ─────────────────────────────── */

.admin-section-title {
    font-size: 16px;
    font-weight: 600;
}

.admin-project-search-wrap,
.admin-client-search-wrap {
    position: relative;
    margin-bottom: 20px;
    max-width: 420px;
}

.admin-project-search-wrap i,
.admin-client-search-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
    font-size: 14px;
}

.admin-project-search-wrap .form-control,
.admin-client-search-wrap .form-control {
    padding-left: 40px;
    background: var(--surface);
    border-color: var(--border);
}

.admin-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-page-head .page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.admin-empty-state-card {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
}

.admin-empty-state-card p {
    margin: 0;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.admin-client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.admin-client-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.admin-client-card:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    box-shadow: var(--shadow-md);
}

.admin-client-card-body {
    padding: 18px 18px 14px;
    flex: 1;
}

.admin-client-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-client-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent) 14%, transparent));
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.admin-client-card-intro {
    flex: 1;
    min-width: 0;
}

.admin-client-name {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 2px;
    color: var(--text);
    line-height: 1.35;
}

.admin-client-company {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0;
}

.admin-client-project-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--badge-gray-bg);
    color: var(--badge-gray-text);
    border: 1px solid var(--badge-gray-border);
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-client-contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-client-contact li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    min-width: 0;
}

.admin-client-contact i {
    color: var(--text-faint);
    font-size: 14px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.admin-client-contact a {
    color: var(--text-muted);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-client-contact a:hover {
    color: var(--accent-hover);
}

.admin-client-muted {
    color: var(--text-faint);
    font-style: italic;
}

.admin-client-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.15);
}

.admin-client-card-footer .btn-primary {
    flex: 1;
}

/* New project — AI starter tasks */
.starter-tasks-card {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    height: 100%;
}

.starter-tasks-card-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.starter-tasks-card-head > i {
    font-size: 22px;
    color: #a78bfa;
    margin-top: 2px;
}

.starter-tasks-card-head strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}

.starter-tasks-card-head p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.starter-tasks-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.starter-tasks-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.starter-tasks-panel {
    margin-top: 14px;
}

.starter-tasks-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
}

.starter-tasks-count {
    color: var(--text-muted);
    font-weight: 500;
}

.starter-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.starter-task-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    cursor: pointer;
    margin: 0;
}

.starter-task-option:has(.starter-task-check:checked) {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    background: var(--accent-light);
}

.starter-task-check {
    margin-top: 4px;
    flex-shrink: 0;
}

.starter-task-option-body {
    flex: 1;
    min-width: 0;
}

.starter-task-type {
    font-size: 10px;
    margin-bottom: 4px;
}

.starter-task-title {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 4px;
}

.starter-task-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
}

.starter-task-reason {
    font-size: 11px;
    color: var(--text-faint);
    margin: 6px 0 0;
    line-height: 1.4;
}

.admin-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.admin-project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}

.admin-project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.admin-project-card-main {
    display: block;
    padding: 18px 18px 14px;
    text-decoration: none;
    color: inherit;
}

.admin-project-card-main:hover {
    color: inherit;
}

.admin-project-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-project-code {
    font-size: 12px;
    font-weight: 700;
}

.admin-project-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text);
    line-height: 1.35;
}

.admin-project-card-client {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.admin-project-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}

.admin-project-open-badge {
    color: #dc2626;
    font-weight: 500;
}

.admin-project-open-badge i {
    font-size: 6px;
    vertical-align: middle;
}

.admin-project-open-none {
    color: var(--text-faint);
}

.admin-project-live {
    color: var(--accent);
}

.admin-project-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
    background: var(--bg);
}

.admin-hub-breadcrumb a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.admin-hub-breadcrumb a:hover {
    color: var(--accent);
}

.admin-hub-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
}

.admin-hub-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.admin-hub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-hub-tab {
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
}

.admin-hub-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-hub-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.admin-hub-tasks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-hub-task-card {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, background .15s;
}

.admin-hub-task-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft, #eef2ff);
    color: inherit;
}

.admin-hub-task-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.admin-hub-task-top time {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-hub-task-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.admin-hub-task-url {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.task-detail-page {
    max-width: 760px;
    margin: 0 auto;
}

/* Developer console tabs */
.admin-console-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.admin-console-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
}

.admin-console-tab:hover {
    color: var(--accent);
}

.admin-console-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.admin-console-panel {
    display: none;
}

.admin-console-panel.active {
    display: block;
}

.console-context-preview {
    display: block;
    max-height: 360px;
    overflow: auto;
    padding: 16px;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    background: var(--bg);
    border: none;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #b8c0d4;
}

.console-task-rank {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
}

.console-group-label {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
}

.console-task-summary {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 6px 0 0;
    line-height: 1.4;
}

.console-task-reason {
    font-size: 12px;
    color: var(--accent);
    margin: 6px 0 0;
    font-style: italic;
}

.console-sort-reasons {
    margin-bottom: 16px;
}

.console-insight-action h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.console-insight-action p {
    color: var(--text-muted);
    line-height: 1.55;
}

.console-insight-action h3 i {
    color: var(--accent);
    margin-right: 6px;
}

.console-insight-card {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    margin-bottom: 12px;
    color: var(--text);
}

.console-insight-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.console-insight-card h4 i {
    color: var(--accent);
    margin-right: 6px;
}

.console-briefing-text {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.console-priority-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 13px;
    line-height: 1.7;
}

.console-priority-list li {
    margin-bottom: 6px;
}

.console-rec-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.console-rec-blocker { border-left: 3px solid #ef4444; }
.console-rec-quick_win { border-left: 3px solid #22c55e; }
.console-rec-duplicate { border-left: 3px solid #f59e0b; }
.console-rec-missing_info { border-left: 3px solid #0ea5e9; }
.console-rec-grouping { border-left: 3px solid #8b5cf6; }

.dev-metadata-form textarea,
.dev-metadata-form input {
    font-size: 13px;
}

.dev-metadata-form .form-label {
    font-size: 12.5px;
    font-weight: 600;
}

/* ── Admin dark mode (default) ─────────────────────────────── */
.admin-dark {
    --bg:              #080a0f;
    --surface:         #11141b;
    --surface-raised:  #171b24;
    --border:          #232936;
    --border-light:    #1a1f29;
    --text:            #e8ebf2;
    --text-muted:      #9aa3b8;
    --text-faint:      #707890;
    --accent:          #7c6af7;
    --accent-hover:    #9585ff;
    --accent-light:    rgba(124, 106, 247, 0.14);
    --accent-glow:     rgba(124, 106, 247, 0.22);
    --shadow:          0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md:       0 8px 32px rgba(0, 0, 0, 0.5);
    --badge-red-bg:    rgba(239, 68, 68, 0.14);
    --badge-red-text:  #fca5a5;
    --badge-red-border:rgba(239, 68, 68, 0.35);
    --badge-blue-bg:   rgba(99, 102, 241, 0.14);
    --badge-blue-text: #a5b4fc;
    --badge-blue-border:rgba(99, 102, 241, 0.35);
    --badge-amber-bg:  rgba(245, 158, 11, 0.14);
    --badge-amber-text:#fcd34d;
    --badge-amber-border:rgba(245, 158, 11, 0.35);
    --badge-green-bg:  rgba(34, 197, 94, 0.14);
    --badge-green-text:#86efac;
    --badge-green-border:rgba(34, 197, 94, 0.35);
    --badge-gray-bg:   rgba(148, 163, 184, 0.1);
    --badge-gray-text: #cbd5e1;
    --badge-gray-border:rgba(148, 163, 184, 0.25);
    /* Bootstrap vars — keep utility classes readable on dark surfaces */
    --bs-body-color:          #e8ebf2;
    --bs-secondary-color:     #9aa3b8;
    --bs-tertiary-color:      #707890;
    --bs-emphasis-color:      #f3f4f6;
    --bs-heading-color:       #f3f4f6;
    --bs-border-color:        #232936;
}

.admin-dark .admin-topbar {
    background: var(--surface);
    border-bottom-color: var(--border);
}

.admin-dark .form-control,
.admin-dark .form-select {
    background: var(--surface-raised);
    border-color: var(--border);
    color: var(--text);
}

.admin-dark .form-control:focus,
.admin-dark .form-select:focus {
    background: var(--surface-raised);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.admin-dark .form-control::placeholder,
.admin-dark .form-select::placeholder,
.admin-dark textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* Bootstrap utility overrides — default BS muted colors are too dark here */
.admin-dark .text-muted,
.admin-dark .text-body-secondary {
    color: var(--text-muted) !important;
}

.admin-dark .text-secondary {
    color: var(--text-muted) !important;
}

.admin-dark .form-text {
    color: var(--text-muted);
}

.admin-dark .card {
    background: var(--surface);
    color: var(--text);
}

.admin-dark .table th {
    background: var(--surface-raised) !important;
    color: var(--text-muted);
    border-bottom-color: var(--border) !important;
}

.admin-dark .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-hover-bg: var(--surface-raised);
    --bs-table-hover-color: var(--text);
    --bs-table-striped-bg: transparent;
    --bs-table-active-bg: var(--surface-raised);
    --bs-table-border-color: var(--border-light);
}

.admin-dark .table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text);
    box-shadow: none;
    border-bottom-color: var(--border-light);
}

.admin-dark .table td {
    color: var(--text-muted);
}

.admin-dark .table-hover tbody tr:hover > * {
    background-color: var(--surface-raised) !important;
    color: var(--text);
}

.admin-dark .table-hover tbody tr:hover td {
    background: transparent;
}

.admin-dark .modal-content {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.admin-dark .modal-header,
.admin-dark .modal-footer {
    border-color: var(--border-light);
}

.admin-dark .badge.bg:where(.bg-secondary) {
    background: var(--badge-gray-bg) !important;
    color: var(--badge-gray-text) !important;
    border: 1px solid var(--badge-gray-border);
    font-weight: 500;
}

.admin-dark .btn-close { filter: invert(1) grayscale(1) opacity(0.6); }

.admin-dark .alert-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.admin-dark .alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.admin-dark .alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.admin-dark .btn-outline-secondary:hover {
    background: var(--surface-raised);
    border-color: var(--border);
}

.admin-dark .admin-project-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

/* ── Developer console (project hub) ─────────────────────── */
.dev-console {
    max-width: 1100px;
}

.dev-console-hero {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    margin-bottom: 20px;
    overflow: hidden;
}

.dev-console-hero-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% -10%, var(--accent-glow), transparent 55%),
        radial-gradient(ellipse 50% 40% at 90% 0%, rgba(56, 189, 248, 0.08), transparent 50%);
    pointer-events: none;
}

.dev-console-hero-inner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px 18px;
}

.dev-console-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.dev-console-code {
    font-size: 13px !important;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-hover);
}

.dev-console-ai-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent-hover);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.dev-console-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.dev-console-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.dev-console-meta a { color: var(--accent-hover); }

.dev-console-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
}

.dev-console-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 14px 18px;
    background: var(--surface-raised);
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    color: inherit;
}

.dev-console-stat:hover {
    background: var(--bg);
}

.admin-dark .dev-console-stat:hover {
    background: #1c2130;
}

.dev-console-stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.dev-console-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dev-console-stat-danger .dev-console-stat-value { color: #f87171; }
.dev-console-stat-warning .dev-console-stat-value { color: #fbbf24; }
.dev-console-stat-success .dev-console-stat-value { color: #4ade80; }

.dev-console .admin-console-tabs {
    gap: 4px;
    border-bottom-color: var(--border);
    margin-bottom: 20px;
}

.dev-console .admin-console-tab {
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
}

.dev-console .admin-console-tab.active {
    background: var(--surface);
    border-bottom-color: var(--accent);
    color: var(--text);
}

.dev-console .card {
    background: var(--surface);
    border-color: var(--border) !important;
    box-shadow: none;
}

.dev-console .card-header {
    background: var(--surface-raised) !important;
    border-bottom-color: var(--border-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dev-console .admin-hub-tab {
    background: var(--surface-raised);
    border-color: var(--border);
    color: var(--text-muted);
}

.dev-console .admin-hub-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Task cards */
.dev-console .admin-hub-tasks {
    gap: 12px;
}

.console-task-card {
    padding: 0 !important;
    background: var(--surface);
    border-color: var(--border) !important;
    border-left-width: 3px;
    border-left-color: var(--border);
    overflow: hidden;
}

.console-task-card:hover {
    background: var(--bg);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border)) !important;
    border-left-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.admin-dark .console-task-card {
    background: var(--surface-raised);
}

.admin-dark .console-task-card:hover {
    background: #1a1f2c;
    border-color: var(--accent) !important;
    border-left-color: var(--accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.console-task-priority-high { border-left-color: #ef4444 !important; }
.console-task-priority-medium { border-left-color: #f59e0b !important; }
.console-task-priority-low { border-left-color: #64748b !important; }

.console-task-card-layout {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 16px 18px;
}

.console-task-card-main {
    flex: 1;
    min-width: 0;
}

.console-task-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.console-task-id {
    font-size: 11px;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: var(--text-faint);
    margin-right: 2px;
}

.console-task-card-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    flex-shrink: 0;
    padding-top: 2px;
}

.console-task-card-aside time {
    font-size: 11px;
    color: var(--text-faint);
    white-space: nowrap;
}

.console-task-chevron {
    font-size: 14px;
    color: var(--text-faint);
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
}

.console-task-card:hover .console-task-chevron {
    opacity: 1;
    transform: translateX(2px);
    color: var(--accent-hover);
}

.console-ai-block {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--accent-light);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.console-ai-block-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-hover);
    margin-bottom: 6px;
}

.console-ai-block-label i { font-size: 11px; }

.console-ai-block-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

.admin-dark .console-ai-block-text {
    color: #c4b5fd;
}

.console-task-excerpt {
    margin: 6px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.dev-console .console-task-reason {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--accent-light);
    font-style: normal;
    font-size: 12px;
    color: var(--accent-hover);
}

.dev-console .console-context-preview {
    background: var(--bg);
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.admin-dark .dev-console .console-context-preview {
    background: #0a0d12;
    color: #a8b0c4;
}

.dev-console .console-insight-card {
    background: var(--surface-raised);
    border-color: var(--border);
}

.dev-console .console-insight-action {
    background: var(--surface);
    border-color: var(--border);
}

.dev-console .console-insight-action h3 {
    color: var(--text);
}

.dev-console .console-insight-action p,
.dev-console .console-insight-action .text-muted {
    color: var(--text-muted) !important;
}

.dev-console .context-entry-meta {
    color: var(--text-muted);
}

.dev-console .context-entry-head strong {
    color: var(--text);
}

.dev-console .card-body .text-muted {
    color: var(--text-muted) !important;
}

.dev-console .empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.dev-console .empty-state i {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

.dev-console .context-entry {
    background: var(--surface-raised);
    border-color: var(--border);
}

@media (max-width: 768px) {
    .dev-console-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dev-console-title {
        font-size: 22px;
    }

    .console-task-card-layout {
        flex-direction: column;
    }

    .console-task-card-aside {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }

    .console-task-chevron {
        opacity: 1;
    }
}

/* ── System metadata console ───────────────────────────────── */
.meta-console {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.meta-console-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.meta-console-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.meta-console-title i {
    color: var(--accent-hover);
}

.meta-console-intro p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    max-width: 560px;
    line-height: 1.55;
}

.meta-console-sync {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.meta-sync-status {
    font-size: 12px;
    color: var(--text-muted);
    min-height: 18px;
}

.meta-overview-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
}

.meta-completion-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.meta-completion-ring {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.meta-ring-svg {
    width: 64px;
    height: 64px;
    transform: rotate(-90deg);
}

.meta-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}

.meta-ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.4s ease;
}

.meta-ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.meta-completion-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.meta-completion-copy strong {
    font-size: 13px;
    color: var(--text);
}

.meta-chip-board {
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    min-height: 96px;
}

.meta-chip-board-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 10px;
}

.meta-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 999px;
    background: var(--accent-light);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    color: #c4b5fd;
    line-height: 1.3;
}

.meta-chip i {
    font-size: 11px;
    color: var(--accent-hover);
    flex-shrink: 0;
}

.meta-chip-key {
    font-weight: 600;
    color: var(--accent-hover);
}

.meta-chip-empty {
    background: var(--surface-raised);
    border-color: var(--border);
    color: var(--text-faint);
    font-style: italic;
}

.meta-ai-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.meta-ai-panel {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

.meta-ai-panel-client {
    border-top: 3px solid #38bdf8;
}

.meta-ai-panel-dev {
    border-top: 3px solid var(--accent);
}

.meta-ai-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-light);
}

.meta-ai-panel-head strong {
    display: block;
    font-size: 13px;
    color: var(--text);
}

.meta-ai-panel-head span {
    font-size: 11px;
    color: var(--text-muted);
}

.meta-ai-panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.meta-ai-panel-client .meta-ai-panel-icon {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.meta-ai-panel-dev .meta-ai-panel-icon {
    background: var(--accent-light);
    color: var(--accent-hover);
}

.meta-ai-panel-body {
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    min-height: 88px;
    max-height: 160px;
    overflow-y: auto;
}

.meta-ai-empty {
    color: var(--text-faint);
    font-style: italic;
    font-size: 12.5px;
}

.meta-section {
    padding: 20px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.meta-section + .meta-section {
    margin-top: 0;
}

.dev-metadata-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.meta-section-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.meta-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--accent-hover);
    font-size: 17px;
    flex-shrink: 0;
}

.meta-section-head h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 3px;
    color: var(--text);
}

.meta-section-head p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.meta-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.meta-field-card {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.meta-field-card.meta-field-filled {
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}

.meta-field-card-wide {
    grid-column: 1 / -1;
}

.meta-field-card-full {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
}

.meta-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.meta-field-label i {
    font-size: 13px;
    color: var(--accent-hover);
    opacity: 0.85;
}

.meta-field-card .form-control {
    font-size: 13px;
    border-color: var(--border);
    background: #0c0f14;
}

.meta-field-card .form-control:focus {
    border-color: var(--accent);
    background: #0c0f14;
}

.meta-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.meta-form-hint {
    font-size: 12px;
    color: var(--text-faint);
}

@media (max-width: 768px) {
    .meta-overview-grid {
        grid-template-columns: 1fr;
    }

    .meta-ai-row {
        grid-template-columns: 1fr;
    }

    .meta-field-grid {
        grid-template-columns: 1fr;
    }

    .meta-console-sync {
        align-items: flex-start;
        width: 100%;
    }
}

/* ── Architecture open board ───────────────────────────────── */
.arch-board-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.meta-completion-compact {
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    gap: 10px;
}

.meta-completion-compact .meta-completion-ring {
    width: 44px;
    height: 44px;
}

.meta-completion-compact .meta-ring-svg {
    width: 44px;
    height: 44px;
}

.meta-completion-compact .meta-ring-value {
    font-size: 11px;
}

.arch-toolbar-stat {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.arch-board-hint {
    font-size: 12px;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    gap: 6px;
}

.arch-board {
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--border);
    background-color: #080a0e;
    background-image:
        radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--accent) 12%, transparent) 1px, transparent 0);
    background-size: 22px 22px;
    min-height: 320px;
    max-height: 72vh;
    padding: 0;
    margin-bottom: 14px;
    overflow: auto;
}

.arch-board-canvas {
    position: relative;
    z-index: 1;
    min-height: 560px;
    min-width: 900px;
    margin: 0;
    padding: 24px;
}

.arch-board-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.arch-node-hidden {
    display: none !important;
}

.arch-node {
    position: absolute;
    width: 200px;
    z-index: 2;
    background: #12151c;
    border: 2px solid #2a3142;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.arch-node-logic {
    width: 280px;
}

.arch-node-client {
    width: 190px;
}

.arch-node-ai {
    width: 240px;
}

.arch-node-dragging {
    z-index: 20;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
    transition: none;
}

.arch-board-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.arch-add-node .form-select {
    min-width: 160px;
    font-size: 12px;
}

.arch-board-empty {
    text-align: center;
    padding: 56px 32px;
    border-radius: 14px;
    border: 2px dashed var(--border);
    background: var(--surface);
    margin-bottom: 14px;
}

.arch-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-faint);
    background: var(--surface-raised);
    border: 1px solid var(--border);
}

.arch-board-empty h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
}

.arch-board-empty p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 420px;
    margin: 0 auto 20px;
    line-height: 1.55;
}

.arch-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.arch-node:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.arch-node-dragging:hover {
    border-color: var(--accent);
}

.arch-node-filled {
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow-md);
}

.arch-node-hub {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: linear-gradient(165deg, #1a1528 0%, #12151c 55%);
}

.arch-node-static {
    border-style: dashed;
    border-color: #3d4658;
    background: rgba(18, 21, 28, 0.7);
}

.arch-board:not(.d-none) {
    min-height: 280px;
}

.arch-node-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: #171b24;
    cursor: grab;
    user-select: none;
}

.arch-node-head::before {
    content: '⋮⋮';
    font-size: 10px;
    letter-spacing: -2px;
    color: var(--text-faint);
    margin-right: 2px;
}

.arch-node-head:active {
    cursor: grabbing;
}

.arch-node-head i {
    font-size: 14px;
    color: var(--accent-hover);
}

.arch-node-head-client i { color: #38bdf8; }

.arch-node-head-ai-client {
    background: rgba(56, 189, 248, 0.08);
    border-bottom-color: rgba(56, 189, 248, 0.2);
}

.arch-node-head-ai-client i { color: #38bdf8; }

.arch-node-head-ai-dev {
    background: var(--accent-light);
    border-bottom-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.arch-node-preview {
    padding: 12px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
}

.arch-node-body {
    padding: 10px 12px 12px;
    font-size: 12px;
    line-height: 1.55;
    color: #c8cdd8;
    min-height: 48px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.arch-node-body-link a {
    color: var(--accent-hover);
    word-break: break-all;
    pointer-events: auto;
}

.arch-node-body-link a:hover {
    text-decoration: underline;
}

.arch-viz-footer {
    font-size: 12px;
    color: var(--text-faint);
    margin: 0;
    line-height: 1.5;
}

.arch-viz-footer a {
    color: var(--accent-hover);
}

.arch-node-input {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    color: #c8cdd8;
    font-size: 12px;
    line-height: 1.55;
    padding: 10px 12px;
    resize: vertical;
    min-height: 76px;
    font-family: inherit;
}

.arch-node-input-single {
    min-height: 0;
    padding: 12px;
}

.arch-node-input:focus {
    outline: none;
    color: var(--text);
    background: rgba(0, 0, 0, 0.25);
}

.arch-node-input::placeholder {
    color: var(--text-faint);
}

.arch-node-ai-body {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
    min-height: 64px;
    max-height: 100px;
    overflow-y: auto;
}

.arch-node-ai .meta-ai-empty {
    font-style: italic;
    color: var(--text-faint);
}

.arch-board-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.arch-board-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.arch-board-tab:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.arch-board-tab.active {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    color: var(--text);
}

.arch-board-tab-badge {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 25%, transparent);
    color: #c4b5fd;
}

.arch-board-view {
    display: none;
}

.arch-board-view.active {
    display: block;
}

.arch-node-page {
    width: 250px;
}

.arch-node-head-page i {
    color: #34d399;
}

.arch-node-page-body {
    padding: 10px 12px;
    font-size: 11.5px;
    line-height: 1.45;
    max-height: 220px;
    overflow-y: auto;
}

.arch-page-row {
    margin-bottom: 8px;
}

.arch-page-row:last-child {
    margin-bottom: 0;
}

.arch-page-label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 2px;
}

.arch-page-value {
    display: block;
    color: var(--text-muted);
}

.arch-node-portal {
    width: 220px;
}

@media (max-width: 900px) {
    .arch-board-canvas {
        max-width: 100%;
    }

    .arch-node {
        width: min(100%, 220px);
    }

    .arch-board {
        min-height: auto;
        overflow-x: auto;
    }

    .arch-board-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .arch-board-toolbar-right {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Admin developer AI chat (floating) */
.admin-dev-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1080;
}

.admin-dev-chat-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-dev-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 48%, transparent);
}

.admin-dev-chat-open .admin-dev-chat-fab {
    display: none;
}

.admin-dev-chat-panel {
    width: min(380px, calc(100vw - 32px));
    height: min(520px, calc(100vh - 100px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-dev-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--accent-light);
    flex-shrink: 0;
}

.admin-dev-chat-head-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.admin-dev-chat-head-title i {
    color: #a78bfa;
}

.admin-dev-chat-head-title small {
    font-weight: 500;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 999px;
}

.admin-dev-chat-head-actions {
    display: flex;
    gap: 2px;
}

.admin-dev-chat-head-actions .btn-link {
    color: var(--text-muted);
    padding: 4px 8px;
}

.admin-dev-chat-head-actions .btn-link:hover {
    color: var(--text);
}

.admin-dev-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
}

.admin-dev-chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 94%;
}

.admin-dev-chat-msg-user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.admin-dev-chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.admin-dev-chat-msg-assistant .admin-dev-chat-msg-avatar {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent);
}

.admin-dev-chat-msg-user .admin-dev-chat-msg-avatar {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.admin-dev-chat-msg-bubble {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
    max-height: 280px;
    overflow-y: auto;
}

.admin-dev-chat-msg-assistant .admin-dev-chat-msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.admin-dev-chat-msg-user .admin-dev-chat-msg-bubble {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
}

.admin-dev-chat-typing .admin-dev-chat-msg-bubble {
    color: var(--text-muted);
    font-style: italic;
}

.admin-dev-chat-saved {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 5px;
}

.admin-dev-chat-created-tasks {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: #93c5fd;
    line-height: 1.5;
}

.admin-dev-chat-created-tasks a {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 600;
}

.admin-dev-chat-created-tasks a:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

.admin-dev-chat-created-tasks a + a::before {
    content: ', ';
    color: var(--text-faint);
    font-weight: 400;
}

.admin-dev-chat-proposal {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.35);
}

.admin-dev-chat-proposal-title {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-dev-chat-proposal-list {
    margin: 0 0 10px;
    padding-left: 18px;
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.45;
}

.admin-dev-chat-proposal-meta {
    color: #94a3b8;
    font-weight: 400;
}

.admin-dev-chat-proposal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-dev-chat-proposal-actions .btn {
    font-size: 12px;
    padding: 4px 10px;
}

.admin-dev-chat-proposal-status {
    font-size: 11px;
    font-weight: 600;
    color: #86efac;
}

.admin-dev-chat-proposal-denied .admin-dev-chat-proposal-status {
    color: #fca5a5;
}

.admin-dev-chat-proposal-done,
.admin-dev-chat-proposal-denied {
    opacity: 0.85;
}

.admin-dev-chat-input {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.admin-dev-chat-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    min-height: 42px;
    max-height: 100px;
}

.admin-dev-chat-input textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.admin-dev-chat-input .btn {
    height: 42px;
    width: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-dev-chat-error {
    padding: 8px 14px 12px;
    font-size: 12px;
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    border-top: 1px solid rgba(248, 113, 113, 0.2);
}

@media (max-width: 480px) {
    .admin-dev-chat {
        right: 12px;
        bottom: 12px;
    }

    .admin-dev-chat-panel {
        width: calc(100vw - 24px);
        height: min(70vh, 480px);
    }
}

/* ═══════════════════════════════════════════════════════════════
   Dashboard redesign
═══════════════════════════════════════════════════════════════ */

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Console hero */
.console-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 22px 26px;
    margin-bottom: 20px;
    border-radius: 14px;
    background:
        radial-gradient(1000px 180px at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
        linear-gradient(135deg, var(--surface) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.console-hero-eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    margin-bottom: 6px;
}

.console-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 6px;
}

.console-hero-sub {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 620px;
}

.console-hero-sub strong { color: var(--text); }

.console-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Console command grid */
.console-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.console-grid--primary {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 16px;
}

.console-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 160px;
    box-shadow: none;
}

.console-panel--quiet {
    min-height: 0;
    background: transparent;
    border-color: var(--border-light);
}

.console-panel--quiet .console-panel-head {
    padding: 10px 4px 12px;
    border-bottom-color: var(--border-light);
    font-weight: 600;
}

.console-panel--quiet .console-panel-body {
    padding: 0;
}

.console-panel-body--row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    padding: 4px 0 0 !important;
}

.console-panel-body--row .console-rec-item,
.console-panel-body--row .console-empty {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 0;
}

.console-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.console-panel-head i { color: var(--accent); margin-right: 6px; }

.console-panel-more {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.console-panel-more:hover { color: var(--accent); }

.console-panel-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.console-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
    flex: 1;
    padding: 22px 12px;
    color: var(--text-muted);
    font-size: 12.5px;
}

.console-empty i { font-size: 22px; color: var(--text-faint); }
.console-empty a { font-size: 12px; font-weight: 600; }

.console-schedule-item,
.console-deadline-item,
.console-rec-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: background .15s ease;
}

.console-schedule-item:hover,
.console-deadline-item:hover,
.console-rec-item:hover {
    background: var(--bg);
    color: var(--text);
}

.console-schedule-time {
    flex-shrink: 0;
    width: 46px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.console-schedule-time span {
    display: block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-top: 2px;
}

.console-schedule-body { flex: 1; min-width: 0; }

.console-schedule-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.console-schedule-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.console-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.console-dot--high { background: #ef4444; }

.console-deadline-date {
    flex-shrink: 0;
    width: 42px;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 0;
    line-height: 1;
}

.console-deadline-date--overdue {
    border-color: rgba(239,68,68,.4);
    background: rgba(239,68,68,.08);
}

.console-deadline-day { font-size: 16px; font-weight: 700; color: var(--text); }
.console-deadline-mon { font-size: 9px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }

.console-deadline-rel {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.console-rec-item {
    border-left: 3px solid var(--border);
}

.console-rec-item--high { border-left-color: #ef4444; }
.console-rec-item--medium { border-left-color: #f59e0b; }
.console-rec-item--low { border-left-color: #9ca3af; }

@media (max-width: 991px) {
    .console-grid,
    .console-grid--primary { grid-template-columns: 1fr; }
}

/* AI Briefing banner */
.dash-briefing {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent) 0%, color-mix(in srgb, var(--accent) 4%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.dash-briefing-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.dash-briefing-icon {
    font-size: 22px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.dash-briefing-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-bottom: 4px;
}

.dash-briefing-sub {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

.dash-briefing-priority {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brief-pri-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 4px;
}

.brief-pri-item {
    display: block;
    padding: 10px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}

.brief-pri-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--text);
}

.brief-pri-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.brief-pri-reason {
    font-size: 12px;
    color: var(--text-muted);
}

/* Stat cards / metric strip */
.dash-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    margin-bottom: 24px;
    padding: 4px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.dash-metric {
    flex: 1 1 120px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border-right: 1px solid var(--border-light);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    position: relative;
    transition: background 0.15s;
    min-width: 0;
}

.dash-metric:last-child {
    border-right: none;
}

.dash-metric:hover {
    background: color-mix(in srgb, var(--accent) 4%, transparent);
    color: var(--text);
    box-shadow: none;
    transform: none;
}

.dash-metric .stat-label {
    margin-bottom: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-metric .stat-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dash-metric--hot .stat-value {
    color: #dc2626;
}

.dash-metric--hot {
    background: color-mix(in srgb, #dc2626 4%, transparent);
}

.dash-metric--accent .stat-value {
    color: var(--accent);
}

.stat-card-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s, background 0.15s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card-link:hover {
    color: var(--text);
}

.stat-card-icon {
    font-size: 26px;
    color: var(--text-faint);
    flex-shrink: 0;
    transition: color 0.15s;
}

.stat-card-link:hover .stat-card-icon {
    color: var(--accent);
}

.stat-card-body {
    flex: 1;
    min-width: 0;
}

.stat-card-hot {
    border-color: rgba(239, 68, 68, 0.4);
    animation: stat-pulse 2.5s ease-in-out infinite;
}

@keyframes stat-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50%       { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.08); }
}

.stat-card-danger { border-color: rgba(239, 68, 68, 0.25); }
.stat-card-accent { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }

.stat-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border-radius: 6px;
    padding: 2px 7px;
}

.stat-card-accent .stat-card-badge {
    background: var(--accent-light);
    color: var(--accent);
}

/* Dash sections */
.dash-section {
    margin-bottom: 28px;
}

.dash-section--primary {
    margin-bottom: 28px;
    padding: 18px 18px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.dash-section--primary .dash-section-title {
    font-size: 16px;
}

.dash-section--primary .dash-inbox {
    gap: 0;
}

.dash-section--primary .dash-inbox-item {
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    box-shadow: none;
    padding: 14px 4px;
    background: transparent;
}

.dash-section--primary .dash-inbox-item:last-child {
    border-bottom: none;
}

.dash-section--primary .dash-inbox-item:hover {
    background: var(--bg);
    border-color: transparent;
    box-shadow: none;
}

.dash-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.dash-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-section-title i {
    color: var(--accent);
    font-size: 16px;
}

.dash-section-more {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.dash-section-more:hover {
    color: var(--accent);
}

/* Priority inbox */
.dash-inbox {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-inbox-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dash-inbox-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.dash-inbox-item-high {
    border-left: 3px solid rgba(239, 68, 68, 0.7);
}

.dash-inbox-item-medium {
    border-left: 3px solid rgba(245, 158, 11, 0.7);
}

.dash-inbox-item-new {
    background: linear-gradient(135deg, var(--surface) 60%, color-mix(in srgb, var(--accent) 4%, transparent));
}

.dash-inbox-left {
    flex: 1;
    min-width: 0;
}

.dash-inbox-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.dash-inbox-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 600px;
}

.dash-inbox-title:hover {
    color: var(--accent);
}

.dash-inbox-meta {
    display: flex;
    gap: 10px;
    font-size: 11.5px;
    color: var(--text-faint);
    flex-wrap: wrap;
    align-items: center;
}

.dash-inbox-summary {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.dash-inbox-actions {
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Task Detail redesign
═══════════════════════════════════════════════════════════════ */

/* Topbar */
.task-detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.task-back-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    margin-left: -12px;
    transition: background 0.15s, color 0.15s;
}

.task-back-link:hover {
    background: var(--surface);
    color: var(--text);
}

.task-detail-topbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Task hero */
.task-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 28px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.task-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.task-hero-project {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
}

.task-hero-project .code-display {
    font-size: 11px;
}

.task-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.task-hero-sub {
    display: flex;
    gap: 16px;
    font-size: 12.5px;
    color: var(--text-faint);
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.task-hero-sub a.task-page-url {
    color: var(--accent);
    font-size: 12px;
}

/* Status progress track */
.task-status-track {
    display: flex;
    align-items: center;
    gap: 0;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.task-status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.task-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--border);
    transition: background 0.2s, border-color 0.2s;
}

.task-status-step.active .task-status-dot {
    background: var(--accent);
    border-color: var(--accent);
}

.task-status-step.current .task-status-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.task-status-label {
    font-size: 10px;
    color: var(--text-faint);
    white-space: nowrap;
}

.task-status-step.active .task-status-label,
.task-status-step.current .task-status-label {
    color: var(--accent);
    font-weight: 600;
}

.task-status-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-bottom: 16px;
    transition: background 0.2s;
}

.task-status-line.active {
    background: var(--accent);
}

/* Two-column grid */
.task-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

/* Section cards */
.task-section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.task-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-description {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text);
}

/* Conversation bubbles */
.task-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-bubble {
    display: flex;
    gap: 12px;
    max-width: 92%;
}

.task-bubble-you {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.task-bubble-client {
    align-self: flex-start;
}

.task-bubble-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.task-bubble-you .task-bubble-avatar {
    background: var(--accent-light);
    color: var(--accent);
}

.task-bubble-client .task-bubble-avatar {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.task-bubble-wrap {
    flex: 1;
    min-width: 0;
}

.task-bubble-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}

.task-bubble-you .task-bubble-meta {
    flex-direction: row-reverse;
}

.task-bubble-meta strong {
    color: var(--text);
    font-weight: 600;
}

.task-bubble-meta time {
    color: var(--text-faint);
}

.task-bubble-body {
    font-size: 13.5px;
    line-height: 1.65;
    padding: 11px 15px;
    border-radius: 12px;
    white-space: pre-wrap;
}

.task-bubble-you .task-bubble-body {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.task-bubble-client .task-bubble-body {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.task-bubble-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.task-bubble-img-link img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Proof card */
.task-proof-card {
    border-color: rgba(34, 197, 94, 0.3);
}

/* AI auto-brief panel */
.task-ai-brief {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent) 0%, color-mix(in srgb, var(--accent) 3%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 16px;
}

.task-ai-brief-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.task-ai-brief-icon {
    font-size: 18px;
    color: var(--accent);
}

.task-ai-brief-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.task-ai-brief-status {
    font-size: 11px;
    color: var(--text-faint);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 8px;
}

.task-ai-brief-loading {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
}

.task-ai-brief-error {
    font-size: 13px;
    color: var(--badge-red-text, #fca5a5);
    padding: 8px 0;
}

.task-ai-brief-body {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.6;
}

.brief-estimate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 6px;
    padding: 3px 10px;
    margin-bottom: 10px;
}

.brief-summary {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.65;
}

.brief-steps-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.brief-steps {
    font-size: 13px;
    color: var(--text);
    line-height: 1.7;
    padding-left: 20px;
    margin: 0 0 14px;
}

.brief-steps li { margin-bottom: 4px; }

.brief-draft-toggle {
    margin-bottom: 8px;
}

.brief-draft {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}

.brief-draft-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.65;
    white-space: pre-wrap;
}

/* Sidebar */
.task-detail-sidebar {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.task-sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.task-sidebar-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
}

.task-sidebar-card-title i {
    color: var(--accent);
    font-size: 13px;
}

/* Action card */
.task-action-card {
    text-align: center;
}

.task-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    padding: 14px;
    border-radius: 12px;
    letter-spacing: 0.01em;
}

.task-start-btn i {
    font-size: 18px;
}

.task-action-hint {
    font-size: 11.5px;
    color: var(--text-faint);
    margin: 8px 0 0;
    line-height: 1.5;
}

.task-action-waiting {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.task-action-waiting-icon {
    font-size: 24px;
    color: var(--text-faint);
    flex-shrink: 0;
}

.task-action-done {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

/* AI result in sidebar */
.task-ai-result {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}

.task-ai-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.task-ai-result-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.task-ai-loading {
    font-size: 12.5px;
    color: var(--text-faint);
    padding: 8px 0;
    display: flex;
    align-items: center;
}

/* Notes saved indicator */
.task-notes-saved {
    font-size: 10px;
    font-weight: 600;
    color: var(--badge-green-text, #86efac);
    background: var(--badge-green-bg, rgba(34,197,94,0.14));
    border-radius: 6px;
    padding: 2px 8px;
    margin-left: auto;
}

/* Button micro variant */
.btn-xs {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 6px;
    line-height: 1.5;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-faint);
    padding: 3px 6px;
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--surface-raised);
}

/* flex-1 utility */
.flex-1 { flex: 1; }

/* Responsive task detail */
@media (max-width: 900px) {
    .task-detail-grid {
        grid-template-columns: 1fr;
    }
    .task-detail-sidebar {
        position: static;
    }
    .task-hero {
        padding: 18px 20px 16px;
    }
    .task-hero-title {
        font-size: 19px;
    }
}

@media (max-width: 640px) {
    .task-detail-topbar-actions {
        display: none;
    }
    .dash-inbox-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .dash-inbox-actions {
        align-self: stretch;
    }
    .dash-inbox-actions .btn {
        width: 100%;
    }
    .dash-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-metric {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 12px 14px;
    }
}

/* Admin inquiry AI assistant */
.inquiry-ai-card .card-header {
    background: var(--surface-raised);
}

.inquiry-ai-loading {
    font-size: 12.5px;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.inquiry-ai-panel {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}

.inquiry-ai-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.inquiry-ai-panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.inquiry-ai-panel-body {
    color: var(--text);
    line-height: 1.55;
}

.inquiry-ai-list-block {
    margin-bottom: 12px;
}

.inquiry-ai-list-block:last-child {
    margin-bottom: 0;
}

.inquiry-ai-list-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.inquiry-ai-list-block ul {
    margin: 0;
    padding-left: 1.1rem;
}

.inquiry-ai-list-block li {
    margin-bottom: 4px;
}

.inquiry-ai-question-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.inquiry-ai-question-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    margin: 0;
    transition: border-color 0.15s, background 0.15s;
}

.inquiry-ai-question-item:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-light);
}

.inquiry-ai-question-item input {
    margin-right: 8px;
    flex-shrink: 0;
}

.inquiry-ai-question-text {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.45;
}

.inquiry-ai-question-why {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 22px;
}

.inquiry-ai-question-item {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
}

.inquiry-ai-question-item .inquiry-ai-question-text {
    flex: 1;
    min-width: 0;
}

.inquiry-ai-question-item .inquiry-ai-question-why {
    width: 100%;
    padding-left: 22px;
}

/* Admin inquiry conversation thread */
.inquiry-thread-body {
    max-height: 520px;
    overflow-y: auto;
}

.inquiry-thread-msg-body,
.inquiry-thread-bubble {
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.inquiry-thread-msg-time {
    color: var(--text-muted);
}

.inquiry-thread-msg--developer {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
}

.inquiry-thread-msg--developer .inquiry-thread-msg-label {
    color: #15803d;
}

.inquiry-thread-msg--developer .inquiry-thread-msg-time {
    color: #4b7c5f;
}

.inquiry-thread-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.inquiry-thread-username {
    color: var(--text);
}

.inquiry-thread-bubble {
    background: #4b5563;
    color: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 13.5px;
}

.admin-dark .inquiry-thread-msg--developer {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.32);
    color: #d1fae5;
}

.admin-dark .inquiry-thread-msg--developer .inquiry-thread-msg-label {
    color: #86efac;
}

.admin-dark .inquiry-thread-msg--developer .inquiry-thread-msg-time {
    color: #6ee7b7;
    opacity: 0.85;
}

.admin-dark .inquiry-thread-avatar {
    background: var(--surface-raised);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.admin-dark .inquiry-thread-username {
    color: var(--text);
}

.admin-dark .inquiry-thread-bubble {
    background: #2d3748;
    color: #f1f5f9;
    border: 1px solid var(--border);
}

.admin-dark .inquiry-thread-msg--client .inquiry-thread-msg-time {
    color: var(--text-muted);
}

/* ── AI Secretary hub ─────────────────────────────────────── */
.assistant-stats .stat-card { min-height: 100px; }

.assistant-memory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assistant-memory-item {
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.assistant-memory-cat {
    font-size: 10px;
    text-transform: uppercase;
    margin-right: 6px;
}

.assistant-confidence-pill {
    float: right;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 8px;
}

.assistant-skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.assistant-skill-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.assistant-skill-card--gap {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.06);
}

.assistant-skill-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.assistant-skill-name {
    font-weight: 600;
    font-size: 14px;
}

.assistant-skill-meta {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.assistant-confidence-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.assistant-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #22c55e);
    border-radius: 999px;
    transition: width .3s ease;
}

.assistant-skill-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.assistant-recs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assistant-rec-card {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left-width: 3px;
}

.assistant-rec-card--high { border-left-color: #ef4444; }
.assistant-rec-card--medium { border-left-color: #f59e0b; }
.assistant-rec-card--low { border-left-color: #6b7280; }

.assistant-rec-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.assistant-rec-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.assistant-rec-actions {
    display: flex;
    gap: 6px;
}

.assistant-chat-card {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    min-height: 480px;
}

.assistant-chat-card .card-body {
    min-height: 420px;
}

.assistant-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    min-height: 280px;
}

.assistant-chat-bubble {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.assistant-chat-bubble--user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.assistant-chat-bubble--assistant {
    align-self: flex-start;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.assistant-chat-proposal {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.assistant-chat-proposal-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.assistant-chat-proposal-list {
    margin: 0 0 10px;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
}

.assistant-chat-proposal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.assistant-chat-proposal-status {
    font-size: 11px;
    font-weight: 600;
    color: #15803d;
}

.assistant-chat-proposal.is-denied .assistant-chat-proposal-status {
    color: #b91c1c;
}

.assistant-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-light);
    align-items: flex-end;
}

.assistant-chat-input-wrap textarea {
    flex: 1;
    resize: none;
    font-size: 13px;
}

/* FullCalendar theming */
#workCalendar {
    --fc-border-color: var(--border);
    --fc-page-bg-color: var(--surface);
    --fc-neutral-bg-color: var(--bg);
    --fc-list-event-hover-bg-color: var(--bg);
    --fc-today-bg-color: var(--accent-light);
}

#workCalendar .fc-toolbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

#workCalendar .fc-button {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
    font-size: 13px;
    padding: 4px 10px;
}

#workCalendar .fc-button:hover,
#workCalendar .fc-button:focus {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
    box-shadow: none;
}

#workCalendar .fc-button-primary:not(:disabled).fc-button-active,
#workCalendar .fc-button-primary:not(:disabled):active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

#workCalendar .fc-col-header-cell-cushion,
#workCalendar .fc-daygrid-day-number,
#workCalendar .fc-list-day-text,
#workCalendar .fc-list-day-side-text {
    color: var(--text-muted);
    text-decoration: none;
}

#workCalendar .fc-event {
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
}

.admin-dark #workCalendar .fc-theme-standard td,
.admin-dark #workCalendar .fc-theme-standard th {
    border-color: var(--border);
}

.admin-dark .assistant-chat-bubble--assistant {
    background: var(--surface-raised);
}

/* ── Tasks page ───────────────────────────────────────────── */
.task-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.task-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: all .15s ease;
}

.task-chip:hover {
    border-color: var(--accent);
    color: var(--text);
}

.task-chip i { font-size: 14px; }

.task-chip-count {
    font-size: 11px;
    font-weight: 600;
    background: var(--bg);
    border-radius: 999px;
    padding: 1px 8px;
    min-width: 22px;
    text-align: center;
}

.task-chip--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.task-chip--active .task-chip-count {
    background: rgba(255,255,255,.22);
    color: #fff;
}

.task-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.task-search {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.task-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 14px;
    pointer-events: none;
}

.task-search .form-control {
    padding-left: 34px;
}

.task-project-filter {
    min-width: 240px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.task-row:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
    color: var(--text);
}

.task-row--high { border-left-color: #ef4444; }
.task-row--medium { border-left-color: #f59e0b; }
.task-row--low { border-left-color: #9ca3af; }

.task-row-main { min-width: 0; flex: 1; }

.task-row-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
}

.task-row-title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.task-row-summary {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.4;
}

.task-row-summary i { color: var(--accent); }

.task-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    align-items: center;
}

.task-row-meta i { opacity: .7; }

.task-row-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    text-align: right;
}

.task-row-due {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: 6px;
    padding: 2px 8px;
}

.task-row-due--overdue {
    color: #dc2626;
    background: rgba(239,68,68,.1);
}

.task-row-sched {
    font-size: 11.5px;
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-row-date {
    font-size: 11px;
    color: var(--text-faint);
}

.task-row-open {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 640px) {
    .task-row { flex-direction: column; gap: 10px; }
    .task-row-side { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; }
}

/* ── Calendar / scheduler layout ──────────────────────────── */
.calendar-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 18px;
    align-items: start;
}

.calendar-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
}

.calendar-sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.calendar-sidebar-head i { color: var(--accent); }

.calendar-sidebar-count {
    font-size: 12px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 999px;
    padding: 1px 9px;
    font-weight: 600;
}

.calendar-sidebar-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.calendar-unscheduled {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 460px;
    overflow-y: auto;
}

.calendar-drag-task {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: grab;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.calendar-drag-task:hover {
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.calendar-drag-task:active { cursor: grabbing; }

.calendar-drag-task--high { border-left-color: #ef4444; }
.calendar-drag-task--medium { border-left-color: #f59e0b; }
.calendar-drag-task--low { border-left-color: #9ca3af; }

.calendar-drag-task-project {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-drag-task-project i { font-size: 11px; opacity: .8; }

.calendar-drag-task-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 5px;
}

/* Calendar event content: project name + task title */
.fc-task-event {
    padding: 1px 3px;
    overflow: hidden;
    line-height: 1.25;
}

.fc-task-event-project {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    opacity: .85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-task-event-title {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-task-event-time { font-weight: 600; opacity: .9; }

/* Month-view dot events: colored text on transparent bg */
.fc-daygrid-dot-event .fc-task-event-project { color: var(--text-muted); }
.fc-daygrid-dot-event .fc-task-event-title { color: var(--text); }

/* Block/time-grid events: white text on colored bg */
.fc-timegrid-event .fc-task-event-project,
.fc-timegrid-event .fc-task-event-title,
.fc-daygrid-block-event .fc-task-event-project,
.fc-daygrid-block-event .fc-task-event-title { color: #fff; }

.calendar-drag-task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.calendar-drag-task-due {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #d97706;
}

.calendar-sidebar-empty {
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

.calendar-sidebar-empty i { color: #16a34a; font-size: 20px; display: block; margin-bottom: 6px; }

.calendar-legend {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.calendar-legend-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.calendar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.calendar-main { margin: 0; }

@media (max-width: 991px) {
    .calendar-layout { grid-template-columns: 1fr; }
    .calendar-sidebar { position: static; }
    .calendar-unscheduled { max-height: 260px; }
}

.admin-dark .task-chip-count { background: var(--surface-raised); }
.admin-dark .task-row-due { background: var(--surface-raised); }
.admin-dark .calendar-drag-task { background: var(--surface-raised); }


