﻿/* ===== Admin Panel Styles ===== */
:root {
    --sidebar-width: 260px;
    --primary: #4e73df;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --dark: #5a5c69;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    color: #333;
}

/* Layout */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    color: #333;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: all 0.3s;
    border-right: 1px solid #e3e6f0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

.sidebar-brand {
    padding: 1.2rem 1rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #e3e6f0;
}

.sidebar-nav { padding: 0.5rem 0; }

.sidebar-nav .nav-item { list-style: none; }

.sidebar-nav .nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #333;
    background: #f0f0f0;
    border-left-color: #333;
}

.sidebar-nav .nav-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
}

/* Main content */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem 2rem;
    background: #f8f9fc;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.topbar h1 { font-size: 1.75rem; font-weight: 700; color: #333; }

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar .user-info span { font-size: 0.9rem; color: #666; }
.topbar .user-info a { color: var(--danger); text-decoration: none; font-size: 0.85rem; }

/* Cards */
.card {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    border: 1px solid #e3e6f0;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e3e6f0;
    font-weight: 700;
    font-size: 1rem;
}

.card-body { padding: 1.25rem; }

/* Stats cards */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }

.stat-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary);
}

.stat-card .stat-label { font-size: 0.8rem; text-transform: uppercase; color: #858796; font-weight: 700; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; margin-top: 0.3rem; }

.stat-card.border-success { border-left-color: var(--success); }
.stat-card.border-info { border-left-color: var(--info); }
.stat-card.border-warning { border-left-color: var(--warning); }

/* Tables */
.table-container { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th, table.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e3e6f0;
    font-size: 0.9rem;
}

table.data-table th {
    background: #fff;
    font-weight: 700;
    color: #5a5c69;
    font-size: 0.8rem;
    text-transform: uppercase;
}

table.data-table tr:hover { background: #fff; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #2e59d9; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.btn-group { display: flex; gap: 0.3rem; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 0.9rem; color: #333; }
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    font-size: 0.9rem;
    transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 0.2rem rgba(78,115,223,0.25); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { appearance: auto; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Alerts */
.alert {
    padding: 0.75rem 1.25rem;
    border-radius: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-draft { background: #e3e6f0; color: #5a5c69; }
.badge-published { background: #d4edda; color: #155724; }
.badge-ended { background: #f8d7da; color: #721c24; }
.badge-single { background: #cce5ff; color: #004085; }
.badge-multiple { background: #d4edda; color: #155724; }
.badge-text { background: #fff3cd; color: #856404; }
.badge-fill { background: #e8daef; color: #6c3483; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.25rem; margin-top: 1rem; }
.pagination a, .pagination span {
    padding: 0.4rem 0.75rem;
    border: 1px solid #d1d3e2;
    border-radius: 0.25rem;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.85rem;
}
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #fff;
}

.login-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.2);
}

.login-card h2 { text-align: center; margin-bottom: 1.5rem; color: #333; font-weight: 800; }

/* Search bar */
.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: nowrap; align-items: center; }
.search-bar .btn { flex-shrink: 0; }
.search-bar .form-control { max-width: 300px; }

/* Action bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid #e3e6f0; margin-bottom: 1.5rem; }
.tab { padding: 0.5rem 1.25rem; text-decoration: none; color: #858796; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Checklist */
.checklist { max-height: 300px; overflow-y: auto; border: 1px solid #e3e6f0; border-radius: 0.35rem; padding: 0.5rem; }
.checklist-item { padding: 0.4rem 0.5rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.checklist-item:hover { background: #fff; }
.checklist-item input[type="checkbox"] { margin: 0; }
