:root {
    color-scheme: light;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8faff;
    --ink: #161a24;
    --muted: #6b7280;
    --line: #e7ebf2;
    --line-strong: #d8deea;
    --brand: #4095cb;
    --brand-2: #62abd8;
    --sidebar: #4f566c;
    --sidebar-2: #626a82;
    --danger: #d71945;
    --warn: #ffb224;
    --ok: #42c87f;
    --low: #48c78e;
    --radius: 10px;
    --shadow: 0 24px 70px rgba(26, 35, 60, .10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; height: auto; overflow-y: auto; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}
button {
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    border-radius: 0;
}
button::-moz-focus-inner { border: 0; padding: 0; }

.shell { display: block; min-height: 100vh; }
.sidebar {
    background: linear-gradient(180deg, var(--sidebar), #464d63);
    color: #f8fafc;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    height: 100vh;
    z-index: 30;
    box-shadow: inset -1px 0 rgba(255,255,255,.08);
}
.brand, .login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: 0;
}
.brand { padding: 0 8px 8px; }
.brand-lockup { gap: 11px; }
.brand-mark {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: transparent;
    color: #1f2937;
    font-weight: 650;
    flex: 0 0 auto;
    overflow: hidden;
}
.brand-mark img, .page-avatar img { width: 100%; height: 100%; display: block; }
.login-mark {
    width: 40px;
    height: 40px;
}
.sidebar-mark {
    width: 36px;
    height: 36px;
}
.login-wordmark {
    width: 176px;
    height: auto;
    display: block;
}
.sidebar-wordmark {
    width: 142px;
    height: auto;
    display: block;
}
.sidebar-brand {
    min-height: 42px;
    padding-bottom: 10px;
}
.nav { display: grid; gap: 6px; }
.nav a {
    color: rgba(255,255,255,.78);
    padding: 12px 13px;
    border-radius: 8px;
    font-weight: 560;
}
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.13); }
.userbox {
    margin-top: auto;
    padding: 14px 10px 2px;
    border-top: 1px solid rgba(255,255,255,.16);
    color: rgba(255,255,255,.78);
    font-size: 13px;
}
.userbox strong { color: #fff; }

.main { min-width: 0; min-height: 100vh; margin-left: 260px; padding: 0 0 80px; background: var(--surface); overflow: visible; }
.topbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 26px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.94);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}
.page-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-avatar {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    background: transparent;
    color: #111827;
    font-weight: 650;
    overflow: hidden;
}
.topbar h1 { margin: 0; font-size: 21px; line-height: 1.1; letter-spacing: 0; text-transform: none; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.main > .grid, .main > .panel, .main > .table-wrap, .main > .service-hero, .main > .quick-add, .main > .task-toolbar, .main > .task-table, .main > .flash {
    margin-left: 26px;
    margin-right: 26px;
}
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 620;
    box-shadow: 0 1px 1px rgba(15,23,42,.04);
}
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 10px 24px rgba(64,149,203,.22); }
.btn.danger { color: var(--danger); border-color: #ffd3dc; }
.btn.small { min-height: 31px; padding: 0 10px; font-size: 12px; }

.grid { display: grid; gap: 16px; margin-top: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(380px, .88fr) minmax(520px, 1.12fr);
    gap: 16px;
    align-items: start;
    margin: 16px 26px 28px;
}
.dashboard-left {
    display: grid;
    gap: 16px;
    min-width: 0;
}
.dashboard-grid { align-items: start; margin-top: 16px; }
.dashboard-clients-panel { margin-top: 16px; }
.panel, .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.panel { padding: 18px; }
.panel { min-width: 0; }
.panel h2 { margin: 0 0 12px; font-size: 17px; }
.card { padding: 16px; }
.metric { display: grid; gap: 8px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 30px; }

.dashboard-service-list { display: grid; gap: 10px; margin-top: 10px; }
.dashboard-service-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcff;
}
.dashboard-service-card:hover { background: #f8faff; border-color: #dce5fb; }
.dashboard-service-card span:first-child { min-width: 0; display: grid; gap: 3px; }
.dashboard-service-card strong, .dashboard-service-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-service-card small { color: var(--muted); }
.mini-pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}
.mini-pagination a {
    min-width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #647084;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
}
.mini-pagination a.active {
    border-color: var(--brand);
    background: #eef3ff;
    color: var(--brand);
}

.table-wrap {
    margin-top: 22px;
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: #737b91; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: #fbfcff; }
tr:last-child td { border-bottom: 0; }
.services-section { margin-top: 22px; overflow-x: auto; }
.services-table th:last-child, .services-table td:last-child { width: 92px; }
.services-table td.actions {
    display: table-cell;
    text-align: center;
    white-space: nowrap;
}
.services-table td.actions .btn { min-width: 54px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 500;
    background: #f5f7ff;
    color: #30374a;
    white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); box-shadow: 0 0 0 3px rgba(64,149,203,.10); }
.muted { color: var(--muted); }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
label { color: #42495a; font-weight: 620; font-size: 12px; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    min-height: 40px;
    padding: 9px 11px;
    outline: none;
}
select {
    padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, #697386 50%), linear-gradient(135deg, #697386 50%, transparent 50%);
    background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(64,149,203,.13); }
textarea { min-height: 104px; resize: vertical; }
select[multiple] { min-height: 112px; }
.help { color: var(--muted); font-size: 12px; }
.flash {
    padding: 12px 14px;
    border-radius: 10px;
    margin-top: 18px;
    margin-bottom: 18px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
.flash.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(64,149,203,.16), transparent 34%),
        linear-gradient(135deg, #f8faff, #eef2ff 58%, #f7f8fb);
}
.login-box {
    width: min(430px, 100%);
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.login-brand { color: var(--ink); margin-bottom: 24px; }
.login-box h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: 0; }

.service-hero {
    margin-top: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px auto;
    gap: 18px;
    align-items: center;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #fbfcff);
}
.service-tabs {
    display: flex;
    gap: 30px;
    align-items: center;
    min-height: 50px;
    padding: 0 26px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: #626a7f;
    font-size: 15px;
    font-weight: 560;
    white-space: nowrap;
    overflow-x: auto;
}
.service-tabs a {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    border-bottom: 3px solid transparent;
}
.service-tabs .active { color: var(--brand); border-color: var(--brand); }
.crumb { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.service-hero h2 { margin: 0; font-size: 26px; letter-spacing: 0; }
.service-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; color: var(--muted); }
.service-progress { display: grid; gap: 4px; }
.service-progress strong { font-size: 28px; }
.service-progress span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.progress-track, .progress-mini {
    display: block;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #eef1fb;
    overflow: hidden;
}
.progress-track i, .progress-mini i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #14b8a6); }

.quick-add {
    margin-top: 16px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 210px 180px auto;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcff;
    box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.service-dashboard {
    margin: 22px 26px 28px;
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) repeat(2, minmax(220px, 1fr));
    gap: 16px;
}
.dashboard-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 12px 34px rgba(15,23,42,.04);
}
.dashboard-card h2 { margin: 0 0 14px; font-size: 16px; }
.service-overview strong { display: block; margin: 6px 0; font-size: 42px; line-height: 1; }
.service-overview p, .notes-card p { margin: 12px 0 0; color: var(--muted); }
.status-breakdown { display: grid; gap: 10px; }
.status-breakdown div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    background: #f8faff;
}
.status-breakdown span { display: inline-flex; align-items: center; gap: 8px; font-weight: 520; }
.status-breakdown i, .kanban-head i {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 999px;
}
.priority-breakdown { display: flex; gap: 8px; flex-wrap: wrap; }
.notes-card { grid-column: 1 / -1; }
.kanban-board {
    margin: 22px 26px 28px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.kanban-column {
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8faff;
    padding: 12px;
}
.kanban-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #273042;
    font-weight: 620;
}
.kanban-head span { display: inline-flex; align-items: center; gap: 8px; }
.kanban-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.kanban-card span { color: var(--muted); font-size: 12px; }
.kanban-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.client-toolbar {
    margin: 22px 26px 0;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}
.client-toolbar input { max-width: 420px; border-radius: 999px; }
.client-index {
    margin: 16px 26px 28px;
    display: grid;
    gap: 14px;
}
.client-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,.04);
    overflow: hidden;
}
.client-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}
.client-title-block { min-width: 0; flex: 1; }
.client-toggle {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--brand);
    font-weight: 650;
    cursor: pointer;
}
.client-head h2 { margin: 2px 0 4px; font-size: 20px; color: #4095cb; font-weight: 700; }
.client-head p { margin: 0; color: var(--muted); }
.client-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.client-count {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f6fb;
    color: #5f6678;
    font-weight: 600;
    font-size: 12px;
}
.service-list { display: grid; }
.client-card.is-collapsed .service-list { display: none; }
.service-list-label {
    padding: 10px 18px 8px;
    color: #677084;
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: #fbfcff;
    border-bottom: 1px solid var(--line);
}
.service-list-label.closed { background: #f4f6fb; color: #7b8190; }
.service-row-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto 130px;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}
.service-row-card:last-child { border-bottom: 0; }
.service-row-card:hover { background: #f8faff; }
.service-row-card.is-closed {
    background: #f3f5f9;
    color: #6b7280;
}
.service-row-card.is-closed:hover { background: #edf1f7; }
.service-row-card.is-closed .progress-mini i { background: #9aa3b2; }
.service-row-main { display: grid; gap: 3px; min-width: 0; }
.service-row-main strong, .service-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-row-main small { color: var(--muted); }
.service-row-progress { display: grid; gap: 4px; font-weight: 520; }
.task-toolbar {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.task-toolbar input { max-width: 360px; border-radius: 999px; }
.export-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.export-btn {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #fff;
    color: #4b5563;
    font-size: 12px;
    font-weight: 520;
}
.export-btn:hover { color: var(--brand); border-color: #b7d8ed; background: #f4faff; }
.download-icon {
    width: 14px;
    height: 14px;
    position: relative;
    display: inline-block;
}
.download-icon::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 1px;
    width: 2px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}
.download-icon::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 6px;
    width: 7px;
    height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
}

.task-table {
    margin-top: 12px;
    margin-bottom: 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow-x: auto;
    overflow-y: visible;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15,23,42,.04);
}
.task-table-head, .task-summary {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) minmax(145px, .9fr) 122px 122px 170px 128px 126px 126px;
    align-items: center;
    gap: 14px;
    min-width: 1320px;
}
.task-table-head {
    padding: 13px 18px;
    color: #737b91;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    background: #fbfcff;
}
.task-section {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 1320px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: #111827;
}
.task-section button {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--brand);
    cursor: pointer;
    font-weight: 600;
}
.task-section strong { font-size: 17px; font-weight: 720; }
.task-item { min-width: 1320px; border-bottom: 1px solid var(--line); scroll-margin-top: 150px; }
.task-item:last-child { border-bottom: 0; }
.task-summary {
    width: 100%;
    min-height: 52px;
    padding: 0 18px;
    background: #fff;
    color: #111827;
    text-align: left;
}
.task-summary:hover { background: #f8faff; }
.task-item.is-complete .task-title-button { color: #7b8192; text-decoration: line-through; }
.task-title-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.complete-form { flex: 0 0 auto; display: inline-flex; margin: 0; }
.complete-toggle {
    width: 22px;
    height: 22px;
    border: 1.5px solid #c5d1ea;
    border-radius: 999px;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    font-weight: 650;
    line-height: 1;
}
.complete-toggle:hover { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(64,149,203,.12); }
.task-title-button {
    min-width: 0;
    padding: 0;
    background: transparent !important;
    color: #252b3a;
    cursor: pointer;
    font-weight: 450;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-title-button:hover { color: var(--brand); }
.cell-trigger, .priority-button {
    width: 100%;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 10px;
    border-radius: 8px;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    color: #2f3544;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cell-trigger:hover { background: #f1f4fb !important; }
.date-trigger { color: #94a1ba; font-weight: 450; }
.assignee-trigger { background: #f7f9fd !important; color: #5e6576; justify-content: center; }
.status-trigger { font-weight: 450; }
.time-trigger { color: #4b5563; }
.blue-dot { width: 8px; height: 8px; border-radius: 999px; background: #4097ff; flex: 0 0 auto; }
.priority, .priority-button {
    display: inline-flex;
    min-width: 92px;
    justify-content: center;
    border-radius: 7px;
    padding: 7px 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 520;
}
.priority.urgent, .priority-button.urgent, .priority-card.urgent { background: #e12545 !important; color: #fff; }
.priority.high, .priority-button.high, .priority-card.high { background: #ffc13b !important; color: #fff; }
.priority.normal, .priority-button.normal, .priority-card.normal { background: #6f8dff !important; color: #fff; }
.priority.low, .priority-button.low, .priority-card.low { background: #50ca8e !important; color: #fff; }
.priority.waiting, .priority-button.waiting, .priority-card.waiting { background: #eef0f4 !important; color: #6b7280; }
.priority-button:hover { filter: brightness(.98); box-shadow: inset 0 0 0 999px rgba(255,255,255,.08); }
.progress-cell { display: grid; gap: 4px; color: #273042; font-weight: 450; }
.progress-mini { height: 7px; margin-bottom: 0; }
.task-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 14px;
}
.task-detail-grid .wide, .task-detail-grid .notes { grid-column: 1 / -1; }
.task-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.task-drawer[hidden], .menu-popover[hidden] { display: none !important; }
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15,23,42,.18);
}
.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 90;
    width: min(560px, calc(100vw - 24px));
    height: 100vh;
    overflow-y: auto;
    padding: 22px;
    background: #fff;
    box-shadow: -24px 0 70px rgba(15,23,42,.18);
    display: grid;
    align-content: start;
    gap: 16px;
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drawer-head h2 { margin: 2px 0 0; font-size: 24px; line-height: 1.15; }
.drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #f3f5fa;
    color: #4b5563;
    cursor: pointer;
    font-size: 22px;
}
.drawer-open { overflow: hidden; }
.menu-popover {
    position: fixed;
    z-index: 140;
    width: 282px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15,23,42,.18);
}
.menu-title {
    padding: 4px 4px 10px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 620;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.menu-list { display: grid; gap: 8px; margin: 0; }
.menu-option, .menu-card {
    min-height: 48px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border-radius: 8px;
    background: #f3f6fb;
    color: #111827;
    cursor: pointer;
    text-align: left;
    font-weight: 450;
}
.menu-option:hover, .menu-option.active { background: #eaf0ff; color: var(--brand); }
.avatar-dot {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #ffe082;
    color: #1f2937;
    font-size: 12px;
    font-weight: 620;
}
.date-menu { width: 330px; }
.date-form { display: grid; gap: 10px; margin: 0; }
.menu-date-input {
    min-height: 46px;
    border-radius: 9px;
    background: #f8faff;
    font-size: 16px;
}
.quick-date-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
}
.quick-date-row button {
    min-height: 40px;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    font-weight: 520;
    border-right: 1px solid var(--line);
}
.quick-date-row button:last-child { border-right: 0; }
.priority-menu { width: 264px; }
.priority-card {
    min-height: 58px;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}
.priority-card.active { outline: 3px solid rgba(64,149,203,.20); }
.time-menu { width: min(470px, calc(100vw - 28px)); padding: 16px; }
.time-menu-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.time-menu-head .menu-title { display: block; padding: 0; }
.time-menu-head small { display: block; margin-top: 4px; color: var(--muted); }
.time-menu-head strong { font-size: 18px; }
.time-entry-form { display: grid; gap: 11px; margin: 0; }
.time-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.time-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(64,149,203,.13); }
.time-text-input {
    border: 0;
    box-shadow: none !important;
    min-height: 48px;
    background: transparent;
    font-size: 15px;
}
.timer-button {
    width: 30px;
    height: 30px;
    margin-right: 6px;
    border-radius: 999px;
    background: #b7bcc6;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    display: inline-grid;
    place-items: center;
}
.timer-button[aria-pressed="true"] { background: var(--brand); }
.time-live { color: var(--muted); font-size: 13px; }
.time-entry-form textarea { min-height: 74px; }
.time-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mini-task {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: #fbfcff;
}
.task-title { font-weight: 450; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.danger-zone { border-color: #fecaca; background: #fff7f7; }

.template-editor { gap: 18px; }
.template-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.template-editor-head h2 { margin: 2px 0 0; font-size: 22px; }
.template-task-panel { margin-top: 16px; }
.template-add-task {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 220px 110px auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcff;
}
.template-task-groups { display: grid; gap: 16px; margin-top: 16px; }
.template-task-group {
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}
.template-category-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f8faff;
    color: #1f2937;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .05em;
}
.template-category-title span {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: #e9efff;
    color: var(--brand);
}
.template-task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
}
.template-task-edit {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 190px 86px auto;
    gap: 8px;
    align-items: center;
}
.template-task-edit input, .template-task-edit select, .template-add-task input, .template-add-task select { min-height: 38px; }
.icon-danger {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #ffd3dc;
    color: var(--danger);
    background: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.icon-danger:hover { background: #fff1f4; }

.user-admin-panel { margin-top: 16px; }
.user-admin-list {
    display: grid;
    gap: 12px;
}
.user-edit-card {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) 130px 110px minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcff;
}
.user-edit-card input, .user-edit-card select { min-height: 38px; }
.user-edit-meta {
    display: grid;
    gap: 8px;
    justify-items: end;
    color: var(--muted);
    font-size: 12px;
}
.user-create-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.user-create-form h3 { margin: 0; font-size: 16px; }
.user-profile-panel { margin-top: 22px; }
.profile-permissions {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8faff;
    color: #4b5563;
}

@media (max-width: 1180px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .task-table { overflow-x: auto; }
    .task-table-head, .task-summary, .task-section, .task-item { min-width: 1320px; }
    .user-edit-card { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .user-edit-meta { justify-items: start; }
}
@media (max-width: 900px) {
    .shell { display: block; }
    .sidebar { position: static; width: auto; height: auto; min-height: 0; border-radius: 0; }
    .main { margin-left: 0; }
    .main > .grid, .main > .panel, .main > .table-wrap, .main > .service-hero, .main > .quick-add, .main > .task-toolbar, .main > .task-table, .main > .flash {
        margin-left: 16px;
        margin-right: 16px;
    }
    .dashboard-layout { margin-left: 16px; margin-right: 16px; }
    .topbar { align-items: flex-start; flex-direction: column; padding: 16px; position: static; }
    .grid.cols-2, .grid.cols-3, .service-hero, .quick-add, .task-detail-grid, .service-dashboard, .service-row-card { grid-template-columns: 1fr; }
    .service-dashboard, .kanban-board, .client-toolbar, .client-index { margin-left: 16px; margin-right: 16px; }
    .client-toolbar, .client-head { flex-direction: column; }
    .client-head { align-items: stretch; }
    .task-detail-grid .wide { grid-column: 1 / -1; }
    .drawer-panel { width: 100vw; }
    .template-add-task, .template-task-edit, .template-task-card, .user-edit-card { grid-template-columns: 1fr; }
}
