:root {
    --bg-main: #1A1A2E;
    --bg-surface: #16213E;
    --bg-sidebar: #0F3460;
    --accent-gold: #E8A838;
    --text-main: #FFFFFF;
    --text-muted: #B8C5D6;
    --success: #52C41A;
    --danger: #E74C3C;
    --warning: #FAAD14;
    --border-color: #2a3654;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
}

a:hover {
    color: #ffd700;
}

/* Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.sidebar-brand {
    padding: 20px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 1px;
}

.brand-text {
    color: #fff;
}

.brand-accent {
    color: var(--accent-gold);
}

.sidebar-nav {
    list-style: none;
    padding: 20px 0;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-speed);
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background-color: rgba(232, 168, 56, 0.1);
    color: var(--accent-gold);
    border-left: 4px solid var(--accent-gold);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: 60px;
    background-color: var(--bg-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.topbar-left h2 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-name {
    color: var(--text-muted);
}

/* Content Body */
.content-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Cards */
.card {
    background-color: var(--bg-surface);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(145deg, var(--bg-surface), #1a264a);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.stat-card h3, .stat-card h4 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.stat-card-small .stat-value {
    font-size: 22px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: rgba(0,0,0,0.2);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
}

.table tr:hover {
    background-color: rgba(255,255,255,0.02);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background-color: rgba(82, 196, 26, 0.2); color: var(--success); }
.badge-danger { background-color: rgba(231, 76, 60, 0.2); color: var(--danger); }
.badge-warning { background-color: rgba(250, 173, 20, 0.2); color: var(--warning); }
.badge-secondary { background-color: rgba(184, 197, 214, 0.2); color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
    text-align: center;
}

.btn-primary { background-color: var(--accent-gold); color: #000; }
.btn-primary:hover { background-color: #ffd700; }
.btn-secondary { background-color: #34495e; color: #fff; }
.btn-secondary:hover { background-color: #2c3e50; }
.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover { background-color: #c0392b; }
.btn-success { background-color: var(--success); color: #fff; }
.btn-success:hover { background-color: #27ae60; }
.btn-info { background-color: #3498db; color: #fff; }
.btn-info:hover { background-color: #2980b9; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; }
.w-100 { width: 100%; }

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px;
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.col { flex: 1; min-width: 150px; }
.col-4 { width: 33.333%; }
.col-8 { width: 66.666%; }
.col-6 { width: 50%; }

.search-form { display: flex; gap: 10px; }
.search-form input { flex-grow: 1; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: var(--bg-main);
    margin: 5% auto;
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover { color: #fff; }

.user-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    justify-content: center;
}

.pagination a {
    padding: 6px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
}

.pagination a.active {
    background: var(--accent-gold);
    color: #000;
    border-color: var(--accent-gold);
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--bg-surface);
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.alert {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-danger {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-surface);
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-left: 4px solid var(--accent-gold);
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s forwards;
    min-width: 250px;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
    to { opacity: 0; }
}

/* Utilities */
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-items-end { align-items: flex-end; }
.row { display: flex; flex-wrap: wrap; margin: -10px; }
.row > [class^="col-"] { padding: 10px; }

@media (max-width: 768px) {
    .admin-wrapper { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); flex-direction: row; align-items: center; justify-content: space-between; padding: 0 10px; }
    .sidebar-brand { border: none; padding: 10px; }
    .sidebar-nav { display: flex; padding: 0; overflow-x: auto; }
    .sidebar-nav li a { padding: 10px; white-space: nowrap; }
    .row { flex-direction: column; }
    .col-4, .col-6, .col-8 { width: 100%; }
    .user-detail-grid { grid-template-columns: 1fr; }
}
