/* ============================================================
   GBSS Workforce — Admin Panel Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --admin-primary:   #111111;       /* Sleek Charcoal Black */
    --admin-secondary: #C5A059;       /* Rich Gold */
    --admin-accent:    #D4AF37;       /* Accent Gold */
    --admin-success:   #10B981;
    --admin-error:     #EF4444;
    --admin-warning:   #F59E0B;
    --admin-info:      #C5A059;
    --admin-sidebar-w: 260px;
    --admin-header-h:  60px;
    --admin-bg:        #F1F5F9;
    --admin-white:     #FFFFFF;
    --admin-border:    #E2E8F0;
    --admin-text:      #0F172A;
    --admin-muted:     #64748B;
    --admin-shadow:    0 1px 3px rgba(0,0,0,0.08);
    --admin-shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
    --radius:          8px;
    --radius-lg:       12px;
    --font:            'Inter', -apple-system, sans-serif;
    --transition:      0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: var(--font);
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Sidebar */
.admin-sidebar {
    width: var(--admin-sidebar-w);
    background: var(--admin-primary);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    min-width: 38px;
    max-width: 38px;
    background: var(--admin-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden !important;
}

.sidebar-logo.has-img {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
}

.sidebar-logo img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    border-radius: 6px;
}

.sidebar-brand-text { flex: 1; min-width: 0; }
.sidebar-site-name { font-size: 0.9rem; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-panel-label { font-size: 0.7rem; color: rgba(255,255,255,0.5); letter-spacing: 0.06em; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section { margin-top: 8px; }
.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 8px 20px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.75);
    font-size: 0.87rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
    border-left: 3px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-link.active { background: rgba(255,255,255,0.12); color: white; border-left-color: var(--admin-accent); font-weight: 600; }
.sidebar-link .link-icon { width: 20px; font-size: 0.9rem; flex-shrink: 0; text-align: center; }

.sidebar-badge {
    margin-left: auto;
    background: var(--admin-accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9999px;
}

/* Main content */
.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top bar */
.admin-topbar {
    background: white;
    height: var(--admin-header-h);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--admin-shadow);
}

.topbar-title { font-size: 1rem; font-weight: 700; color: var(--admin-primary); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.admin-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--admin-text);
}

.admin-user-avatar {
    width: 28px; height: 28px;
    background: var(--admin-secondary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.7rem; font-weight: 700;
}

/* Content area */
.admin-content { flex: 1; padding: 24px; }
.page-title { font-size: 1.3rem; font-weight: 800; color: var(--admin-primary); margin-bottom: 4px; }
.page-subtitle { font-size: 0.87rem; color: var(--admin-muted); margin-bottom: 24px; }

/* ── Cards ───────────────────────────────────────────────── */
.a-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--admin-border);
    box-shadow: var(--admin-shadow);
}
.a-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.a-card-title { font-size: 0.9rem; font-weight: 700; color: var(--admin-primary); }
.a-card-body { padding: 20px; }

/* Stat Cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--admin-border);
    box-shadow: var(--admin-shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--admin-shadow-lg); transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.blue   { background: #FAF6EC; color: #C5A059; }
.stat-icon.green  { background: #F0FDF4; }
.stat-icon.yellow { background: #FEFCE8; }
.stat-icon.red    { background: #FEF2F2; }
.stat-icon.purple { background: #FAF5FF; }
.stat-icon.orange { background: #FFF7ED; }
.stat-info {}
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--admin-primary); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--admin-muted); font-weight: 500; margin-top: 3px; }
.stat-trend { font-size: 0.72rem; color: var(--admin-success); font-weight: 600; margin-top: 2px; }

/* ── Tables ──────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 11px 16px; text-align: left; }
.admin-table th { background: #F8FAFC; font-weight: 700; font-size: 0.78rem; color: var(--admin-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--admin-border); white-space: nowrap; }
.admin-table td { font-size: 0.85rem; color: var(--admin-text); border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.admin-table tr:hover td { background: #F8FAFC; }

/* ── Buttons ─────────────────────────────────────────────── */
.a-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; font-size: 0.82rem; font-weight: 600; border-radius: var(--radius); border: 1.5px solid transparent; cursor: pointer; transition: all var(--transition); text-decoration: none; font-family: var(--font); line-height: 1; white-space: nowrap; }
.a-btn-primary { background: var(--admin-secondary); color: white; border-color: var(--admin-secondary); }
.a-btn-primary:hover { background: var(--admin-primary); border-color: var(--admin-primary); color: white; }
.a-btn-success { background: var(--admin-success); color: white; border-color: var(--admin-success); }
.a-btn-danger  { background: var(--admin-error);   color: white; border-color: var(--admin-error);   }
.a-btn-warning { background: var(--admin-accent);   color: white; border-color: var(--admin-accent);  }
.a-btn-outline { background: transparent; color: var(--admin-secondary); border-color: var(--admin-secondary); }
.a-btn-outline:hover { background: var(--admin-secondary); color: white; }
.a-btn-sm { padding: 5px 10px; font-size: 0.76rem; }
.a-btn-lg { padding: 11px 22px; font-size: 0.9rem; }

/* ── Forms ──────────────────────────────────────────────── */
.a-form-group { margin-bottom: 18px; }
.a-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--admin-text); margin-bottom: 5px; }
.a-label .req { color: var(--admin-error); }
.a-input, .a-select, .a-textarea {
    width: 100%; padding: 9px 13px; font-size: 0.87rem; color: var(--admin-text);
    background: white; border: 1.5px solid var(--admin-border); border-radius: var(--radius);
    transition: border-color var(--transition); outline: none; font-family: var(--font);
    appearance: none; -webkit-appearance: none;
}
.a-input:focus, .a-select:focus, .a-textarea:focus { border-color: var(--admin-secondary); box-shadow: 0 0 0 3px rgba(21,101,192,0.1); }
.a-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }
.a-textarea { resize: vertical; min-height: 90px; }
.a-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Alerts / Flash ─────────────────────────────────────── */
.a-alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.87rem; }
.a-alert-success { background: #F0FDF4; border: 1px solid #86EFAC; color: #15803D; }
.a-alert-error   { background: #FEF2F2; border: 1px solid #FCA5A5; color: #B91C1C; }
.a-alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.a-alert-info    { background: #FAF6EC; border: 1px solid #EDE6D8; color: #A68545; }

/* ── Pills ────────────────────────────────────────────────*/
.a-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; font-size: 0.72rem; font-weight: 700; }
.a-pill-green  { background: #FAF6EC; color: #A68545; }
.a-pill-blue   { background: #FAF6EC; color: #C5A059; }
.a-pill-yellow { background: #FEF9C3; color: #92400E; }
.a-pill-red    { background: #FEE2E2; color: #991B1B; }
.a-pill-gray   { background: #F1F5F9; color: #475569; }
.a-pill-purple { background: #EDE9FE; color: #5B21B6; }
.a-pill-orange { background: #FED7AA; color: #9A3412; }

/* ── Login Page ─────────────────────────────────────────── */
.admin-login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #000000 0%, #111111 60%, #1A1A1A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-secondary));
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 900; color: white;
    margin-bottom: 12px;
}
.login-logo-icon.has-img {
    background: #111111;
    padding: 8px;
    overflow: hidden;
}
.login-logo-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.login-title { font-size: 1.3rem; font-weight: 800; color: var(--admin-primary); margin-bottom: 4px; }
.login-sub { font-size: 0.82rem; color: #64748B; }

/* ── Misc ────────────────────────────────────────────────── */
.a-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.a-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.a-flex { display: flex; align-items: center; gap: 8px; }
.a-flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.a-spacer { flex: 1; }
.a-text-muted { color: var(--admin-muted); font-size: 0.82rem; }
.a-mt-0 { margin-top: 0; }
.a-mb-16 { margin-bottom: 16px; }
.a-mb-24 { margin-bottom: 24px; }
.table-responsive { overflow-x: auto; }
.a-tag { display: inline-block; background: #FAF6EC; color: #C5A059; padding: 2px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.mobile-open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .a-form-row { grid-template-columns: 1fr; }
    .a-grid-2, .a-grid-3 { grid-template-columns: 1fr; }
    .admin-content { padding: 16px; }
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #CBD5E1; border-radius: 22px; transition: 0.3s; }
.toggle-slider:before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--admin-success); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* Sidebar footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer a { color: rgba(255,255,255,0.6); font-size: 0.82rem; display: flex; align-items: center; gap: 8px; transition: color 0.15s; }
.sidebar-footer a:hover { color: var(--admin-accent); }
