*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f5f7;
    color: #1a1a2e;
    font-size: 14px;
}

.admin-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    background: #1a1a2e;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
}

.admin-header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.admin-body {
    display: flex;
    flex: 1;
}

.admin-sidebar {
    width: 200px;
    background: #16213e;
    min-height: calc(100vh - 50px);
    padding: 12px 0;
    flex-shrink: 0;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    margin: 0;
}

.admin-sidebar a, .admin-sidebar a:visited {
    display: block;
    padding: 10px 20px;
    color: #b0bec5;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.admin-sidebar a:hover {
    background: #1a2744;
    color: #fff;
}

.admin-sidebar a.active {
    background: #0f3460;
    color: #fff;
    font-weight: 600;
}

.admin-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Page titles */
h2 { font-size: 20px; margin-bottom: 16px; color: #1a1a2e; }
h3 { font-size: 16px; margin: 16px 0 8px; color: #333; }

/* Stat cards */
.stat-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    min-width: 180px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .label { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #0f3460; margin-top: 4px; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.3px;
}

td { font-size: 13px; }

tr:last-child td { border-bottom: none; }

tr:hover td { background: #f8f9fb; }

/* Forms */
.form-panel {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    max-width: 600px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0f3460;
    box-shadow: 0 0 0 2px rgba(15,52,96,0.15);
}

.form-group textarea { resize: vertical; min-height: 80px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary { background: #0f3460; color: #fff; }
.btn-primary:hover { background: #1a4a80; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-secondary { background: #95a5a6; color: #fff; }
.btn-secondary:hover { background: #7f8c8d; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Misc */
.mb-16 { margin-bottom: 16px; }
.text-muted { color: #888; font-size: 12px; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge-green { background: #d4edda; color: #155724; }
.badge-blue { background: #d1ecf1; color: #0c5460; }
.badge-yellow { background: #fff3cd; color: #856404; }
.badge-red { background: #f8d7da; color: #721c24; }

.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.filter-bar select, .filter-bar input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

/* ---- Help icon on portal pages (Shared/HelpLink.razor) ---------------- */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    border-radius: 50%;
    border: 1px solid #94a3b8;
    color: #475569;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    flex: 0 0 auto;
}
.help-icon:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.help-icon:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* ---- Mobile (PWA / native shell): collapse the sidebar into a horizontal strip ---- */
@media (max-width: 768px) {
    .admin-body { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        min-height: 0;
        padding: 4px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-sidebar ul { display: flex; white-space: nowrap; align-items: center; }
    .admin-sidebar li { flex-shrink: 0; }
    .admin-sidebar a, .admin-sidebar a:visited { padding: 8px 12px; font-size: 12px; }
    .admin-content { padding: 12px; }
}
