/* ============================================
   VOICES FOR THE FALLEN — Admin Panel CSS
   ============================================ */

:root {
    --admin-bg: #f3f4f6;
    --admin-sidebar: #111827;
    --admin-sidebar-hover: #1f2937;
    --admin-primary: #4f46e5;
    --admin-primary-hover: #4338ca;
    --admin-text: #1f2937;
    --admin-text-light: #6b7280;
    --admin-border: #e5e7eb;
    --admin-card: #ffffff;
    --admin-gold: #c9a84c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; color: var(--admin-text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* ─── Login Page ──────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628, #152a4a);
}
.login-container { width: 100%; max-width: 400px; padding: 2rem; }
.login-card {
    background: var(--admin-card);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1rem;
    color: var(--admin-text);
}
.login-header p {
    font-size: 0.85rem;
    color: var(--admin-text-light);
    margin-top: 0.25rem;
}
.btn-login {
    width: 100%;
    padding: 0.85rem;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.btn-login:hover { background: var(--admin-primary-hover); }
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}
.login-footer a {
    font-size: 0.85rem;
    color: var(--admin-text-light);
    transition: color 0.2s;
}
.login-footer a:hover { color: var(--admin-primary); }

/* ─── Admin Layout ────────────────────────── */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--admin-bg);
}

/* ─── Sidebar ─────────────────────────────── */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--admin-sidebar);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
}
.sidebar-subtitle {
    font-size: 0.7rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sidebar-nav {
    padding: 0.75rem 0;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    color: white;
    background: var(--admin-sidebar-hover);
}
.sidebar-link.active {
    color: white;
    background: var(--admin-sidebar-hover);
    border-left-color: var(--admin-gold);
}
.sidebar-link svg { flex-shrink: 0; }
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.75rem 0;
}
.sidebar-logout:hover { color: #f87171; }

/* ─── Main Content Area ───────────────────── */
.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--admin-card);
    border-bottom: 1px solid var(--admin-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-page-title {
    font-size: 1.25rem;
    font-weight: 700;
}
.admin-user {
    font-size: 0.85rem;
    color: var(--admin-text-light);
}
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--admin-text);
    padding: 0.25rem;
}
.admin-content {
    padding: 1.5rem 2rem;
}
.admin-alerts {
    padding: 0 2rem;
    padding-top: 1rem;
}

/* ─── Cards ───────────────────────────────── */
.admin-card {
    background: var(--admin-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--admin-border);
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.admin-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}
.card-link {
    font-size: 0.85rem;
    color: var(--admin-primary);
    font-weight: 500;
}
.card-link:hover { text-decoration: underline; }

/* ─── Stats Grid ──────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--admin-card);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--admin-border);
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}
.stat-card-label {
    font-size: 0.8rem;
    color: var(--admin-text-light);
    margin-top: 0.25rem;
}

/* ─── Admin Row ───────────────────────────── */
.admin-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ─── Tables ──────────────────────────────── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table thead th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-light);
    padding: 0.75rem;
    border-bottom: 1px solid var(--admin-border);
}
.admin-table tbody td {
    padding: 0.75rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f3f4f6;
}
.admin-table tbody tr:hover {
    background: #f9fafb;
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Badges ──────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-new { background: #fef3c7; color: #92400e; }
.badge-in_progress { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-declined { background: #fee2e2; color: #991b1b; }
.badge-officers { background: #dbeafe; color: #1e40af; }
.badge-anthems { background: #ede9fe; color: #5b21b6; }
.badge-k9 { background: #fce7f3; color: #9d174d; }

/* ─── Status Bars ─────────────────────────── */
.status-bars { display: flex; flex-direction: column; gap: 1rem; }
.status-bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.status-bar-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 110px;
    font-size: 0.85rem;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-new { background: #f59e0b; }
.status-progress { background: #3b82f6; }
.status-completed { background: #10b981; }
.status-declined { background: #ef4444; }
.status-bar-track {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}
.status-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.status-bar-count {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}

/* ─── Filter Bar ──────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--admin-border);
    background: var(--admin-card);
    color: var(--admin-text-light);
    transition: all 0.2s;
}
.filter-pill:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.filter-pill.active {
    background: var(--admin-primary);
    color: white;
    border-color: var(--admin-primary);
}
.filter-pill.active .status-dot { background: white; }

/* ─── Detail Page ─────────────────────────── */
.back-link {
    font-size: 0.9rem;
    color: var(--admin-primary);
}
.back-link:hover { text-decoration: underline; }
.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.detail-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-light);
    margin-bottom: 0.75rem;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}
.detail-label { color: var(--admin-text-light); }
.detail-value { font-weight: 500; }
.detail-value a { color: var(--admin-primary); }
.detail-text {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--admin-text);
    white-space: pre-wrap;
}

/* ─── Forms ───────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--admin-text);
}
.form-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    color: var(--admin-text);
}
.form-input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }
.form-row-admin {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ─── Buttons ─────────────────────────────── */
.btn-admin {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-admin-primary {
    background: var(--admin-primary);
    color: white;
}
.btn-admin-primary:hover { background: var(--admin-primary-hover); }
.btn-admin-secondary {
    background: #f3f4f6;
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}
.btn-admin-secondary:hover { background: #e5e7eb; }
.btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: #f3f4f6;
    color: var(--admin-text-light);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon:hover { background: #e5e7eb; color: var(--admin-text); }
.btn-icon-danger:hover { background: #fee2e2; color: #dc2626; }

/* ─── Gallery Admin List ──────────────────── */
.gallery-admin-list { display: flex; flex-direction: column; gap: 0.75rem; }
.gallery-admin-item {
    padding: 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    transition: border-color 0.2s;
}
.gallery-admin-item:hover { border-color: #d1d5db; }
.gallery-admin-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gallery-admin-item-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--admin-text-light);
}
.gallery-admin-edit {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--admin-border);
}

/* ─── Alerts ──────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* ─── Empty State ─────────────────────────── */
.empty-state {
    text-align: center;
    color: var(--admin-text-light);
    font-size: 0.9rem;
}

/* ─── Code ────────────────────────────────── */
code {
    background: #f3f4f6;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-row { flex-direction: column; }
    .form-row-admin { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .admin-content {
        padding: 1rem;
    }
    .stats-grid { grid-template-columns: 1fr; }
}
