/* Security Access Panel (CC_038) */
.security-layout { display: grid; grid-template-areas: "top top" "grid side"; grid-template-columns: 1fr 320px; gap: 1rem; padding: 1rem; }
.security-top { grid-area: top; }
.security-grid-area { grid-area: grid; }
.security-sidebar { grid-area: side; display: flex; flex-direction: column; gap: 1rem; }
.btn-lockdown { width: 100%; padding: 1rem; font-size: 1.1rem; font-weight: bold; background: rgba(213,0,0,0.2); border: 2px solid #d50000; color: #d50000; cursor: pointer; border-radius: 4px; }
.btn-lockdown:hover { background: rgba(213,0,0,0.4); }
.door-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.deck-section { border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 0.75rem; }
.deck-title { color: var(--accent-cyan, #00e5ff); font-size: 0.9rem; margin: 0 0 0.5rem 0; text-transform: uppercase; letter-spacing: 0.1em; }
.section-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.section-cell { border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; padding: 0.5rem; min-width: 150px; display: flex; flex-direction: column; gap: 0.25rem; background: rgba(0,0,0,0.3); }
.section-cell.locked { border-color: #d50000; background: rgba(213,0,0,0.1); }
.section-cell.unlocked { border-color: #00c853; }
.section-cell.intruder { border-color: #ffd600; background: rgba(255,214,0,0.15); animation: intruder-flash 1s infinite; }
@keyframes intruder-flash { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.section-name { font-weight: bold; font-size: 0.85rem; }
.lock-indicator { font-size: 0.9rem; }
.section-controls { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.clearance-select { background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.3); color: inherit; font-size: 0.75rem; padding: 0.2rem; }
.access-log-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.access-log-table th, .access-log-table td { border: 1px solid rgba(255,255,255,0.1); padding: 0.3rem 0.5rem; }
.access-log-table th { background: rgba(255,255,255,0.05); }
.access-log-table-wrap { max-height: 200px; overflow-y: auto; }
.intruder-alert-card { background: rgba(213,0,0,0.2); border: 1px solid #d50000; border-radius: 4px; padding: 0.5rem; color: #ff5252; }

/* CC_038 P3: Eindringlingsalarm-Steuerung und Log-Filter */
.btn-clear-alert { font-size: 0.7rem; padding: 0.1rem 0.4rem; margin-left: 0.5rem; background: rgba(213,0,0,0.2); border: 1px solid #d50000; color: #ff5252; cursor: pointer; border-radius: 2px; }
.btn-trigger-alert { font-size: 0.75rem; margin: 0.1rem; background: rgba(255,214,0,0.1); border: 1px solid #ffd600; color: #ffd600; cursor: pointer; border-radius: 2px; padding: 0.2rem 0.4rem; }
.intruder-trigger-summary { font-size: 0.8rem; color: var(--accent-cyan, #00e5ff); cursor: pointer; padding: 0.3rem 0; }
.intruder-trigger-list { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.access-log-filter { padding: 0.3rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.access-log-filter form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.row-intruder td { color: #ffd600; background: rgba(255,214,0,0.07); }


/* Lockdown aufheben (im Türraster, erscheint nur bei aktivem Lockdown) */
.lockdown-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid #d50000; border-radius: 4px; background: rgba(213,0,0,0.12); color: #ff6666; }
.lockdown-banner-text { display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; align-items: baseline; font-size: 0.85rem; }
.btn-lockdown-lift { padding: 0.5rem 1rem; font-weight: bold; background: rgba(0,200,83,0.15); border: 2px solid #00c853; color: #00c853; border-radius: 4px; cursor: pointer; min-height: 44px; }
.btn-lockdown-lift:hover { background: rgba(0,200,83,0.3); }
.lockdown-message { margin: 0 0 0.75rem; font-size: 0.85rem; color: #40c4ff; }

/*
  Breite Schirme (ab 1800 px, z. B. 2560×1070 oder 1920×1080): ohne Scrollen.
  Die Seite darf breiter werden als die Standardhülle (1400 px). Die Seitenleiste bekommt zwei
  Spalten (Alarm, Personalakten, Keycard | Zugangsprotokolle), damit sie nicht höher wird als das
  Türraster; ist genug Platz, stehen die Decks zu zweit nebeneinander. Raster und Protokoll füllen
  bis zum unteren Rand (Abstand dort = Innenabstand von .station-main, wie oben).
*/
@media (min-width: 1800px) {
    .station-main:has(.security-layout) { max-width: min(2400px, 100%); display: flex; flex-direction: column; }
    .security-layout {
        flex: 1 0 auto;
        padding: 0;
        grid-template-columns: minmax(0, 1fr) minmax(0, 680px);
        grid-template-rows: auto 1fr;
    }
    .btn-lockdown { padding: 0.75rem; }
    .security-grid-area { display: flex; flex-direction: column; min-width: 0; }
    .security-grid-area > #door-grid-container { flex: 1 0 auto; display: flex; flex-direction: column; }
    .security-layout .door-grid {
        flex: 1 0 auto;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 820px), 1fr));
        gap: 1rem;
    }
    .security-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto 1fr;
        align-content: start;
        align-items: start;
    }
    .security-sidebar > #access-log-container { grid-column: 2; grid-row: 1 / -1; align-self: stretch; display: flex; flex-direction: column; }
    .security-sidebar > #access-log-container > .access-log-panel { flex: 1 0 auto; }
    .security-sidebar .access-log-table-wrap { max-height: 640px; }
}
