/* ==========================================================================
   LSH Portal v4 — Admin-Bereich Stylesheet
   Sidebar-Layout, Login, Dashboard, Tabellen, Module
   v4.4.0 — ISL Design-DNA: Navy/Gold/Ivory, Outfit + Cormorant Garamond
   ========================================================================== */

/* ── Typografie-Override: Lesbarkeit im Admin-Bereich ──────── */
/* System-UI statt Outfit für dichte Informationsflächen        */

.admin-layout,
.admin-login-screen {
    --font:   system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --muted:  #3a4a6a;     /* dunkler → besserer Kontrast auf kleiner Schrift      */
    --fs-xs:  0.8125rem;   /* 13px  (statt 12px)                                   */
    --fs-sm:  0.875rem;    /* 14px  (statt 13px)                                   */
    --fs-md:  0.9375rem;   /* 15px  (statt 14px)                                   */
    font-family: var(--font);
}

/* Badges: minimal 12px, nicht 10px */
.admin-layout .badge,
.admin-layout [class*="badge"] {
    font-size: max(var(--fs-xs), 12px) !important;
}

/* Tabellen: Mindestgrösse 14px */
.admin-table td,
.admin-table th {
    font-size: var(--fs-sm);
}

/* ── Layout ────────────────────────────────────────────────── */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #0f2248;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 300;
    transition: transform var(--trans-slow);
    overflow-y: auto;
    flex-shrink: 0;
}

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

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1a3a72, #c9a24a);
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.3;
    font-family: var(--font);
}

.sidebar-title small {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 400;
    opacity: .55;
}

/* Sidebar Navigation */

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-nav-section {
    padding: 8px 20px 4px;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #c9a24a;
    font-weight: 600;
    opacity: .8;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: var(--fs-md);
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--trans-fast);
    border-left: 3px solid transparent;
    user-select: none;
}

.sidebar-nav-item:hover {
    background: rgba(250,248,242,.07);
    color: #faf8f2;
}

.sidebar-nav-item.active {
    background: rgba(201,162,74,.1);
    color: #e8c97a;
    border-left-color: #c9a24a;
    font-weight: 600;
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    opacity: .7;
    flex-shrink: 0;
}

.sidebar-nav-item.active svg {
    opacity: 1;
    color: #c9a24a;
}

/* Sidebar User (unten fixiert) */

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, #1a3a72, #c9a24a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--fs-md);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: var(--fs-md);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: var(--fs-xs);
    opacity: .55;
}

.sidebar-logout-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.45);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--r-sm);
    transition: all var(--trans-fast);
}

.sidebar-logout-btn:hover {
    color: var(--danger);
    background: rgba(255,255,255,.08);
}

.sidebar-logout-btn svg {
    width: 20px;
    height: 20px;
}

/* ── Main Content ──────────────────────────────────────────── */

.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: #faf8f2;
    display: flex;
    flex-direction: column;
}

.admin-header {
    position: sticky;
    top: 0;
    background: #faf8f2;
    border-bottom: 1px solid #d0cbbf;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 200;
    min-height: 60px;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header h1 {
    font-size: var(--fs-xl);
    font-weight: 700;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #0f2248;
    margin: 0;
}

.admin-breadcrumb {
    font-size: var(--fs-sm);
    color: #4a5a80;
}

.admin-breadcrumb a {
    color: #1a3a72;
    text-decoration: none;
}

.admin-hamburger {
    display: none;
    background: none;
    border: none;
    color: #0f2248;
    cursor: pointer;
    padding: 4px;
}

.admin-hamburger svg {
    width: 24px;
    height: 24px;
}

.admin-content {
    flex: 1;
    padding: 24px;
}

/* ── Page Header ───────────────────────────────────────────── */

.page-header {
    margin-bottom: 24px;
}

.page-title,
.page-header h1,
.page-header h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #0f2248;
    margin: 0 0 4px;
}

.page-subtitle {
    color: #4a5a80;
    font-size: var(--fs-sm);
}

/* ── Login Screen ──────────────────────────────────────────── */

.admin-login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #080e1e 0%, #0f2248 100%);
    padding: 20px;
}

.admin-login-card {
    background: #faf8f2;
    border-radius: var(--r-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(8,14,30,.4);
    width: 100%;
    max-width: 400px;
    border: 1px solid #e8e2d4;
}

.admin-login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.admin-login-logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0f2248 0%, #c9a24a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
    font-size: 32px;
    font-weight: 800;
}

.admin-login-logo h1 {
    font-size: var(--fs-lg);
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #0f2248;
    margin-bottom: 4px;
}

.admin-login-logo p {
    font-size: var(--fs-sm);
    color: #4a5a80;
}

.admin-login-form .form-group {
    margin-bottom: 16px;
}

.admin-login-form label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: #1a2240;
    margin-bottom: 6px;
}

.admin-login-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0cbbf;
    border-radius: var(--r);
    font-size: var(--fs-base);
    color: #1a2240;
    background: #fff;
    transition: border-color var(--trans);
    font-family: var(--font);
}

.admin-login-form input:focus {
    outline: none;
    border-color: #c9a24a;
    box-shadow: 0 0 0 3px rgba(201,162,74,.15);
}

.admin-login-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--r);
    font-size: var(--fs-sm);
    margin-bottom: 16px;
    display: none;
}

.admin-login-error.visible {
    display: block;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--r);
    font-size: var(--fs-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans);
    border: 1px solid transparent;
    font-family: var(--font);
    text-decoration: none;
    line-height: 1.4;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: #0f2248;
    color: #faf8f2;
    border-color: #0f2248;
}

.btn-primary:hover {
    background: #1a3a72;
    border-color: #1a3a72;
}

.btn-accent {
    background: #c9a24a;
    color: #0f2248;
    border-color: #c9a24a;
}

.btn-accent:hover {
    background: #e8c97a;
    border-color: #e8c97a;
    color: #080e1e;
}

.btn-secondary {
    background: #fff;
    color: #1a2240;
    border-color: #d0cbbf;
}

.btn-secondary:hover {
    background: #f2efe6;
    border-color: #c0bab0;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 5px 10px;
    font-size: var(--fs-xs);
}

.btn-lg {
    padding: 12px 24px;
    font-size: var(--fs-base);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Stats Cards (Dashboard) ───────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15,34,72,.08);
    border: 1px solid #e8e2d4;
    transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15,34,72,.12);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card-icon.blue   { background: rgba(26,58,114,.1);   color: #1a3a72; }
.stat-card-icon.green  { background: var(--ok-bg);         color: var(--ok); }
.stat-card-icon.orange { background: rgba(201,162,74,.12); color: #8b6914; }
.stat-card-icon.red    { background: var(--danger-bg);     color: var(--danger); }

.stat-card-value {
    font-size: var(--fs-2xl);
    font-weight: 800;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #0f2248;
    line-height: 1.2;
}

.stat-card-label {
    font-size: var(--fs-sm);
    color: #4a5a80;
    margin-top: 2px;
}

/* ── Admin Tables ──────────────────────────────────────────── */

.admin-card {
    background: #fff;
    border-radius: var(--r-lg);
    box-shadow: 0 2px 8px rgba(15,34,72,.08);
    border: 1px solid #e8e2d4;
    overflow: hidden;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e2d4;
    gap: 12px;
    flex-wrap: wrap;
    background: #fff;
}

.admin-card-header h2 {
    font-size: var(--fs-lg);
    font-weight: 700;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #0f2248;
    margin: 0;
}

.admin-card-body {
    padding: 20px;
}

.admin-card-body.no-pad {
    padding: 0;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-md);
}

.admin-table th {
    text-align: left;
    padding: 10px 16px;
    font-weight: 600;
    color: #1a2240;
    font-size: var(--fs-sm);
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #f2efe6;
    border-bottom: 2px solid #d0cbbf;
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

/* Sub-Tab-Navigation (z.B. Formulare: Liste / Editor / Einreichungen) */
.forms-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #d0cbbf;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.forms-tabs button {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 18px;
    font-size: var(--fs-md);
    font-weight: 500;
    color: #4a5a80;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color .15s, border-color .15s, background .15s;
    border-radius: 6px 6px 0 0;
}

.forms-tabs button:hover {
    color: #0f2248;
    background: rgba(201,162,74,.06);
}

.forms-tabs button.active {
    color: #0f2248;
    border-bottom-color: #c9a24a;
    font-weight: 600;
}

.admin-table th.sortable {
    cursor: pointer;
}

.admin-table th.sortable:hover {
    color: #0f2248;
    background: #e8e2d4;
}

.admin-table th.sortable .sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: .75em;
    opacity: .35;
    transition: opacity .15s, color .15s;
}

.admin-table th.sortable:hover .sort-icon {
    opacity: .75;
    color: #c9a24a;
}

.admin-table th.sorted-asc,
.admin-table th.sorted-desc {
    color: #0f2248;
}

.admin-table th.sorted-asc .sort-icon,
.admin-table th.sorted-desc .sort-icon {
    opacity: 1;
    color: #c9a24a;
}

.admin-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #e8e2d4;
    color: #1a2240;
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:nth-child(even) td {
    background: #faf8f2;
}

.admin-table tr:hover td {
    background: #f2efe6;
}

.admin-table .actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.admin-table .actions button {
    background: none;
    border: 1px solid #d0cbbf;
    color: #4a5a80;
    cursor: pointer;
    padding: 6px 10px;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    transition: all var(--trans-fast);
}

.admin-table .actions button:hover {
    color: #1a3a72;
    background: rgba(26,58,114,.08);
    border-color: #1a3a72;
}

.admin-table .actions button.danger:hover {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: var(--danger);
}

/* ── Badges ────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: var(--ok-bg); color: var(--ok); }
.badge-warning { background: var(--warn-bg); color: var(--warn); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-info    { background: rgba(26,58,114,.1); color: #1a3a72; }
.badge-muted   { background: rgba(74,90,128,.1); color: #4a5a80; }
.badge-admin   { background: rgba(201,162,74,.15); color: #8b6914; border: 1px solid rgba(201,162,74,.3); }
.badge-gold    { background: rgba(201,162,74,.15); color: #8b6914; border: 1px solid rgba(201,162,74,.3); }

/* ── Toolbar / Filter Bar ──────────────────────────────────── */

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-toolbar .search-input {
    padding: 7px 12px 7px 34px;
    border: 1px solid #d0cbbf;
    border-radius: var(--r);
    font-size: var(--fs-md);
    min-width: 220px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5a80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 10px center;
    transition: border-color var(--trans);
    font-family: var(--font);
    color: #1a2240;
}

.admin-toolbar .search-input:focus {
    outline: none;
    border-color: #c9a24a;
    box-shadow: 0 0 0 3px rgba(201,162,74,.15);
}

.admin-toolbar select {
    padding: 7px 12px;
    border: 1px solid #d0cbbf;
    border-radius: var(--r);
    font-size: var(--fs-md);
    color: #1a2240;
    background: #fff;
    cursor: pointer;
    font-family: var(--font);
}

/* ── Pagination ────────────────────────────────────────────── */

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}

.admin-pagination button {
    padding: 6px 12px;
    border: 1px solid #d0cbbf;
    background: #fff;
    border-radius: var(--r);
    cursor: pointer;
    font-size: var(--fs-sm);
    color: #1a2240;
    transition: all var(--trans-fast);
    font-family: var(--font);
}

.admin-pagination button:hover:not(:disabled) {
    border-color: #c9a24a;
    color: #0f2248;
    background: rgba(201,162,74,.06);
}

.admin-pagination button.active {
    background: #0f2248;
    color: #faf8f2;
    border-color: #0f2248;
}

.admin-pagination button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ── Forms / Modals ────────────────────────────────────────── */

.admin-form-group {
    margin-bottom: 16px;
}

.admin-form-group label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: #1a2240;
    margin-bottom: 6px;
}

.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0cbbf;
    border-radius: var(--r);
    font-size: var(--fs-md);
    color: #1a2240;
    background: #fff;
    font-family: var(--font);
    transition: border-color var(--trans);
}

.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
    outline: none;
    border-color: #c9a24a;
    box-shadow: 0 0 0 3px rgba(201,162,74,.15);
}

.admin-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e8e2d4;
    margin-top: 8px;
}

/* Toggle Switch */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d0cbbf;
    border-radius: var(--r-full);
    transition: background var(--trans);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--trans);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--ok);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ── Empty State ───────────────────────────────────────────── */

.admin-empty {
    text-align: center;
    padding: 48px 20px;
    color: #4a5a80;
}

.admin-empty svg {
    width: 48px;
    height: 48px;
    opacity: .3;
    margin-bottom: 12px;
}

.admin-empty p {
    font-size: var(--fs-md);
    margin-bottom: 16px;
}

/* ── Loading Spinner ───────────────────────────────────────── */

.admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.admin-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e8e2d4;
    border-top-color: #c9a24a;
    border-radius: 50%;
    animation: admin-spin 0.8s linear infinite;
}

@keyframes admin-spin {
    to { transform: rotate(360deg); }
}

/* ── Sidebar Overlay (Mobile) ──────────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8,14,30,.6);
    z-index: 299;
}

/* ── Activity Log ──────────────────────────────────────────── */

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e8e2d4;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9a24a;
    flex-shrink: 0;
    margin-top: 6px;
}

.activity-text {
    font-size: var(--fs-md);
    color: #1a2240;
    line-height: 1.5;
}

.activity-time {
    font-size: var(--fs-xs);
    color: #4a5a80;
    display: block;
    margin-top: 2px;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-hamburger {
        display: block;
    }

    .admin-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-form-row {
        grid-template-columns: 1fr;
    }

    .admin-card-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-toolbar .search-input {
        min-width: unset;
    }
}

/* ── Modal (Admin — x-if Pattern) ────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8,14,30,.6);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: #faf8f2;
    border-radius: var(--r-lg, 12px);
    box-shadow: 0 20px 60px rgba(8,14,30,.35);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e8e2d4;
    animation: modal-appear 0.2s ease-out;
}

@keyframes modal-appear {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e2d4;
    background: #fff;
}

.modal-header h3 {
    font-size: var(--fs-lg, 18px);
    font-weight: 700;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #0f2248;
    margin: 0;
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 14px;
}

.modal-body .form-group label {
    display: block;
    font-size: var(--fs-sm, 13px);
    font-weight: 500;
    color: #1a2240;
    margin-bottom: 5px;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea,
.modal-body .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0cbbf;
    border-radius: var(--r, 8px);
    font-size: var(--fs-md, 14px);
    font-family: inherit;
    color: #1a2240;
    background: #fff;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus,
.modal-body .form-control:focus {
    outline: none;
    border-color: #c9a24a;
    box-shadow: 0 0 0 3px rgba(201,162,74,.15);
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid #e8e2d4;
    background: #fff;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #4a5a80;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--trans-fast);
}

.modal-close:hover {
    color: var(--danger, #dc2626);
}

@media (max-width: 600px) {
    .modal-overlay {
        padding: 12px;
    }
    .modal-content {
        max-width: 100%;
        max-height: 95vh;
    }
}

/* ── Sidebar 2-Level Navigation ────────────────────────────── */

/* Section label (divider) */
.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 16px 16px 4px;
    margin-top: 4px;
}

/* Active item: gold left-border */
.sidebar-nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left: 3px solid var(--gold, #c8a84b);
}

/* Hover animation */
.sidebar-nav-item {
    transition: background 0.15s ease, padding-left 0.15s ease;
}

.sidebar-nav-item:hover:not(.active) {
    background: rgba(255,255,255,0.08);
    padding-left: 20px;
}

/* Tools toggle button (no underline, same style as nav item) */
.tools-toggle {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    color: rgba(255,255,255,.65);
    font-size: var(--fs-md, 0.9375rem);
    font-family: var(--font, system-ui, sans-serif);
    cursor: pointer;
}

/* Tools submenu collapsible */
.tools-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 0;
}

.tools-submenu.open {
    max-height: 400px;
}

/* Sub-items slightly indented */
.sidebar-nav-item--sub {
    padding-left: 28px;
}

.sidebar-nav-item--sub:hover:not(.active) {
    padding-left: 32px;
}

/* ── Sidebar Notification Badges ────────────────────────────── */

.nav-badge {
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: auto;
    flex-shrink: 0;
    line-height: 1.6;
}

.nav-badge.badge-warn {
    background: var(--warn, #d97706);
    color: #fff;
}

.nav-badge.badge-danger {
    background: var(--danger, #dc2626);
    color: #fff;
}
