:root {
    --sidebar-width: 260px;
    --app-bg: #f4f7fb;
    --ink: #1f2a37;
    --muted: #667085;
    --line: #d9e2ec;
    --brand: #116466;
    --brand-dark: #0b3f40;
    --accent: #f59e0b;
}

* {
    letter-spacing: 0;
}

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

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
}

.app-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--line);
    padding: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1020;
}

.brand {
    color: var(--ink);
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    margin-bottom: 22px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}

.brand small {
    color: var(--muted);
    display: block;
    font-size: 12px;
}

.app-sidebar .nav-link {
    color: #344054;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 600;
}

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

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

.app-navbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 16px 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.app-navbar h1 {
    font-size: 24px;
    line-height: 1.2;
    margin: 0;
}

.page-kicker {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 2px;
}

.notification-dropdown {
    width: min(360px, calc(100vw - 2rem));
    max-height: 430px;
    overflow-y: auto;
}

.notification-item {
    white-space: normal;
    border-left: 3px solid transparent;
}

.notification-item.is-unread {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.notification-item small {
    overflow-wrap: anywhere;
}

.app-content {
    padding: 24px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.metric-card,
.panel,
.table-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric-card {
    padding: 18px;
}

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

.metric-value {
    font-size: 28px;
    font-weight: 750;
}

.metric-foot {
    color: var(--muted);
    font-size: 12px;
    margin-top: 8px;
}

.panel {
    padding: 18px;
}

.table-panel {
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.table-responsive {
    min-height: 140px;
}

.table {
    margin-bottom: 0;
}

.table th {
    color: #475467;
    font-size: 13px;
    background: #f8fafc;
    white-space: nowrap;
}

.form-required::after {
    content: " *";
    color: #dc3545;
}

.empty-state {
    padding: 40px 20px;
    color: var(--muted);
    text-align: center;
}

.sensitive-note {
    background: #fff8e5;
    border: 1px solid #f7d774;
    color: #7a4f01;
    border-radius: 8px;
    padding: 12px 14px;
}

.chart-box {
    min-height: 280px;
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        width: var(--sidebar-width);
        box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

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