:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #22c55e;
    --primary-100: #e9f2ff;
    --success-100: #e6fbf0;
    --warning-100: #fff7e6;
    --danger-100: #fff0f0;
    --sidebar-bg: #ffffff;
    --sidebar-bg-2: #f8fafc;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --radius: 14px;
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 36px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'SF Pro Text', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 0% 0%, rgba(191, 219, 254, 0.4) 0%, rgba(191, 219, 254, 0) 38%),
        radial-gradient(circle at 100% 0%, rgba(226, 232, 240, 0.6) 0%, rgba(226, 232, 240, 0) 32%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app-shell {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar-backdrop {
    display: none;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: #1e293b;
    padding: 20px 12px 14px;
    border-right: 1px solid var(--border);
    box-shadow: none;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(145deg, #1d4ed8, #60a5fa);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.brand {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-top: 2px;
}

.sidebar-context {
    margin-top: 18px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #e2e8f0;
    color: #1e3a8a;
}

.sidebar-user-name {
    font-weight: 700;
    font-size: 0.92rem;
}

.sidebar-user-meta {
    color: #64748b;
    font-size: 0.73rem;
    margin-top: 2px;
}

.sidebar-search {
    margin-top: 14px;
    position: relative;
}

.sidebar-search .bi {
    position: absolute;
    left: 11px;
    top: 9px;
    color: #94a3b8;
    font-size: 0.8rem;
    pointer-events: none;
}

.sidebar-search .form-control {
    border: 1px solid #dbe4f1;
    background: #ffffff;
    color: #0f172a;
    padding-left: 30px;
    height: 35px;
}

.sidebar-search .form-control::placeholder {
    color: #94a3b8;
}

.sidebar-search .form-control:focus {
    border-color: rgba(37, 99, 235, 0.46);
    box-shadow: 0 0 0 0.17rem rgba(37, 99, 235, 0.18);
}

.nav-stack {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
}

.nav-stack .nav-section-title,
.nav-stack .nav-link {
    width: 100%;
}

.nav-section-title {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 1.2px;
    color: #64748b;
    margin: 12px 10px 6px;
    font-weight: 700;
}

.sidebar-compact-toggle {
    border-color: #dbe4f1;
    color: #475569;
}

.sidebar-compact-toggle:hover {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.app-sidebar .nav-link {
    color: #334155;
    border-radius: 11px;
    margin-bottom: 2px;
    padding: 8px 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.app-sidebar .nav-link .bi {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

.app-sidebar .nav-link.active,
.app-sidebar .nav-link:hover {
    color: #1d4ed8;
    background: #eff6ff;
    transform: translateX(2px);
}

.app-sidebar .nav-link.nav-logout {
    color: #b91c1c;
    border: 1px dashed #fecdd3;
    background: #fff1f2;
}

.app-sidebar .nav-link.nav-logout:hover {
    color: #991b1b;
    background: #ffe4e6;
}

.nav-group {
    margin-bottom: 6px;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: transparent;
    padding-right: 8px;
}

.nav-group-toggle .bi {
    color: #94a3b8;
    font-size: 0.72rem;
    transition: transform 200ms ease;
}

.nav-group-links {
    max-height: 520px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 220ms ease, opacity 200ms ease;
}

.nav-group.is-collapsed .nav-group-links {
    max-height: 0;
    opacity: 0.25;
}

.nav-group.is-collapsed .nav-group-toggle .bi {
    transform: rotate(-90deg);
}

body.sidebar-compact .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
}

body.sidebar-compact .app-sidebar {
    padding-left: 10px;
    padding-right: 10px;
}

body.sidebar-compact .brand-wrap > div,
body.sidebar-compact .sidebar-context,
body.sidebar-compact .sidebar-search,
body.sidebar-compact .nav-section-title span,
body.sidebar-compact .app-sidebar .nav-link span,
body.sidebar-compact .nav-group-toggle .bi {
    display: none;
}

body.sidebar-compact .brand-wrap {
    justify-content: center;
    width: 100%;
}

body.sidebar-compact .nav-group-toggle {
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
}

body.sidebar-compact .app-sidebar .nav-link {
    justify-content: center;
    padding: 10px 6px;
}

body.sidebar-compact .app-sidebar .nav-link .bi {
    width: auto;
    font-size: 1rem;
}

body.sidebar-compact .nav-group-links {
    max-height: none;
    opacity: 1;
}

.app-main {
    padding: 16px 20px 24px;
}

.topbar {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 1050;
}

/* Ensure dropdown menus float above main content */
.dropdown-menu {
    z-index: 2050;
}

.topbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-meta {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

.topbar-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4f5d75;
    background: #edf3fe;
    border: 1px solid #dae5f8;
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.alert {
    border-radius: 12px;
    border: 1px solid transparent;
}

.card {
    border: 1px solid #e4eaf6;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}

.card h3,
.card .h5 {
    font-weight: 700;
    color: #18283f;
}

.reports-hero {
    border-color: #dbe6fb;
    background:
        linear-gradient(135deg, rgba(10, 99, 246, 0.06), rgba(30, 201, 162, 0.06)),
        #ffffff;
}

.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-kpi-card {
    padding: 14px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.report-kpi-label {
    color: #6a7891;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.report-kpi-value {
    margin-top: 6px;
    font-size: 1.22rem;
    font-weight: 800;
    color: #14305c;
    line-height: 1.2;
}

.report-kpi-sub {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #5d6f8f;
}

.report-rate-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-rate-bar {
    width: 100%;
    min-width: 110px;
    height: 8px;
    background: #e7eefb;
}

.report-rate-bar .progress-bar {
    background: linear-gradient(90deg, #0b63f6 0%, #1ec9a2 100%);
}

.report-rate-label {
    font-size: 0.82rem;
    color: #29466f;
    white-space: nowrap;
}

/* Sparkline utilities used on dashboard */
.sparkline {
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
}
.spark-bar {
    width: 12px;
    border-radius: 4px;
    background: linear-gradient(180deg, #2563eb 0%, #0b63f6 100%);
    box-shadow: 0 1px 2px rgba(11,99,246,0.18);
    transition: height 220ms ease, opacity 180ms ease, transform 220ms ease;
}
.spark-bar.task { background: linear-gradient(180deg, #059669 0%, #047a50 100%); }
.spark-bar.empty { opacity: 0.14; }

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #d4ddee;
    min-height: 40px;
}

.form-control:focus,
.form-select:focus {
    border-color: #95b7f8;
    box-shadow: 0 0 0 0.18rem rgba(11, 99, 246, 0.18);
}

/* Disabled selects and readonly inputs should look muted and consistent */
.form-select:disabled,
select[disabled] {
    color: var(--muted);
    background: var(--surface-muted);
    opacity: 1;
}

.form-control[readonly] {
    color: var(--muted);
    background: var(--surface-muted);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #0c58d6 0%, #0748b4 100%);
    border-color: #0748b4;
}

/* Secondary and outline button variants for consistent styling */
.btn-secondary {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline {
    background: transparent;
    color: var(--muted);
    border: 1px solid rgba(15,23,42,0.06);
}

.dashboard-icon-btn, .btn.icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid rgba(15,23,42,0.04);
    transition: transform .12s ease, box-shadow .12s ease;
}

.dashboard-icon-btn:hover, .btn.icon:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15,23,42,0.06); }

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    background: #eef3ff;
    color: #21467f;
    border-bottom: 1px solid #d9e5fa;
    font-size: 0.82rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    padding-top: 12px;
    padding-bottom: 12px;
}

.table tbody td {
    border-color: #edf1fa;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f6faff;
}

/* Global SaaS harmonization for common pages */
.saas-panel {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.saas-panel:hover {
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.saas-filter-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.saas-filter-form {
    row-gap: 12px;
}

.saas-filter-form .form-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.saas-filter-form .form-control,
.saas-filter-form .form-select {
    border-radius: 12px;
    border-color: #d9e2f3;
    min-height: 42px;
}

.saas-filter-form input[type='search'],
.saas-filter-form input[name='q'] {
    min-height: 46px;
    font-size: 0.95rem;
}

.saas-data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.saas-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fbff;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 12px 14px;
}

.saas-data-table tbody td {
    padding: 14px;
    border-bottom: 1px solid #edf2f9;
    vertical-align: middle;
}

.saas-data-table tbody tr {
    transition: background-color 180ms ease, box-shadow 180ms ease;
}

.saas-data-table tbody tr:hover {
    background: #f8fbff;
    box-shadow: inset 0 0 0 1px #e4edff;
}

.saas-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.saas-row-actions .btn {
    border-radius: 9px;
}

.saas-action-menu {
    border-radius: 12px;
    border-color: #e2e8f0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

/* Shared status pills across all pages */
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-pill-pending {
    background: #fff7db;
    color: #9a6700;
}

.status-pill-completed {
    background: #eaf9f1;
    color: #0f7a43;
}

.status-pill-danger {
    background: #ffe9e9;
    color: #c21f1f;
}

.status-pill-muted {
    background: #edf2f7;
    color: #4a5568;
}

.status-pill-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.table-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #e2e9f8;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: #f8fbff;
}

.table-tools-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.table-tools .form-control,
.table-tools .form-select {
    min-height: 36px;
    height: 36px;
    font-size: 0.86rem;
}

.table-tools .table-search {
    width: min(320px, 60vw);
}

.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border: 1px solid #e2e9f8;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: #f8fbff;
}

.table-pagination-info {
    color: var(--muted);
    font-size: 0.83rem;
}

.table-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-page-indicator {
    color: #3c4d69;
    font-size: 0.84rem;
    min-width: 80px;
    text-align: center;
}

.table-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 22px !important;
}

.table-sortable::after {
    content: '\2195';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #7d8ba6;
}

.table-sortable[data-sort='asc']::after {
    content: '\2191';
    color: #0b63f6;
}

.table-sortable[data-sort='desc']::after {
    content: '\2193';
    color: #0b63f6;
}

.typeahead-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1080;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #dbe4f1;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.typeahead-item {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f8;
    color: #0f172a;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1.35;
    background: #ffffff;
}

.typeahead-item:last-child {
    border-bottom: 0;
}

.typeahead-item:hover,
.typeahead-item.is-active {
    background: #eff6ff;
    color: #1d4ed8;
}

code {
    color: #1a3f79;
    background: #eaf1ff;
    border-radius: 6px;
    padding: 2px 6px;
}

footer {
    color: #6f7e98;
}

body.ai-manual-open {
    overflow: hidden;
}

.ai-manual-footer-trigger {
    position: fixed;
    right: 24px;
    bottom: 20px;
    z-index: 1062;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #ffffff;
    background: linear-gradient(145deg, #4f66ff 0%, #304ddc 100%);
    box-shadow: 0 16px 34px rgba(48, 77, 220, 0.32);
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.ai-manual-footer-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 38px rgba(48, 77, 220, 0.38);
}

.ai-manual-footer-trigger:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(117, 143, 255, 0.38), 0 20px 38px rgba(48, 77, 220, 0.38);
}

.ai-manual-footer-trigger-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);
}

.ai-manual-panel {
    position: fixed;
    inset: 0;
    z-index: 1075;
    pointer-events: none;
}

.ai-manual-panel.is-open {
    pointer-events: auto;
}

.ai-manual-overlay {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.34);
    cursor: pointer;
    opacity: 0;
    transition: opacity 220ms ease;
}

.ai-manual-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(430px, 100vw);
    height: 100%;
    background: #f6f8ff;
    border-left: 1px solid #d9e2f3;
    box-shadow: -20px 0 54px rgba(15, 23, 42, 0.24);
    transform: translateX(100%);
    transition: transform 240ms ease;
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.ai-manual-panel.is-open .ai-manual-overlay {
    opacity: 1;
}

.ai-manual-panel.is-open .ai-manual-drawer {
    transform: translateX(0);
}

.ai-manual-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.ai-manual-head h2 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.05;
    color: #253a60;
    font-weight: 800;
}

.ai-manual-head p {
    margin: 10px 0 0;
    color: #6279a2;
    font-size: 1.02rem;
}

.ai-manual-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #d0dbf1;
    background: #e9eefb;
    color: #4e6288;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-manual-close:hover {
    background: #dee7fb;
}

.ai-manual-progress-line {
    color: #4566a0;
    font-size: 1.05rem;
    font-weight: 700;
}

.ai-manual-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #d6dfef;
    overflow: hidden;
}

.ai-manual-progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #4e66ff 0%, #7f8ff7 100%);
    transition: width 220ms ease;
}

.ai-manual-step-card {
    border-radius: 14px;
    border: 1px solid #b7d8be;
    background: #d4e5db;
    padding: 14px;
}

.ai-manual-step-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ai-manual-step-chip {
    border-radius: 999px;
    padding: 5px 10px;
    background: #dfe9ff;
    color: #4f67bf;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ai-manual-step-status {
    border-radius: 999px;
    padding: 4px 11px;
    border: 1px solid #c8d3e6;
    color: #5d708e;
    background: #edf1f8;
    font-size: 0.9rem;
    font-weight: 700;
}

.ai-manual-step-status.is-done {
    border-color: #9dc9ab;
    color: #2f7f4a;
    background: #e5f5e9;
}

.ai-manual-step-card h3 {
    margin: 12px 0 6px;
    color: #253a60;
    font-size: 2rem;
    line-height: 1.05;
    font-weight: 800;
}

.ai-manual-step-card p {
    margin: 0;
    color: #4f678f;
    font-size: 1.08rem;
}

.ai-manual-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ai-manual-controls .btn {
    min-height: 42px;
    border-radius: 12px;
    font-weight: 700;
}

.ai-manual-controls [data-ai-manual-complete].is-done {
    opacity: 0.72;
}

.ai-manual-open-link {
    min-height: 48px;
    border-radius: 12px;
    border: 0;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #4f66ff 0%, #304ddc 100%);
    box-shadow: 0 10px 24px rgba(48, 77, 220, 0.26);
}

.ai-manual-open-link.disabled {
    pointer-events: none;
    opacity: 0.55;
}

.dashboard-page {
    display: grid;
    gap: 12px;
}

.dashboard-card {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    padding: 20px;
}

.dashboard-hero {
    background:
        radial-gradient(circle at 95% -10%, rgba(59, 130, 246, 0.13), rgba(59, 130, 246, 0) 40%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.dashboard-hero-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.dashboard-eyebrow {
    font-size: 0.75rem;
    color: #64748b;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.dashboard-hero-title {
    font-size: 1.85rem;
    line-height: 1.12;
    margin: 6px 0 10px;
    color: #0f172a;
    font-weight: 900;
}

.dashboard-hero-subtitle {
    color: #64748b;
    max-width: 560px;
    font-size: 0.92rem;
}

.dashboard-hero-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-hero-controls .group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dashboard-hero-controls .group.filter {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: 10px;
}

.dashboard-hero-controls .group.filter .btn {
    min-height: 38px;
}

.dashboard-hero-controls .group.actions .btn {
    min-height: 38px;
}

.dashboard-filter-form {
    min-width: 230px;
}

.dashboard-filter-form .form-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.dashboard-range-select {
    min-width: 140px;
}

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

.dashboard-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dashboard-dot-badge {
    position: absolute;
    right: -5px;
    top: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.dashboard-pill-btn {
    border-radius: 999px;
    padding: 0.42rem 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    line-height: 1.1;
}

.dashboard-hero-controls .group.actions .dashboard-pill-btn {
    padding: 0.42rem 0.95rem;
    font-weight: 600;
}

.dashboard-hero-controls .group.actions .dashboard-pill-btn.dropdown-toggle::after {
    margin-left: 0.45rem;
}

.dashboard-kpi-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-kpi-card {
    border: 1px solid #e8eef8;
    border-radius: 14px;
    background: #ffffff;
    padding: 16px;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.06);
}

.dashboard-kpi-card.is-attention {
    border-color: rgba(220, 38, 38, 0.14);
    background: linear-gradient(180deg, #fff9f9 0%, #fff5f5 100%);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.06);
}

/* Tone backgrounds for KPI cards */
.dashboard-kpi-card.tone-primary { background: var(--primary-100); border-color: rgba(37,99,235,0.08); }
.dashboard-kpi-card.tone-success { background: var(--success-100); border-color: rgba(5,150,105,0.06); }
.dashboard-kpi-card.tone-warning { background: var(--warning-100); border-color: rgba(217,119,6,0.06); }
.dashboard-kpi-card.tone-danger { background: var(--danger-100); border-color: rgba(220,38,38,0.06); }

.dashboard-kpi-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.dashboard-kpi-icon.tone-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.dashboard-kpi-icon.tone-warning {
    background: #fef3c7;
    color: #b45309;
}

.dashboard-kpi-icon.tone-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.dashboard-kpi-icon.tone-success {
    background: #dcfce7;
    color: #15803d;
}

.dashboard-kpi-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 700;
}

.dashboard-kpi-value {
    font-size: 2rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.02;
}

.dashboard-kpi-meta {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8rem;
    color: #64748b;
}

.dashboard-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.dashboard-kpi-trend.is-up {
    color: #16a34a;
}

.dashboard-kpi-trend.is-down {
    color: #ef4444;
}

.dashboard-kpi-trend.is-flat {
    color: #64748b;
}

.dashboard-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-card-sub {
    font-size: 0.84rem;
    color: #64748b;
}

.dashboard-chart-shell {
    position: relative;
    min-height: 220px;
}

.dashboard-chart-shell canvas {
    width: 100% !important;
    height: 220px !important;
}

.dashboard-donut-shell canvas {
    height: 210px !important;
}

.dashboard-skeleton {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(100deg, #f1f5f9 24%, #e2e8f0 40%, #f1f5f9 58%);
    background-size: 200% 100%;
    animation: dashboardPulse 1.2s linear infinite;
    z-index: 2;
}

.dashboard-skeleton.is-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

@keyframes dashboardPulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.dashboard-empty-state {
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: #64748b;
    text-align: center;
    padding: 12px;
}

.dashboard-empty-state .bi {
    font-size: 1.25rem;
    color: #94a3b8;
}

.dashboard-empty-state p {
    margin: 0;
    font-size: 0.88rem;
}

.dashboard-status-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.dashboard-status-legend {
    display: grid;
    gap: 10px;
}

.dashboard-status-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.dashboard-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.dashboard-status-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
}

.dashboard-status-meta {
    font-size: 0.78rem;
    color: #64748b;
}

.dashboard-attention-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-attention-stat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dashboard-attention-stat span {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.dashboard-attention-stat strong {
    color: #0f172a;
    font-size: 1.1rem;
}

.dashboard-attention-list .list-group-item {
    border-color: #eef2f7;
    padding-left: 0;
    padding-right: 0;
}

.dashboard-attention-link {
    display: grid;
    gap: 2px;
    text-decoration: none;
}

.dashboard-attention-title {
    color: #1e293b;
    font-weight: 600;
}

.dashboard-attention-date {
    color: #dc2626;
    font-size: 0.8rem;
}

.dashboard-actions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.86rem;
}

.dashboard-link:hover {
    color: #1d4ed8;
}

.dashboard-activity-table tbody tr {
    transition: background-color 180ms ease, box-shadow 180ms ease;
}

.dashboard-activity-table tbody tr[data-row-href] {
    cursor: pointer;
}

.dashboard-activity-table tbody tr[data-row-href]:hover {
    background: #f8fbff;
    box-shadow: inset 0 0 0 1px #dbeafe;
}

.dashboard-task-name {
    font-weight: 600;
    color: #1e293b;
}

.dashboard-task-meta {
    font-size: 0.78rem;
    color: #64748b;
}

.dashboard-owner-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dashboard-owner-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 700;
}

.dashboard-status-badge {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-status-badge.status-success {
    color: #166534;
    background: #dcfce7;
}

.dashboard-status-badge.status-pending {
    color: #a16207;
    background: #fef3c7;
}

.dashboard-status-badge.status-progress {
    color: #1d4ed8;
    background: #dbeafe;
}

.dashboard-status-badge.status-danger {
    color: #b91c1c;
    background: #fee2e2;
}

.dashboard-status-badge.status-muted {
    color: #475569;
    background: #e2e8f0;
}

/* Manage Tasks page */
.tasks-page {
    display: grid;
    gap: 12px;
}

.task-panel {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    padding: 18px;
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.task-panel:hover {
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.task-panel-filters {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.task-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.task-eyebrow {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.task-page-title {
    margin: 4px 0;
    font-size: 1.5rem;
    line-height: 1.15;
    font-weight: 800;
    color: #0f172a;
}

.task-page-subtitle {
    margin: 0;
    color: #64748b;
    max-width: 620px;
    font-size: 0.92rem;
}

.task-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid #dbe7ff;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
}

.task-filters-form .form-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.task-input-icon {
    position: relative;
}

.task-input-icon .bi {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.task-input-icon .form-control,
.task-input-icon .form-select {
    border-radius: 12px;
    border-color: #d9e2f3;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.task-input-icon .form-control {
    padding-left: 36px;
}

.task-search-input {
    min-height: 46px;
    font-size: 0.95rem;
}

.task-filter-btn {
    border-radius: 10px;
    min-height: 38px;
    padding-inline: 14px;
}

.task-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-table-sub {
    color: #64748b;
    font-size: 0.86rem;
}

.task-empty-state {
    min-height: 180px;
    border-radius: 12px;
    border: 1px dashed #dbe4f1;
    background: #f8fbff;
    display: grid;
    place-items: center;
    text-align: center;
    color: #64748b;
    gap: 6px;
}

.task-empty-state .bi {
    font-size: 1.35rem;
    color: #94a3b8;
}

.task-table {
    border-collapse: separate;
    border-spacing: 0;
}

.task-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fbff;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 12px 14px;
}

.task-table tbody td {
    padding: 14px;
    border-bottom: 1px solid #edf2f9;
    vertical-align: middle;
}

.task-table tbody tr {
    transition: background-color 180ms ease, box-shadow 180ms ease;
}

.task-table tbody tr:hover {
    background: #f8fbff;
    box-shadow: inset 0 0 0 1px #e4edff;
}

.task-main-title {
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.25;
}

.task-main-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.78rem;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.task-meta-sep {
    color: #c0c9d8;
}

.task-date-primary {
    color: #1e293b;
    font-size: 0.84rem;
    font-weight: 600;
}

.task-date-sub {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.76rem;
}

.task-assignee {
    color: #1e293b;
    font-size: 0.86rem;
    font-weight: 600;
}

.task-status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.task-status-pending {
    background: #fff7db;
    color: #9a6700;
}

.task-status-completed {
    background: #eaf9f1;
    color: #0f7a43;
}

.task-status-overdue {
    background: #ffe9e9;
    color: #c21f1f;
}

.task-status-muted {
    background: #edf2f7;
    color: #4a5568;
}

.task-status-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.task-reassign-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.task-reassign-select {
    min-width: 150px;
}

.task-reassign-save {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-actions-toggle {
    border-radius: 9px;
    min-height: 34px;
}

.task-actions-menu {
    border-radius: 12px;
    border-color: #e2e8f0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

@media (max-width: 991px) {
    .task-panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-count-chip {
        margin-top: 4px;
    }

    .task-table thead th,
    .task-table tbody td {
        padding: 12px;
    }

    .task-reassign-select {
        min-width: 130px;
    }
}

body.theme-dark {
    background: #0f172a;
    color: #e2e8f0;
}

body.theme-dark .dashboard-card,
body.theme-dark .topbar,
body.theme-dark .app-sidebar,
body.theme-dark .sidebar-context,
body.theme-dark .table-tools,
body.theme-dark .table-pagination {
    background: #111b30;
    border-color: #1f2a40;
    color: #dbe7ff;
}

body.theme-dark .dashboard-kpi-card,
body.theme-dark .dashboard-attention-stat {
    background: #15223a;
    border-color: #243753;
}

body.theme-dark .task-panel,
body.theme-dark .task-panel-filters,
body.theme-dark .task-empty-state,
body.theme-dark .task-table thead th {
    background: #111b30;
    border-color: #243753;
    color: #dbe7ff;
}

body.theme-dark .task-page-title,
body.theme-dark .task-main-title,
body.theme-dark .task-assignee,
body.theme-dark .task-date-primary {
    color: #e2e8f0;
}

body.theme-dark .task-page-subtitle,
body.theme-dark .task-eyebrow,
body.theme-dark .task-table-sub,
body.theme-dark .task-main-meta,
body.theme-dark .task-date-sub {
    color: #9fb0ce;
}

body.theme-dark .task-table tbody td {
    border-bottom-color: #243753;
}

body.theme-dark .task-table tbody tr:hover {
    background: #182742;
    box-shadow: inset 0 0 0 1px #27406a;
}

body.theme-dark .task-input-icon .form-control,
body.theme-dark .task-input-icon .form-select {
    background: #0f172a;
    border-color: #324766;
    color: #dbe7ff;
}

body.theme-dark .task-input-icon .bi {
    color: #8fa5c8;
}

body.theme-dark .task-status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

body.theme-dark .task-status-completed {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

body.theme-dark .task-status-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

body.theme-dark .task-status-muted {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

body.theme-dark .task-status-progress {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

body.theme-dark .saas-panel,
body.theme-dark .saas-filter-card,
body.theme-dark .saas-data-table thead th {
    background: #111b30;
    border-color: #243753;
    color: #dbe7ff;
}

body.theme-dark .saas-filter-form .form-label {
    color: #9fb0ce;
}

body.theme-dark .saas-filter-form .form-control,
body.theme-dark .saas-filter-form .form-select {
    background: #0f172a;
    border-color: #324766;
    color: #dbe7ff;
}

body.theme-dark .saas-data-table tbody td {
    border-bottom-color: #243753;
}

body.theme-dark .saas-data-table tbody tr:hover {
    background: #182742;
    box-shadow: inset 0 0 0 1px #27406a;
}

body.theme-dark .saas-action-menu {
    background: #111b30;
    border-color: #243753;
}

body.theme-dark .status-pill-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

body.theme-dark .status-pill-completed {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

body.theme-dark .status-pill-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

body.theme-dark .status-pill-muted {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

body.theme-dark .status-pill-progress {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

body.theme-dark .dashboard-hero {
    background: linear-gradient(180deg, #111b30 0%, #17263f 100%);
}

body.theme-dark .dashboard-kpi-label,
body.theme-dark .dashboard-card-sub,
body.theme-dark .dashboard-task-meta,
body.theme-dark .dashboard-empty-state,
body.theme-dark .dashboard-status-meta,
body.theme-dark .dashboard-attention-stat span,
body.theme-dark .dashboard-hero-subtitle,
body.theme-dark .table-pagination-info,
body.theme-dark .sidebar-user-meta,
body.theme-dark .brand-subtitle,
body.theme-dark .topbar-meta {
    color: #9fb0ce;
}

body.theme-dark .dashboard-hero-title,
body.theme-dark .dashboard-kpi-value,
body.theme-dark .dashboard-task-name,
body.theme-dark .dashboard-status-label,
body.theme-dark .dashboard-attention-title,
body.theme-dark .dashboard-attention-stat strong,
body.theme-dark .brand,
body.theme-dark .sidebar-user-name,
body.theme-dark .topbar h1,
body.theme-dark .topbar-time,
body.theme-dark .app-sidebar .nav-link {
    color: #e2e8f0;
}

body.theme-dark .app-sidebar .nav-link.active,
body.theme-dark .app-sidebar .nav-link:hover {
    background: #20324f;
    color: #dbeafe;
}

body.theme-dark .sidebar-search .form-control,
body.theme-dark .form-control,
body.theme-dark .form-select {
    background: #0f172a;
    border-color: #324766;
    color: #dbe7ff;
}

body.theme-dark .sidebar-search .form-control::placeholder {
    color: #8fa5c8;
}

body.theme-dark .dashboard-link {
    color: #93c5fd;
}

body.theme-dark .dashboard-activity-table tbody tr[data-row-href]:hover {
    background: #182742;
    box-shadow: inset 0 0 0 1px #27406a;
}

body.theme-dark .dashboard-status-badge.status-success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

body.theme-dark .dashboard-status-badge.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

body.theme-dark .dashboard-status-badge.status-progress {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

body.theme-dark .dashboard-status-badge.status-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

body.theme-dark .dashboard-status-badge.status-muted {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

body.theme-dark .ai-manual-footer-trigger {
    background: linear-gradient(145deg, #5f78ff 0%, #3a58ea 100%);
    box-shadow: 0 16px 34px rgba(58, 88, 234, 0.38);
}

body.theme-dark .ai-manual-overlay {
    background: rgba(2, 6, 23, 0.6);
}

body.theme-dark .ai-manual-drawer {
    background: #111b30;
    border-left-color: #2a3e60;
}

body.theme-dark .ai-manual-head h2,
body.theme-dark .ai-manual-step-card h3 {
    color: #dbe7ff;
}

body.theme-dark .ai-manual-head p,
body.theme-dark .ai-manual-step-card p,
body.theme-dark .ai-manual-progress-line {
    color: #9fb0ce;
}

body.theme-dark .ai-manual-close {
    background: #17263f;
    border-color: #2d4367;
    color: #b6c8e9;
}

body.theme-dark .ai-manual-progress-track {
    background: #243753;
}

body.theme-dark .ai-manual-step-card {
    border-color: #2f4c59;
    background: #1a2f3c;
}

body.theme-dark .ai-manual-step-chip {
    background: #213654;
    color: #a8c3f0;
}

body.theme-dark .ai-manual-step-status {
    border-color: #2e4468;
    color: #9fb0ce;
    background: #15223a;
}

body.theme-dark .ai-manual-step-status.is-done {
    border-color: #2f7f4a;
    color: #9de1b4;
    background: rgba(34, 197, 94, 0.18);
}

@media (max-width: 1099px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: fixed;
        z-index: 1040;
        left: -274px;
        top: 0;
        width: 264px;
        transition: left 0.25s ease;
    }

    body.sidebar-open .app-sidebar {
        left: 0;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(7, 20, 43, 0.45);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 1035;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-main {
        padding: 12px;
    }
}

@media (max-width: 1200px) {
    .reports-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-hero-head {
        flex-direction: column;
    }

    .dashboard-hero-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 992px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-status-layout {
        grid-template-columns: 1fr;
    }
}

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

    .ai-manual-footer-trigger {
        right: 12px;
        bottom: 12px;
        padding: 10px 14px;
        font-size: 0.94rem;
    }

    .ai-manual-drawer {
        width: 100%;
        padding: 12px;
    }

    .ai-manual-head h2,
    .ai-manual-step-card h3 {
        font-size: 1.55rem;
    }

    .ai-manual-head p,
    .ai-manual-step-card p {
        font-size: 0.97rem;
    }

    .ai-manual-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-manual-controls [data-ai-manual-complete] {
        grid-column: span 2;
    }

    .table-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .table-tools-group {
        width: 100%;
    }

    .table-tools .table-search {
        width: 100%;
    }

    .topbar-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        padding: 16px;
    }

    .dashboard-filter-form {
        min-width: 0;
        width: 100%;
    }

    .dashboard-meta-actions {
        width: 100%;
    }

    .dashboard-attention-metrics {
        grid-template-columns: 1fr;
    }
}

/* Premium Glassmorphic Toast Notifications System */
#ajax-alert-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100vw - 48px);
}

.ajax-toast {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(190%);
    -webkit-backdrop-filter: blur(12px) saturate(190%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 14px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 16px 20px;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, margin 0.3s ease;
    opacity: 0;
}

.ajax-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.ajax-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.ajax-toast-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ajax-toast-body {
    flex-grow: 1;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1e293b;
    padding-top: 1px;
}

.ajax-toast-close {
    background: none;
    border: none;
    padding: 2px;
    margin: -2px;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ajax-toast-close:hover {
    color: #475569;
    transform: scale(1.1);
}

/* Success Toast */
.ajax-toast.toast-success {
    border-left: 5px solid #10b981;
    background: rgba(240, 253, 250, 0.92);
}
.ajax-toast.toast-success .ajax-toast-icon {
    color: #10b981;
}

/* Danger/Error Toast */
.ajax-toast.toast-danger {
    border-left: 5px solid #ef4444;
    background: rgba(254, 242, 242, 0.92);
}
.ajax-toast.toast-danger .ajax-toast-icon {
    color: #ef4444;
}

/* Warning Toast */
.ajax-toast.toast-warning {
    border-left: 5px solid #f59e0b;
    background: rgba(255, 251, 235, 0.92);
}
.ajax-toast.toast-warning .ajax-toast-icon {
    color: #f59e0b;
}

/* Info Toast */
.ajax-toast.toast-info {
    border-left: 5px solid #3b82f6;
    background: rgba(239, 246, 255, 0.92);
}
.ajax-toast.toast-info .ajax-toast-icon {
    color: #3b82f6;
}

/* Dark mode overrides */
body.theme-dark .ajax-toast {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(51, 65, 85, 0.5);
}
body.theme-dark .ajax-toast-body {
    color: #f1f5f9;
}
body.theme-dark .ajax-toast.toast-success {
    background: rgba(6, 78, 59, 0.85);
}
body.theme-dark .ajax-toast.toast-danger {
    background: rgba(153, 27, 27, 0.85);
}
body.theme-dark .ajax-toast.toast-warning {
    background: rgba(146, 64, 14, 0.85);
}
body.theme-dark .ajax-toast.toast-info {
    background: rgba(30, 58, 138, 0.85);
}
body.theme-dark .ajax-toast-close {
    color: #64748b;
}
body.theme-dark .ajax-toast-close:hover {
    color: #94a3b8;
}

/* Kanban Board & Calendar Styles */
.task-board-page {
    margin-top: 1.5rem;
}
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.board-view-toggle {
    display: inline-flex;
    background: var(--surface-muted);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.board-view-toggle .btn {
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.9rem;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    transition: all 0.2s ease;
}
.board-view-toggle .btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Kanban Layout */
.kanban-wrapper {
    overflow-x: auto;
    padding-bottom: 1rem;
}
.kanban-board {
    display: flex;
    gap: 16px;
    min-width: 1100px;
    align-items: flex-start;
}
.kanban-col {
    flex: 1;
    min-width: 260px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}
.kanban-col-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.kanban-col-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.kanban-col-count {
    background: var(--border);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.kanban-cards-list {
    padding: 12px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 150px;
    transition: background-color 0.2s ease;
}
.kanban-cards-list.drag-over {
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 0 0 12px 12px;
}

/* Kanban Card */
.kanban-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border-left: 4px solid var(--muted);
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}
.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

/* Priority Left Borders */
.kanban-card.priority-low { border-left-color: #64748b; }
.kanban-card.priority-medium { border-left-color: #3b82f6; }
.kanban-card.priority-high { border-left-color: #f59e0b; }
.kanban-card.priority-critical { border-left-color: #ef4444; }

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.kanban-card-id {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
}
.kanban-card-type {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-100);
    padding: 2px 6px;
    border-radius: 4px;
}
.kanban-card-type.type-office {
    color: #0d9488;
    background: #ccfbf1;
}
.kanban-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.4;
}
.kanban-card-body {
    margin-bottom: 12px;
}
.kanban-card-progress {
    margin-top: 8px;
}
.kanban-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 4px;
}
.kanban-card-progress .progress {
    height: 5px;
    background-color: var(--border);
}
.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    margin-top: 8px;
}
.kanban-card-date {
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.kanban-card-date.overdue {
    color: #ef4444;
    font-weight: 600;
}
.kanban-card-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
}
.kanban-card-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #1e3a8a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Calendar Container */
.calendar-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

/* FullCalendar Customizations */
.fc {
    --fc-border-color: var(--border);
    --fc-today-bg-color: rgba(37, 99, 235, 0.05);
    font-family: inherit;
}
.fc .fc-toolbar-title {
    font-size: 1.2rem !important;
    font-weight: 700;
    color: var(--text);
}
.fc .fc-button-primary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    font-weight: 600;
    border-radius: 8px;
    text-transform: capitalize;
}
.fc .fc-button-primary:hover,
.fc .fc-button-primary:focus {
    background: var(--surface-muted) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}
.fc .fc-button-active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}
.fc-theme-standard th {
    background: var(--surface-muted);
    padding: 8px 0 !important;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}
.fc-event {
    border-radius: 6px !important;
    padding: 2px 6px !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    border: none !important;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.1s ease;
}
.fc-event:hover {
    transform: scale(1.02);
}

/* Dark Mode Overrides */
body.theme-dark .board-view-toggle {
    background: #0f172a;
    border-color: #324766;
}
body.theme-dark .board-view-toggle .btn.active {
    background: #1e293b;
    color: #3b82f6;
}
body.theme-dark .kanban-col {
    background: #111b30;
    border-color: #2a3e60;
}
body.theme-dark .kanban-col-header {
    border-bottom-color: #2a3e60;
}
body.theme-dark .kanban-col-count {
    background: #1e293b;
    color: #9fb0ce;
}
body.theme-dark .kanban-card {
    background: #1e293b;
    border-color: #2a3e60;
}
body.theme-dark .kanban-card:hover {
    border-color: #475569;
}
body.theme-dark .kanban-card-footer {
    border-top-color: #2a3e60;
}
body.theme-dark .kanban-card-avatar {
    background: #2d3748;
    color: #3b82f6;
}
body.theme-dark .calendar-container {
    background: #111b30;
    border-color: #2a3e60;
}
body.theme-dark .fc-theme-standard th {
    background: #1e293b;
    color: #9fb0ce;
}
body.theme-dark .kanban-cards-list.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
}
