/* ===== Admin Panel Styles ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #e85d26;
    --primary-dark: #c44a1a;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --bg: #f0f2f5;
    --white: #fff;
    --text: #333;
    --text-light: #777;
    --border: #e0e0e0;
    --success: #27ae60;
    --danger: #e74c3c;
    --shadow: 0 2px 10px rgba(0,0,0,0.06);
    --radius: 8px;
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg); color: var(--text);
    line-height: 1.5;
}
a { text-decoration: none; color: inherit; }

/* ===== Login ===== */
.login-screen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.login-card {
    background: var(--white); border-radius: 16px; padding: 40px;
    width: 400px; max-width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 1.8rem; color: var(--text); }
.login-header h1 span { color: var(--primary); }
.login-header p { color: var(--text-light); margin-top: 4px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.login-form input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 0.95rem; transition: border var(--transition);
}
.login-form input:focus { outline: none; border-color: var(--primary); }
.form-error { color: var(--danger); font-size: 0.85rem; margin-bottom: 12px; min-height: 20px; }
.login-hint { text-align: center; font-size: 0.8rem; color: var(--text-light); margin-top: 16px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: var(--radius); font-size: 0.9rem;
    font-weight: 600; cursor: pointer; border: 2px solid transparent;
    transition: all var(--transition);
}
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { background: #c0392b; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

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

.sidebar {
    width: 240px; background: var(--sidebar-bg); color: var(--white);
    display: flex; flex-direction: column; position: fixed;
    top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-brand {
    padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-brand h2 { font-size: 1.3rem; }
.sidebar-brand h2 span { color: var(--primary); }
.sidebar-badge {
    background: var(--primary); font-size: 0.7rem; padding: 2px 8px;
    border-radius: 10px; font-weight: 600;
}
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-footer { padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; color: rgba(255,255,255,0.7);
    font-size: 0.9rem; transition: all var(--transition);
}
.nav-item:hover { color: var(--white); background: var(--sidebar-hover); }
.nav-item.active { color: var(--white); background: var(--sidebar-hover); border-left: 3px solid var(--primary); }
.nav-icon { font-size: 1.1rem; }

.main-content { flex: 1; margin-left: 240px; }

.topbar {
    background: var(--white); padding: 16px 28px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 1.3rem; font-weight: 700; }
.topbar-right { font-size: 0.9rem; color: var(--text-light); }

.page { display: none; padding: 28px; }
.page.active { display: block; }

/* ===== Stats ===== */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px; margin-bottom: 28px;
}
.stat-card {
    background: var(--white); border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow);
}
.stat-icon { font-size: 2rem; }
.stat-value { display: block; font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 0.85rem; color: var(--text-light); }

/* ===== Cards ===== */
.card {
    background: var(--white); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); margin-bottom: 20px;
}
.card h3 { margin-bottom: 16px; font-size: 1.1rem; }

.quick-actions { display: flex; gap: 12px; }

.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    border-radius: var(--radius); transition: background var(--transition);
}
.recent-item:hover { background: var(--bg); }
.recent-item img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.recent-item-info h4 { font-size: 0.9rem; font-weight: 600; }
.recent-item-info span { font-size: 0.8rem; color: var(--text-light); }

/* ===== Tables ===== */
.page-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 12px 14px; font-size: 0.8rem;
    text-transform: uppercase; color: var(--text-light); border-bottom: 2px solid var(--border);
}
.data-table td {
    padding: 12px 14px; font-size: 0.9rem;
    border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tr:hover td { background: rgba(0,0,0,0.01); }
.data-table img {
    width: 56px; height: 42px; object-fit: cover; border-radius: 6px;
}
.action-btns { display: flex; gap: 8px; }

/* ===== Forms ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 6px; color: var(--text);
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 0.9rem;
    font-family: inherit; transition: border var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
}
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

/* ===== Modal ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal-panel {
    background: var(--white); border-radius: 12px; width: 600px;
    max-width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal-panel-sm { width: 450px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.15rem; }
.modal-close-btn {
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    color: var(--text-light); transition: color var(--transition);
}
.modal-close-btn:hover { color: var(--text); }
.modal-body { padding: 24px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.status-on { background: #d4edda; color: #155724; }
.status-off { background: #f8d7da; color: #721c24; }
