:root {
    --navy-950: #06162B;
    --navy-900: #0A2342;
    --teal-600: #0D9488;
    --teal-700: #0B726B;
    --gold-500: #D9A441;
    --slate-900: #0F172A;
    --slate-700: #334155;
    --slate-500: #64748B;
    --slate-200: #E2E8F0;
    --bg: #F1F5F9;
    --white: #FFFFFF;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--slate-900);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--navy-900);
}

a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-shell { display: flex; height: 100vh; overflow: hidden; }

.admin-sidebar {
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.22) transparent;
    background: var(--navy-950);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.24s ease;
}
.admin-sidebar::-webkit-scrollbar { width: 6px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 999px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.brand-pill {
    background: var(--teal-600);
    color: var(--white);
    font-weight: 800;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand small { color: rgba(255,255,255,0.68); font-size: 0.75rem; }

.sidebar-nav { display: grid; gap: 0.35rem; margin: 1.5rem 0 auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255,255,255,0.82);
    padding: 0.68rem 0.85rem;
    border-radius: 8px;
    font-weight: 600;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(13, 148, 136, 0.25);
    color: var(--white);
    text-decoration: none;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 1rem;
    display: grid;
    gap: 0.5rem;
    font-size: 0.88rem;
}
.sidebar-footer a { color: rgba(255,255,255,0.82); display: inline-flex; align-items: center; gap: 0.4rem; }
.sidebar-footer .logout-link { color: #FCA5A5; }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow-y: auto; }

.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--slate-200);
    padding: 1rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 0.85rem; }
.admin-menu-btn {
    display: none;
    background: var(--bg);
    border: 1px solid var(--slate-200);
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    font-size: 1.15rem;
    cursor: pointer;
}
.admin-topbar h1 { margin: 0; font-size: 1.3rem; }
.admin-user { color: var(--slate-500); font-size: 0.9rem; }

.admin-content { padding: 1.75rem; display: grid; gap: 1.4rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.panel {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    padding: 1.35rem;
    box-shadow: 0 1px 3px rgba(6,22,43,0.04);
}
.kpi-value { font-size: 2.1rem; font-weight: 800; color: var(--navy-900); margin: 0.25rem 0; }
.kpi-sub { color: var(--slate-500); font-size: 0.86rem; }

.bar-track {
    height: 10px;
    background: var(--slate-200);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.35rem;
}
.bar-fill { height: 100%; background: var(--teal-600); border-radius: 999px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }
.filter-group { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }

.form-control, .btn {
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    font-size: 0.9rem;
    font-family: inherit;
}

.btn {
    background: var(--teal-600);
    color: var(--white);
    border-color: var(--teal-600);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn:hover { background: var(--teal-700); text-decoration: none; }
.btn-sm { padding: 0.38rem 0.72rem; font-size: 0.82rem; }
.btn-secondary { background: var(--white); color: var(--slate-700); border-color: #CBD5E1; }
.btn-secondary:hover { background: #F8FAFC; color: var(--slate-900); }
.btn-danger { background: #DC2626; border-color: #DC2626; color: var(--white); }
.btn-danger:hover { background: #B91C1C; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.78rem 0.65rem; border-bottom: 1px solid var(--slate-200); text-align: left; vertical-align: top; }
th { background: #F8FAFC; color: var(--navy-900); font-weight: 700; white-space: nowrap; }

.status-badge {
    display: inline-block;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #E2E8F0;
    color: #334155;
}
.status-new { background: #DBEAFE; color: #1E40AF; }
.status-reviewing, .status-contacted, .status-in_progress { background: #FEF3C7; color: #92400E; }
.status-shortlisted, .status-replied { background: #D1FAE5; color: #065F46; }

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.pagination-meta { font-size: 0.86rem; color: var(--slate-500); margin-top: 0.75rem; }
.pagination-links { display: flex; gap: 0.5rem; }

/* Modal Inspector */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 22, 43, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2000;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
    background: var(--white);
    border-radius: 14px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.6rem;
    box-shadow: 0 24px 55px rgba(6,22,43,0.28);
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--slate-200);
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
}
.modal-close {
    background: var(--bg);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 1.3rem;
    cursor: pointer;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}
.detail-item {
    background: #F8FAFC;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
}
.detail-item.full { grid-column: 1 / -1; }
.detail-item small { display: block; color: var(--slate-500); font-size: 0.76rem; text-transform: uppercase; font-weight: 700; }

.alert { padding: 0.85rem 1rem; border-radius: 8px; border-left: 4px solid; }
.alert-success { background: #ECFDF5; border-color: #10B981; color: #065F46; }
.alert-error { background: #FEF2F2; border-color: #EF4444; color: #991B1B; }

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--navy-950), var(--navy-900));
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: 16px;
    padding: 2.1rem;
    box-shadow: 0 24px 52px rgba(0,0,0,0.3);
}
.stack-form { display: grid; gap: 1rem; }
.field-group { display: grid; gap: 0.35rem; }
.field-group label { font-weight: 600; font-size: 0.88rem; }

.admin-backdrop { position: fixed; inset: 0; background: rgba(6,22,43,0.5); z-index: 998; }

@media (max-width: 960px) {
    .admin-shell { height: auto; min-height: 100vh; overflow: visible; }
    .admin-main { height: auto; min-height: 100vh; overflow-y: visible; }
    .admin-menu-btn { display: inline-flex; }
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 999;
        transform: translateX(-105%);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .kpi-grid, .detail-grid { grid-template-columns: 1fr; }
}


/* v3 Enterprise CMS Admin Styles */
.nav-group-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    font-weight: 700;
    margin: 0.9rem 0 0.25rem 0.65rem;
}
.sidebar-nav { margin: 0.5rem 0 auto; }
.sidebar-nav a { padding: 0.52rem 0.78rem; font-size: 0.86rem; }
.role-pill {
    display: inline-block;
    background: #E0F2FE;
    color: #0369A1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    margin-left: 0.35rem;
}
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    border-bottom: 1px solid var(--slate-200);
    padding-bottom: 0.85rem;
}
.admin-tab {
    padding: 0.48rem 0.95rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--slate-700);
    background: var(--white);
    border: 1px solid var(--slate-200);
}
.admin-tab.active, .admin-tab:hover {
    background: var(--navy-900);
    color: var(--white);
    border-color: var(--navy-900);
    text-decoration: none;
}
.form-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.field-full { grid-column: 1 / -1; }
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}
.media-card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.media-thumb {
    aspect-ratio: 16 / 10;
    background: #0F172A;
    overflow: hidden;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-meta { padding: 0.75rem; display: grid; gap: 0.4rem; font-size: 0.83rem; }
.rte-wrap { border: 1px solid #CBD5E1; border-radius: 8px; overflow: hidden; background: var(--white); }
.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.45rem;
    background: #F8FAFC;
    border-bottom: 1px solid var(--slate-200);
}
.rte-btn {
    border: 1px solid #CBD5E1;
    background: var(--white);
    border-radius: 5px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.rte-btn:hover { background: #E2E8F0; }
.rte-editor {
    min-height: 220px;
    padding: 0.85rem;
    outline: none;
    line-height: 1.6;
}
@media (max-width: 720px) {
    .form-2col { grid-template-columns: 1fr; }
}
