/* Admin Panel Global Styles */
:root {
    --primary: #1e3a8a; /* deep blue */
    --primary-hover: #1e40af;
    --secondary: #ef4444; /* red */
    --secondary-hover: #dc2626;
    --bg-color: #f3f4f6; /* light gray bg */
    --surface: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-bg: #111827;
    --sidebar-text: #9ca3af;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: #1f2937;
    --radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: rgba(0,0,0,0.2);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sidebar-header i { margin-right: 10px; color: var(--secondary); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
}

.nav-item:hover, .nav-item.active {
    color: var(--sidebar-text-hover);
    background-color: var(--sidebar-active-bg);
}

.nav-item.active { border-left: 4px solid var(--secondary); }

/* Main Content Wrapper */
.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.admin-topbar {
    height: 64px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }

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

/* Content Area */
.admin-content { padding: 32px; flex: 1; overflow-y: auto; }

/* Cards */
.admin-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.admin-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
}

.admin-card-title { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
.admin-card-body { padding: 20px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.9rem; font-weight: 500; color: var(--text-main); margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,138,0.1); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { background-color: white; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px; border-radius: 6px; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; border: 1px solid transparent; text-decoration: none;
    transition: var(--transition); gap: 8px;
}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: var(--secondary); color: white; }
.btn-secondary:hover { background-color: var(--secondary-hover); }
.btn-outline { background-color: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background-color: var(--bg-color); }
.btn-danger { background-color: #dc2626; color: white; }
.btn-danger:hover { background-color: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Tables */
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th { background-color: #f9fafb; padding: 12px 16px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border-color); }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; color: var(--text-main); vertical-align: middle; }
.admin-table tr:hover { background-color: #f9fafb; }
.admin-table tr:last-child td { border-bottom: none; }

/* Badges */
.badge { padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-info { background-color: #dbeafe; color: #1e40af; }

/* Flash Messages */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.alert-success { background-color: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); box-shadow: var(--shadow-md); }
    .admin-main { margin-left: 0; }
    .mobile-toggle { display: block; }
    .admin-content { padding: 20px; }
}
