:root {
    --sidebar-width: 280px;
    --surface: #ffffff;
    --surface-muted: #f5f7fb;
    --line: #e5e9f0;
    --ink: #1f2937;
    --muted: #697586;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --sidebar: #111827;
    --sidebar-hover: #1f2937;
    --warning-orange: #f97316;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--surface-muted);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
}

a {
    text-decoration: none;
}

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

.app-sidebar {
    background: var(--sidebar);
    color: #d1d5db;
    flex: 0 0 var(--sidebar-width);
    min-height: 100vh;
    padding: 18px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.brand {
    align-items: center;
    color: #fff;
    display: flex;
    font-size: 17px;
    font-weight: 700;
    gap: 12px;
    margin-bottom: 24px;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    align-items: center;
    background: var(--brand);
    border-radius: 8px;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
}

.sidebar-nav a {
    align-items: center;
    border-radius: 8px;
    color: #cbd5e1;
    display: flex;
    gap: 12px;
    padding: 11px 12px;
}

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

.nav-section {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 18px 10px 6px;
    text-transform: uppercase;
}

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

.app-header {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    min-height: 76px;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 1010;
    backdrop-filter: blur(12px);
}

.breadcrumb-mini {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 2px;
}

.app-header h1 {
    font-size: 22px;
    line-height: 1.25;
    margin: 0;
}

.content-wrap {
    padding: 24px;
}

.global-search {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    gap: 10px;
    max-width: 420px;
    padding: 8px 12px;
    width: 35vw;
}

.global-search input {
    background: transparent;
    border: 0;
    outline: 0;
    width: 100%;
}

.icon-btn,
.user-pill {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: inline-flex;
    gap: 8px;
    min-height: 40px;
    padding: 8px 10px;
}

.icon-btn {
    justify-content: center;
    width: 42px;
}

.avatar {
    align-items: center;
    background: #e0ecff;
    border-radius: 50%;
    color: var(--brand);
    display: inline-flex;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    width: 28px;
}

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

.notification-menu {
    min-width: 320px;
}

.notification-menu .dropdown-item {
    display: grid;
    gap: 2px;
    white-space: normal;
}

.notification-menu span {
    color: var(--muted);
    font-size: 13px;
}

.metric-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}

.metric-card {
    min-height: 128px;
    padding: 18px;
}

.metric-card .label {
    color: var(--muted);
    font-size: 13px;
}

.metric-card .value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    margin-top: 10px;
    overflow-wrap: anywhere;
}

.metric-card .icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.panel {
    padding: 18px;
}

.panel-title {
    align-items: center;
    display: flex;
    font-size: 16px;
    font-weight: 700;
    justify-content: space-between;
    margin-bottom: 14px;
}

.table-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.form-section-title {
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    font-weight: 700;
    margin: 8px 0 16px;
    padding-bottom: 8px;
}

.required::after {
    color: #dc2626;
    content: " *";
}

.badge.bg-orange {
    background: var(--warning-orange);
    color: #fff;
}

.timeline {
    border-left: 2px solid var(--line);
    display: grid;
    gap: 18px;
    margin-left: 8px;
    padding-left: 20px;
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    background: var(--brand);
    border: 3px solid #fff;
    border-radius: 50%;
    content: "";
    height: 14px;
    left: -28px;
    position: absolute;
    top: 2px;
    width: 14px;
}

.auth-page {
    align-items: center;
    background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 48%, #f0fdf4 100%);
    display: flex;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, .12);
    margin: auto;
    max-width: 440px;
    padding: 30px;
    width: 100%;
}

.auth-card h1 {
    font-size: 26px;
    margin-bottom: 6px;
}

.loading-overlay {
    align-items: center;
    background: rgba(255, 255, 255, .62);
    display: none;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.dataTables_wrapper .dt-buttons {
    margin-bottom: 12px;
}

.calendar-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        bottom: 0;
        left: -290px;
        position: fixed;
        transition: left .2s ease;
    }

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

    .app-header {
        padding: 12px 16px;
    }

    .content-wrap {
        padding: 16px;
    }
}

@media (max-width: 575.98px) {
    .app-header {
        gap: 10px;
    }

    .app-header h1 {
        font-size: 18px;
    }
}
