:root {
    --ps-black: #060914;
    --ps-night: #0b1020;
    --ps-panel: #11182a;
    --ps-panel-soft: #17223a;
    --ps-panel-hover: #1b2945;
    --ps-line: rgba(45, 212, 255, 0.2);
    --ps-line-strong: rgba(45, 212, 255, 0.38);
    --ps-blue: #0070d1;
    --ps-blue-bright: #00a3ff;
    --ps-cyan: #2dd4ff;
    --ps-violet: #7565ff;
    --ps-red: #ff4655;
    --ps-red-dark: #d92f3f;
    --ps-green: #34d399;
    --ps-yellow: #ffca3a;
    --text-main: #f7fbff;
    --text-soft: #d6e3ff;
    --text-muted: #9aa8c7;
    --shadow-ps: 0 18px 45px rgba(0, 0, 0, 0.28);
    --radius-ui: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--ps-black);
}

body {
    min-height: 100vh;
    color: var(--text-main);
    background:
        linear-gradient(135deg, rgba(0, 112, 209, 0.24) 0%, rgba(6, 9, 20, 0) 34%),
        linear-gradient(225deg, rgba(117, 101, 255, 0.2) 0%, rgba(6, 9, 20, 0) 28%),
        linear-gradient(180deg, #0a1020 0%, #070a14 54%, #050711 100%) !important;
}

body.login-page {
    align-items: stretch !important;
    background:
        linear-gradient(135deg, rgba(0, 112, 209, 0.35) 0%, rgba(0, 0, 0, 0) 42%),
        linear-gradient(225deg, rgba(45, 212, 255, 0.16) 0%, rgba(0, 0, 0, 0) 38%),
        linear-gradient(180deg, #080d1c 0%, #060914 100%) !important;
}

a {
    color: var(--ps-cyan);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

::-webkit-scrollbar-thumb {
    background: rgba(45, 212, 255, 0.38);
    border: 2px solid rgba(6, 9, 20, 0.8);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 212, 255, 0.6);
}

.app-shell {
    background: transparent !important;
}

.sidebar,
.offcanvas.sidebar {
    color: var(--text-main) !important;
    background:
        linear-gradient(180deg, rgba(10, 16, 32, 0.98) 0%, rgba(8, 12, 25, 0.98) 100%) !important;
    border-right: 1px solid var(--ps-line) !important;
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.25) !important;
}

.brand-logo,
.login-brand {
    color: var(--text-main) !important;
}

.brand-logo::before,
.login-logo-mark {
    background:
        linear-gradient(135deg, var(--ps-blue) 0%, var(--ps-cyan) 58%, var(--ps-violet) 100%) !important;
    box-shadow: 0 14px 34px rgba(0, 163, 255, 0.24) !important;
}

.brand-subtitle,
.brand-meta,
.page-subtitle,
.login-subtitle,
.muted,
.text-muted,
.small,
small {
    color: var(--text-muted) !important;
}

.sidebar .nav-link {
    min-height: 44px;
    color: var(--text-soft) !important;
    border: 1px solid transparent !important;
    border-radius: var(--radius-ui) !important;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar .nav-link:hover {
    color: #ffffff !important;
    background: rgba(45, 212, 255, 0.08) !important;
    border-color: rgba(45, 212, 255, 0.18) !important;
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    color: #ffffff !important;
    background:
        linear-gradient(135deg, rgba(0, 112, 209, 0.86) 0%, rgba(0, 163, 255, 0.66) 100%) !important;
    border-color: rgba(45, 212, 255, 0.5) !important;
    box-shadow: 0 12px 28px rgba(0, 112, 209, 0.28) !important;
}

.sidebar .nav-link i,
.sidebar .nav-link svg,
.sidebar .logout-button i {
    color: currentColor !important;
}

.logout-button {
    color: #ffd6dc !important;
    background: rgba(255, 70, 85, 0.1) !important;
    border: 1px solid rgba(255, 70, 85, 0.24) !important;
    border-radius: var(--radius-ui) !important;
}

.logout-button:hover {
    color: #ffffff !important;
    background: rgba(255, 70, 85, 0.18) !important;
    border-color: rgba(255, 70, 85, 0.42) !important;
}

.main-content {
    background: transparent !important;
}

.mobile-topbar,
.page-header,
.content-card,
.summary-card,
.tv-card,
.filter-card,
.print-area,
.login-card,
.modal-content,
.dropdown-menu {
    color: var(--text-main) !important;
    background:
        linear-gradient(180deg, rgba(17, 24, 42, 0.94) 0%, rgba(12, 18, 32, 0.94) 100%) !important;
    border: 1px solid var(--ps-line) !important;
    border-radius: var(--radius-ui) !important;
    box-shadow: var(--shadow-ps) !important;
}

.mobile-topbar {
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
}

.page-header {
    overflow: hidden;
}

.page-header::before,
.content-card::before,
.summary-card::before,
.tv-card::before {
    background: linear-gradient(90deg, var(--ps-blue) 0%, var(--ps-cyan) 48%, var(--ps-violet) 100%) !important;
}

.page-title,
.card-title,
.summary-label,
.summary-value,
.tv-title,
.modal-title,
.login-title,
.table-title,
.section-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main) !important;
    letter-spacing: 0 !important;
}

.page-toolbar,
.toolbar,
.action-row,
.filter-actions {
    gap: 0.75rem;
}

.status-pill,
.badge,
.chip,
.filter-chip,
.session-chip {
    border-radius: 999px !important;
}

.btn,
button,
.page-link {
    border-radius: var(--radius-ui) !important;
    letter-spacing: 0 !important;
}

.btn-primary,
.btn-ps,
.btn-action,
.btn-login,
.btn-start,
.btn-submit,
button[type="submit"]:not(.logout-button) {
    color: #ffffff !important;
    background:
        linear-gradient(135deg, var(--ps-blue) 0%, var(--ps-blue-bright) 100%) !important;
    border: 1px solid rgba(45, 212, 255, 0.5) !important;
    box-shadow: 0 12px 26px rgba(0, 112, 209, 0.3) !important;
}

.btn-primary:hover,
.btn-ps:hover,
.btn-action:hover,
.btn-login:hover,
.btn-start:hover,
.btn-submit:hover,
button[type="submit"]:not(.logout-button):hover {
    background:
        linear-gradient(135deg, #0b7ee6 0%, #19b7ff 100%) !important;
    border-color: rgba(45, 212, 255, 0.78) !important;
    transform: translateY(-1px);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-secondary,
.btn-light,
.btn-outline-light,
.btn-filter,
.btn-print,
.btn-export,
.menu-toggle,
.navbar-toggler {
    color: var(--text-soft) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(154, 168, 199, 0.24) !important;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-secondary:hover,
.btn-light:hover,
.btn-outline-light:hover,
.btn-filter:hover,
.btn-print:hover,
.btn-export:hover,
.menu-toggle:hover,
.navbar-toggler:hover {
    color: #ffffff !important;
    background: rgba(45, 212, 255, 0.1) !important;
    border-color: rgba(45, 212, 255, 0.42) !important;
}

.btn-danger,
.btn-stop,
.btn-delete,
.btn-outline-danger:hover {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--ps-red-dark), var(--ps-red)) !important;
    border-color: rgba(255, 70, 85, 0.62) !important;
}

.btn-success,
.btn-paid {
    color: #061114 !important;
    background: linear-gradient(135deg, #2dd4bf, var(--ps-green)) !important;
    border-color: rgba(52, 211, 153, 0.7) !important;
}

.summary-card {
    position: relative;
    overflow: hidden;
}

.summary-card .icon,
.summary-icon,
.metric-icon {
    color: #ffffff !important;
    background:
        linear-gradient(135deg, rgba(0, 112, 209, 0.92), rgba(45, 212, 255, 0.74)) !important;
    border: 1px solid rgba(45, 212, 255, 0.36) !important;
    border-radius: var(--radius-ui) !important;
}

.summary-card.danger .summary-icon,
.summary-card.danger .icon,
.summary-card.warning .summary-icon,
.summary-card.warning .icon {
    background: linear-gradient(135deg, rgba(255, 70, 85, 0.9), rgba(255, 202, 58, 0.75)) !important;
}

.tv-grid,
.dashboard-grid,
.summary-grid,
.report-summary {
    gap: 1rem !important;
}

.tv-card {
    min-width: 0;
    overflow: hidden;
}

.tv-card.active,
.content-card.active,
.summary-card.active {
    border-color: rgba(45, 212, 255, 0.5) !important;
    box-shadow: 0 18px 45px rgba(0, 112, 209, 0.2) !important;
}

.tv-card:hover,
.content-card:hover,
.summary-card:hover {
    border-color: var(--ps-line-strong) !important;
}

.status-active,
.badge-active,
.badge.bg-success,
.badge-success,
.text-success {
    color: #8fffe0 !important;
}

.status-idle,
.badge-idle,
.badge.bg-secondary,
.badge-secondary {
    color: var(--text-soft) !important;
    background: rgba(154, 168, 199, 0.16) !important;
}

.status-warning,
.badge-warning,
.badge.bg-warning,
.text-warning {
    color: #ffe08a !important;
}

.status-danger,
.badge-danger,
.badge.bg-danger,
.text-danger {
    color: #ffbac2 !important;
}

.badge.bg-primary,
.badge-primary {
    color: #ffffff !important;
    background: rgba(0, 112, 209, 0.78) !important;
    border: 1px solid rgba(45, 212, 255, 0.34) !important;
}

.badge.bg-success,
.badge-success {
    background: rgba(52, 211, 153, 0.16) !important;
    border: 1px solid rgba(52, 211, 153, 0.28) !important;
}

.badge.bg-danger,
.badge-danger {
    background: rgba(255, 70, 85, 0.16) !important;
    border: 1px solid rgba(255, 70, 85, 0.28) !important;
}

.badge.bg-warning,
.badge-warning {
    background: rgba(255, 202, 58, 0.14) !important;
    border: 1px solid rgba(255, 202, 58, 0.28) !important;
}

.table,
.data-table,
.report-table {
    --bs-table-color: var(--text-soft);
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(154, 168, 199, 0.14);
    color: var(--text-soft) !important;
    border-color: rgba(154, 168, 199, 0.14) !important;
}

.table thead th,
.data-table thead th,
.report-table thead th {
    color: #ffffff !important;
    background:
        linear-gradient(180deg, rgba(0, 112, 209, 0.34), rgba(0, 112, 209, 0.18)) !important;
    border-color: rgba(45, 212, 255, 0.18) !important;
}

.table tbody tr,
.data-table tbody tr,
.report-table tbody tr {
    border-color: rgba(154, 168, 199, 0.12) !important;
}

.table tbody tr:hover,
.data-table tbody tr:hover,
.report-table tbody tr:hover {
    color: #ffffff !important;
    background: rgba(45, 212, 255, 0.055) !important;
}

.table tfoot th,
.table tfoot td,
.report-table tfoot th,
.report-table tfoot td {
    color: #ffffff !important;
    background: rgba(0, 112, 209, 0.2) !important;
}

.table-responsive,
.report-table-wrap {
    border: 1px solid rgba(154, 168, 199, 0.16) !important;
    border-radius: var(--radius-ui) !important;
    background: rgba(255, 255, 255, 0.025) !important;
}

.form-control,
.form-select,
.input-group-text,
select,
textarea,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="password"],
input[type="email"],
input[type="search"] {
    color: var(--text-main) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(154, 168, 199, 0.24) !important;
    border-radius: var(--radius-ui) !important;
    color-scheme: dark;
}

.form-select,
select {
    background-color: #17223a !important;
}

.form-select option,
select option {
    color: var(--text-main) !important;
    background-color: #11182a !important;
}

.form-select option:checked,
select option:checked {
    color: #ffffff !important;
    background-color: var(--ps-blue) !important;
}

.form-select option:hover,
select option:hover {
    color: #ffffff !important;
    background-color: #1b2945 !important;
}

.form-select option:disabled,
select option:disabled {
    color: rgba(214, 227, 255, 0.42) !important;
    background-color: #0b1020 !important;
}

.form-control:focus,
.form-select:focus,
select:focus,
textarea:focus,
input:focus {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(45, 212, 255, 0.82) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 163, 255, 0.18) !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(214, 227, 255, 0.52) !important;
}

.form-label,
label {
    color: var(--text-soft) !important;
}

.input-group-text {
    color: var(--ps-cyan) !important;
}

.dropdown-item {
    color: var(--text-soft) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #ffffff !important;
    background: rgba(45, 212, 255, 0.1) !important;
}

.alert {
    color: var(--text-soft) !important;
    border-radius: var(--radius-ui) !important;
    border: 1px solid rgba(154, 168, 199, 0.18) !important;
    background: rgba(17, 24, 42, 0.92) !important;
}

.alert-success {
    border-color: rgba(52, 211, 153, 0.32) !important;
    background: rgba(52, 211, 153, 0.1) !important;
}

.alert-danger {
    border-color: rgba(255, 70, 85, 0.32) !important;
    background: rgba(255, 70, 85, 0.1) !important;
}

.alert-warning {
    border-color: rgba(255, 202, 58, 0.32) !important;
    background: rgba(255, 202, 58, 0.1) !important;
}

.pagination .page-link {
    color: var(--text-soft) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(154, 168, 199, 0.18) !important;
}

.pagination .active .page-link,
.page-item.active .page-link {
    color: #ffffff !important;
    background: var(--ps-blue) !important;
    border-color: rgba(45, 212, 255, 0.6) !important;
}

.modal-backdrop.show {
    opacity: 0.72 !important;
}

.modal-header,
.modal-footer {
    border-color: rgba(154, 168, 199, 0.14) !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.login-card {
    width: min(100%, 440px) !important;
    margin: auto !important;
}

.login-card::before {
    background: linear-gradient(90deg, var(--ps-blue), var(--ps-cyan), var(--ps-violet)) !important;
}

.login-helper,
.login-footer,
.login-note {
    color: var(--text-muted) !important;
}

.print-area {
    padding: clamp(1rem, 2vw, 1.5rem) !important;
}

.report-header {
    color: var(--text-main) !important;
    border-bottom: 1px solid rgba(45, 212, 255, 0.18) !important;
}

.report-title,
.print-title {
    color: #ffffff !important;
}

.report-meta,
.print-meta {
    color: var(--text-muted) !important;
}

.summary-box,
.mini-summary div,
.report-total-card {
    color: var(--text-main) !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(154, 168, 199, 0.16) !important;
    border-radius: var(--radius-ui) !important;
}

.summary-box.primary,
.report-total-card.primary {
    background: rgba(0, 112, 209, 0.16) !important;
    border-color: rgba(45, 212, 255, 0.28) !important;
}

.summary-box.warning {
    background: rgba(255, 202, 58, 0.12) !important;
    border-color: rgba(255, 202, 58, 0.26) !important;
}

.summary-box.danger {
    background: rgba(255, 70, 85, 0.13) !important;
    border-color: rgba(255, 70, 85, 0.28) !important;
}

.summary-box .label,
.mini-summary .label,
.summary-box small {
    color: var(--text-muted) !important;
}

.summary-box .value,
.mini-summary strong,
.grand-total,
.total-amount {
    color: #ffffff !important;
}

.price,
.amount,
.money,
.rupiah {
    color: #8fffe0 !important;
}

.empty-state {
    color: var(--text-muted) !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px dashed rgba(154, 168, 199, 0.22) !important;
    border-radius: var(--radius-ui) !important;
}

.ps-accent-line,
.accent-line {
    background: linear-gradient(90deg, var(--ps-blue), var(--ps-cyan), var(--ps-violet)) !important;
}

@media (max-width: 992px) {
    body {
        background:
            linear-gradient(145deg, rgba(0, 112, 209, 0.22) 0%, rgba(6, 9, 20, 0) 44%),
            linear-gradient(180deg, #080d1b 0%, #060914 100%) !important;
    }

    .main-content {
        padding-left: 0 !important;
    }

    .page-header,
    .content-card,
    .summary-card,
    .tv-card,
    .filter-card,
    .print-area {
        border-radius: var(--radius-ui) !important;
    }

    .page-toolbar,
    .filter-actions,
    .action-row {
        align-items: stretch !important;
    }

    .page-toolbar .btn,
    .filter-actions .btn,
    .action-row .btn {
        min-height: 42px;
    }
}

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

    .page-title,
    .login-title {
        font-size: clamp(1.35rem, 7vw, 1.85rem) !important;
    }

    .page-header,
    .content-card,
    .summary-card,
    .tv-card,
    .filter-card,
    .print-area,
    .login-card {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22) !important;
    }

    .summary-grid,
    .dashboard-grid,
    .report-summary {
        grid-template-columns: 1fr !important;
    }

    .table-responsive,
    .report-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .table,
    .data-table,
    .report-table {
        min-width: 720px;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 42px;
    }
}

@media print {
    html,
    body {
        color: #111827 !important;
        background: #ffffff !important;
    }

    .print-area,
    .content-card,
    .summary-box,
    .mini-summary div {
        color: #111827 !important;
        background: #ffffff !important;
        border-color: #d1d5db !important;
        box-shadow: none !important;
    }

    .report-header,
    .table,
    .data-table,
    .report-table {
        color: #111827 !important;
        border-color: #d1d5db !important;
    }

    .table thead th,
    .data-table thead th,
    .report-table thead th,
    .table tfoot th,
    .table tfoot td,
    .report-table tfoot th,
    .report-table tfoot td {
        color: #111827 !important;
        background: #eef2ff !important;
        border-color: #d1d5db !important;
    }

    .summary-box .label,
    .mini-summary .label,
    .report-meta,
    .print-meta {
        color: #4b5563 !important;
    }

    .summary-box .value,
    .mini-summary strong,
    .report-title,
    .print-title,
    .grand-total,
    .total-amount {
        color: #111827 !important;
    }
}
