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

*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.dark{background:#050814;color:#e4e9f2}
a{color:#93c5fd;text-decoration:none;transition:color .2s ease,background .2s ease,border .2s ease}
h1{font-size:24px;margin:0 0 12px 0;font-weight:700;letter-spacing:.3px}
h2{font-size:18px;margin:16px 0 8px;text-transform:uppercase;letter-spacing:1px;font-weight:600}
h3{font-size:16px;margin:12px 0 6px;font-weight:600}
input,select,button{font-size:14px;font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,sans-serif}

.shell{display:flex;min-height:100vh}
.sidebar{width:260px;background:#050816;border-right:1px solid #111827;padding:18px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;gap:16px}
.brand{display:flex;flex-direction:column;align-items:center;gap:6px;margin-bottom:8px}
.brand-logo{width:78px;height:78px;border-radius:16px;object-fit:cover;background:#111827}
.brand-text{font-weight:600;font-size:14px;letter-spacing:.12em;text-transform:uppercase;color:#e5e7eb}
.nav{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.nav-link{display:block;padding:8px 10px;border-radius:999px;background:#0b1120;border:1px solid #111827;font-size:13px;font-weight:500;color:#e5e7eb;text-align:left}
.nav-link:hover{background:#020617;border-color:#1d293b}
.nav-link.danger{background:#3b0b10;border-color:#7f1d1d;color:#fecaca}
.nav-link.danger:hover{background:#450a0a}

.content{flex:1;padding:22px 24px}

.card{background:#020617;border:1px solid #0f172a;border-radius:18px;padding:16px 18px;box-shadow:0 18px 40px rgba(15,23,42,.6)}
.card-accent-gold{border-top:3px solid #c9a76c}
.card-accent-navy{border-top:3px solid #1e2a47}
.card-accent-deepblue{border-top:3px solid #0e1a34}
.card-accent-slate{border-top:3px solid #202b40}

.centered-card{display:grid;place-items:center;height:100vh;padding:20px}
.app-title{margin-bottom:12px;opacity:.9;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:#c9a76c}

label{display:block;margin-bottom:6px;font-size:13px;font-weight:500;opacity:.85}
input,select{width:100%;background:#020617;border:1px solid #1e293b;color:#e5e7eb;border-radius:12px;padding:8px 11px;transition:border .15s ease,box-shadow .15s ease}
input:focus,select:focus{outline:none;border-color:#c9a76c;box-shadow:0 0 0 1px #c9a76c33}

button{background:linear-gradient(135deg,#c9a76c,#8c6f3c);color:#fff;border:none;border-radius:999px;padding:10px 16px;cursor:pointer;font-weight:600;letter-spacing:.03em;transition:transform .12s ease,box-shadow .12s ease,filter .12s ease}
button:hover{transform:translateY(-1px);box-shadow:0 10px 25px rgba(0,0,0,.35);filter:brightness(1.02)}
button.secondary{background:#0b1120;border:1px solid #1f2937;box-shadow:none;color:#e5e7eb}
button.secondary:hover{background:#020617;border-color:#334155}
button:disabled{opacity:.6;cursor:not-allowed;box-shadow:none;transform:none}
.btn-secondary{background:#0b1120;border:1px solid #1f2937;box-shadow:none;color:#e5e7eb;border-radius:8px;padding:8px 14px;font-size:13px}
.btn-secondary:hover{background:#020617;border-color:#334155}
.btn-danger-small{background:#7f1d1d;color:#fecaca;border:1px solid #991b1b;border-radius:6px;padding:4px 10px;font-size:12px}
.btn-danger-small:hover{background:#991b1b;border-color:#b91c1c}

.table{width:100%;border-collapse:collapse;margin:10px 0;border-radius:12px;overflow:hidden;font-size:13px}
.table th,.table td{border:1px solid #111827;padding:8px;vertical-align:middle}
.table th{background:#020617;font-weight:600;color:#e5e7eb}

.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}
.small{font-size:12px}.muted{opacity:.75}
.toast{position:fixed;right:16px;bottom:16px;background:#020617;color:#f9fafb;border:1px solid #1f2937;padding:10px 14px;border-radius:12px;z-index:1000;font-size:13px;box-shadow:0 16px 40px rgba(0,0,0,.7)}
.invalid{border-color:#ef4444!important;outline-color:#ef4444}
.row{padding:8px 0;border-bottom:1px solid #111827;font-size:13px}
.badge{display:inline-block;padding:2px 8px;border-radius:999px;border:1px solid #334155;background:#020617;font-size:11px;margin-left:6px;text-transform:uppercase;letter-spacing:.09em}
.badge-active{border-color:#15803d;background:#022c22;color:#bbf7d0}
.badge-pending{border-color:#d97706;background:#451a03;color:#fed7aa}
/* ===== Manager Dashboard Styling ===== */

.mgr-section {
    padding: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #0f0f15;
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background: #1a1a22;
    padding: 12px;
    text-align: left;
    font-size: 14px;
    color: #ccc;
    font-weight: 600;
}

.table td {
    padding: 12px;
    border-top: 1px solid #222;
    font-size: 14px;
    color: #ddd;
}

.table tr:hover {
    background: #1a1a1a;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending { background: #444; color: #ddd; }
.badge-approved { background: #065f46; color: #fff; }
.badge-rejected { background: #7f1d1d; color: #fff; }
.badge-escalated { background: #92400e; color: #fff; }
.badge-warning { background: #d97706; color: #fff; }
.badge-info { background: #0284c7; color: #fff; }
.badge-primary { background: #4f46e5; color: #fff; }
.badge-success { background: #16a34a; color: #fff; }
.badge-danger { background: #dc2626; color: #fff; }
.badge-secondary { background: #6b7280; color: #fff; }
.badge.gold { background: #c9a76c; color: #000; }
.badge.navy { background: #1e2a47; color: #fff; }
.badge.blue { background: #0284c7; color: #fff; }
.badge.purple { background: #7c3aed; color: #fff; }
.badge.orange { background: #ea580c; color: #fff; }
.badge.red { background: #dc2626; color: #fff; }
.badge.green { background: #16a34a; color: #fff; }

/* Action buttons */
.btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    margin-right: 6px;
}

.btn-approve { background: #059669; color: white; }
.btn-reject { background: #dc2626; color: white; }
.btn-escalate { background: #d97706; color: white; }
.btn-info { background: #2563eb; color: white; }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #11121a;
    padding: 20px;
    width: 420px;
    border-radius: 8px;
}

.modal-content h3 {
    margin-bottom: 10px;
}

.modal textarea {
    width: 100%;
    height: 100px;
    background: #1a1a22;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
}

.modal-actions {
    text-align: right;
    margin-top: 12px;
}
.modal-actions button {
    margin-left: 8px;
}
/* Manager Table Styling */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th, .table td {
    padding: 12px;
    border-bottom: 1px solid #2b2b2b;
    text-align: left;
}

.table th {
    background: #1d1d1d;
    color: #fff;
    font-weight: 600;
}

.table tr:hover {
    background: #262626;
}

/* Buttons */
.btn-small {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    color: #fff;
}

.btn-view {
    background-color: #0077ff;
}

.btn-view:hover {
    background-color: #005fcc;
}

.btn-approve {
    background-color: #20b531;
}

.btn-approve:hover {
    background-color: #189628;
}

.btn-reject {
    background-color: #d93b3b;
}

.btn-reject:hover {
    background-color: #b42828;
}

/* Card layout general improvements */
.card {
    padding: 20px;
    background: #1a1a1a;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* ===== Officer Dashboard Styling ===== */
.layout {
    display: flex;
    min-height: 100vh;
    background: #050814;
    color: #e4e9f2;
}

.sidebar-header {
    padding: 16px 0;
    border-bottom: 1px solid #111827;
    margin-bottom: 12px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #c9a76c;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border-radius: 999px;
    background: #0b1120;
    border: 1px solid #111827;
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: #020617;
    border-color: #1d293b;
    transform: translateX(2px);
}

.menu-item.logout {
    background: #3b0b10;
    border-color: #7f1d1d;
    color: #fecaca;
    margin-top: 12px;
}

.menu-item.logout:hover {
    background: #450a0a;
}

.section {
    padding: 20px 0;
}

.section.hidden {
    display: none;
}

/* Card Grid for Dashboard KPIs */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card-grid .card {
    text-align: center;
    padding: 20px;
}

.card-grid .card h3 {
    font-size: 14px;
    margin: 0 0 8px 0;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-grid .card p {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: #c9a76c;
}

/* Improve button consistency */
.btn-primary {
    background: linear-gradient(135deg, #c9a76c, #8c6f3c);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 167, 108, 0.3);
    filter: brightness(1.05);
}

.btn-secondary {
    background: #0b1120;
    border: 1px solid #1f2937;
    color: #e5e7eb;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: #020617;
    border-color: #334155;
}

/* Tabs styling */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #111827;
    padding-bottom: 8px;
}

.mgr-tab, .exec-tab {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.mgr-tab:hover, .exec-tab:hover {
    color: #e5e7eb;
}

.mgr-tab.tab-active, .exec-tab.tab-active {
    color: #c9a76c;
    border-bottom-color: #c9a76c;
}

.hidden {
    display: none !important;
}

/* Application Detail Page Styles */
.info-text {
    color: #e5e7eb;
    font-size: 14px;
    margin: 4px 0 12px 0;
    padding: 8px;
    background: #0b1120;
    border-radius: 6px;
    border: 1px solid #111827;
}

.note-item {
    background: #0b1120;
    border-left: 3px solid #c9a76c;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.note-item p {
    margin: 4px 0;
}

textarea {
    width: 100%;
    background: #020617;
    border: 1px solid #1e293b;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 14px;
    resize: vertical;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
    outline: none;
    border-color: #c9a76c;
    box-shadow: 0 0 0 1px rgba(201, 167, 108, 0.2);
}

input[type="file"] {
    width: 100%;
    background: #020617;
    border: 1px solid #1e293b;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 8px 11px;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, #c9a76c, #8c6f3c);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    margin-right: 10px;
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }

    .actions button {
        width: 100%;
    }
}

/* ============================================
   Manager Sub-Pages: Shared Layout & Components
   ============================================ */

/* Layout */
.dashboard-container { display: flex; min-height: 100vh; background: #050814; color: #e4e9f2; font-family: 'Poppins', system-ui, sans-serif; }
.main-content { flex: 1; padding: 24px 28px; overflow-y: auto; }
.main-content h1 { font-size: 24px; font-weight: 700; margin: 0 0 20px; color: #f1f5f9; }
.main-content h2 { font-size: 16px; font-weight: 600; margin: 16px 0 10px; color: #e2e8f0; text-transform: uppercase; letter-spacing: 1px; }

/* Sidebar overrides for sub-pages */
.logo-section { margin-bottom: 12px; }
.logo-section h2 { color: #fbbf24; font-size: 16px; font-weight: 700; text-transform: none; letter-spacing: 0; margin: 0; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a { display: block; padding: 9px 12px; border-radius: 8px; color: #94a3b8; text-decoration: none; font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.sidebar-nav a:hover { background: #1e293b; color: #e2e8f0; }
.sidebar-nav a.active { background: #1e293b; color: #fbbf24; font-weight: 600; }
.logout-btn { display: block; width: 100%; margin-top: 16px; padding: 9px 12px; border-radius: 8px; background: #3b0b10; border: 1px solid #7f1d1d; color: #fecaca; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; }
.logout-btn:hover { background: #450a0a; }

/* Filter bar */
.filter-section { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 160px; }
.filter-group label { font-size: 12px; color: #94a3b8; font-weight: 500; }
.filter-group input, .filter-group select { padding: 8px 12px; background: #1e293b; border: 1px solid #334155; border-radius: 6px; color: #e2e8f0; font-size: 13px; width: 100%; }
.filter-group input:focus, .filter-group select:focus { outline: none; border-color: #fbbf24; }

/* Loading / empty */
.loading-message { color: #94a3b8; font-style: italic; padding: 24px 0; text-align: center; font-size: 14px; }
.empty-state { color: #64748b; text-align: center; padding: 40px; font-size: 14px; }

/* Data table (used by sub-pages) */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.data-table th { background: #0f172a; color: #94a3b8; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; padding: 10px 12px; text-align: left; border-bottom: 1px solid #1e293b; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #1e293b; color: #cbd5e1; vertical-align: middle; }
.data-table tr:hover td { background: #0f172a; }

/* Badge variants */
.badge-success { background: #052e16; border-color: #15803d; color: #bbf7d0; }
.badge-danger  { background: #450a0a; border-color: #991b1b; color: #fecaca; }
.badge-warning { background: #422006; border-color: #92400e; color: #fde68a; }
.badge-info    { background: #0c1a40; border-color: #1d4ed8; color: #bfdbfe; }
.badge-secondary { background: #1e293b; border-color: #334155; color: #94a3b8; }

/* Small action button */
.btn-view-small { display: inline-block; padding: 4px 10px; border-radius: 5px; background: #1e3a5f; border: 1px solid #1d4ed8; color: #93c5fd; font-size: 12px; font-weight: 500; cursor: pointer; text-decoration: none; margin-right: 4px; transition: background .15s; }
.btn-view-small:hover { background: #1d4ed8; color: #fff; }

/* Stats grids */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-grid-large { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }

.stat-card { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 18px 20px; }
.stat-card-large { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 20px 22px; }
.stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; color: #fbbf24; }
.stat-card-large .stat-value { font-size: 30px; }
.stat-change { font-size: 11px; color: #64748b; margin-top: 4px; }
.stat-success { color: #10b981 !important; }
.stat-danger  { color: #ef4444 !important; }
.stat-warning { color: #f59e0b !important; }
.stat-info    { color: #3b82f6 !important; }

/* Charts layout */
.charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.chart-card { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 20px; }
.chart-card h3 { font-size: 13px; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 14px; }

/* Officer detail */
.officer-detail-card { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 20px; margin-bottom: 14px; }
.officer-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 12px 0; }
.officer-stat { background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 12px; text-align: center; }
.officer-stat .stat-label { font-size: 11px; }
.officer-stat .stat-value { font-size: 20px; }

/* Progress bar */
.progress-bar { background: #0f172a; border-radius: 999px; height: 8px; overflow: hidden; margin: 6px 0; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #fbbf24, #f59e0b); transition: width .3s ease; }
.progress-text { font-size: 12px; color: #64748b; margin-top: 2px; }
