@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');

/* ──────────────────────────────────────
   VARIABLES
────────────────────────────────────── */
:root {
    --primary-h: 199;
    --primary-s: 89%;
    --primary-l: 48%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.35);

    --accent-h: 262;
    --accent-s: 83%;
    --accent-l: 58%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3);

    --bg-base: #020617;
    --bg-card: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);

    --clr-white: #ffffff;
    --clr-light: #f1f5f9;
    --clr-subtle: #cbd5e1;
    --clr-muted: #94a3b8;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;

    --sidebar-w: 275px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --trans: all 0.35s var(--ease);
}

/* ──────────────────────────────────────
   RESET & GLOBAL NUCLEAR TEXT OVERRIDE
────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: dark;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-base);
    background-image:
        radial-gradient(ellipse at 0% 0%, hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--clr-light);
    min-height: 100vh;
}

/* FORCE ALL TEXT LIGHT — CRITICAL */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--clr-white) !important;
    font-weight: 800;
}

p,
label,
span,
li {
    color: var(--clr-light) !important;
}

td,
th {
    color: var(--clr-light) !important;
}

.text-white {
    color: #ffffff !important;
}

.text-muted {
    color: var(--clr-subtle) !important;
}

.text-dim {
    color: var(--clr-muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-accent {
    color: var(--accent) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-info {
    color: var(--info) !important;
}

.fw-900 {
    font-weight: 900;
}

.fw-800 {
    font-weight: 800;
}

.fw-700 {
    font-weight: 700;
}

.fw-600 {
    font-weight: 600;
}

.bg-dim {
    background: rgba(255, 255, 255, 0.04);
}

/* ──────────────────────────────────────
   GLASS PANEL
────────────────────────────────────── */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ──────────────────────────────────────
   SIDEBAR
────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: var(--trans);
    overflow: hidden;
}

.sidebar-brand {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
    padding: 0 0.75rem;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-link {
    color: var(--clr-muted) !important;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: var(--trans);
    margin-bottom: 0.3rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--trans);
}

.nav-link:hover {
    color: var(--clr-light) !important;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link.active {
    color: var(--clr-white) !important;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(99, 102, 241, 0.14));
    border: 1px solid rgba(14, 165, 233, 0.25);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.15);
}

.nav-link.active::before {
    opacity: 1;
}

.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-section {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--clr-muted) !important;
    padding: 0.5rem 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ──────────────────────────────────────
   MAIN CONTENT
────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    padding: 2.5rem;
    transition: var(--trans);
    min-height: 100vh;
}

/* ──────────────────────────────────────
   STAT CARDS
────────────────────────────────────── */
.card-stat {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.75rem;
    transition: var(--trans);
    position: relative;
    overflow: hidden;
}

.card-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.card-stat:hover {
    transform: translateY(-4px);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(14, 165, 233, 0.15);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.3rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--clr-white) !important;
    letter-spacing: -1px;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--clr-muted) !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ──────────────────────────────────────
   TABLE
────────────────────────────────────── */
.table-container {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
}

.table {
    margin-bottom: 0;
    color: var(--clr-light) !important;
}

.table thead th {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
    color: var(--clr-muted) !important;
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    color: var(--clr-light) !important;
}

.table-hover tbody tr:hover>* {
    background: rgba(14, 165, 233, 0.07);
    color: var(--clr-white) !important;
}

/* ──────────────────────────────────────
   BADGES
────────────────────────────────────── */
.badge-premium {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ──────────────────────────────────────
   BUTTONS
────────────────────────────────────── */
.btn-premium {
    padding: 0.65rem 1.4rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--trans);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary-premium {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white !important;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
    color: white !important;
}

/* ──────────────────────────────────────
   CHAT BUBBLES
────────────────────────────────────── */
.chat-window {
    background: rgba(2, 6, 23, 0.5);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    height: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.msg-bubble {
    max-width: 78%;
    padding: 0.9rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    line-height: 1.65;
    animation: fadeInUp 0.3s ease-out;
}

.msg-lawan {
    background: rgba(30, 41, 59, 0.8);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--glass-border);
    color: var(--clr-light) !important;
}

.msg-user {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: white !important;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.msg-meta {
    font-size: 0.68rem;
    margin-top: 0.4rem;
    opacity: 0.6;
    text-align: right;
}

/* ──────────────────────────────────────
   FORMS
────────────────────────────────────── */
.form-label,
label {
    color: var(--clr-subtle) !important;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--clr-white) !important;
    border-radius: 12px !important;
    padding: 0.75rem 1rem !important;
    transition: var(--trans);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--clr-muted) !important;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px var(--primary-glow) !important;
    outline: none !important;
    background: rgba(15, 23, 42, 0.95) !important;
    color: var(--clr-white) !important;
}

.input-group-text {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--clr-muted) !important;
}

/* ──────────────────────────────────────
   SIDEBAR TOGGLE (MOBILE)
────────────────────────────────────── */
.sidebar-toggle {
    display: none;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--glass-border);
    color: white !important;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    font-size: 1.1rem;
}

/* ──────────────────────────────────────
   ANIMATIONS
────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 40px var(--primary-glow), 0 0 80px rgba(99, 102, 241, 0.2);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.stagger-in>* {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-in>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-in>*:nth-child(2) {
    animation-delay: 0.15s;
}

.stagger-in>*:nth-child(3) {
    animation-delay: 0.25s;
}

.stagger-in>*:nth-child(4) {
    animation-delay: 0.35s;
}

.stagger-in>*:nth-child(5) {
    animation-delay: 0.45s;
}

.stagger-in>*:nth-child(6) {
    animation-delay: 0.55s;
}

/* ──────────────────────────────────────
   ILLUSTRATION STYLES
────────────────────────────────────── */
.illus-float {
    animation: float 5s ease-in-out infinite;
}

.illus-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.illus-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(14, 165, 233, 0.25);
    animation: spin-slow 20s linear infinite;
}

.illus-ring.ring-1 {
    width: 160px;
    height: 160px;
    animation-duration: 15s;
}

.illus-ring.ring-2 {
    width: 220px;
    height: 220px;
    animation-direction: reverse;
    animation-duration: 22s;
}

.illus-ring.ring-3 {
    width: 280px;
    height: 280px;
    animation-duration: 30s;
}

/* ──────────────────────────────────────
   ALERT OVERRIDE
────────────────────────────────────── */
.alert {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--clr-light) !important;
    border-radius: 14px !important;
}

.alert-premium {
    background: rgba(14, 165, 233, 0.1) !important;
    border: 1px solid rgba(14, 165, 233, 0.3) !important;
    color: var(--info) !important;
}

/* ──────────────────────────────────────
   SCROLLBAR
────────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ──────────────────────────────────────
   RESPONSIVE
────────────────────────────────────── */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 4rem;
    }

    .sidebar-toggle {
        display: block;
    }
}