:root {
    --brand-red: #b5121b;
    --brand-red-dark: #8f0f16;
    --brand-yellow: #f3c316;

    --navy-900: #081225;
    --navy-800: #0d1b34;
    --navy-700: #142544;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-900: #0f172a;

    --white: #ffffff;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.07);
    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: var(--slate-900);
}


/* BASE */
a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: #fff;
    padding: 14px 16px;
    outline: none;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(181, 18, 27, 0.45);
    box-shadow: 0 0 0 4px rgba(181, 18, 27, 0.08);
}

button {
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* LAYOUT */
.navbar {
    height: 78px;
    background: linear-gradient(90deg, var(--navy-900), var(--navy-800));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
    box-shadow: 0 6px 20px rgba(2, 6, 23, 0.18);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.navbar-brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
}

.navbar-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.navbar-title {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.navbar-title strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.navbar-title span {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.68);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-size: 0.92rem;
}

.btn-logout {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
}

.btn-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(181, 18, 27, 0.25);
}

.container {
    display: flex;
    min-height: calc(100vh - 78px);
}

.sidebar {
    width: 290px;
    background: linear-gradient(180deg, #96131a 0%, #b5121b 48%, #8f0f16 100%);
    color: white;
    padding: 24px 18px;
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(243,195,22,0.08), transparent 25%);
    pointer-events: none;
}

.sidebar-inner {
    position: relative;
    z-index: 1;
}

.sidebar-brand-card {
    background: rgba(255,255,255,0.96);
    border-radius: 24px;
    padding: 22px 18px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.16);
    margin-bottom: 26px;
    text-align: center;
}

.sidebar-brand-card img {
    width: 118px;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
}

.sidebar-brand-card h3 {
    margin: 0;
    color: var(--navy-900);
    font-size: 1.12rem;
    font-weight: 800;
}

.sidebar-brand-card p {
    margin: 8px 0 0;
    color: var(--slate-500);
    font-size: 0.9rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    color: rgba(255,255,255,0.92);
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.12);
    transform: translateX(2px);
}

.sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(255,255,255,0.10));
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.content {
    flex: 1;
    padding: 34px;
    background: transparent;
}

/* PAGE HEADERS */
.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--slate-900);
}

.page-header p {
    margin: 8px 0 0;
    color: var(--slate-500);
    font-size: 1rem;
}

/* CARDS */
.card,
.panel,
.card-form {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.card,
.panel {
    padding: 24px;
}

.card-form {
    padding: 28px;
}

.section-title {
    margin: 0 0 18px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--slate-900);
}

/* KPI GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--slate-100);
}

.kpi-card::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    right: -24px;
    top: -24px;
    border-radius: 50%;
    background: rgba(181, 18, 27, 0.06);
}

.kpi-label {
    color: var(--slate-500);
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--slate-900);
}

.kpi-meta {
    margin-top: 8px;
    color: var(--brand-red);
    font-size: 0.88rem;
    font-weight: 700;
}

/* PANELS GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
}

.stack {
    display: grid;
    gap: 20px;
}

/* TABLES */
.table-wrap {
    overflow-x: auto;
    border-radius: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

table thead th {
    text-align: left;
    font-size: 0.84rem;
    color: var(--slate-500);
    font-weight: 800;
    padding: 16px 14px;
    border-bottom: 1px solid var(--slate-200);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table tbody td {
    padding: 16px 14px;
    border-bottom: 1px solid #eef2f7;
    color: var(--slate-700);
    font-weight: 500;
}

table tbody tr:hover {
    background: rgba(15, 23, 42, 0.02);
}

/* BUTTONS */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: white;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(181, 18, 27, 0.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 18px;
    border-radius: 14px;
    background: white;
    color: var(--slate-700);
    font-weight: 700;
    border: 1px solid var(--slate-200);
}

.btn-link {
    background: transparent;
    color: var(--brand-red);
    font-weight: 700;
    padding: 0;
}

/* ALERTS */
.alert {
    padding: 16px 18px;
    border-radius: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-success {
    background: rgba(22,163,74,0.09);
    color: #166534;
    border: 1px solid rgba(22,163,74,0.14);
}

.alert-error {
    background: rgba(220,38,38,0.08);
    color: #991b1b;
    border: 1px solid rgba(220,38,38,0.14);
}

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

label {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: 8px;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

/* LOGIN PREMIUM */
.guest-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(243,195,22,0.10), transparent 20%),
        radial-gradient(circle at bottom right, rgba(181,18,27,0.08), transparent 22%),
        linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.login-container {
    display: flex;
    min-height: 100vh;
}

.login-brand {
    flex: 1;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(243,195,22,0.08), transparent 18%),
        radial-gradient(circle at 90% 80%, rgba(255,255,255,0.06), transparent 18%);
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
}

.logo-panel {
    width: 180px;
    background: rgba(255,255,255,0.98);
    border-radius: 28px;
    padding: 18px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.24);
    margin-bottom: 26px;
}

.logo-panel img {
    width: 100%;
    object-fit: contain;
    display: block;
}

.brand-content h1 {
    font-size: 3rem;
    line-height: 1;
    margin: 0 0 14px;
    font-weight: 900;
    letter-spacing: -0.06em;
}

.brand-content p {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.78);
    max-width: 380px;
}

.brand-bars {
    display: flex;
    gap: 18px;
    margin-top: 28px;
}

.brand-bars span {
    width: 56px;
    height: 6px;
    border-radius: 999px;
    background: var(--brand-yellow);
}

.login-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
}

.form-box {
    width: 100%;
    max-width: 430px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    border-radius: 30px;
    padding: 34px;
}

.form-box h2 {
    margin: 0 0 8px;
    font-size: 2rem;
    font-weight: 900;
    color: var(--slate-900);
    letter-spacing: -0.04em;
}

.form-box .subtext {
    margin: 0 0 24px;
    color: var(--slate-500);
    line-height: 1.6;
}

.input-group {
    margin-bottom: 18px;
}

.btn-login {
    width: 100%;
    padding: 15px 18px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: white;
    font-weight: 800;
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(181,18,27,0.22);
}

/* RESPONSIVE */
@media (max-width: 1180px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .login-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .container {
        flex-direction: column;
    }

    .content {
        padding: 22px;
    }
}

@media (max-width: 640px) {
    .kpi-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 0 16px;
    }

    .content {
        padding: 16px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }
}