:root {
    --app-bg: #eef4fb;
    --app-blue: #0b5ed7;
    --app-blue-dark: #073b8e;
    --app-blue-soft: #eaf3ff;
    --app-cyan: #35b9ff;
    --app-white: #ffffff;
    --app-text: #14213d;
    --app-muted: #64748b;
    --app-border: #dbe7f5;
    --app-border-soft: #edf3fa;
    --app-shadow: 0 18px 50px rgba(7, 59, 142, .10);
    --sidebar-width: 286px;
}

* {
    letter-spacing: 0;
}

body,
.app-body {
    background:
        linear-gradient(180deg, rgba(238, 244, 251, .96), rgba(248, 251, 255, .98)),
        radial-gradient(circle at 85% 0%, rgba(53, 185, 255, .16), transparent 28%);
    color: var(--app-text);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    min-height: 100vh;
}

a {
    text-decoration: none;
}

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

.app-sidebar {
    background:
        linear-gradient(180deg, rgba(40, 59, 126, .86), rgba(13, 37, 83, .94)),
        radial-gradient(circle at 20% 0%, rgba(150, 93, 255, .55), transparent 36%),
        radial-gradient(circle at 100% 18%, rgba(37, 193, 255, .40), transparent 34%);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 0 26px 26px 0;
    box-shadow: 18px 0 55px rgba(7, 22, 58, .24);
    display: flex;
    flex-direction: column;
    gap: 18px;
    left: 0;
    min-height: calc(100vh - 48px);
    overflow: hidden;
    padding: 18px;
    position: fixed;
    top: 24px;
    width: var(--sidebar-width);
    z-index: 1020;
}

.app-sidebar::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 42%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.app-sidebar > * {
    position: relative;
    z-index: 1;
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

.sidebar-dots {
    display: flex;
    gap: 7px;
    padding: 4px 8px 0;
}

.sidebar-dots span {
    border-radius: 999px;
    height: 8px;
    width: 8px;
}

.sidebar-dots span:nth-child(1) {
    background: #ff6b6b;
}

.sidebar-dots span:nth-child(2) {
    background: #ffd166;
}

.sidebar-dots span:nth-child(3) {
    background: #59d98e;
}

.sidebar-profile {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    display: flex;
    gap: 12px;
    padding: 12px 8px 20px;
}

.sidebar-profile:hover {
    color: #fff;
}

.brand-mark {
    align-items: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    box-shadow: 0 14px 34px rgba(7, 22, 58, .24);
    color: #fff;
    display: flex;
    flex: 0 0 46px;
    font-size: 21px;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.sidebar-profile-copy,
.sidebar-profile-copy strong,
.sidebar-profile-copy small {
    display: block;
}

.sidebar-profile-copy strong {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.sidebar-profile-copy small {
    color: rgba(255, 255, 255, .62);
    font-size: 12px;
    font-weight: 500;
}

.sidebar-menu {
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding: 4px 2px;
    scrollbar-width: thin;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .22);
    border-radius: 999px;
}

.sidebar-link {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, .72);
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 12px;
    min-height: 44px;
    padding: 9px 12px;
    transition: .18s ease;
}

.sidebar-link i {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 10px;
    color: rgba(255, 255, 255, .78);
    display: inline-flex;
    flex: 0 0 30px;
    font-size: 14px;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.sidebar-link:hover,
.sidebar-link:focus {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(64, 148, 255, .34), rgba(64, 148, 255, .10));
    border-color: rgba(126, 183, 255, .42);
    box-shadow: inset 3px 0 0 #57b9ff, 0 16px 36px rgba(9, 24, 65, .20);
    color: #fff;
}

.sidebar-link.active i {
    background: rgba(87, 185, 255, .22);
    border-color: rgba(126, 211, 255, .34);
    color: #fff;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, .14);
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
}

.sidebar-mode,
.sidebar-logout {
    align-items: center;
    border-radius: 14px;
    display: flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: space-between;
    min-height: 42px;
    padding: 10px 12px;
}

.sidebar-mode {
    background: rgba(255, 255, 255, .10);
    color: rgba(255, 255, 255, .78);
}

.sidebar-mode span {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.sidebar-mode span i {
    color: #b9dcff;
}

.sidebar-logout {
    background: rgba(255, 255, 255, .88);
    color: #e1485a;
    justify-content: center;
    gap: 8px;
}

.sidebar-logout:hover {
    background: #fff;
    color: #c82d40;
}

.app-topbar {
    align-items: center;
    background: rgba(255, 255, 255, .86);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(18px);
    display: flex;
    gap: 16px;
    min-height: 78px;
    padding: 14px 26px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.topbar-label {
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.topbar-title {
    color: var(--app-text);
    font-size: 22px;
    font-weight: 800;
}

.sidebar-toggle {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 42px;
}

.user-box {
    align-items: center;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
    display: flex;
    gap: 10px;
    padding: 8px;
}

.user-avatar {
    align-items: center;
    background: var(--app-blue-soft);
    border-radius: 8px;
    color: var(--app-blue);
    display: inline-flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.user-copy {
    line-height: 1.15;
    min-width: 96px;
}

.user-copy span {
    color: var(--app-muted);
    display: block;
    font-size: 12px;
}

.user-copy strong {
    color: var(--app-text);
    display: block;
    font-size: 13px;
}

.app-container {
    max-width: 1500px;
}

.page-heading {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-heading h1 {
    color: var(--app-text);
    font-size: 30px;
}

.page-heading p {
    color: var(--app-muted);
    line-height: 1.65;
    margin: 0;
    max-width: 900px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--app-blue), #087df0);
    border: 0;
    box-shadow: 0 12px 28px rgba(11, 94, 215, .25);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--app-blue-dark), var(--app-blue));
}

.btn-light,
.btn-outline-primary {
    background: #fff;
    border-color: var(--app-border);
}

.stat-card,
.panel,
.flow-card {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--app-border-soft);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
}

.stat-card {
    height: 100%;
    overflow: hidden;
    padding: 22px;
    position: relative;
}

.stat-card::after {
    background: linear-gradient(135deg, rgba(11, 94, 215, .14), rgba(53, 185, 255, .05));
    border-radius: 999px;
    content: "";
    height: 96px;
    position: absolute;
    right: -34px;
    top: -34px;
    width: 96px;
}

.stat-card p {
    font-size: 14px;
    font-weight: 700;
}

.stat-card h2 {
    color: var(--app-text);
    font-size: 36px;
    line-height: 1;
}

.stat-trend {
    color: #0f9f6e;
    font-size: 12px;
    font-weight: 800;
}

.stat-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 48px;
    font-size: 22px;
    height: 48px;
    justify-content: center;
    position: relative;
    width: 48px;
    z-index: 1;
}

.stat-icon-primary,
.stat-icon-info {
    background: var(--app-blue-soft);
    color: var(--app-blue);
}

.stat-icon-success {
    background: #e8f8f0;
    color: #159957;
}

.stat-icon-warning {
    background: #fff6df;
    color: #c47a00;
}

.panel {
    padding: 24px;
}

.panel-title {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel h2,
.flow-card h2,
.flow-card h3 {
    color: var(--app-text);
}

.flow-card {
    height: 100%;
    padding: 20px;
}

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

.priority-list {
    display: grid;
    gap: 10px;
}

.priority-item {
    align-items: center;
    background: #f8fbff;
    border: 1px solid var(--app-border-soft);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 13px 14px;
}

.warehouse-meter {
    background: linear-gradient(135deg, #f7fbff, #ffffff);
    border: 1px solid var(--app-border-soft);
    border-radius: 8px;
    padding: 16px;
}

.chart-wrap {
    align-items: end;
    background:
        linear-gradient(to top, rgba(219, 231, 245, .7) 1px, transparent 1px);
    background-size: 100% 38px;
    border: 1px solid var(--app-border-soft);
    border-radius: 8px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(6, minmax(64px, 1fr));
    min-height: 260px;
    overflow-x: auto;
    padding: 28px 20px 16px;
}

.chart-group {
    align-items: center;
    display: grid;
    gap: 10px;
    justify-items: center;
}

.chart-bars {
    align-items: end;
    display: flex;
    gap: 7px;
    height: 148px;
}

.chart-bar {
    border-radius: 8px 8px 3px 3px;
    box-shadow: 0 12px 20px rgba(11, 94, 215, .16);
    display: block;
    width: 13px;
}

.bar-tender {
    background: var(--app-blue);
}

.bar-kontrak {
    background: #35b9ff;
}

.bar-produksi {
    background: #74d3ff;
}

.chart-label {
    color: var(--app-muted);
    font-size: 13px;
    font-weight: 800;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.chart-legend span {
    align-items: center;
    color: var(--app-muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
}

.legend-dot {
    border-radius: 999px;
    display: inline-flex;
    height: 10px;
    width: 10px;
}

.dot-tender {
    background: var(--app-blue);
}

.dot-kontrak {
    background: #35b9ff;
}

.dot-produksi {
    background: #74d3ff;
}

.table-responsive {
    border: 1px solid var(--app-border-soft);
    border-radius: 8px;
}

.table {
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--app-border-soft);
    padding: 15px 16px;
    vertical-align: middle;
}

.table thead th {
    background: linear-gradient(180deg, #f7fbff, #edf6ff);
    color: #2f4770;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

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

.excel-table {
    box-shadow: inset 0 0 0 1px #fff;
}

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

.form-label {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 7px;
}

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

.form-control:focus,
.form-select:focus {
    border-color: #8cc4ff;
    box-shadow: 0 0 0 .2rem rgba(11, 94, 215, .12);
}

.progress {
    background: #e7f0fb;
    border-radius: 999px;
    height: 18px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--app-blue), var(--app-cyan));
    font-size: 12px;
    font-weight: 800;
}

.list-group-item {
    border-color: var(--app-border-soft);
}

.modal-content {
    border: 0;
    border-radius: 8px;
    box-shadow: var(--app-shadow);
}

.modal-header,
.modal-footer {
    border-color: var(--app-border-soft);
}

.login-page {
    align-items: center;
    background:
        linear-gradient(180deg, rgba(238, 244, 251, .94), rgba(248, 251, 255, .98)),
        radial-gradient(circle at 16% 8%, rgba(11, 94, 215, .20), transparent 28%);
    display: flex;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--app-border-soft);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
    margin: auto;
    max-width: 440px;
    padding: 32px;
    width: 100%;
}

.mobile-sidebar {
    width: min(86vw, 320px);
}

.mobile-sidebar .offcanvas-body {
    background: #fff;
}

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

    .app-main {
        margin-left: 0;
        width: 100%;
    }

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

    .mobile-sidebar {
        background:
            linear-gradient(180deg, rgba(40, 59, 126, .96), rgba(13, 37, 83, .98)),
            radial-gradient(circle at 20% 0%, rgba(150, 93, 255, .45), transparent 34%);
        color: #fff;
    }

    .mobile-sidebar .offcanvas-header,
    .mobile-sidebar .offcanvas-body {
        background: transparent;
    }

    .mobile-sidebar .offcanvas-title {
        color: #fff;
    }

    .mobile-sidebar .btn-close {
        filter: invert(1) grayscale(1);
    }
}

@media (max-width: 767.98px) {
    body,
    .app-body {
        font-size: 14px;
    }

    .topbar-label {
        display: none;
    }

    .topbar-title {
        font-size: 18px;
    }

    .page-heading {
        display: block;
        margin-bottom: 18px;
    }

    .page-heading h1 {
        font-size: 24px;
    }

    .page-heading .btn,
    .page-heading button {
        margin-top: 14px;
        width: 100%;
    }

    .panel,
    .stat-card,
    .flow-card {
        padding: 18px;
    }

    .panel-title {
        display: block;
    }

    .panel-title .btn,
    .panel-title .badge {
        margin-top: 12px;
    }

    .chart-wrap {
        grid-template-columns: repeat(6, 70px);
    }

    .table > :not(caption) > * > * {
        padding: 12px;
    }

    .login-card {
        padding: 24px;
    }
}
