:root {
    --uvmp-bg: #f4f6f8;
    --uvmp-surface: #ffffff;
    --uvmp-surface-soft: #f8fafc;
    --uvmp-border: #dde3ea;
    --uvmp-border-strong: #cfd7e1;

    --uvmp-text: #172033;
    --uvmp-muted: #6b7687;

    --uvmp-nav: #111827;
    --uvmp-nav-soft: #1f2937;
    --uvmp-accent: #2f6fed;
    --uvmp-accent-soft: #eaf1ff;

    --uvmp-success: #198754;
    --uvmp-danger: #c73b3b;
    --uvmp-warning: #b7791f;

    --uvmp-radius: 14px;
    --uvmp-radius-sm: 9px;

    --uvmp-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 22px rgba(15, 23, 42, 0.035);
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--uvmp-bg);
    color: var(--uvmp-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 0.94rem;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--uvmp-accent);
    text-decoration: none;
}

a:hover {
    color: #2358c7;
    text-decoration: none;
}

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

.app-main {
    flex: 1 0 auto;
}


/* ---------------------------------------------------------
   Header / Navigation
--------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--uvmp-nav);
    color: white;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
}

.topbar-inner {
    min-height: 74px;
    display: flex;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;
    min-width: 0;
}

.brand:hover {
    color: white;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--uvmp-accent);
    color: white;
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-title {
    font-size: 1.03rem;
    font-weight: 750;
    letter-spacing: 0.025em;
}

.brand-subtitle {
    margin-top: 5px;
    color: #9ca8b8;
    font-size: 0.72rem;
    font-weight: 500;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 0;
}

.app-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 8px;
    color: #c4cbd5;
    font-size: 0.875rem;
    font-weight: 600;
    transition:
        color 120ms ease,
        background-color 120ms ease;
}

.app-nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.065);
}

.app-nav-link.active {
    color: white;
    background: rgba(47, 111, 237, 0.22);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--uvmp-nav-soft);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 0.8rem;
    font-weight: 750;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-label {
    color: #8f9bac;
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.user-name {
    margin-top: 3px;
    color: #e5e7eb;
    font-size: 0.82rem;
    font-weight: 600;
}

.mobile-user-row {
    align-items: center;
    gap: 9px;
    padding: 9px 0 14px;
    color: #d5dbe4;
}

.navbar-toggler {
    margin-left: auto;
    border-color: rgba(255, 255, 255, 0.15);
    filter: invert(1);
}


/* ---------------------------------------------------------
   Page Titles
--------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--uvmp-text);
    font-weight: 720;
    letter-spacing: -0.015em;
}

h1 {
    font-size: clamp(1.55rem, 2vw, 2rem);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-title {
    margin: 0;
}

.page-subtitle {
    margin-top: 5px;
    color: var(--uvmp-muted);
    font-size: 0.9rem;
}


/* ---------------------------------------------------------
   Auth
--------------------------------------------------------- */

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, 0.11), transparent 34%),
        var(--uvmp-bg);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.auth-card {
    width: min(100%, 430px);
    padding: 34px;
    border: 1px solid var(--uvmp-border);
    border-radius: 18px;
    background: var(--uvmp-surface);
    box-shadow:
        0 2px 5px rgba(15, 23, 42, 0.04),
        0 24px 60px rgba(15, 23, 42, 0.08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 26px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--uvmp-border);
}

.auth-brand-mark {
    width: 42px;
    height: 42px;
}

.auth-title {
    color: var(--uvmp-text);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.auth-subtitle {
    margin-top: 3px;
    color: var(--uvmp-muted);
    font-size: 0.78rem;
}

.auth-heading {
    margin-bottom: 24px;
}

.auth-heading h1 {
    margin: 0;
    font-size: 1.55rem;
}

.auth-heading p {
    margin: 7px 0 0;
    color: var(--uvmp-muted);
}

.form-text {
    color: var(--uvmp-muted);
    font-size: 0.76rem;
}


/* ---------------------------------------------------------
   Cards / Metrics
--------------------------------------------------------- */

.card {
    border: 1px solid var(--uvmp-border);
    border-radius: var(--uvmp-radius);
    background: var(--uvmp-surface);
    box-shadow: var(--uvmp-shadow);
    overflow: hidden;
}

.card-header {
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 13px 17px;
    background: var(--uvmp-surface);
    border-bottom: 1px solid var(--uvmp-border);
    color: var(--uvmp-text);
    font-size: 0.9rem;
}

.card-body {
    padding: 18px;
}

.metric-card {
    min-height: 122px;
}

.metric-card .card-body {
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: center;
}

.metric-label {
    color: var(--uvmp-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 7px;
    color: var(--uvmp-text);
    font-size: 2rem;
    font-weight: 780;
    line-height: 1;
    letter-spacing: -0.03em;
}

.metric-value-sm {
    margin-top: 7px;
    color: var(--uvmp-text);
    font-size: 1.3rem;
    font-weight: 760;
}


/* ---------------------------------------------------------
   Tables
--------------------------------------------------------- */

.table-responsive {
    scrollbar-width: thin;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #f8fafc;
    margin-bottom: 0;
    color: var(--uvmp-text);
}

.table > :not(caption) > * > * {
    padding: 0.75rem 0.85rem;
    border-bottom-color: #e8edf2;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--uvmp-surface-soft);
    color: #657184;
    border-bottom: 1px solid var(--uvmp-border-strong);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table a {
    font-weight: 650;
}

.table .text-danger {
    color: var(--uvmp-danger) !important;
    font-weight: 650;
}


/* ---------------------------------------------------------
   Forms
--------------------------------------------------------- */

.form-label {
    color: #495568;
    font-size: 0.79rem;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: var(--uvmp-border-strong);
    border-radius: var(--uvmp-radius-sm);
    color: var(--uvmp-text);
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #8db0f6;
    box-shadow: 0 0 0 0.22rem rgba(47, 111, 237, 0.11);
}

.form-control::placeholder {
    color: #9aa4b2;
}

.filter-bar {
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--uvmp-border);
    border-radius: var(--uvmp-radius);
    background: var(--uvmp-surface);
    box-shadow: var(--uvmp-shadow);
}


/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */

.btn {
    min-height: 40px;
    border-radius: var(--uvmp-radius-sm);
    font-size: 0.86rem;
    font-weight: 680;
    padding-left: 15px;
    padding-right: 15px;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background: #285fce;
    border-color: #285fce;
}

.btn-outline-secondary {
    color: #526073;
    border-color: var(--uvmp-border-strong);
    background: white;
}

.btn-outline-secondary:hover {
    color: var(--uvmp-text);
    border-color: #aeb8c5;
    background: #f8fafc;
}


/* ---------------------------------------------------------
   Badges / Alerts
--------------------------------------------------------- */

.badge {
    padding: 0.42em 0.66em;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.text-bg-success {
    color: #12643e !important;
    background: #e7f6ee !important;
}

.text-bg-light {
    color: #667085 !important;
    background: #eef1f4 !important;
}

.alert {
    border-radius: var(--uvmp-radius);
    border-width: 1px;
}

.alert-success {
    color: #155f3c;
    background: #edf9f2;
    border-color: #ccebd9;
}

.alert-danger {
    color: #8c3030;
    background: #fff2f2;
    border-color: #f1cece;
}


/* ---------------------------------------------------------
   Utility Presentation
--------------------------------------------------------- */

.data-empty {
    padding: 28px 18px !important;
    color: var(--uvmp-muted) !important;
    text-align: center;
}

.muted-label {
    color: var(--uvmp-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.mono {
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
}

pre {
    border-radius: 10px !important;
    font-size: 0.82rem;
}


/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */

.app-footer {
    flex: 0 0 auto;
    color: #8792a2;
    font-size: 0.74rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    border-top: 1px solid var(--uvmp-border);
}

.footer-separator {
    color: #c3cad3;
}


/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */

@media (max-width: 991.98px) {
    .topbar-inner {
        min-height: 66px;
    }

    .brand-subtitle {
        display: none;
    }

    .app-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        padding: 10px 0 4px;
    }

    .app-nav-link {
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 15px;
    }

    .metric-value {
        font-size: 1.65rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.68rem 0.72rem;
    }
}
