/* ==========================================================
   BLUE ROSE ARCHIVE — Pengeluaran Magang
   Art direction: poster anime gelap, mawar biru, tekstur manga.
   ========================================================== */

:root {
    /* Warna */
    --ink:         #05060B;   /* hitam tinta, dasar */
    --ink-soft:    #080B16;
    --panel:       #0A0F1E;   /* permukaan panel */
    --panel-2:     #0D1428;
    --line:        #1B2540;   /* garis pembatas */
    --line-hot:    #234A8F;

    --rose:        #2D6BF0;   /* biru mawar utama */
    --rose-bright: #5CBBFF;   /* kilau cyan */
    --rose-deep:   #102A63;
    --bruise:      #E8409B;   /* aksen pink lebam */

    --bone:        #EAF0FF;   /* teks utama */
    --muted:       #8A98B8;   /* teks sekunder */
    --danger:      #FF4D5E;

    /* Tipografi */
    --font-display: 'Dela Gothic One', 'Zen Kaku Gothic New', sans-serif;
    --font-body:    'Zen Kaku Gothic New', 'Segoe UI', sans-serif;

    /* Bentuk */
    --notch: 16px;
    --notch-sm: 10px;
    --glow: 0 0 24px rgba(92, 187, 255, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background-color: var(--ink);
    color: var(--bone);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Cahaya panggung: dua sorot biru dan satu pink */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(70vw 60vh at 12% 8%,  rgba(45, 107, 240, 0.22), transparent 70%),
        radial-gradient(60vw 55vh at 92% 92%, rgba(232, 64, 155, 0.14), transparent 70%),
        radial-gradient(90vw 80vh at 50% 50%, rgba(8, 12, 26, 0.55), var(--ink) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- TEKSTUR HALFTONE MANGA ---------- */
.fx-halftone {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(92, 187, 255, 0.13) 1px, transparent 1.4px);
    background-size: 7px 7px;
    mask-image: radial-gradient(120vw 90vh at 85% 15%, #000 0%, transparent 68%);
    -webkit-mask-image: radial-gradient(120vw 90vh at 85% 15%, #000 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- GARIS KECEPATAN ALA MANGA ---------- */
.fx-speedlines {
    position: fixed;
    inset: -20%;
    background-image: repeating-linear-gradient(
        74deg,
        rgba(92, 187, 255, 0.10) 0px,
        rgba(92, 187, 255, 0.10) 1px,
        transparent 1px,
        transparent 26px
    );
    mask-image: radial-gradient(60vw 70vh at 3% 55%, #000 0%, transparent 62%);
    -webkit-mask-image: radial-gradient(60vw 70vh at 3% 55%, #000 0%, transparent 62%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- KELOPAK MAWAR BERJATUHAN ---------- */
.petals-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    overflow: hidden;
}

.blue-petal {
    position: absolute;
    background: linear-gradient(140deg, #BFE6FF 0%, var(--rose-bright) 30%, var(--rose) 62%, #0E2352 100%);
    border-radius: 100% 6% 100% 6%;
    box-shadow: 0 0 10px rgba(92, 187, 255, 0.55);
    animation: fallPetal linear infinite;
}

@keyframes fallPetal {
    0%   { transform: translateY(-12vh) translateX(0)     rotate(0deg)   scale(1);    opacity: 0; }
    14%  { opacity: 0.7; }
    50%  { transform: translateY(48vh)  translateX(78px)  rotate(220deg) scale(0.9);  opacity: 0.5; }
    100% { transform: translateY(112vh) translateX(-68px) rotate(430deg) scale(0.75); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .blue-petal { display: none; }
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.hidden { display: none !important; }

/* ---------- ELEMEN TIPOGRAFI BERSAMA ---------- */
.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--rose-bright);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.tick {
    display: inline-block;
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, var(--rose-bright), transparent);
}

.num { font-weight: 700; font-variant-numeric: tabular-nums; }
.num-blue { color: var(--rose-bright); }
.num-pink { color: var(--bruise); }

.prose { font-size: 14px; color: var(--muted); line-height: 1.75; }
.prose b, .prose strong { color: var(--bone); }

/* ==========================================================
   HALAMAN LOGIN — POSTER DUA PANEL
   ========================================================== */
.login-wrapper {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.login-stage {
    position: relative;
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    width: 100%;
    max-width: 880px;
    background: var(--panel);
    border: 1px solid var(--line-hot);
    clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.85), 0 0 70px rgba(45, 107, 240, 0.2);
}

/* --- Sisi poster --- */
.login-art {
    position: relative;
    min-height: 460px;
    overflow: hidden;
    background: #03040A;
    display: flex;
    align-items: flex-end;
}

.login-art-img {
    position: absolute;
    inset: 0;
    background-image: url('assets/rose-bg.jpg');
    background-size: cover;
    background-position: 62% center;
}

.login-art-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(3, 4, 10, 0.55) 0%, transparent 35%, rgba(3, 4, 10, 0.9) 100%);
}

.login-art-copy {
    position: relative;
    padding: 28px;
    z-index: 2;
}

.jp-vert {
    font-size: 12px;
    letter-spacing: 0.5em;
    color: var(--rose-bright);
    margin-bottom: 12px;
    opacity: 0.9;
}

.art-title {
    font-family: var(--font-display);
    font-size: clamp(34px, 4.6vw, 52px);
    line-height: 0.92;
    letter-spacing: -0.01em;
    color: #fff;
    text-shadow: 0 0 30px rgba(92, 187, 255, 0.55), 0 6px 0 rgba(16, 42, 99, 0.9);
}

.art-sub {
    margin-top: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Sudut kurung ala HUD anime */
.corner {
    position: absolute;
    width: 26px;
    height: 26px;
    z-index: 3;
    pointer-events: none;
}
.corner.tl { top: 12px; left: 12px; border-top: 2px solid var(--rose-bright); border-left: 2px solid var(--rose-bright); }
.corner.br { bottom: 12px; right: 12px; border-bottom: 2px solid var(--bruise); border-right: 2px solid var(--bruise); }

/* --- Sisi form --- */
.login-card {
    position: relative;
    padding: 44px 40px;
    background: linear-gradient(160deg, var(--panel-2), var(--panel) 60%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rose-mark {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 200px;
    height: 200px;
    background: url('assets/rose-emblem.png') center/contain no-repeat;
    opacity: 0.09;
    pointer-events: none;
}

.login-card h2 {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 10px;
}

.login-card .lead {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 26px;
    max-width: 34ch;
}

.login-card label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.login-card input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 20px;
    background: #04060E;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-hot);
    color: var(--bone);
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.login-card input::placeholder { color: #4A5878; }

.login-card input:focus {
    border-color: var(--rose);
    border-left-color: var(--rose-bright);
    box-shadow: var(--glow);
}

#loginError {
    color: var(--danger);
    font-size: 13px;
    margin-top: 14px;
    text-align: center;
    display: none;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ---------- TOMBOL "BILAH" ---------- */
.btn-blade {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #03050C;
    background: linear-gradient(120deg, var(--rose-bright) 0%, var(--rose) 55%, #1B4FC4 100%);
    border: none;
    padding: 15px 26px;
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
    box-shadow: 0 0 26px rgba(45, 107, 240, 0.45);
    transition: filter 0.25s, transform 0.25s, box-shadow 0.25s;
    width: 100%;
}

.btn-blade:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(92, 187, 255, 0.7);
}

.btn-blade:active { transform: translateY(0); }

/* ==========================================================
   TATA LETAK APLIKASI
   ========================================================== */
.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
    width: 268px;
    min-width: 268px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, rgba(10, 15, 30, 0.97), rgba(5, 6, 11, 0.97));
    border-right: 1px solid var(--line);
    box-shadow: 14px 0 45px rgba(0, 0, 0, 0.7);
}

/* Garis cahaya di tepi sidebar */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: -1px;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--rose) 35%, var(--bruise) 75%, transparent);
    opacity: 0.7;
}

.brand {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(120deg, rgba(45, 107, 240, 0.18), transparent 75%);
}

.brand-mark {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: url('assets/rose-emblem.png') center/contain no-repeat;
    filter: drop-shadow(0 0 10px rgba(92, 187, 255, 0.7));
}

/* Cahaya lembut yang berdenyut di belakang emblem — gambarnya sendiri diam,
   jadi tidak ada getaran sub-pixel seperti saat memakai rotate/scale. */
.brand-mark::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(92, 187, 255, 0.45) 0%, rgba(45, 107, 240, 0.15) 45%, transparent 70%);
    opacity: 0.35;
    animation: roseGlow 4.5s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes roseGlow {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-mark::after { animation: none; }
}

.brand-text b {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 0.01em;
    color: #fff;
    line-height: 1.2;
}

.brand-text span {
    display: block;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--rose-bright);
    margin-top: 3px;
}

.sidebar nav {
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-legend {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #4A5878;
    padding: 0 8px 8px;
}

.nav {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    background: transparent;
    border: 1px solid transparent;
    border-left: 3px solid var(--line);
    text-align: left;
    padding: 12px 16px;
    font-family: var(--font-body);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.nav-jp {
    font-size: 9px;
    letter-spacing: 0.3em;
    color: #4A5878;
    transition: color 0.28s;
}

.nav-id {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.nav:hover {
    background: rgba(45, 107, 240, 0.1);
    color: var(--bone);
    border-left-color: var(--rose);
}

.nav.active {
    background: linear-gradient(90deg, rgba(45, 107, 240, 0.28), rgba(45, 107, 240, 0.02));
    color: #fff;
    border-left-color: var(--rose-bright);
    box-shadow: inset 0 0 30px rgba(45, 107, 240, 0.18);
}

.nav.active .nav-jp { color: var(--rose-bright); }

.sidebar-foot {
    margin-top: auto;
    padding: 18px 16px 22px;
    border-top: 1px solid var(--line);
}

.sidebar-note {
    font-size: 11px;
    color: #4A5878;
    margin-bottom: 12px;
    line-height: 1.5;
}

.btn-logout {
    width: 100%;
    padding: 12px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bruise);
    background: transparent;
    border: 1px solid rgba(232, 64, 155, 0.45);
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
    transition: all 0.25s;
}

.btn-logout:hover {
    background: rgba(232, 64, 155, 0.16);
    color: #fff;
    border-color: var(--bruise);
    box-shadow: 0 0 22px rgba(232, 64, 155, 0.35);
}

/* ---------- KONTEN UTAMA ---------- */
.main {
    flex: 1;
    min-width: 0;
    padding: 38px 40px 60px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 34px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    position: relative;
}

.topbar::after {
    content: '';
    position: absolute;
    left: 0; bottom: -1px;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--rose-bright), transparent);
}

.topbar-title { min-width: 0; }

.topbar h1 {
    font-family: var(--font-display);
    font-size: clamp(26px, 3.2vw, 40px);
    line-height: 1.05;
    color: #fff;
    letter-spacing: -0.01em;
    text-shadow: 0 0 34px rgba(92, 187, 255, 0.35);
}

.topbar .btn-blade { width: auto; white-space: nowrap; }

/* ---------- KARTU STATISTIK ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.card {
    position: relative;
    overflow: hidden;
    padding: 24px 26px 26px;
    background: linear-gradient(150deg, var(--panel-2), rgba(6, 9, 20, 0.92));
    border: 1px solid var(--line);
    clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch)));
    transition: border-color 0.3s, transform 0.3s;
}

.card:hover { border-color: var(--line-hot); transform: translateY(-3px); }

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--rose-bright), var(--rose), transparent);
}

.card-alt::before { background: linear-gradient(90deg, var(--bruise), #8B2E6B, transparent); }

.card span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.card strong {
    display: block;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 900;
    line-height: 1.1;
    color: var(--rose-bright);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    text-shadow: 0 0 26px rgba(92, 187, 255, 0.45);
}

.card-alt strong { color: var(--bruise); text-shadow: 0 0 26px rgba(232, 64, 155, 0.4); }

/* Kanji besar sebagai cap latar */
.card-jp {
    position: absolute;
    right: 14px;
    bottom: -6px;
    font-size: 58px;
    font-weight: 900;
    font-style: normal;
    line-height: 1;
    color: rgba(92, 187, 255, 0.07);
    pointer-events: none;
    user-select: none;
}

.card-alt .card-jp { color: rgba(232, 64, 155, 0.08); }

/* ---------- PANEL ---------- */
.grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.panel {
    position: relative;
    padding: 24px 26px 28px;
    background: linear-gradient(165deg, rgba(13, 20, 40, 0.92), rgba(6, 9, 20, 0.92));
    border: 1px solid var(--line);
    clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch)));
    min-width: 0;
    transition: border-color 0.3s;
}

.panel:hover { border-color: var(--line-hot); }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    padding-left: 14px;
    position: relative;
}

/* Bilah biru di kiri judul panel */
.panel-head::before {
    content: '';
    position: absolute;
    left: 0; top: 2px;
    width: 4px;
    height: calc(100% - 4px);
    background: linear-gradient(180deg, var(--rose-bright), var(--rose-deep));
    box-shadow: 0 0 12px rgba(92, 187, 255, 0.6);
}

.panel-head h2 {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.01em;
    color: #fff;
    line-height: 1.3;
}

.panel-head p {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* ---------- GRAFIK BATANG ---------- */
.chart {
    height: 210px;
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
}

.chart-bars {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: flex-end;
    gap: 14px;
    padding-top: 18px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.chart-bar-wrap {
    flex: 1;
    min-width: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 44px;
    background: linear-gradient(180deg, var(--rose-bright), var(--rose) 45%, #0E2A66 100%);
    clip-path: polygon(0 8px, 8px 0, 100% 0, 100% 100%, 0 100%);
    box-shadow: 0 0 18px rgba(92, 187, 255, 0.5);
    transition: filter 0.3s, box-shadow 0.3s;
}

.chart-bar-alt {
    background: linear-gradient(180deg, #FF8AC4, var(--bruise) 45%, #6E1C48 100%);
    box-shadow: 0 0 18px rgba(232, 64, 155, 0.5);
}

.chart-bar:hover {
    filter: brightness(1.35);
    box-shadow: 0 0 32px rgba(92, 187, 255, 0.95);
}

.chart-bar-alt:hover { box-shadow: 0 0 32px rgba(232, 64, 155, 0.95); }

/* ---------- SOROTAN PENGELUARAN TERBESAR ---------- */
.spotlight {
    position: relative;
    padding: 22px 22px 20px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(45, 107, 240, 0.22), transparent 60%),
        rgba(4, 6, 14, 0.7);
    border: 1px solid var(--line);
    border-left: 3px solid var(--bruise);
    overflow: hidden;
}

.spotlight-jp {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4em;
    color: var(--bruise);
    margin-bottom: 10px;
}

.spotlight-title {
    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
    color: #fff;
    overflow-wrap: anywhere;
}

.spotlight-amount {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.2;
    color: var(--rose-bright);
    font-variant-numeric: tabular-nums;
    margin: 6px 0 18px;
    overflow-wrap: anywhere;
    text-shadow: 0 0 24px rgba(92, 187, 255, 0.45);
}

.spotlight-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 18px;
    font-size: 13px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.spotlight-meta dt {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    align-self: center;
    white-space: nowrap;
}

.spotlight-meta dd { color: #C6D2EC; overflow-wrap: anywhere; }

.chart-bar-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-top: 10px;
}

/* ---------- TABEL ---------- */
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    background: rgba(4, 6, 14, 0.6);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
    min-width: 460px;
}

th, td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

th {
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rose-bright);
    background: linear-gradient(180deg, rgba(18, 42, 99, 0.55), rgba(4, 6, 14, 0.9));
    border-bottom: 1px solid var(--line-hot);
    position: sticky;
    top: 0;
}

td { color: #C6D2EC; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(45, 107, 240, 0.1); color: #fff; }

/* ---------- FIELD & FILTER ---------- */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

select, .filters input {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--bone);
    background: #04060E;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-hot);
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

select {
    width: 240px;
    max-width: 100%;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--rose-bright) 50%), linear-gradient(135deg, var(--rose-bright) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

select:focus, .filters input:focus {
    border-color: var(--rose);
    border-left-color: var(--rose-bright);
    box-shadow: var(--glow);
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filters input { flex: 1; min-width: 200px; }
.filters input::placeholder { color: #4A5878; }

button.ghost {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--line-hot);
    padding: 12px 22px;
    color: var(--muted);
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
    transition: all 0.25s;
}

button.ghost:hover {
    background: rgba(45, 107, 240, 0.15);
    color: var(--rose-bright);
    border-color: var(--rose);
    box-shadow: 0 0 20px rgba(45, 107, 240, 0.3);
}

/* ---------- MODAL ---------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 10, 0.88);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    overflow-y: auto;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 32px 34px 34px;
    background: linear-gradient(160deg, var(--panel-2), var(--ink-soft) 70%);
    border: 1px solid var(--line-hot);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.85), 0 0 60px rgba(45, 107, 240, 0.2);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 26px;
}

.modal-head h2 {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.15;
    color: #fff;
}

.close {
    background: none;
    border: 1px solid var(--line);
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.25s;
}

.close:hover { color: #fff; border-color: var(--bruise); background: rgba(232, 64, 155, 0.16); }

.modal form label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 18px;
    color: var(--muted);
}

.modal form input {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 13px 14px;
    font-family: var(--font-body);
    font-size: 15px;
    letter-spacing: normal;
    text-transform: none;
    color: var(--bone);
    background: #04060E;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-hot);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.modal form input::placeholder { color: #4A5878; }

.modal form input:focus {
    border-color: var(--rose);
    border-left-color: var(--rose-bright);
    box-shadow: var(--glow);
}

.modal form .two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
    gap: 16px;
}

button.full { width: 100%; margin-top: 10px; }

/* ---------- TOAST ---------- */
.toast {
    position: fixed;
    bottom: 26px;
    right: 26px;
    max-width: min(92vw, 420px);
    padding: 15px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #EAF6FF;
    background: linear-gradient(120deg, rgba(16, 42, 99, 0.97), rgba(6, 9, 20, 0.97));
    border: 1px solid var(--rose);
    border-left: 4px solid var(--rose-bright);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(45, 107, 240, 0.35);
    z-index: 200;
    animation: toastIn 0.35s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(26px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ==========================================================
   RESPONSIVE — TABLET
   ========================================================== */
@media (max-width: 1080px) {
    .main { padding: 30px 26px 52px; }
    .grid-two { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================
   RESPONSIVE — HP
   ========================================================== */
@media (max-width: 860px) {
    .login-wrapper { padding: 14px; align-items: flex-start; }

    .login-stage {
        grid-template-columns: minmax(0, 1fr);
        max-width: 460px;
        margin: auto;
        clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
    }

    .login-art { min-height: 210px; }
    .login-art-img { background-position: 70% 38%; }
    .login-art-copy { padding: 20px; }
    .art-title { font-size: 40px; }
    .login-card { padding: 30px 22px 34px; }
    .login-card h2 { font-size: 25px; }
    .rose-mark { width: 150px; height: 150px; top: -24px; right: -24px; }
    .corner.br { display: none; }
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }

    /* Sidebar jadi bilah atas yang ringkas: merek + logout sebaris, tab di bawahnya */
    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        position: sticky;
        top: 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--line-hot);
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75);
        z-index: 30;
        background: #070B15;
    }

    .sidebar::after {
        top: auto; right: auto;
        bottom: -1px; left: 0;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, var(--rose) 0%, var(--bruise) 60%, transparent);
    }

    .brand {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        padding: 10px 14px;
        border-bottom: none;
    }

    .brand-text { min-width: 0; }

    .brand-mark { width: 34px; height: 34px; min-width: 34px; }
    .brand-text b { font-size: 14px; }
    .brand-text span { font-size: 9px; letter-spacing: 0.18em; }

    .sidebar nav {
        order: 3;
        width: 100%;
        padding: 8px 10px 9px;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        border-top: 1px solid var(--line);
        background: rgba(4, 6, 14, 0.6);
    }

    .sidebar nav::-webkit-scrollbar { display: none; }
    .nav-legend { display: none; }

    .nav {
        flex: 1 0 auto;
        min-width: 140px;
        align-items: center;
        text-align: center;
        padding: 9px 12px;
        border-left: none;
        border-bottom: 3px solid var(--line);
        clip-path: none;
    }

    .nav-id { font-size: 13px; }
    .nav-jp { font-size: 8px; }

    .nav:hover, .nav.active {
        border-left: none;
        border-bottom-color: var(--rose-bright);
    }

    .sidebar-foot {
        order: 2;
        margin-top: 0;
        width: auto;
        flex: 0 0 auto;
        padding: 10px 12px;
        border-top: none;
    }

    .sidebar-note { display: none; }

    .btn-logout {
        width: auto;
        min-height: 38px;
        padding: 9px 18px;
        font-size: 10.5px;
        white-space: nowrap;
    }

    /* Konten */
    .main { padding: 18px 14px 44px; min-width: 0; }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 22px;
        padding-bottom: 18px;
    }

    .topbar h1 { font-size: 30px; overflow-wrap: anywhere; }
    .topbar .btn-blade { width: 100%; }

    .cards, .grid-two {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        margin-bottom: 14px;
    }

    .card { padding: 20px 20px 22px; }
    .card-jp { font-size: 46px; right: 10px; }

    .panel {
        padding: 18px 16px 22px;
        --notch: 12px;
    }

    .panel-head { margin-bottom: 16px; padding-left: 12px; }
    .panel-head h2 { font-size: 16px; }

    .spotlight { padding: 18px 16px; }
    .spotlight-meta { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .spotlight-meta dt { margin-top: 8px; }

    .chart { height: 185px; }
    .chart-bars { gap: 10px; }
    .chart-bar-wrap { min-width: 30px; }

    table { min-width: 580px; }
    th, td { padding: 11px 13px; }

    .field label { margin-bottom: 6px; }
    select { width: 100%; }

    .filters { flex-direction: column; gap: 10px; }
    .filters input { width: 100%; min-width: 0; }
    button.ghost { width: 100%; }

    .modal { padding: 12px; }

    .modal-card {
        max-width: none;
        max-height: calc(100vh - 24px);
        padding: 22px 18px 26px;
        clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
    }

    .modal-head { margin-bottom: 20px; }
    .modal-head h2 { font-size: 21px; }
    .modal form .two { grid-template-columns: minmax(0, 1fr); }

    .toast {
        left: 12px; right: 12px; bottom: 12px;
        max-width: none;
        text-align: center;
    }

    /* Tekstur dikurangi supaya hemat dan tidak berisik di layar kecil */
    .fx-speedlines { display: none; }
}

@media (max-width: 420px) {
    .main { padding: 14px 11px 40px; }
    .topbar h1 { font-size: 26px; }
    .card { padding: 17px; }
    .card strong { font-size: 27px; }
    .card-jp { font-size: 38px; }
    .panel { padding: 16px 13px 20px; }
    .nav { min-width: 128px; }
    .art-title { font-size: 34px; }
    .login-card { padding: 26px 18px 30px; }
    .login-card h2 { font-size: 22px; }
}
