:root {
    /* Dark theme — slate + orange accent */
    --bg-page: #0b1120;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #172033;
    --bg-input: #0c1323;
    --bg-elevated: #263449;
    --primary: #fb923c;
    --primary-hover: #fdba74;
    --primary-dim: rgba(251, 146, 60, 0.18);
    --ring-focus: rgba(251, 146, 60, 0.42);
    --accent: #f97316;
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --border: #334155;
    --border-strong: #475569;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    /* Task urgency — distinct from brand orange (--primary) */
    --urgency-critical: #f87171;
    --urgency-high: #a78bfa;
    --urgency-medium: #38bdf8;
    --urgency-low: #34d399;
    --glass: rgba(15, 23, 42, 0.82);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --lh-tight: 1.35;
    --lh-body: 1.6;
    --lh-relaxed: 1.7;
}

.light-mode {
    /* Light theme — paper + orange accent */
    --bg-page: #eef2f7;
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-input: #ffffff;
    --bg-elevated: #f1f5f9;
    --primary: #ea580c;
    --primary-hover: #c2410c;
    --primary-dim: rgba(234, 88, 12, 0.12);
    --ring-focus: rgba(234, 88, 12, 0.35);
    --accent: #d97706;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --urgency-critical: #dc2626;
    --urgency-high: #6d28d9;
    --urgency-medium: #2563eb;
    --urgency-low: #059669;
    --glass: rgba(255, 255, 255, 0.92);
    --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.07);
    --shadow-soft: 0 1px 0 rgba(15, 23, 42, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: var(--lh-body);
    background-color: var(--bg-page);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    text-rendering: optimizeLegibility;
}

.logo-area h1,
.top-bar h2,
.modal-header h3,
.section-header h3,
.section-header h4,
.client-card h3,
#view-projects .section-header h3,
#view-clients .section-header h3 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 600;
    line-height: var(--lh-tight);
}

.stat-info h3 {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 500;
}

.mobile-only {
    display: none !important;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Login - Dark Theme Now */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1c1410 100%);
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.14) 0%, transparent 60%);
    top: -50%;
    left: -50%;
    pointer-events: none;
}

.login-box {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.login-icon-wrapper {
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(249, 115, 22, 0.12);
    color: var(--primary);
    border-radius: 16px;
}

.login-box h2 {
    margin-top: 0;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-sub {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring-focus);
}

.btn-login {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.btn-login:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.875rem;
    z-index: 20;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    padding: 0 0.35rem 0 0.5rem;
    color: var(--primary);
}

.logo-icon {
    font-size: 2rem;
}

.logo-area h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.main-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    text-align: left;
}

.nav-item:hover {
    background-color: var(--bg-elevated);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-item .material-icons-round {
    font-size: 1.25rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.info {
    display: flex;
    flex-direction: column;
}

.name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.35;
}

.role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar — sections & labels */
.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.logo-tagline {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-subtle);
    letter-spacing: 0.02em;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1.1rem;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-subtle);
    padding: 0.35rem 0.85rem 0.45rem;
}

.main-nav-spacer {
    flex: 1;
    min-height: 0.5rem;
}

.nav-item-text {
    flex: 1;
    text-align: left;
}

.nav-item--muted {
    color: var(--text-muted);
}

.nav-item--muted:hover {
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: var(--bg-page);
}

.light-mode .main-content {
    background: var(--bg-page);
}

.light-mode .modal-overlay {
    background: rgba(15, 23, 42, 0.45);
}

.light-mode .sidebar {
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
}

.light-mode .close-modal:hover {
    background: var(--bg-elevated);
}

.top-bar {
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workspace-header {
    flex-wrap: wrap;
    row-gap: 0.75rem;
    padding: 1.1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.page-heading {
    min-width: 0;
}

.top-bar h2,
.page-heading h2 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    line-height: var(--lh-tight);
}

.page-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.45;
    max-width: 36rem;
}

.top-bar-center {
    flex: 1 1 220px;
    display: flex;
    justify-content: center;
    max-width: 420px;
    margin: 0 auto;
}

.header-search-wrap {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.header-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    max-height: min(360px, 50vh);
    overflow-y: auto;
    padding: 0.35rem 0;
}

.header-search-results.hidden {
    display: none;
}

.search-results-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.35rem 0.85rem 0.2rem;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.875rem;
}

.search-result-item:hover,
.search-result-item:focus {
    background: var(--bg-input);
    outline: none;
}

.search-result-item .material-icons-round {
    font-size: 1.15rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.search-result-title {
    font-weight: 500;
    display: block;
}

.search-result-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.search-results-empty {
    padding: 0.75rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Settings */
.settings-panel .panel-header {
    margin-bottom: 1rem;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.settings-tab {
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.settings-tab:hover {
    color: var(--text-main);
    background: var(--bg-input);
}

.settings-tab.active {
    color: var(--primary);
    background: rgba(234, 88, 12, 0.12);
    border-color: rgba(234, 88, 12, 0.35);
}

.settings-pane {
    display: none;
    max-width: 520px;
}

.settings-pane.active {
    display: block;
}

/* Settings: wide panes (e.g. packages editor) */
.settings-pane--wide {
    max-width: min(1040px, 100%);
}

/* Packages editor (Settings → Packages) */
.packages-editor-form {
    max-width: 100%;
}

.packages-editor-hero {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-dim), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.packages-editor-hero-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--primary);
}

.packages-editor-hero-icon .material-icons-round {
    font-size: 26px;
}

.packages-editor-hero-text {
    min-width: 0;
}

.packages-editor-title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.packages-editor-lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.packages-editor-mount {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.packages-region-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.packages-region-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.packages-region-card__actions {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .packages-region-card__actions {
        margin-left: 0;
        width: 100%;
    }

    .packages-region-card__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.packages-region-card__head .material-icons-round {
    font-size: 28px;
    color: var(--primary);
    margin-top: 0.1rem;
}

.packages-region-card__titles h4 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--text-main);
}

.packages-region-card__tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.packages-region-card__sub {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 42rem;
}

.packages-tier-stack {
    padding: 1.1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.packages-tier-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.1rem 1.15rem 1.15rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.packages-tier-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.12);
}

.packages-tier-card__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--border);
}

.packages-tier-card__top--toolbar {
    align-items: flex-end;
}

.packages-tier-card__code-wrap {
    flex: 1 1 220px;
    min-width: 0;
}

.packages-tier-card__top--toolbar .pkg-delete-tier {
    flex-shrink: 0;
    margin-bottom: 0.05rem;
}

.pkg-code-pill {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid rgba(251, 146, 60, 0.35);
}

.light-mode .pkg-code-pill {
    border-color: rgba(234, 88, 12, 0.28);
}

.packages-tier-card__name {
    flex: 1 1 200px;
    min-width: 0;
}

.packages-tier-card__name label,
.pkg-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.packages-tier-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem 1rem;
}

@media (min-width: 720px) {
    .packages-tier-card__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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

@media (min-width: 720px) {
    .pkg-field--pages {
        grid-column: span 2;
    }
}

.pkg-field .form-control {
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
}

.pkg-field-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-subtle);
    margin-top: 0.3rem;
    line-height: 1.35;
}

.packages-tier-card__features {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
}

.packages-tier-card__features-head {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 0.45rem;
}

.pkg-features-editor-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pkg-feature-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pkg-feature-row .pkg-feature-input {
    flex: 1;
    min-width: 0;
}

.pkg-feature-remove {
    flex-shrink: 0;
    padding: 0.35rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pkg-feature-remove-icon {
    font-size: 18px;
    line-height: 1;
}

.pkg-features-preview-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.pkg-features-preview-list li {
    margin-bottom: 0.25rem;
}

.pkg-features-preview-empty {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-subtle);
    font-style: italic;
}

.packages-region-empty {
    margin: 0;
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px dashed var(--border);
}

.packages-editor-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.packages-editor-save {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.packages-editor-save .material-icons-round {
    font-size: 20px;
}

.settings-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.settings-form .form-section-label {
    margin-bottom: 0.75rem;
}

.settings-msg {
    font-size: 0.875rem;
    margin: 0 0 0.75rem;
}

.settings-msg.ok {
    color: #16a34a;
}

.settings-msg.err {
    color: #ef4444;
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.settings-checkbox-row .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--ring-focus);
}

.header-search-icon {
    font-size: 1.15rem;
    color: var(--text-subtle);
    flex-shrink: 0;
}

.header-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
}

.header-search-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

body.light-mode .header-search-results {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem 2.5rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

/* Workspace panels (PM-style content regions) */
.workspace-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-soft);
}

.workspace-panel--metrics {
    padding: 1.35rem 1.5rem;
}

.workspace-panel--metrics .stats-grid {
    margin-bottom: 0;
}

.dashboard-metrics-scope {
    margin-bottom: 1.25rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-metrics-scope__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-metrics-range {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    font-family: "Outfit", "Inter", sans-serif;
    color: var(--text-main);
    flex: 1 1 200px;
    min-width: 0;
    line-height: 1.4;
}

.dashboard-metrics-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.75rem;
}

.dashboard-metric-date {
    margin-bottom: 0;
    min-width: 0;
}

.dashboard-metric-date label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dashboard-metric-date .form-control {
    min-width: 9.5rem;
}

.dashboard-metrics-hint {
    margin: 0.65rem 0 0;
    max-width: 52rem;
    line-height: 1.45;
}

.workspace-panel--analytics .analytics-export-bar {
    margin-top: 0.5rem;
    background: var(--bg-elevated);
    border-style: dashed;
}

.panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.workspace-panel--analytics .panel-header {
    margin-bottom: 1rem;
}

.panel-header .panel-title,
.panel-header h3.panel-title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.panel-desc {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 40rem;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chips-inline {
    margin-top: 0;
}

.workspace-panel .task-list {
    margin-top: 0;
}

.table-scroll {
    overflow-x: auto;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

.light-mode .workspace-panel {
    box-shadow: var(--shadow-card);
}

.analytics-export-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.analytics-export-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.analytics-export-bar .form-group.compact {
    margin-bottom: 0;
    min-width: 160px;
}

.analytics-export-bar .form-group.compact label {
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
}

.admin-export-wrap {
    flex-direction: column;
    align-items: stretch;
}

.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.light-mode .stat-card,
.light-mode .task-card,
.light-mode .client-card {
    box-shadow: var(--shadow-card);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.stat-card--clickable {
    cursor: pointer;
    user-select: none;
}

.stat-card--clickable:focus-visible {
    outline: 2px solid var(--ring-focus);
    outline-offset: 2px;
}

.stat-card--clickable:active {
    transform: translateY(-2px);
}

.stat-card-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box.purple {
    background: rgba(251, 146, 60, 0.18);
    color: #fb923c;
}

.icon-box.blue {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.icon-box.orange {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.light-mode .icon-box.purple {
    background: rgba(234, 88, 12, 0.14);
    color: #c2410c;
}

.light-mode .icon-box.blue {
    background: rgba(217, 119, 6, 0.16);
    color: #b45309;
}

.light-mode .icon-box.orange {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-info .number {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Tasks List */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.task-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.task-card.task-card--urgency-critical {
    border-left: 4px solid var(--urgency-critical);
}

.task-card.task-card--urgency-high {
    border-left: 4px solid var(--urgency-high);
}

.task-card.task-card--urgency-medium {
    border-left: 4px solid var(--urgency-medium);
}

.task-card.task-card--urgency-low {
    border-left: 4px solid var(--urgency-low);
}

.task-card.task-card--urgency-critical:hover {
    border-color: var(--border);
    border-left: 4px solid var(--urgency-critical);
}

.task-card.task-card--urgency-high:hover {
    border-color: var(--border);
    border-left: 4px solid var(--urgency-high);
}

.task-card.task-card--urgency-medium:hover {
    border-color: var(--border);
    border-left: 4px solid var(--urgency-medium);
}

.task-card.task-card--urgency-low:hover {
    border-color: var(--border);
    border-left: 4px solid var(--urgency-low);
}

.task-card.active-tracking.task-card--urgency-critical,
.task-card.active-tracking.task-card--urgency-high,
.task-card.active-tracking.task-card--urgency-medium,
.task-card.active-tracking.task-card--urgency-low {
    border-left-width: 4px;
    border-left-style: solid;
}

.task-card.active-tracking.task-card--urgency-critical {
    border-left-color: var(--urgency-critical);
}

.task-card.active-tracking.task-card--urgency-high {
    border-left-color: var(--urgency-high);
}

.task-card.active-tracking.task-card--urgency-medium {
    border-left-color: var(--urgency-medium);
}

.task-card.active-tracking.task-card--urgency-low {
    border-left-color: var(--urgency-low);
}

.task-card.active-tracking {
    border-color: var(--success);
    background: linear-gradient(to right, rgba(52, 211, 153, 0.08), var(--bg-card));
}

.light-mode .task-card.active-tracking {
    background: linear-gradient(to right, rgba(5, 150, 105, 0.12), var(--bg-card));
}

.task-left {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 6px;
    background-color: var(--text-muted);
    flex-shrink: 0;
}

.status-indicator.pending {
    background-color: var(--warning);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.status-indicator.in_progress {
    background-color: var(--primary);
    box-shadow: 0 0 10px rgba(251, 146, 60, 0.35);
}

.status-indicator.completed {
    background-color: var(--success);
}

.task-info h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    line-height: var(--lh-tight);
}

.task-meta {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.client-badge {
    background: var(--bg-elevated);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}

.time-badge {
    background: var(--bg-elevated);
    padding: 3px 10px;
    border-radius: 6px;
    font-family: monospace;
    color: var(--primary);
    border: 1px solid var(--primary-dim);
}

.btn-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-weight: 600;
    cursor: pointer;
    background-color: var(--bg-input);
    color: var(--text-main);
    transition: var(--transition);
}

.btn-timer:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

.btn-timer.active {
    background-color: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border-color: var(--success);
}

.light-mode .btn-timer.active {
    background-color: rgba(5, 150, 105, 0.1);
}

/* Tables (Users, etc) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table thead {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.4;
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.9375rem;
    line-height: 1.5;
}

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.78);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    border-radius: 20px;
    border: 1px solid var(--border);
    transform: scale(0.95);
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: var(--transition);
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.light-mode .close-modal:hover {
    background: var(--bg-elevated);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    font-size: 1rem;
    line-height: var(--lh-body);
}

/* Forms Common */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.45;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring-focus);
}

.modal--wide {
    max-width: min(640px, 100vw - 2rem);
}

.modal--monthly-log-detail {
    max-width: min(960px, 100vw - 2rem);
}

.monthly-log-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem 1.5rem;
    margin: 0 0 1.25rem;
    padding: 0;
}

.monthly-log-detail-meta dt {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.monthly-log-detail-meta dd {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: var(--text-main);
}

.monthly-log-detail-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.monthly-log-detail-heading {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.monthly-log-addon-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-main);
}

.monthly-log-addon-item + .monthly-log-addon-item {
    margin-top: 0.65rem;
}

.monthly-log-addon-notes {
    margin-top: 0.35rem;
    white-space: pre-wrap;
}

.monthly-log-detail-table-wrap {
    max-height: min(50vh, 420px);
}

.monthly-log-notes-cell {
    max-width: 220px;
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-word;
}

.logs-list-row__action {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.form-section + .form-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.form-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--text-subtle);
    margin: 0 0 1rem;
}

.label-optional {
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8em;
}

.form-group-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.form-group-check input[type='checkbox'] {
    width: 1.125rem;
    height: 1.125rem;
    min-width: 1.125rem;
    margin-top: 0.15rem;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}

.form-group-check__body {
    flex: 1;
    min-width: 0;
}

.form-group-check__body > label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    line-height: 1.35;
}

.form-group-check__body .field-hint {
    margin: 0;
}

.form-group-check__body .field-hint + .field-hint {
    margin-top: 0.35rem;
}

.task-card__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

.chart-card {
    display: block;
    height: 300px;
    position: relative;
    padding: 1.25rem 1.25rem 0.75rem;
}

.chart-card--tall {
    height: 350px;
}

.chart-card__title {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.analytics-panel-note {
    margin: -0.25rem 0 1.25rem;
    max-width: 52rem;
}

.form-hint-inline {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.nav-item:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
.close-modal:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--primary);
}

.chip:focus-visible {
    border-color: var(--primary);
}

/* Form Row Helper */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row > .form-group {
    flex: 1;
    min-width: 0;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

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

.btn-icon-sm {
    background: transparent;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm:hover {
    background: rgba(255, 255, 255, 0.06);
}

.light-mode .btn-icon-sm:hover {
    background: var(--bg-elevated);
}

.btn-icon-sm .material-icons-round {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.btn-icon-sm:hover .material-icons-round {
    color: var(--text-main);
}

/* Grids for Clients and Projects */
.clients-grid,
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card-client {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.15rem 0 0;
    line-height: 1.4;
}

.project-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.client-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.client-card:hover {
    border-color: rgba(249, 115, 22, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.client-card-expanded {
    display: flex;
    flex-direction: column;
}

.client-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.client-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--primary));
}

.client-card-contact {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.45;
    min-height: 0;
}

.client-card-contact:empty {
    display: none;
}

.client-total-time {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(251, 191, 36, 0.08));
    border: 1px solid rgba(249, 115, 22, 0.28);
    border-radius: 12px;
}

.client-total-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 600;
}

.client-total-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: var(--primary);
}

.client-work-section {
    margin-bottom: 1rem;
}

.client-work-section:last-child {
    margin-bottom: 0;
}

.client-work-heading {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.client-work-empty {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

.client-work-list,
.client-work-recent {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.15);
}

.light-mode .client-work-list,
.light-mode .client-work-recent {
    background: rgba(15, 23, 42, 0.04);
}

.client-work-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.45;
}

.client-work-list li:last-child {
    border-bottom: none;
}

.client-work-task {
    font-weight: 500;
    color: var(--text-main);
    flex: 1;
    min-width: 0;
}

.client-work-dur {
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    color: var(--primary);
    flex-shrink: 0;
}

.client-work-recent li {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.45;
}

.client-work-recent li:last-child {
    border-bottom: none;
}

.client-work-recent-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.client-work-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.client-work-recent-task {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.client-work-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-top: 0.35rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.hidden {
    display: none !important;
}

/* Chip Selectors */
.selector-chips {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.chip {
    padding: 0.4rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 99px;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--text-muted);
    transition: var(--transition);
}

.chip:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.chip.selected {
    background: rgba(251, 146, 60, 0.22);
    border-color: var(--primary);
    color: var(--primary);
}

.light-mode .chip.selected {
    background: rgba(234, 88, 12, 0.14);
}

/* Detail Modal Styles */
.status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scope-badge {
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.scope-internal {
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid rgba(251, 146, 60, 0.4);
}

.light-mode .scope-internal {
    border-color: rgba(234, 88, 12, 0.32);
}

.scope-external {
    background: rgba(52, 211, 153, 0.14);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.light-mode .scope-external {
    background: rgba(5, 150, 105, 0.12);
    color: var(--success);
    border-color: rgba(5, 150, 105, 0.28);
}

.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 36rem;
}

.company-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.company-flowbotix {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.company-design_done_right {
    border-color: rgba(244, 114, 182, 0.45);
    background: rgba(244, 114, 182, 0.12);
    color: #f472b6;
}

.company-media_zoo {
    border-color: rgba(251, 146, 60, 0.5);
    background: var(--primary-dim);
    color: var(--primary);
}

.light-mode .company-flowbotix {
    color: #0369a1;
}

.light-mode .company-design_done_right {
    color: #be185d;
}

.light-mode .company-media_zoo {
    color: var(--primary-hover);
}

.deskside-pill {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 6px;
    vertical-align: middle;
    background: rgba(251, 191, 36, 0.18);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.45);
}

.light-mode .deskside-pill {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.35);
}

.detail-invoice-route {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.tag-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 6px;
    display: inline-block;
}

.tag-urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tag-waiting-client {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.tag-waiting-third {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-payment {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-risk {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

/* Location Badges */
.location-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 6px;
    display: inline-block;
}

.location-usa {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.location-sa {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Time Entry Item */
.subtask-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    background: rgba(249, 115, 22, 0.14);
    color: var(--primary);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.subtasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.subtasks-header h4 {
    margin: 0;
}

.subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subtask-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.subtask-row:hover {
    border-color: var(--primary);
}

.subtask-row-title {
    flex: 1;
    font-weight: 500;
}

.subtask-indent {
    color: var(--text-muted);
    margin-right: 0.35rem;
}

.task-card.is-subtask {
    margin-left: 0.75rem;
    border-left: 2px dashed var(--border);
}

.muted.small {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.link-like {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.detail-time-summary {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.detail-time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-time-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.detail-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.detail-actions__label {
    width: 100%;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.detail-actions__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.detail-actions__row .detail-actions__delete {
    margin-left: auto;
}

.time-entries-panel {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.12);
}

.light-mode .time-entries-panel {
    background: rgba(15, 23, 42, 0.04);
}

.time-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    text-align: center;
    padding: 1.25rem;
}

.time-entry-item {
    padding: 0.65rem 0.35rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.45;
}

.time-entry-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.time-entry-item:last-child {
    border-bottom: none;
}

.time-entry-info {
    display: flex;
    flex-direction: column;
}

.time-entry-user {
    font-weight: 600;
    color: var(--text-main);
}

.time-entry-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.time-entry-duration {
    font-family: monospace;
    color: var(--primary);
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 4px;
}

.time-entry-actions {
    display: flex;
    gap: 0.35rem;
    align-items: flex-start;
    flex-shrink: 0;
}

.time-entry-notes {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.55;
}

.time-loc {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.72rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

/* Yellow Warning Button */
.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-success {
    background: var(--success);
    color: white;
}

/* Detail View Enhancements */
.detail-row {
    margin-bottom: 1.5rem;
}

.detail-row h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

#detail-desc,
#detail-project-client,
#detail-date,
.detail-row p {
    line-height: var(--lh-relaxed);
    color: var(--text-main);
}

#detail-desc {
    color: var(--text-secondary);
}

.light-mode #detail-desc {
    color: var(--text-secondary);
}

.detail-actions .btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.detail-actions .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

.btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Client card — monthly retainer (high contrast, not gray-on-gray) */
.client-retainer-panel {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    background: var(--bg-input);
}

.client-retainer-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.client-retainer-row:last-of-type {
    margin-bottom: 0;
}

.client-retainer-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.client-retainer-value {
    color: var(--text-main);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.light-mode .client-retainer-panel {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}

.retainer-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.light-mode .retainer-bar-bg {
    background: var(--border-strong);
}

.retainer-bar-fill {
    height: 100%;
    transition: width 0.5s ease, background 0.35s ease, box-shadow 0.35s ease;
    border-radius: 4px;
}

/* Usage tiers: green (healthy) → yellow → orange → red (at/over limit) */
.retainer-bar-fill.retainer--safe {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}

.retainer-bar-fill.retainer--caution {
    background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.35);
}

.retainer-bar-fill.retainer--high {
    background: linear-gradient(180deg, #fdba74 0%, #ea580c 100%);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

.retainer-bar-fill.retainer--over {
    background: linear-gradient(180deg, #fca5a5 0%, #dc2626 100%);
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.45);
}

.light-mode .retainer-bar-fill.retainer--safe {
    background: linear-gradient(180deg, #86efac 0%, #16a34a 100%);
    box-shadow: none;
}

.light-mode .retainer-bar-fill.retainer--caution {
    background: linear-gradient(180deg, #fde047 0%, #d97706 100%);
    box-shadow: none;
}

.light-mode .retainer-bar-fill.retainer--high {
    background: linear-gradient(180deg, #fed7aa 0%, #c2410c 100%);
    box-shadow: none;
}

.light-mode .retainer-bar-fill.retainer--over {
    background: linear-gradient(180deg, #fecaca 0%, #b91c1c 100%);
    box-shadow: none;
}

/* Loading & Empty States */
.empty-state,
.loading-state {
    text-align: center;
    padding: 2.75rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.55;
    font-style: normal;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--bg-elevated);
}

.loading-state {
    color: var(--text-secondary);
}

.loading-state::before {
    content: 'hourglass_empty';
    font-family: 'Material Icons Round';
    display: block;
    font-size: 2rem;
    margin-bottom: 0.65rem;
    font-style: normal;
    color: var(--text-subtle);
    animation: loading-pulse 1.1s ease-in-out infinite;
}

@keyframes loading-pulse {
    50% { opacity: 0.45; }
}

.empty-state::before {
    content: 'assignment';
    font-family: 'Material Icons Round';
    display: block;
    font-size: 2.25rem;
    margin-bottom: 0.65rem;
    font-style: normal;
    color: var(--text-subtle);
    opacity: 0.9;
}

@media (max-width: 960px) {
    .workspace-header .top-bar-center {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        margin: 0;
    }

    .workspace-header {
        align-items: stretch;
    }

    .workspace-header .top-bar-left,
    .workspace-header .top-bar-actions {
        flex: 1 1 auto;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex !important;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        transition: var(--transition);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 15;
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

    .top-bar,
    .workspace-header {
        padding: 1rem 1.25rem;
    }

    .top-bar h2,
    .page-heading h2 {
        font-size: 1.25rem;
    }

    .content-wrapper {
        padding: 0 1.25rem 1.25rem 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .clients-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .task-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .task-right {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .modal {
        width: 95%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .top-bar,
    .workspace-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .top-bar h2,
    .page-heading h2 {
        margin-bottom: 0.25rem;
    }

    .top-bar .actions,
    .workspace-header .top-bar-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .workspace-header .top-bar-left {
        width: 100%;
    }
}

/* Full-page client / project workspace */
.detail-page {
    min-height: 0;
}

.detail-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.detail-page-toolbar__center {
    flex: 1 1 220px;
    min-width: 0;
}

.detail-page-title {
    margin: 0;
    font-size: 1.65rem;
    font-family: "Outfit", "Inter", sans-serif;
    font-weight: 600;
    color: var(--text-main);
}

.detail-page-sub {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-page-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    justify-content: flex-end;
}

.detail-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.detail-page-body {
    padding-bottom: 2rem;
}

.detail-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.detail-kv {
    margin: 0.4rem 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.detail-project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.detail-description {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.92rem;
}

.detail-rich-block {
    font-size: 0.9rem;
}

.detail-page .task-list .task-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.client-card-expanded {
    cursor: pointer;
}

/* List toolbars & pagination (dashboard, projects, clients, logs, users) */
.list-toolbar {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.list-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.list-toolbar-field {
    flex: 1 1 140px;
    min-width: 0;
    margin-bottom: 0;
}

.list-toolbar-field--narrow {
    flex: 0 1 110px;
    max-width: 140px;
}

.list-toolbar-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.list-toolbar-hint {
    margin: 0.65rem 0 0;
    line-height: 1.45;
}

.list-pagination-wrap {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.list-pagination-wrap.hidden {
    display: none;
}

.list-pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.list-pagination-bar--single {
    justify-content: flex-start;
}

.list-pagination-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.list-pagination-btns {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.list-pagination-pages {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0 0.25rem;
}

@media (max-width: 640px) {
    .list-toolbar-field--narrow {
        flex: 1 1 100px;
        max-width: none;
    }
}

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

.dashboard-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.workspace-panel--compact .panel-header {
    margin-bottom: 0.75rem;
}

.activity-feed {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-right: 0.25rem;
}

.activity-feed__item {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-feed__item:last-child {
    border-bottom: none;
}

.activity-feed__icon {
    font-size: 1.15rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.activity-feed__body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.activity-feed__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-feed__summary {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.due-soon-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 280px;
    overflow-y: auto;
}

.due-soon-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elevated);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    font: inherit;
}

.due-soon-row:hover {
    border-color: var(--primary);
}

.due-soon-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    flex: 0 0 auto;
}

.due-soon-title {
    flex: 1 1 140px;
    min-width: 0;
    font-size: 0.9rem;
    text-align: left;
}

.panel-header-actions--wrap {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.task-board-layout-chips {
    margin-left: 0;
}

.task-kanban-board {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.task-kanban-board.hidden {
    display: none;
}

.task-kanban-empty {
    width: 100%;
    text-align: center;
    padding: 2rem 1rem;
}

.task-kanban-col {
    flex: 1 1 220px;
    min-width: 200px;
    max-width: 320px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 640px);
}

.task-kanban-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
}

.task-kanban-count {
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
}

.task-kanban-col-body {
    padding: 0.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 120px;
}

.task-kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    border-left-width: 4px;
    border-left-style: solid;
}

.task-kanban-card.task-card--urgency-critical {
    border-left-color: var(--urgency-critical);
}

.task-kanban-card.task-card--urgency-high {
    border-left-color: var(--urgency-high);
}

.task-kanban-card.task-card--urgency-medium {
    border-left-color: var(--urgency-medium);
}

.task-kanban-card.task-card--urgency-low {
    border-left-color: var(--urgency-low);
}

.task-kanban-card:hover {
    border-color: var(--primary);
}

.task-kanban-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.task-kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.task-kanban-card .btn-timer--sm {
    width: 100%;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
}

.task-kanban-card .btn-timer--sm .material-icons-round {
    font-size: 1rem;
}

.task-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
}

.task-comment-item {
    padding: 0.6rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.task-comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.35rem;
}

.task-comment-head .btn-icon-sm {
    margin-left: auto;
}

.task-comment-body {
    font-size: 0.88rem;
    line-height: 1.5;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

.task-comment-form textarea {
    resize: vertical;
    min-height: 3rem;
}

/* Custom build / GitHub */
.billing-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.billing-badge--custom {
    background: rgba(56, 189, 248, 0.15);
    color: var(--urgency-medium);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.dev-project-card {
    border-left: 3px solid var(--urgency-medium);
}

.dev-project-repo {
    margin-top: 0.35rem;
}

.github-panel-body {
    font-size: 0.9rem;
}

.github-repo-summary p {
    margin: 0 0 0.5rem;
}

.github-repo-stats {
    margin-top: 0.35rem;
}

.github-commits-heading {
    font-size: 0.85rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-secondary);
}

.github-commit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.github-commit-list li {
    padding: 0.5rem 0.65rem;
    background: var(--bg-elevated);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.github-commit-sha {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
}

.github-commit-msg {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
}

.github-commit-meta {
    margin-top: 0.35rem;
}

.form-section--nested {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.task-parent-banner-text {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.task-page-subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Daily site maintenance checklist */
.maintenance-daily-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.maintenance-daily-date {
    margin-bottom: 0;
    min-width: 11rem;
}

.maintenance-daily-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.maintenance-progress {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.maintenance-client-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.maintenance-client-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.maintenance-client-item--done {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.06);
}

.light-mode .maintenance-client-item--done {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.35);
}

.maintenance-client-label {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    margin: 0;
}

.maintenance-client-cb {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
    accent-color: var(--success);
    cursor: pointer;
}

.maintenance-client-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.maintenance-client-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.maintenance-client-url {
    font-size: 0.85rem;
    word-break: break-all;
}

.maintenance-site-link {
    color: var(--urgency-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.maintenance-site-link:hover {
    text-decoration: underline;
}

.maintenance-external-icon {
    font-size: 14px !important;
    opacity: 0.85;
}

.maintenance-checked-meta {
    display: block;
    margin-top: 0.15rem;
}

/* —— PM: attachments, dependencies, milestones, calendar, notifications, Kanban DnD —— */
.task-attachments-toolbar {
    margin-bottom: 0.75rem;
}

.task-attach-upload-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.task-attachments-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-attachment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.task-attachment-name {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    word-break: break-word;
}

.task-attachment-name:hover {
    text-decoration: underline;
}

.task-attachment-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 120px;
}

.task-dep-add-row {
    margin-bottom: 0.75rem;
    align-items: flex-end;
}

.task-deps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.task-dep-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elevated, var(--bg-input));
}

.milestone-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.milestone-inline-form .form-control {
    flex: 1;
    min-width: 160px;
}

.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.milestone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
}

.milestone-row-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-month-label {
    font-weight: 600;
    min-width: 10rem;
    text-align: center;
}

.calendar-grid {
    margin-top: 0.5rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.35rem;
}

.cal-wd {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.35rem;
}

.calendar-cells {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-cell {
    min-height: 92px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem;
    background: var(--bg-card);
    font-size: 0.8rem;
}

.cal-cell--pad {
    background: transparent;
    border-color: transparent;
    min-height: 0;
}

.cal-cell--has-tasks {
    border-color: var(--primary-dim, rgba(251, 146, 60, 0.45));
}

.cal-day-num {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.cal-day-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cal-task-pill {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 4px;
    padding: 0.2rem 0.35rem;
    font-size: 0.72rem;
    line-height: 1.25;
    background: var(--bg-elevated, rgba(255, 255, 255, 0.06));
    color: var(--text-main);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-task-pill:hover {
    background: var(--primary-dim, rgba(251, 146, 60, 0.2));
}

.header-notifications-wrap {
    position: relative;
}

#btn-notifications {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 1rem;
    height: 1rem;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}

.notifications-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: min(380px, calc(100vw - 2rem));
    max-height: 70vh;
    overflow: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card, 0 12px 40px rgba(0, 0, 0, 0.35));
    z-index: 200;
}

.notifications-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.notifications-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notifications-item {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.notifications-item:hover {
    background: var(--bg-elevated, var(--bg-input));
}

.notifications-item--unread {
    border-left: 3px solid var(--primary);
}

.notifications-item-verb {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.notifications-item-sum {
    font-size: 0.9rem;
    line-height: 1.45;
}

.notifications-empty {
    padding: 1rem;
    text-align: center;
}

.task-kanban-col-body--drag {
    outline: 2px dashed var(--primary);
    outline-offset: -4px;
    border-radius: 8px;
}

.task-kanban-card--dragging {
    opacity: 0.55;
}