/* ============================================================
   GSW Anmeldesystem – Admin Stylesheet
   ============================================================ */

@import url('../fonts/fonts.css');

:root {
    --gsw-primary: #2c5f7c;
    --gsw-primary-dark: #1e4258;
    --gsw-primary-light: #e8f0f5;
    --gsw-accent: #e8913a;
    --gsw-sidebar-width: 230px;
    --gsw-radius: 12px;
    --gsw-radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f6f8;
    margin: 0;
    color: #1a1a1a;
}

/* Sidebar */
.admin-sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--gsw-sidebar-width); height: 100vh;
    background: var(--gsw-primary);
    display: flex; flex-direction: column;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0,0,0,.08);
}

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

.sidebar-logo {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.15); border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
}

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

.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--gsw-radius-sm);
    color: rgba(255,255,255,.75); text-decoration: none;
    font-size: 0.88rem; font-weight: 500;
    transition: all .15s;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(255,255,255,.1); color: white;
}

.sidebar-link.active {
    background: rgba(255,255,255,.18); color: white; font-weight: 600;
}

.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-divider {
    height: 1px; background: rgba(255,255,255,.1);
    margin: 8px 12px;
}

.sidebar-footer {
    padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1);
    text-align: center;
}

/* Main Content */
.admin-content {
    margin-left: var(--gsw-sidebar-width);
    padding: 28px 32px;
    min-height: 100vh;
}

/* Stat Cards */
.stat-card {
    background: white; border-radius: var(--gsw-radius);
    padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border: 1px solid #e9ecef;
}

.stat-label {
    font-size: 0.8rem; font-weight: 600;
    color: #6c757d; text-transform: uppercase;
    letter-spacing: .5px; margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem; font-weight: 700;
    color: var(--gsw-primary);
}

/* Data Table */
.data-table {
    background: white; border-radius: var(--gsw-radius);
    overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border: 1px solid #e9ecef;
}

.data-table .table { margin: 0; }

.data-table .table th {
    background: #f8f9fa; font-size: 0.78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    color: #6c757d; padding: 10px 16px;
    border-bottom: 2px solid #e9ecef;
}

.data-table .table td {
    padding: 12px 16px; vertical-align: middle;
    border-bottom: 1px solid #f0f0f0; font-size: 0.9rem;
}

.data-table .table tbody tr:hover {
    background: var(--gsw-primary-light);
}

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

/* Detail Page */
.detail-section {
    background: white; border-radius: var(--gsw-radius);
    padding: 24px; margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border: 1px solid #e9ecef;
}

.detail-section h5 {
    font-weight: 700; font-size: 1rem; color: var(--gsw-primary);
    margin-bottom: 16px; padding-bottom: 8px;
    border-bottom: 2px solid var(--gsw-primary-light);
}

.detail-section .field-label {
    display: block;
    font-size: 0.78rem; font-weight: 600; color: #6c757d;
    text-transform: uppercase; letter-spacing: .3px;
    margin-bottom: 2px;
}

/* Zeilen-Link in Tabellen: ganze Zelle klick- und fokussierbar */
.data-table .row-link {
    color: inherit; text-decoration: none;
}

.data-table .row-link:hover { text-decoration: underline; }

.data-table .row-link:focus-visible {
    outline: 2px solid var(--gsw-primary); outline-offset: 2px; border-radius: 4px;
}

.detail-section .field-value {
    font-size: 0.95rem; margin-bottom: 14px;
}

.detail-section .field-value:empty::after,
.detail-section .field-value .empty {
    content: '–'; color: #ccc;
}

/* Checklist */
.checklist-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

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

.checklist-item label { cursor: pointer; flex: 1; }

.checklist-item .form-check-input:checked + label {
    text-decoration: line-through; color: #adb5bd;
}

/* Badges */
.badge { font-weight: 600; }

/* Nav pills active color */
.nav-pills .nav-link.active {
    background: var(--gsw-primary);
}

.nav-pills .nav-link {
    color: var(--gsw-primary);
}

/* Buttons */
.btn-primary {
    background: var(--gsw-primary); border-color: var(--gsw-primary);
}

.btn-primary:hover {
    background: var(--gsw-primary-dark); border-color: var(--gsw-primary-dark);
}

/* Leere-Felder-Hervorhebung (Detailansicht) */
.field-empty-required { border-color: #dc3545 !important; box-shadow: 0 0 0 1px #dc3545; }
.field-empty-optional { border-color: #e8913a !important; box-shadow: 0 0 0 1px #e8913a; }

/* Drag-and-Drop Sortierung */
.drag-handle { cursor: grab; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.3; background: var(--gsw-primary-light); }
.sortable-chosen { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%; height: auto; position: relative;
        flex-direction: row; align-items: center;
    }
    .sidebar-nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
    .sidebar-brand { padding: 10px 12px; }
    .sidebar-footer { display: none; }
    .sidebar-divider { display: none; }
    .admin-content { margin-left: 0; padding: 16px; }
}
