/* ========================================
    SCSD Dispatch System - Premium Design 2.0
   Professional Law Enforcement Theme
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Background Colors */
    --bg-primary: #0b0e14;
    --bg-secondary: #111620;
    --bg-card: rgba(17, 22, 32, 0.95);
    --bg-elevated: rgba(22, 30, 45, 0.98);
    --bg-glass: rgba(20, 26, 38, 0.9);
    --bg-hover: rgba(35, 45, 65, 0.95);
    --bg-input: rgba(12, 16, 24, 0.95);
    --bg-table-row: rgba(18, 24, 35, 0.6);
    --bg-table-hover: rgba(212, 168, 67, 0.08);
    
    /* Accent Colors - Sheriff Gold */
    --accent-primary: #d4a843;
    --accent-secondary: #e8c468;
    --accent-glow: rgba(212, 168, 67, 0.5);
    --accent-dim: rgba(212, 168, 67, 0.12);
    --accent-dark: #a68429;
    
    /* Text Colors */
    --text-primary: #f0f4f8;
    --text-secondary: #8b9bb4;
    --text-muted: #5a6a80;
    --text-bright: #ffffff;
    
    /* Border Colors */
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.12);
    --border-gold: rgba(212, 168, 67, 0.25);
    --border-gold-strong: rgba(212, 168, 67, 0.5);
    
    /* Status Colors */
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.15);
    --yellow: #f59e0b;
    --yellow-dim: rgba(245, 158, 11, 0.15);
    --orange: #f97316;
    --orange-dim: rgba(249, 115, 22, 0.15);
    --purple: #8b5cf6;
    --purple-dim: rgba(139, 92, 246, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --cyan: #06b6d4;
    
    /* Layout */
    --header-height: 72px;
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius: 10px;
    --radius-sm: 6px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 40px rgba(212, 168, 67, 0.12);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 100% 80% at 50% -30%, rgba(212, 168, 67, 0.06), transparent 60%),
        radial-gradient(ellipse 60% 50% at 100% 20%, rgba(212, 168, 67, 0.04), transparent 50%),
        radial-gradient(ellipse 50% 40% at 0% 80%, rgba(59, 130, 246, 0.03), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Grid Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.01) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   HEADER - Premium Navigation Bar
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(180deg, rgba(17, 22, 32, 0.98) 0%, rgba(11, 14, 20, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.3;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(212, 168, 67, 0.4));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 50%, var(--accent-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
}

.datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 10px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.time {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-bright);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    margin-top: var(--header-height);
    padding: 28px;
    position: relative;
    z-index: 1;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   CARDS - Modern Glass Design
   ======================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm), var(--shadow-inset);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-md), var(--shadow-gold);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(180deg, var(--bg-elevated) 0%, rgba(22, 30, 45, 0.9) 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
    opacity: 0.2;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-bright);
    letter-spacing: 0.3px;
}

.card-header h2 i {
    color: var(--accent-primary);
    font-size: 1.1rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.card-body {
    padding: 24px;
}

/* ========================================
   TOP SECTION - Dashboard Layout
   ======================================== */

.top-section {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Leitstelle Card */
.leitstelle-card .funkdisziplin {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leitstelle-card .funkdisziplin .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.funk-select {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius);
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23d4a843' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.funk-select:hover {
    border-color: var(--accent-primary);
    background-color: var(--accent-dim);
}

.funk-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-dim), var(--shadow-gold);
}

.funk-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.leitstelle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

.leitstelle-item {
    background: linear-gradient(135deg, var(--bg-glass) 0%, rgba(25, 32, 45, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.leitstelle-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-dark));
    border-radius: 4px 0 0 4px;
}

.leitstelle-item:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
    transform: translateX(4px);
}

.leitstelle-label {
    display: block;
    font-size: 0.7rem;
    color: var(--accent-primary);
    margin-bottom: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leitstelle-info {
    display: flex;
    gap: 10px;
}

.input-dn, .input-name, .input-rang {
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.input-dn {
    width: 65px;
    text-align: center;
    font-weight: 700;
    color: var(--accent-primary);
    border-color: var(--border-gold);
}

.input-name {
    flex: 2;
}

.input-rang {
    flex: 1.2;
    color: var(--text-secondary);
}

.input-dn:focus, .input-name:focus, .input-rang:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: rgba(212, 168, 67, 0.05);
}

.input-dn::placeholder, .input-name::placeholder, .input-rang::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Command Section */
.command-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.command-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-glass);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.command-item:hover {
    border-color: var(--border-light);
}

.command-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.command-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.command-info .input-dn {
    width: 50px;
    padding: 10px 8px;
    background: var(--accent-dim);
    border: 1px solid var(--border-gold);
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.85rem;
}

.command-info .input-name {
    flex: 2;
    font-weight: 600;
}

.command-info .input-rang {
    flex: 1.5;
    font-size: 0.85rem;
}

/* Streifenstatus Card */
.streife-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(212, 168, 67, 0.03) 100%);
}

.streife-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 28px;
}

.streife-counter {
    text-align: center;
}

.counter-display {
    display: flex;
    align-items: baseline;
    gap: 10px;
    justify-content: center;
}

.counter-value {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.counter-separator {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.counter-total {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.counter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.streife-progress {
    width: 100%;
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent-primary), var(--accent-secondary));
    border-radius: 5px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px var(--accent-glow);
}

.department-codes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.dept-code {
    padding: 8px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.dept-code:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.dept-code.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-dim);
    box-shadow: 0 0 20px var(--accent-dim);
}

.dept-num {
    background: var(--bg-input);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
}

.dept-code.active .dept-num {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* ========================================
   CODES SECTION - Collapsible Panel
   ======================================== */

.codes-section {
    margin-bottom: 24px;
}

.toggle-codes {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px 14px;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-codes:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--accent-dim);
}

.toggle-codes i {
    transition: transform 0.3s ease;
}

.toggle-codes.collapsed i {
    transform: rotate(-90deg);
}

.codes-body {
    max-height: 550px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.codes-body.collapsed {
    max-height: 0;
    padding: 0 24px;
}

.codes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.code-column {
    min-width: 0;
}

.code-column h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--accent-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.code-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-glass);
    border-radius: var(--radius);
    margin-bottom: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: default;
}

.code-item:hover {
    border-color: var(--border-light);
    transform: translateX(6px);
    background: var(--bg-hover);
}

.code-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.code-green .code-dot { background: var(--green); box-shadow: 0 0 14px var(--green); }
.code-yellow .code-dot { background: var(--yellow); box-shadow: 0 0 14px var(--yellow); }
.code-blue .code-dot { background: var(--blue); box-shadow: 0 0 14px var(--blue); }
.code-orange .code-dot { background: var(--orange); box-shadow: 0 0 14px var(--orange); }
.code-purple .code-dot { background: var(--purple); box-shadow: 0 0 14px var(--purple); }
.code-red .code-dot { background: var(--red); box-shadow: 0 0 14px var(--red); }

.code-dot.pulse {
    animation: codePulse 1.5s infinite;
}

@keyframes codePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
    }
    50% { 
        transform: scale(1.3);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.code-num {
    font-weight: 800;
    font-size: 1rem;
    color: #ffffff;
    white-space: nowrap;
    min-width: 70px;
    flex-shrink: 0;
}

.code-desc {
    font-size: 0.95rem;
    color: #e0e0e0;
    font-weight: 600;
    line-height: 1.5;
    flex: 1;
}

.code-item.emergency {
    background: linear-gradient(135deg, var(--red-dim) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.code-item.emergency:hover {
    border-color: var(--red);
}

.funk-tips {
    background: linear-gradient(135deg, var(--accent-dim) 0%, rgba(212, 168, 67, 0.05) 100%);
    border-radius: var(--radius-lg);
    padding: 22px !important;
    border: 1px solid var(--border-gold);
}

.funk-tips h3 {
    margin-bottom: 22px !important;
}

.funk-tip {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: 700;
}

.funk-tip i {
    color: var(--accent-primary);
    width: 32px;
    font-size: 1.3rem;
}

/* ========================================
   UNITS TABLE - Professional Data Grid
   ======================================== */

.units-section {
    margin-bottom: 24px;
}

.unit-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.btn-add {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--accent-dim);
}

.btn-add:hover {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.8rem;
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
}

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--red);
}

.btn-home {
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-home:hover {
    background: var(--accent-dim);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--accent-dim);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--accent-dim);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.units-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.units-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.units-table th {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, rgba(22, 30, 45, 0.95) 100%);
    padding: 16px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-gold);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.units-table th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.units-table th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

.units-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    background: var(--bg-table-row);
    font-weight: 500;
}

.units-table tbody tr {
    transition: all 0.2s ease;
}

.units-table tbody tr:hover {
    background: var(--bg-table-hover);
}

.units-table tbody tr:hover td {
    background: transparent;
    color: var(--text-bright);
}

.units-table tbody tr:nth-child(even) td {
    background: rgba(22, 30, 45, 0.4);
}

.units-table .status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.code-01,
.status-badge.code-02 {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.code-03 {
    background: var(--yellow-dim);
    color: var(--yellow);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.code-04 {
    background: var(--blue-dim);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.code-06 {
    background: var(--orange-dim);
    color: var(--orange);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.status-badge.code-09 {
    background: var(--purple-dim);
    color: var(--purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.status-badge.code-10 {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.unit-actions-cell {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-icon.delete:hover {
    background: var(--red-dim);
    color: var(--red);
    border-color: var(--red);
}

/* ========================================
   BOTTOM SECTION - Side Panels
   ======================================== */

.bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.small-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.small-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-gold);
    background: var(--bg-elevated);
}

.small-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.small-table tbody tr {
    transition: all 0.2s ease;
}

.small-table tbody tr:hover {
    background: var(--bg-table-hover);
}

/* ========================================
   MODALS - Premium Dialogs
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #0d1117 100%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 0 1px rgba(212, 168, 67, 0.1),
        0 25px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(212, 168, 67, 0.1);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-small {
    max-width: 550px;
}

/* Person Modal specific styles */
#person-modal .form-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    background: linear-gradient(180deg, rgba(212, 168, 67, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-gold);
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-bright);
    letter-spacing: 0.3px;
}

.modal-header h3 i {
    color: var(--accent-primary);
    font-size: 1.2rem;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 6px 14px;
    line-height: 1;
    transition: all 0.3s ease;
    border-radius: var(--radius);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--red);
    border-color: var(--red);
    background: var(--red-dim);
    transform: rotate(90deg);
}

.modal-body {
    padding: 28px;
}

/* Form Styles - Premium Modal Design */
.modal-body > form > .form-row:first-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.modal-body > form > .form-group:nth-child(2) {
    margin-bottom: 24px;
}

.form-section {
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    position: relative;
}

.form-section h4 {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-dim);
}

.form-section h4 i {
    font-size: 0.9rem;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.form-section .form-row {
    display: grid;
    grid-template-columns: 80px 1fr 1fr;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--bg-glass) 0%, rgba(20, 26, 38, 0.7) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.form-section .form-row:hover {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.05) 0%, var(--bg-glass) 100%);
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.small {
    flex: 0 0 80px;
}

.form-group label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-section .form-group:first-child .form-input {
    text-align: center;
    font-weight: 700;
    color: var(--accent-primary);
    background: var(--accent-dim);
    border-color: var(--border-gold);
}

.form-input {
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-dim), 0 0 20px var(--accent-dim);
    background: rgba(212, 168, 67, 0.03);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23d4a843' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

select.form-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
}

/* Gebiet Field */
.modal-body > form > .form-group:last-of-type {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-body > form > .form-group:last-of-type label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.modal-body > form > .form-group:last-of-type label i {
    font-size: 0.9rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.form-actions .btn {
    padding: 14px 28px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1400px) {
    .top-section {
        grid-template-columns: 1.8fr 1fr;
    }
    
    .codes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .top-section {
        grid-template-columns: 1fr;
    }
    
    .bottom-section {
        grid-template-columns: 1fr;
    }
    
    .codes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .brand {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .leitstelle-grid {
        grid-template-columns: 1fr;
    }
    
    .command-section {
        grid-template-columns: 1fr;
    }
    
    .codes-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group.small {
        flex: 1;
    }
    
    .counter-value {
        font-size: 3rem;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--border-light), var(--border));
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dim);
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
    color: var(--accent-primary);
}

.empty-state p {
    font-size: 0.95rem;
    font-weight: 500;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease forwards;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }
