/* assets/css/admin-style.css */

/* 1. Global Reset & Variables */
:root {
    --warna-oren: #FF6B35;
    --warna-biru: #091057;
    --warna-biru-muda: #36D1DC;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

/* 2. Layout Utama */
.admin-body {
    display: flex;
    background-color: #f4f6f9;
    height: 100vh;
    width: 100vw;
}

/* 3. Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--warna-biru);
    color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.sidebar-brand {
    padding: 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h2 { 
    margin: 0; 
    color: var(--warna-oren); 
    font-size: 1.5rem; 
}

.sidebar-brand span { 
    font-size: 0.8rem; 
    opacity: 0.7; 
    letter-spacing: 1px; 
}

.sidebar-menu { 
    list-style: none; 
    padding: 0; 
    margin-top: 20px; 
    flex-grow: 1; 
}

.sidebar-menu li a {
    display: block;
    padding: 15px 25px;
    color: #cbd5e0;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:hover, 
.sidebar-menu li a.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--warna-oren);
}

.sidebar-menu li a i { 
    width: 30px; 
}

/* 4. Main Content */
.main-content {
    flex-grow: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.header-title h1 { 
    margin: 0; 
    font-size: 1.8rem; 
    color: #333; 
}

.header-title p { 
    margin: 5px 0 0; 
    color: #666; 
}

.btn-logout {
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(231, 76, 60, 0.3);
    transition: 0.3s;
}

.btn-logout:hover { 
    background: #c0392b; 
    transform: translateY(-2px); 
}

/* Kartu Statistik */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
}

.stat-card:hover { 
    transform: translateY(-5px); 
}

.icon-bg {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
}

/* Warna Icon */
.stat-card.blue .icon-bg { 
    background: linear-gradient(135deg, #36D1DC, #5B86E5); 
}

.stat-card.orange .icon-bg { 
    background: linear-gradient(135deg, #FF9966, #FF5E62); 
}

.stat-card.purple .icon-bg { 
    background: linear-gradient(135deg, #a18cd1, #fbc2eb); 
}

.stat-info h3 { 
    margin: 0; 
    font-size: 0.9rem; 
    color: #888; 
    font-weight: 500; 
}

.stat-info .number { 
    font-size: 1.6rem; 
    font-weight: 800; 
    color: #333; 
    margin: 2px 0; 
}

.stat-info p { 
    margin: 0; 
    font-size: 0.75rem; 
    color: #aaa; 
}

/* 5. Container untuk Tabel & Grafik */
.table-container,
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Khusus untuk Chart */
.chart-container {
    padding: 20px 20px 30px 20px;
}

.chart-container h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #444;
    flex-shrink: 0;
}

.chart-wrapper-canvas {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* 6. Tabel Styles */
.table-container {
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px;
}

/* Custom Scrollbar */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #aaa; 
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

/* Sticky Header */
.admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8f9fa;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.admin-table th, 
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.admin-table td {
    font-size: 0.95rem;
    color: #333;
}

.admin-table tbody tr:hover {
    background-color: #fcfcfc;
}

/* 7. Komponen Tabel */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle {
    width: 35px;
    height: 35px;
    background-color: var(--warna-biru);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Badges Status */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-secondary {
    background-color: #f8f9fa;
    color: #6c757d;
}

.text-muted {
    color: #6c757d !important;
}

/* 8. Kontrol Tabel & Pagination */
.table-header-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #555;
    flex-shrink: 0;
}

.limit-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 0 5px;
    font-family: inherit;
    cursor: pointer;
    background-color: #fff;
}

.limit-select:focus {
    border-color: var(--warna-biru);
    outline: none;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.pagination-info {
    font-size: 0.9rem;
    color: #666;
}

.pagination-links {
    display: flex;
    gap: 5px;
}

.page-link {
    display: inline-block;
    padding: 6px 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #555;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

.page-link.active {
    background-color: var(--warna-biru);
    color: white;
    border-color: var(--warna-biru);
    font-weight: 600;
}

/* 9. Tombol Aksi */
.btn-action-delete {
    background-color: #ffebee;
    color: #c62828;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
}

.btn-action-delete:hover {
    background-color: #c62828;
    color: white;
}

/* 10. Animasi */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- LOGIN PAGE STYLES (RESTORED) --- */

.admin-login-body {
    background: linear-gradient(135deg, #091057 0%, #063d5e 100%);
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    overflow: hidden; /* Tetap anti-scroll */
}

.admin-login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    /* Pastikan di atas elemen lain */
    position: relative; 
    z-index: 100;
}

.login-header h2 {
    color: var(--warna-oren);
    font-weight: 800;
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.login-header p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Styling Form di Login (Spesifik biar ga tabrakan) */
.admin-login-container .form-group {
    text-align: left;
    margin-bottom: 1.2rem;
}

.admin-login-container label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.admin-login-container .form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: inherit;
    transition: 0.3s;
}

.admin-login-container .form-control:focus {
    border-color: var(--warna-biru);
    outline: none;
}

.btn-admin-login {
    width: 100%;
    padding: 12px;
    background-color: var(--warna-oren);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    font-size: 1rem;
}

.btn-admin-login:hover {
    background-color: #e69520;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(230, 149, 32, 0.3);
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid #ef9a9a;
}

.back-link {
    margin-top: 25px;
}
.back-link a {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.3s;
}
.back-link a:hover {
    color: var(--warna-biru);
    text-decoration: underline;
}