:root {
    --office-ink: #172033;
    --office-muted: #667085;
    --office-bg: #f6f8fb;
    --office-card: #ffffff;
    --office-line: #e5eaf2;
    --office-primary: #3157d5;
    --office-primary-soft: #edf2ff;
    --office-success: #138a4d;
    --office-warning: #b76b00;
    --office-danger: #c83232;
    --office-radius: 8px;
    --sidebar-width: 272px;
}

* {
    letter-spacing: 0;
}

body {
    color: var(--office-ink);
    background: var(--office-bg);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    display: none;
}

.app-content {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: .85rem 1rem;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--office-line);
    backdrop-filter: blur(12px);
}

.content-wrap {
    padding: 1rem;
    padding-bottom: 5.5rem;
}

.app-footer {
    padding: 0 1rem 5.5rem;
    color: var(--office-muted);
    font-size: .85rem;
}

.auth-wrap {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #eaf0ff, transparent 30%), var(--office-bg);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: var(--office-ink);
    font-weight: 800;
    font-size: 1.05rem;
}

.brand-icon,
.icon-btn,
.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--office-radius);
}

.brand-icon,
.stat-icon.primary {
    color: var(--office-primary);
    background: var(--office-primary-soft);
}

.icon-btn {
    color: var(--office-ink);
    background: #fff;
    border: 1px solid var(--office-line);
}

.sidebar-nav {
    display: grid;
    gap: .25rem;
    margin-top: 1.5rem;
    padding-right: .25rem;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.sidebar-group-label {
    margin: 1rem .75rem .25rem;
    color: var(--office-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 42px;
    padding: .65rem .75rem;
    color: #48566f;
    border-radius: var(--office-radius);
    font-weight: 600;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--office-primary);
    background: var(--office-primary-soft);
}

.nav-count {
    margin-left: auto;
    min-width: 1.35rem;
    padding: .1rem .35rem;
    border-radius: 99px;
    color: #fff;
    background: var(--office-danger);
    font-size: .75rem;
    text-align: center;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: auto;
    padding: .75rem 0;
    border-top: 1px solid var(--office-line);
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    color: #fff;
    background: var(--office-primary);
    font-weight: 800;
}

.user-avatar-lg {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.25rem;
}

.mobile-bottom-nav {
    position: fixed;
    right: .75rem;
    bottom: .75rem;
    left: .75rem;
    z-index: 1020;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .25rem;
    padding: .4rem;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--office-line);
    border-radius: 16px;
    box-shadow: 0 16px 45px rgba(23, 32, 51, .13);
    backdrop-filter: blur(12px);
}

.mobile-bottom-nav a {
    display: grid;
    justify-items: center;
    gap: .1rem;
    padding: .45rem .25rem;
    color: var(--office-muted);
    border-radius: 12px;
    font-size: .72rem;
}

.mobile-bottom-nav a.active {
    color: var(--office-primary);
    background: var(--office-primary-soft);
}

.page-title {
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 800;
}

.page-kicker {
    color: var(--office-muted);
}

.stat-card,
.table-card,
.soft-card,
.form-panel .card,
.profile-card,
.dashboard-hero {
    border: 1px solid var(--office-line);
    border-radius: var(--office-radius);
    background: var(--office-card);
    box-shadow: 0 10px 30px rgba(23, 32, 51, .04);
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-illustration {
    display: none;
}

.profile-card {
    padding: 1rem;
}

.table-card {
    overflow: hidden;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--office-line);
    font-weight: 800;
}

.table {
    --bs-table-hover-bg: #f7f9fd;
}

.table thead th {
    color: #667085;
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.badge {
    border-radius: 99px;
    padding: .4rem .6rem;
    font-weight: 700;
}

.text-bg-primary,
.text-bg-info {
    color: #2440a6 !important;
    background: #eaf0ff !important;
}

.text-bg-warning {
    color: #8a4c00 !important;
    background: #fff1cf !important;
}

.text-bg-success {
    color: #0f6c3d !important;
    background: #def7e9 !important;
}

.text-bg-danger {
    color: #fff !important;
    background: var(--office-danger) !important;
}

.text-bg-secondary {
    color: #475467 !important;
    background: #eef2f7 !important;
}

.progress {
    min-width: 120px;
    height: .65rem;
    background: #edf1f7;
    border-radius: 999px;
}

.progress-bar {
    background: linear-gradient(90deg, #3157d5, #4f7cff);
    border-radius: 999px;
    font-size: .65rem;
    line-height: .65rem;
}

.form-panel {
    max-width: 980px;
}

.form-label {
    color: #344054;
    font-weight: 700;
}

.form-control,
.form-select {
    border-color: #d9e0ec;
    border-radius: var(--office-radius);
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--office-primary);
    box-shadow: 0 0 0 .2rem rgba(49, 87, 213, .12);
}

.form-control:invalid:not(:placeholder-shown),
.form-select:invalid:not(:placeholder-shown) {
    border-color: var(--office-danger);
}

.btn {
    border-radius: var(--office-radius);
    font-weight: 700;
}

.btn-primary {
    background: var(--office-primary);
    border-color: var(--office-primary);
}

.empty-state {
    padding: 2.5rem 1rem;
    color: var(--office-muted);
    text-align: center;
}

.empty-state i {
    display: block;
    margin-bottom: .75rem;
    color: #98a2b3;
    font-size: 2rem;
}

.audit-details {
    max-width: 520px;
    white-space: normal;
    word-break: break-word;
}

.task-mobile-card {
    margin: .75rem;
    border: 1px solid var(--office-line);
    border-radius: var(--office-radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 32, 51, .04);
}

.task-mobile-card.overdue,
.risk-alert.overdue {
    border-left: 4px solid var(--office-danger);
}

.task-mobile-card.risky,
.risk-alert.risky {
    border-left: 4px solid var(--office-warning);
}

.risk-alert {
    background: #fff;
}

.detail-hero {
    border: 1px solid var(--office-line);
    border-radius: var(--office-radius);
    background: #fff;
}

.weekly-planner-grid {
    display: grid;
}

.weekly-plan-row {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--office-line);
}

.weekly-plan-row.current-day,
.task-mobile-card.current-day {
    border-left: 4px solid var(--office-primary);
    background: var(--office-primary-soft);
}

.weekly-plan-day {
    min-width: 9rem;
}

.weekly-plan-table td {
    min-width: 11rem;
    white-space: normal;
}

.weekly-mobile-section {
    display: grid;
    gap: .25rem;
    padding-top: .75rem;
    margin-top: .75rem;
    border-top: 1px solid var(--office-line);
    white-space: normal;
}

.weekly-mobile-section span {
    color: var(--office-muted);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.nav-tabs {
    gap: .35rem;
    border-bottom: 1px solid var(--office-line);
}

.nav-tabs .nav-link {
    color: var(--office-muted);
    border: 0;
    border-bottom: 2px solid transparent;
    font-weight: 800;
}

.nav-tabs .nav-link.active {
    color: var(--office-primary);
    background: transparent;
    border-bottom-color: var(--office-primary);
}

.login-card {
    border: 1px solid var(--office-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 70px rgba(23, 32, 51, .12);
}

.min-w-0 {
    min-width: 0;
}

@media (max-width: 767.98px) {
    .desktop-table {
        display: none;
    }

    .content-wrap {
        padding-inline: .85rem;
    }

    .table-card {
        border-radius: 10px;
    }
}

@media (min-width: 768px) {
    .mobile-list {
        display: none;
    }
}

@media (min-width: 992px) {
    .app-shell {
        display: grid;
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    }

    .app-sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        height: 100vh;
        padding: 1.25rem;
        overflow: hidden;
        background: #fff;
        border-right: 1px solid var(--office-line);
    }

    .topbar {
        padding-inline: 1.5rem;
    }

    .content-wrap {
        padding: 1.5rem;
    }

    .dashboard-hero {
        padding: 1.25rem 1.5rem;
    }

    .hero-illustration {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: .65rem;
        color: var(--office-primary);
        background: var(--office-primary-soft);
        border-radius: 14px;
        font-size: 1.35rem;
    }

    .app-footer {
        padding: 0 1.5rem 1.5rem;
    }

    .mobile-bottom-nav {
        display: none;
    }

    .weekly-plan-row {
        grid-template-columns: 130px repeat(4, minmax(0, 1fr));
        align-items: start;
    }
}
