:root {
    --bg: #0b0e14;
    --bg-2: #111520;
    --panel: #151a26;
    --panel-2: #1a2030;
    --border: #23293a;
    --text: #e5e9f0;
    --muted: #7a8397;
    --brand: #2d6cdf;
    --brand-2: #3a7dec;
    --ok: #2a6b3a;
    --warn: #b36b1a;
    --danger: #a03030;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 14px;
}
input, select, textarea, button { font: inherit; color: inherit; }
.muted { color: var(--muted); font-size: 12px; }

/* -------- Login -------- */
.login-bg { display:flex; align-items:center; justify-content:center; min-height:100vh;
    background: radial-gradient(ellipse at top, #1a2030 0%, #0b0e14 60%);
}
.login-box { width: 420px; background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
.login-logo { display:flex; align-items:center; gap:10px; color:#cde; margin-bottom: 6px; }
.login-logo h1 { margin: 0; font-size: 18px; letter-spacing: 1px; }
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.login-form label { display:block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted); margin: 10px 0 4px; }
.login-form input {
    width: 100%; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 6px; outline: none;
}
.login-form input:focus { border-color: var(--brand-2); }
.btn-primary { margin-top: 18px; width: 100%; padding: 11px; border-radius: 6px; border: 1px solid var(--brand-2);
    background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; letter-spacing: .5px; }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { padding: 7px 12px; background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text); cursor: pointer; }
.btn-ghost:hover { border-color: #3a4560; background: #1b2230; }
.btn-mini { padding: 4px 8px; background: var(--brand); border: 1px solid var(--brand-2); color: #fff; border-radius: 4px; cursor: pointer; font-size: 11px; }
.btn-mini:hover { background: var(--brand-2); }
.err { margin-top: 12px; padding: 9px 12px; background: #3a1f23; border: 1px solid #6b2d36; color: #f5b8bf; border-radius: 6px; font-size: 12px; }
.login-foot { margin-top: 16px; text-align: center; }

/* -------- Dashboard -------- */
.dash-bg { background: var(--bg); min-height: 100vh; }
.dash-head { display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; background: linear-gradient(180deg, #1a2030, #121623); border-bottom: 1px solid var(--border);
}
.dash-head-left { display: flex; align-items: center; gap: 14px; }
.dash-head-right { display: flex; align-items: center; gap: 10px; }
.dash-dept { font-size: 11px; padding: 3px 8px; border-radius: 4px; background: #1c2638; border: 1px solid #2a3752; color: #b8c6e0; text-transform: uppercase; letter-spacing: 1px; }
.badge { padding: 3px 8px; border-radius: 10px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.badge-off { background: #3a1f23; border: 1px solid #6b2d36; color: #f5b8bf; }
.badge-on { background: #17331f; border: 1px solid #2a6b3a; color: #b0e6bf; }

.dash-grid { display: grid; grid-template-columns: 320px 1fr 320px; gap: 10px; padding: 10px; height: calc(100vh - 52px); }
.dash-col { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    display: flex; flex-direction: column; min-height: 0; }
.col-head { padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border);
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #cde;
    display: flex; justify-content: space-between; align-items: center;
}
.list-wrap { flex: 1; overflow-y: auto; padding: 6px; }
.list-wrap.mini-list { max-height: 25vh; }

.call-item {
    padding: 8px 10px; margin: 4px 0; background: var(--bg-2); border: 1px solid var(--border);
    border-left: 3px solid #555; border-radius: 5px; cursor: pointer;
}
.call-item:hover { background: #1b2230; }
.call-item.active { border-color: var(--brand-2); background: #1a2236; }
.call-item .row1 { display: flex; justify-content: space-between; font-weight: 600; font-size: 12px; }
.call-item .row2 { color: var(--muted); font-size: 11px; margin-top: 2px; }
.pri-1 { border-left-color: #444; }
.pri-2 { border-left-color: #2d6cdf; }
.pri-3 { border-left-color: #b36b1a; }
.pri-4 { border-left-color: #a03030; }

.detail-wrap { flex: 1; overflow-y: auto; padding: 14px; }
.empty { color: var(--muted); padding: 30px; text-align: center; }
.detail-h { font-size: 16px; margin: 0 0 6px; }
.detail-sub { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.detail-block { margin: 12px 0; padding: 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; }
.detail-block h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: 1px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.mini-item { padding: 6px 8px; margin: 3px 0; font-size: 11px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 4px; }
.mini-item .mi-time { color: var(--muted); font-size: 10px; }

.note-row { padding: 6px 8px; background: var(--panel-2); border-left: 2px solid var(--brand); margin: 4px 0; border-radius: 3px; font-size: 12px; }
.note-meta { color: var(--muted); font-size: 10px; margin-bottom: 2px; }

.sitrep-row { padding: 8px 10px; background: var(--panel-2); border-left: 2px solid var(--warn); margin: 5px 0; border-radius: 3px; font-size: 12px; }
.sitrep-meta { color: var(--muted); font-size: 10px; display: flex; justify-content: space-between; }
.sitrep-type { display: inline-block; padding: 1px 6px; border-radius: 3px; background: #2a3752; color: #b8c6e0; font-size: 10px; text-transform: uppercase; }

.note-input { display: flex; gap: 6px; margin-top: 6px; }
.note-input input { flex: 1; padding: 7px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 4px; }

/* -------- Modal -------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-box { position: relative; width: 520px; max-width: 94vw; max-height: 90vh; overflow-y: auto;
    background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); }
.modal-head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600;
    display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-body { padding: 16px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: 1px; margin-bottom: 4px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 5px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-2); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row .field { margin-bottom: 10px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
