/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;400;600;700&display=swap');

:root {
    --color-dark: #000E3B;
    --color-navy: #001454;
    --color-lime: #D5E000;
    --color-cyan: #36AAE1;
    --color-white: #F8FAFC;
    --color-slate: #94A3B8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Titillium Web', sans-serif;
}

body {
    background-color: var(--color-white);
    color: var(--color-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   HEADER & NAVBAR
========================================= */
.main-header {
    background: linear-gradient(135deg, var(--color-dark), var(--color-navy));
    box-shadow: 0 4px 20px rgba(0, 14, 59, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-container img { height: 50px; transition: transform 0.3s; }
.logo-container img:hover { transform: scale(1.05); }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links li a {
    color: var(--color-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s, text-shadow 0.3s;
}
.nav-links li a:hover {
    color: var(--color-cyan);
    text-shadow: 0 0 10px rgba(54, 170, 225, 0.5);
}

.btn-login {
    background-color: var(--color-lime);
    color: var(--color-dark) !important;
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(213, 224, 0, 0.3);
}
.btn-login:hover { background-color: #e5f000; transform: translateY(-2px); }

/* Stats Bar */
.stats-bar {
    background-color: var(--color-cyan);
    color: var(--color-white);
    text-align: center;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: inset 0 -3px 10px rgba(0,0,0,0.1);
}

/* =========================================
   LAYOUT DASHBOARD & SIDEBAR TOGGLE
========================================= */
.dashboard-wrapper {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 260px;
    background: var(--color-navy);
    color: var(--color-white);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: width 0.3s ease;
    overflow-x: hidden;
    white-space: nowrap; /* Mencegah teks turun */
    display: flex;
    flex-direction: column;
}

/* State Sidebar saat ditutup */
.sidebar.collapsed {
    width: 80px;
}

/* Container untuk tombol toggle */
.sidebar-toggle-container {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.sidebar.collapsed .sidebar-toggle-container {
    justify-content: center;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    color: var(--color-slate);
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-toggle-sidebar:hover { color: var(--color-lime); }

/* Menu List Sidebar */
.sidebar-menu { list-style: none; }
.sidebar-menu li a {
    color: var(--color-slate);
    text-decoration: none;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.3s;
    border-left: 4px solid transparent;
}
.sidebar-menu li a:hover, .sidebar-menu li a.active {
    color: var(--color-lime);
    background: rgba(255,255,255,0.05);
    border-left-color: var(--color-lime);
}

/* Penyesuaian Menu saat sidebar ditutup */
.sidebar.collapsed .sidebar-menu li a {
    padding: 1rem;
    justify-content: center;
}
.sidebar.collapsed .sidebar-menu li a .text-menu {
    display: none; /* Sembunyikan teks */
}

/* =========================================
   KONTEN UTAMA & STATS CARDS
========================================= */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    background-color: var(--color-white);
    overflow-x: auto; /* Mencegah tabel keluar batas */
}

.dashboard-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-slate);
    padding-bottom: 1rem;
}
.dashboard-header h1 { color: var(--color-dark); font-weight: 700; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(54, 170, 225, 0.15);
    border-color: var(--color-cyan);
}
.stat-icon {
    background: var(--color-cyan);
    color: white;
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}
.stat-card:nth-child(even) .stat-icon { background: var(--color-lime); color: var(--color-dark); }
.stat-info h3 { font-size: 0.9rem; color: var(--color-slate); text-transform: uppercase; letter-spacing: 1px; }
.stat-info p { font-size: 1.8rem; font-weight: 700; color: var(--color-dark); }

/* =========================================
   FORMS & LOGIN
========================================= */
.auth-container { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-box {
    background: white; padding: 3rem; border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 14, 59, 0.1);
    width: 100%; max-width: 400px;
    border-top: 5px solid var(--color-cyan);
}
.login-box h2 { text-align: center; margin-bottom: 2rem; color: var(--color-navy); }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--color-dark); font-weight: 600; }
.form-control {
    width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--color-slate);
    border-radius: 8px; font-size: 1rem; transition: border-color 0.3s;
}
.form-control:focus { outline: none; border-color: var(--color-cyan); box-shadow: 0 0 0 3px rgba(54, 170, 225, 0.2); }
.btn-submit {
    width: 100%; padding: 1rem; background: var(--color-dark); color: var(--color-lime);
    border: none; border-radius: 8px; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; transition: background 0.3s;
}
.btn-submit:hover { background: var(--color-navy); }
.alert { padding: 1rem; background-color: #fee2e2; color: #b91c1c; border-radius: 8px; margin-bottom: 1.5rem; text-align: center; }

/* =========================================
   FOOTER
========================================= */
.main-footer { background-color: var(--color-dark); color: var(--color-white); padding: 3rem 5% 1rem; margin-top: auto; }
.footer-content { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; max-width: 1400px; margin: 0 auto 2rem; }
.footer-col { flex: 1; min-width: 250px; }
.footer-col h3 { color: var(--color-lime); margin-bottom: 1.2rem; font-size: 1.3rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { color: var(--color-slate); text-decoration: none; transition: color 0.3s; display: flex; align-items: center; gap: 0.5rem; }
.footer-links a:hover { color: var(--color-cyan); }
.footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid rgba(148, 163, 184, 0.2); color: var(--color-slate); font-size: 0.9rem; }

/* =========================================
   MOBILE RESPONSIVE
========================================= */
.mobile-menu-btn { display: none; background: none; border: none; color: white; cursor: pointer; }

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--color-navy); flex-direction: column; padding: 1rem 0; }
    .nav-links.active { display: flex; }
    .nav-links li { text-align: center; padding: 0.5rem 0; }
    
    .dashboard-wrapper { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 1rem 0; }
    .sidebar.collapsed { width: 100%; }
    .sidebar-toggle-container { display: none; } /* Sembunyikan toggle sidebar di mode HP */
}

/* =========================================
   PERBAIKAN BADGE TANGGAL SURVAILEN
========================================= */
/* Perbaikan untuk badge tanggal */
.date-badge {
    display: inline-block; /* Pastikan tidak bertumpuk */
    padding: 5px 10px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4; /* Memberi ruang antar baris */
    white-space: nowrap; /* Mencegah tanggal terpotong baris baru */
    text-align: center;
    min-width: 90px;
}

/* Memastikan sel tabel memberi ruang yang cukup */
.data-table td {
    padding: 12px 10px;
    vertical-align: middle;
}