:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --line: #dfe7f2;
    --ink: #101828;
    --muted: #667085;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #079455;
    --warning: #dc6803;
    --danger: #d92d20;
    --sidebar: #111827;
}

* {
    letter-spacing: 0;
}

body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 30rem),
        var(--bg);
    color: var(--ink);
    font-size: .95rem;
    overflow-x: hidden;
}

a {
    color: var(--primary);
}

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

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

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 276px;
    flex-direction: column;
    padding: 22px 18px;
    background: var(--sidebar);
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, .08);
}

.app-main {
    min-width: 0;
    flex: 1;
}

.top-shell {
    display: block;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: #fff;
    font-weight: 800;
}

.brand-lockup strong,
.sidebar-profile strong {
    display: block;
    line-height: 1.1;
}

.brand-lockup small,
.sidebar-profile small {
    display: block;
    color: #aab4c5;
    font-size: .78rem;
    margin-top: 3px;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
    margin-top: 28px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #d5dbea;
    text-decoration: none;
    font-weight: 600;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.sidebar-nav a.active {
    box-shadow: inset 3px 0 0 #60a5fa;
}

.sidebar-nav a:hover {
    transform: translateX(2px);
}

.sidebar-nav i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav.mobile {
    margin-top: 0;
}

.sidebar-nav.mobile a {
    color: var(--ink);
}

.sidebar-nav.mobile a:hover,
.sidebar-nav.mobile a.active {
    background: #eff6ff;
    color: var(--primary);
}

.sidebar-profile {
    display: flex;
    gap: 11px;
    align-items: center;
    margin-top: auto;
    padding: 14px 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
}

.avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    font-weight: 800;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    gap: 12px;
    padding: 14px 28px;
    background: rgba(243, 246, 251, .86);
    border-bottom: 1px solid rgba(223, 231, 242, .88);
    backdrop-filter: blur(16px);
}

.topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    flex-wrap: wrap;
}

.nav-row {
    align-items: flex-end;
}

.eyebrow {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 800;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.top-nav {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
    max-width: min(100%, 980px);
}

.top-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #475467;
    background: rgba(255, 255, 255, .62);
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.top-nav a:hover,
.top-nav a.active {
    border-color: #dbeafe;
    background: #fff;
    color: var(--primary);
    box-shadow: 0 8px 22px rgba(16, 24, 40, .07);
}

.user-chip {
    align-items: center;
    gap: 8px;
    min-height: 40px;
    max-width: 260px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .05);
}

.user-chip .avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #eff6ff;
}

.user-chip span:last-child {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip small {
    display: block;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 8px 24px rgba(16, 24, 40, .06);
}

.notif-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 20px;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
}

.content-wrap {
    width: min(100%, 1600px);
    margin: 0 auto;
    padding: 26px 28px 36px;
    overflow-x: clip;
}

.welcome-strip {
    padding: 22px 24px;
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(17, 24, 39, .96), rgba(30, 64, 175, .9)),
        linear-gradient(90deg, #111827, #1d4ed8);
    box-shadow: 0 20px 55px rgba(17, 24, 39, .18);
}

.welcome-strip h2,
.welcome-strip .eyebrow {
    color: #fff;
}

.welcome-strip p:not(.eyebrow) {
    color: #dbeafe;
}

.date-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 800;
}

.calendar-event-date {
    background: #eff6ff;
    color: var(--primary);
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    margin-bottom: 12px;
}

.calendar-toolbar strong {
    color: var(--ink);
    font-size: 1rem;
}

.calendar-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid #e5edf7;
    border-radius: 999px;
    background: #fff;
    color: #475467;
    font-size: .78rem;
    font-weight: 800;
}

.stage-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--primary);
}

.stage-0 {
    background: #2563eb;
}

.stage-1 {
    background: #0891b2;
}

.stage-2 {
    background: #dc6803;
}

.stage-3 {
    background: #079455;
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--line);
    gap: 1px;
}

.month-weekday {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 8px;
    background: #eef4ff;
    color: #475467;
    font-size: .76rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.month-day {
    min-height: 174px;
    min-width: 0;
    padding: 8px;
    background: #fff;
    overflow: hidden;
}

.month-day.outside-month {
    background: #f8fafc;
    color: #98a2b3;
}

.month-day.today {
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .35);
}

.month-day.event-day {
    background: #fff7ed;
}

.month-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 26px;
    margin-bottom: 7px;
}

.month-day-head strong {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 999px;
    color: var(--ink);
    font-size: .85rem;
}

.month-day.today .month-day-head strong {
    background: var(--primary);
    color: #fff;
}

.month-day-head span {
    padding: 3px 7px;
    border-radius: 999px;
    background: #fed7aa;
    color: #9a3412;
    font-size: .7rem;
    font-weight: 900;
}

.month-task-list {
    display: grid;
    gap: 7px;
}

.month-task {
    padding: 8px;
    border: 1px solid #e5edf7;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(16, 24, 40, .06);
}

.stage-border-0 {
    border-left-color: #2563eb;
}

.stage-border-1 {
    border-left-color: #0891b2;
}

.stage-border-2 {
    border-left-color: #dc6803;
}

.stage-border-3 {
    border-left-color: #079455;
}

.month-task-title {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.month-task-title strong {
    min-width: 0;
    color: var(--ink);
    font-size: .78rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.month-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.month-task-meta span {
    max-width: 100%;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #667085;
    font-size: .68rem;
    font-weight: 800;
}

.month-task p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.3;
}

.month-task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 7px;
}

.month-task-actions a {
    font-size: .72rem;
    font-weight: 900;
    text-decoration: none;
}

.undated-panel {
    margin-top: 14px;
    padding: 13px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.undated-task {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e5edf7;
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
}

.filter-chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: .86rem;
    font-weight: 700;
}

.filter-chip a {
    color: var(--primary);
    font-weight: 900;
    text-decoration: none;
}

.calendar-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(260px, 1fr));
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.calendar-column {
    min-width: 260px;
    border: 1px solid #e6edf7;
    border-radius: 8px;
    background: #f8fbff;
}

.calendar-column-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 14px;
    border-bottom: 1px solid #e6edf7;
    background: rgba(248, 251, 255, .94);
    backdrop-filter: blur(10px);
}

.calendar-column-header strong {
    display: block;
    color: var(--ink);
    font-size: .86rem;
    margin-top: 2px;
}

.calendar-stage {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    font-size: .75rem;
    font-weight: 800;
    border: 1px solid #dbeafe;
}

.calendar-card-list {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.calendar-task-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5edf7;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .07);
}

.calendar-task-card.status-danger {
    border-left-color: var(--danger);
}

.calendar-task-card.status-warning {
    border-left-color: var(--warning);
}

.calendar-task-card.status-success {
    border-left-color: var(--success);
}

.calendar-date {
    display: grid;
    align-content: start;
    justify-items: center;
    min-height: 86px;
    padding: 10px 7px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--ink);
}

.calendar-date strong {
    font-size: 1.6rem;
    line-height: 1;
}

.calendar-date span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.calendar-date em {
    margin-top: 8px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    font-size: .72rem;
    font-style: normal;
    font-weight: 900;
}

.calendar-task-body {
    min-width: 0;
}

.calendar-task-body h3 {
    margin: 0;
    font-size: .98rem;
    line-height: 1.25;
}

.calendar-task-body p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.calendar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.calendar-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f8fafc;
    color: #475467;
    font-size: .75rem;
    font-weight: 700;
}

.calendar-output {
    display: grid;
    gap: 3px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: .8rem;
}

.calendar-output a {
    font-weight: 800;
    text-decoration: none;
}

.calendar-output small {
    color: #98a2b3;
}

.calendar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.calendar-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.calendar-empty-column,
.empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 170px;
    padding: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    text-align: center;
}

.empty-state i,
.calendar-empty-column i {
    color: #94a3b8;
    font-size: 1.7rem;
}

.empty-state strong {
    color: var(--ink);
}

.empty-state span,
.calendar-empty-column span {
    font-size: .86rem;
}

.alert {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .08);
}

.stat-card,
.table-card,
.form-card,
.timeline-group {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(16, 24, 40, .06);
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    min-height: 118px;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(6, 182, 212, .16));
}

.stat-card .value {
    margin-top: 12px;
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1;
}

.table-card,
.form-card {
    padding: 18px;
}

.timeline-group {
    border-left: 4px solid var(--primary);
    padding: 18px;
    margin-bottom: 16px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-weight: 800;
}

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

.table {
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: .82rem .75rem;
    border-bottom-color: #edf2f7;
}

.table thead th {
    background: var(--surface-soft);
    color: #475467;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

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

.table-responsive {
    border: 1px solid #edf2f7;
    border-radius: 8px;
    max-width: 100%;
    overflow-x: auto;
}

.table-responsive .table thead th:first-child,
.table-responsive .table tbody td:first-child {
    padding-left: 1rem;
}

.btn {
    border-radius: 8px;
    font-weight: 700;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(37, 99, 235, .2);
}

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

.btn-warning {
    color: #fff;
    background: var(--warning);
    border-color: var(--warning);
}

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

.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .12);
}

.badge {
    border-radius: 999px;
    padding: .42em .7em;
    font-weight: 800;
}

.progress {
    height: 9px;
    border-radius: 999px;
    background: #e8eef7;
}

.progress-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #06b6d4);
}

.offcanvas {
    border: 0;
}

.offcanvas-header {
    border-bottom: 1px solid var(--line);
}

#notifList a {
    border: 1px solid var(--line) !important;
    border-radius: 8px;
    padding: 12px !important;
    margin-bottom: 10px;
    background: var(--surface);
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        linear-gradient(115deg, rgba(15, 23, 42, .82), rgba(15, 23, 42, .34)),
        url("https://images.unsplash.com/photo-1511578314322-379afb476865?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
    width: min(92vw, 440px);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
    backdrop-filter: blur(10px);
}

.login-panel .text-primary {
    color: var(--primary) !important;
}

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

@media (max-width: 991.98px) {
    .topbar {
        padding: 12px 16px;
    }

    .nav-row {
        align-items: flex-start;
    }

    .content-wrap {
        padding: 18px 14px 28px;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .logout-button span {
        display: none;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: .9rem;
    }

    .table-responsive {
        font-size: .84rem;
    }

    .topbar-row {
        align-items: flex-start;
    }

    .month-calendar {
        display: block;
        border: 0;
        background: transparent;
    }

    .month-weekday {
        display: none;
    }

    .month-day {
        min-height: auto;
        margin-bottom: 8px;
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    .month-day.outside-month:not(.event-day) {
        display: none;
    }

    .stat-card {
        min-height: auto;
    }

    .stat-card .value {
        font-size: 1.75rem;
    }

    .login-panel {
        padding: 26px;
    }

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

    .calendar-task-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .calendar-date strong {
        font-size: 1.35rem;
    }
}
