/* Reset dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Jost', sans-serif;
}

:root {
    --bg-color: #1a1a2e;
    /* Dark Blue */
    --panel-bg: rgba(255, 255, 255, 0.05);
    --gold: #d4af37;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --glass: rgba(255, 255, 255, 0.05);
}

/* PEMILIH TAMPILAN */
.view-opt {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    color: #fff;
}

.view-opt span {
    font-size: 0.8rem;
    margin-top: 5px;
}

.view-opt.active {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
}

body.auth-body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Container pembungkus untuk halaman login mewah */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
    padding: 20px;
    gap: 80px;
    z-index: 2;
}

.auth-brand-side {
    max-width: 450px;
}

.auth-brand-side .brand-slogan {
    font-size: 3rem;
    line-height: 1.2;
    margin-top: 15px;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 300;
}

.auth-brand-side .brand-slogan strong {
    font-weight: 600;
    color: var(--gold);
}

.auth-brand-side .brand-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Responsif untuk Halaman Login Mewah */
@media (max-width: 900px) {
    .auth-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .auth-brand-side {
        max-width: 100%;
    }

    .auth-brand-side .brand {
        justify-content: center !important;
    }

    .auth-brand-side .brand-slogan {
        font-size: 2.2rem;
    }
}

/* Glassmorphism Panel Umum */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 2.5rem;
}

/* Khusus Kotak di Halaman Login */
.auth-container.glass-panel {
    width: 420px;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

/* Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
    font-weight: 600;
}

/* Form Styles */
.auth-form {
    display: none;
    animation: fadeIn 0.4s;
}

.auth-form.active {
    display: block;
}

h2 {
    color: var(--gold);
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
    /* Penting untuk posisi icon mata */
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    padding-right: 45px;
    /* Kasih ruang buat icon mata di kanan */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--gold);
    background: rgba(0, 0, 0, 0.4);
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    /* Penyesuaian presisi di tengah vertikal */
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toggle-password:hover {
    color: var(--gold);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: 0.3s;
}

/* Sembunyikan salah satu path saat kondisi tertentu */
.toggle-password.active .eye-closed {
    display: block;
}

.toggle-password.active .eye-open {
    display: none;
}

.toggle-password:not(.active) .eye-closed {
    display: none;
}

.toggle-password:not(.active) .eye-open {
    display: block;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary {
    background: var(--gold);
    color: #000;
}

.btn-primary:hover {
    background: #e6c855;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* Alerts */
.alert {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-align: center;
}

.alert.hidden {
    display: none;
}

.alert-success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.alert-error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Landscape Enforcer for Mobile */
.landscape-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1a2e;
    color: #d4af37;
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    pointer-events: none;
    /* Biar tidak menghalangi klik kalau lagi sembunyi */
}

.landscape-warning.active {
    display: flex;
    pointer-events: all;
}

.landscape-warning .phone-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: rotatePhone 2s infinite ease-in-out;
}

@keyframes rotatePhone {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(90deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@media screen and (max-width: 992px) and (orientation: portrait) {

    /* MATIKAN PAKSAAN LANDSCAPE: Sekarang bebas putar HP portrait / berdiri normal! */
    .landscape-warning {
        display: none !important;
    }
}

/* =========================================================
   TAMPILAN KHUSUS HP PADA DASHBOARD (LAYAR PENUH 100%)
   ========================================================= */

body.dash-body.mobile-layout {
    background-color: var(--bg-color); /* Kembali ke warna asli, hilangkan warna margin meja */
    display: block; /* Hilangkan flex-center yang menyebabkan gap sisi kiri-kanan */
}

.mobile-layout .dash-layout {
    display: flex;
    flex-direction: column;
    width: 100% !important; /* Gunakan 100% agar aman ukuran padding bawaan */
    max-width: 100% !important;
    position: relative;
    overflow-x: hidden;
    height: 100% !important; /* Kunci permanen ke batas tertinggi browser aslinya */
    box-shadow: none !important; /* Hapus bayangan palsu simulator */
}

.mobile-layout .sidebar {
    width: 100% !important; /* Aman masuk bingkai edge HP */
    max-width: 100% !important;
    height: 75px; /* Sedikit dilonggarkan vertikalnya */
    padding: 5px 0;
    display: flex;
    flex-direction: row;
    position: fixed;
    bottom: 0;
    left: 0 !important;
    transform: none !important; /* Kembalikan ke ujung normal */
    z-index: 9999;
    background: rgba(15, 15, 30, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    border-right: none;
}

/* Hilangkan fungsi khusus PC yang menyusutkan UI karena mengganggu di tablet/chrome mode desktop */


.mobile-layout .brand,
.mobile-layout .user-profile,
.mobile-layout .btn-logout,
.mobile-layout .nav-item span:not(.icon) {
    display: none;
}

.mobile-layout .side-nav {
    flex-direction: row;
    width: 100%;
    height: 100%;
    justify-content: space-around;
    gap: 0;
}

.mobile-layout .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2px;
    gap: 3px;
    border-radius: 0;
    font-size: 0.6rem; /* DIKECILKAN agar muat dan tidak nabrak border bawah */
    line-height: 1.1;
    text-align: center;
    white-space: normal;
}

.mobile-layout .nav-item.active {
    border-left: none;
    border-bottom: 3px solid var(--gold);
    background: transparent;
}

.mobile-layout .nav-item .icon {
    font-size: 1.35rem; /* Icon dikecilkan agar tak kebesaran memakan ruang teks */
    margin: 0;
}

.mobile-layout .main-content {
    padding: 10px;
    padding-bottom: 90px;
    /* height: 100vh; dihapus agar scroll responsif dan flexbox-nya (flex:1) mengambil alih proporsinya */
}

.mobile-layout .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mobile-layout .stat-card {
    padding: 15px 10px;
    text-align: center;
}

.mobile-layout .stat-number {
    font-size: 1.4rem;
}

/* Tabel di HP: Pakai Scroll Horizontal paksa agar tidak hancur */
.mobile-layout .table-wrapper {
    overflow-x: auto;
    max-height: 500px;
}

.mobile-layout .luxury-table {
    min-width: 600px;
}

.mobile-layout .luxury-table td,
.mobile-layout .luxury-table th {
    padding: 8px !important;
    font-size: 0.75rem;
}

.mobile-layout form {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}

/* =========================================================
   BAGIAN 2: DESAIN DASHBOARD EKSKLUSIF (TIDAK NORAK)
   ========================================================= */

html {
    height: 100%;
    margin: 0; padding: 0;
    overflow: hidden !important; 
    overscroll-behavior-y: none; /* Mencegah layar tertarik berlebih (karet) di HP */
}

body.dash-body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden !important;
    height: 100%;
    margin: 0; padding: 0;
}

/* Base Layout (Grid/Flex) */
.dash-layout {
    display: flex;
    height: 100% !important; 
    max-height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Efek Cahaya Halus di Latar Belakang (Lux) */
.luxury-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, rgba(26, 26, 46, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.luxury-bg-glow.top-left {
    top: -200px;
    left: -200px;
}

.luxury-bg-glow.bottom-right {
    bottom: -200px;
    right: -200px;
}

/* === SIDEBAR KIRI === */
.sidebar {
    width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 15, 30, 0.8);
    border-radius: 0;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.brand h2 {
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.gold-dot {
    width: 12px;
    height: 12px;
    background-color: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* Profil Identitas Sidebar */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 1), rgba(153, 122, 21, 1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
}

.greeting {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.text-gold {
    color: var(--gold);
}

/* Navigasi / Menu Tombol Sidebar */
.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    transition: 0.3s ease;
}

.nav-item .icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    transform: translateX(5px);
}

.nav-item.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
}

.nav-item.active .icon {
    opacity: 1;
}

.btn-logout {
    margin-top: auto;
    background: rgba(255, 50, 50, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 50, 50, 0.2);
}

.btn-logout:hover {
    background: rgba(255, 50, 50, 0.2);
    box-shadow: none;
}

.mt-auto {
    margin-top: auto;
}

/* === KONTEN UTAMA KANAN === */
.main-content {
    flex: 1 1 0; /* Shrink to fit, grow safely! KUNCI UTAMA LAYOUT APLIKASI KOKOH */
    min-height: 0 !important; /* MENGHENTIKAN BOCORNYA TINGGI KONTEN MELEWATI LAYAR BATAS BAWAH */
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.5rem;
    padding-top: 40px;
    /* Jarak aman biar bagian atas tidak kepentok/sulit diklik */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Kelancaran scroll ala HP */
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
}

/* Custom Scrollbar untuk Konten Utama (Biar Enak Scroll Atas-Bawah) */
.main-content::-webkit-scrollbar {
    width: 10px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 10px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Top Bar (Tanggal & Sinyal) */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
    position: relative;
    z-index: 10;
    /* Pastikan selalu di atas biar bisa diklik */
}

.date-display {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2ecc71;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 10px #2ecc71;
    animation: pulseGlow 2s infinite;
}

/* Struktur Halaman Konten (View Switcher) */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.content-section.active {
    display: block;
}

.section-title {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Grid Kartu Overview */
.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    padding: 1.5rem 2rem;
    border-top: 3px solid transparent;
    transition: 0.3s;
}

.stat-card:hover {
    border-top: 3px solid var(--gold);
    transform: translateY(-5px);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.5rem;
    color: #fff;
    font-weight: 600;
}

.stat-number small {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.welcome-banner {
    position: relative;
    padding: 2rem 3rem;
}

.luxury-accent.top-left-small {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 30px;
    height: 30px;
    border-top: 2px solid var(--gold);
    border-left: 2px solid var(--gold);
    border-top-left-radius: 12px;
}

/* Tabel Elegan (Dengan Mode Scroll Bebas yang Memanjang Penuh ke Bawah!) */
.table-wrapper {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    
    /* FIX: Kotak tabel dibuat mengalir elastis (Fluid) mentok sampai ke dasar bilah bawah HP */
    flex: 1; 
    max-height: none; /* Dihapus agar tidak ada space gelap tersisa di bawahnya */
    min-height: 250px;
    display: flex;
    flex-direction: column;
    
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom Scrollbar Khusus agar terlihat jelas */
.table-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.8);
}

.luxury-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.luxury-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.luxury-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    padding: 15px 25px;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.luxury-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #eee;
    font-size: 0.85rem;
    /* Mengecilkan teks agar lebih compact (kecil) sesuai request */
}

/* Konsistensi Lebar Kolam Tabel (Lebih Padat agar tidak side-scroll) */
.luxury-table th:first-child,
.luxury-table td:first-child {
    width: 140px;
}

.luxury-table th,
.luxury-table td {
    padding: 6px 12px !important;
}

.luxury-table th:last-child,
.luxury-table td:last-child {
    width: 150px;
    text-align: center;
}

.luxury-table tr:hover td {
    background: rgba(212, 175, 55, 0.03);
}

.text-center {
    text-align: center;
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(46, 204, 113, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}