/* ============================================================
   Bliss CAD — Dark Dispatch Theme
   ============================================================ */

:root {
    --bg-base:     #080b14;
    --bg-surface:  #0f1523;
    --bg-card:     #131c2e;
    --bg-card2:    #192236;
    --bg-hover:    #1e2d47;
    --border:      #1e3a5f;
    --border-light:#243550;

    --blue:        #3b82f6;
    --blue-dark:   #1d4ed8;
    --blue-glow:   rgba(59,130,246,0.25);
    --cyan:        #06b6d4;
    --green:       #22c55e;
    --green-dark:  #15803d;
    --amber:       #f59e0b;
    --orange:      #f97316;
    --red:         #ef4444;
    --red-dark:    #b91c1c;
    --purple:      #a855f7;
    --gray:        #4b5563;

    --text:        #e2e8f0;
    --text-muted:  #64748b;
    --text-dim:    #94a3b8;

    --radius:      8px;
    --radius-sm:   4px;
    --shadow:      0 4px 24px rgba(0,0,0,0.5);
    --nav-h:       56px;
    --footer-h:    36px;

    --font-sans:   'Inter', system-ui, sans-serif;
    --font-mono:   'JetBrains Mono', 'Courier New', monospace;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--blue); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============ NAV ============ */
.main-nav {
    height: var(--nav-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}
.nav-logo {
    color: var(--blue);
    font-size: 1.1rem;
}
.nav-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text);
    white-space: nowrap;
}
.nav-links {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}
.nav-link {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg-hover); }
.nav-link.active { color: var(--blue); background: rgba(59,130,246,0.12); }
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}
.nav-callsign {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.nav-dept {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
}
.dept-police { color: var(--blue); }
.dept-fire   { color: var(--orange); }
.dept-ems    { color: var(--green); }
.dept-admin  { color: var(--purple); }

/* ============ FOOTER ============ */
.main-footer {
    height: var(--footer-h);
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.footer-time { color: var(--cyan); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-outline  { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger   { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: var(--red-dark); }
.btn-orange   { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-sm  { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn-xs  { padding: 0.18rem 0.5rem; font-size: 0.72rem; }
.btn-full { width: 100%; justify-content: center; }

/* ============ FORMS ============ */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.form-row   { display: flex; gap: 0.75rem; }
.form-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.form-input {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}
.form-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px var(--blue-glow);
}
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 70px; }
.form-select-sm {
    background: var(--bg-card2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
    cursor: pointer;
}
.form-select-xs {
    background: var(--bg-card2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    padding: 0.18rem 0.4rem;
    font-size: 0.72rem;
    cursor: pointer;
}
.form-input-sm {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
}
select.form-input, select.form-select-sm, select.form-select-xs {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

/* ============ SEARCH BAR ============ */
.search-bar {
    position: relative;
    margin-bottom: 1rem;
}
.search-input { padding-left: 2.2rem; }
.search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ============ LOGIN ============ */
.login-body {
    background: radial-gradient(ellipse at 60% 30%, #0d1f3c 0%, var(--bg-base) 70%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
}
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo-icon {
    display: inline-block;
    font-size: 2.5rem;
    color: var(--blue);
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 16px var(--blue));
}
.login-title {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--text);
}
.login-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
}
.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow), 0 0 40px rgba(59,130,246,0.07);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.login-footer {
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 0.25rem;
}

/* ============ PAGE LAYOUT ============ */
.page-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
    height: calc(100vh - var(--nav-h) - var(--footer-h));
}
.page-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}
.page-header-actions { display: flex; gap: 0.5rem; }

/* ============ DISPATCH LAYOUT ============ */
.dispatch-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    height: calc(100vh - var(--nav-h) - var(--footer-h));
    overflow: hidden;
}
.dispatch-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border);
}
.dispatch-units-panel {
    border-right: none;
    background: var(--bg-surface);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    gap: 0.5rem;
}
.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text);
}
.panel-icon { font-size: 1rem; }
.panel-actions { display: flex; align-items: center; gap: 0.5rem; }

/* ============ CALLS BOARD ============ */
.calls-board {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.call-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    position: relative;
    transition: all 0.15s;
    cursor: default;
}
.call-card:hover { border-color: var(--border); background: var(--bg-card2); }
.call-card.drag-over {
    border-color: var(--blue) !important;
    background: rgba(59,130,246,0.08) !important;
    box-shadow: 0 0 0 2px var(--blue-glow);
}
.call-card.drop-hover { border-color: var(--green) !important; background: rgba(34,197,94,0.05) !important; }

.priority-critical { border-left-color: var(--red) !important; }
.priority-high     { border-left-color: var(--orange) !important; }
.priority-medium   { border-left-color: var(--amber) !important; }
.priority-low      { border-left-color: var(--blue) !important; }

.call-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}
.call-number {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.call-type {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.call-location {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.icon-sm { font-size: 0.8rem; }
.call-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}
.call-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.call-time { font-family: var(--font-mono); }

.assigned-units-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    min-height: 24px;
}
.unit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    color: var(--blue);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
}
.unit-badge-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: color 0.1s;
}
.unit-badge-remove:hover { color: var(--red); }

.call-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}
.drop-zone-hint {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: 0.3rem;
    letter-spacing: 0.05em;
    border-top: 1px dashed var(--border-light);
    padding-top: 0.4rem;
}
.call-card.drag-active-mode .drop-zone-hint { opacity: 1; }

/* ============ UNITS ROSTER ============ */
.units-roster {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.unit-status-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.68rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 2px;
}
.unit-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    cursor: grab;
    transition: all 0.15s;
    user-select: none;
}
.unit-card:hover { background: var(--bg-hover); border-color: var(--border); }
.unit-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(2deg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.unit-card-left { flex-shrink: 0; }
.unit-card-body { flex: 1; min-width: 0; }
.unit-card-right { flex-shrink: 0; }
.unit-callsign {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.unit-officer {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.unit-assigned-call {
    font-size: 0.68rem;
    color: var(--blue);
    font-family: var(--font-mono);
    margin-top: 0.1rem;
}

/* Unit status colors */
.unit-status-available { border-left: 3px solid var(--green); }
.unit-status-busy      { border-left: 3px solid var(--red); }
.unit-status-enroute   { border-left: 3px solid var(--blue); }
.unit-status-onscene   { border-left: 3px solid var(--amber); }
.unit-status-offduty   { border-left: 3px solid var(--gray); opacity: 0.7; }

/* Status dots */
.unit-status-dot, .legend-dot, .priority-dot, .activity-type-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.dot-available     { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-busy          { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-enroute       { background: var(--blue); box-shadow: 0 0 6px var(--blue); }
.dot-onscene       { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.dot-offduty       { background: var(--gray); }
.dot-critical      { background: var(--red); }
.dot-high          { background: var(--orange); }
.dot-medium        { background: var(--amber); }
.dot-low           { background: var(--blue); }
.dot-blue          { background: var(--blue); }

/* BOLOs mini list */
.panel-section-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}
.bolos-mini-list {
    overflow-y: auto;
    max-height: 200px;
    flex-shrink: 0;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.bolo-mini-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
}
.bolo-mini-type { color: var(--amber); font-weight: 700; font-size: 0.65rem; text-transform: uppercase; }
.bolo-mini-desc { color: var(--text-dim); margin-top: 0.1rem; }

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.badge-blue   { background: rgba(59,130,246,0.15); color: var(--blue); border: 1px solid rgba(59,130,246,0.3); }
.badge-green  { background: rgba(34,197,94,0.12);  color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.badge-red    { background: rgba(239,68,68,0.12);   color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.badge-orange { background: rgba(249,115,22,0.12);  color: var(--orange); border: 1px solid rgba(249,115,22,0.25); }
.badge-amber  { background: rgba(245,158,11,0.12);  color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.badge-gray   { background: rgba(75,85,99,0.3);     color: var(--text-muted); border: 1px solid rgba(75,85,99,0.4); }
.badge-purple { background: rgba(168,85,247,0.12);  color: var(--purple); border: 1px solid rgba(168,85,247,0.25); }

/* Priority + Status pills */
.priority-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
}
.priority-badge.priority-critical { background: rgba(239,68,68,0.2); color: #fca5a5; }
.priority-badge.priority-high     { background: rgba(249,115,22,0.2); color: #fdba74; }
.priority-badge.priority-medium   { background: rgba(245,158,11,0.2); color: #fcd34d; }
.priority-badge.priority-low      { background: rgba(59,130,246,0.15); color: #93c5fd; }
.status-pill {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}
.status-pill.status-pending  { color: var(--amber); border-color: rgba(245,158,11,0.3); }
.status-pill.status-active   { color: var(--blue);  border-color: rgba(59,130,246,0.3); }
.status-pill.status-enroute  { color: var(--cyan);  border-color: rgba(6,182,212,0.3); }
.status-pill.status-onscene  { color: var(--green); border-color: rgba(34,197,94,0.3); }
.status-pill.status-resolved { color: var(--gray);  border-color: rgba(75,85,99,0.4); }

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card2);
    gap: 0.5rem;
}
.card-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}
.card-body { padding: 1rem 1.25rem; }
.card-body-scroll {
    overflow-y: auto;
    max-height: 340px;
}

/* ============ TABS ============ */
.records-tabs, .lookup-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.records-tab-content, .tab-content { display: none; }
.records-tab-content.active, .tab-content.active { display: block; }

/* ============ TABLE ============ */
.table-container { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.data-table thead tr {
    border-bottom: 1px solid var(--border);
}
.data-table th {
    text-align: left;
    padding: 0.6rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.data-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(30,58,95,0.4);
    color: var(--text-dim);
    vertical-align: middle;
}
.data-table td strong { color: var(--text); }
.data-table tbody tr:hover { background: var(--bg-hover); }

/* ============ STATS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
}
.stat-blue::before   { background: var(--blue); }
.stat-green::before  { background: var(--green); }
.stat-red::before    { background: var(--red); }
.stat-amber::before  { background: var(--amber); }
.stat-purple::before { background: var(--purple); }
.stat-icon { font-size: 1.5rem; flex-shrink: 0; }
.stat-number { font-size: 1.6rem; font-weight: 800; font-family: var(--font-mono); color: var(--text); line-height: 1; }
.stat-label  { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; font-weight: 600; letter-spacing: 0.04em; }
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ============ ACTIVITY / LISTS ============ */
.activity-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(30,58,95,0.3);
}
.activity-row:last-child { border-bottom: none; }
.activity-body { flex: 1; }
.activity-title { font-size: 0.82rem; color: var(--text); }
.activity-meta  { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }
.activity-time  { font-family: var(--font-mono); font-size: 0.72rem; flex-shrink: 0; }

/* ============ OFFICER PAGE ============ */
.officer-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1rem;
    padding: 1.25rem;
    overflow-y: auto;
    height: calc(100vh - var(--nav-h) - var(--footer-h));
}
.officer-main, .officer-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.unit-status-board { padding: 1rem 1.25rem; }
.unit-status-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.unit-info-block { flex: 1; min-width: 100px; }
.current-call-banner {
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: rgba(59,130,246,0.06);
    border: 1px solid rgba(59,130,246,0.2);
    border-left: 4px solid var(--blue);
}
.current-call-banner.priority-critical { border-left-color: var(--red); background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.2); }
.current-call-banner.priority-high     { border-left-color: var(--orange); }
.current-call-banner.priority-medium   { border-left-color: var(--amber); }
.call-banner-label { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.12em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.3rem; }
.call-banner-number { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); }
.call-banner-type   { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0.2rem 0; }
.call-banner-location { font-size: 0.82rem; color: var(--text-dim); }
.no-call-banner { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.85rem; }
.warrant-row, .bolo-row { padding: 0.6rem 1.25rem; border-bottom: 1px solid rgba(30,58,95,0.3); }
.warrant-row:last-child, .bolo-row:last-child { border-bottom: none; }
.warrant-name, .bolo-desc { font-size: 0.82rem; color: var(--text); margin-bottom: 0.2rem; }
.warrant-charges { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.warrant-meta { display: flex; align-items: center; gap: 0.5rem; }
.bolo-type-badge { display: inline-block; padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; margin-bottom: 0.25rem; }
.bolo-plate { font-family: var(--font-mono); font-size: 0.78rem; color: var(--cyan); margin-top: 0.2rem; }

/* Lookup */
.lookup-result { margin-top: 0.75rem; }
.lookup-result-card {
    background: var(--bg-card2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}
.lookup-result-card.has-warrants {
    border-color: rgba(239,68,68,0.4);
    border-left: 3px solid var(--red);
}
.result-name { font-weight: 700; color: var(--text); margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.5rem; }
.result-meta { font-size: 0.78rem; color: var(--text-muted); }
.no-results { text-align: center; color: var(--text-muted); padding: 1rem; font-size: 0.82rem; }

/* ============ MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 680px; }
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to   { opacity: 1; transform: none; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card2);
}
.modal-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0.1rem;
}
.modal-close:hover { color: var(--text); }
.modal > form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ============ ADMIN PANEL ============ */
.admin-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.15rem;
}

/* ============ DETAIL GRID ============ */
.detail-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.detail-row { display: flex; gap: 1rem; }
.detail-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); text-transform: uppercase; min-width: 100px; }
.detail-value { font-size: 0.85rem; color: var(--text); }

/* ============ TOASTS ============ */
.toast-container {
    position: fixed;
    bottom: calc(var(--footer-h) + 12px);
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}
.toast {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    color: var(--text);
    box-shadow: var(--shadow);
    animation: toastIn 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 220px;
    max-width: 340px;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--blue); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateX(20px); }
}

/* ============ ALERTS ============ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    border: 1px solid;
}
.alert-danger   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-success  { background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.3);  color: #86efac; }

/* ============ EMPTY STATES ============ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 0.5rem;
    color: var(--text-muted);
}
.empty-icon  { font-size: 2.5rem; opacity: 0.5; }
.empty-text  { font-size: 0.9rem; font-weight: 600; }
.empty-sub   { font-size: 0.78rem; opacity: 0.7; }
.empty-state-sm { padding: 1.5rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.82rem; }

/* ============ MISC ============ */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.loading-text { padding: 2rem; text-align: center; color: var(--text-muted); font-size: 0.82rem; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:0.7} 50%{opacity:1} }

/* ============ SCROLLBARS ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .dispatch-layout { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
    .dispatch-units-panel { max-height: 260px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .officer-layout { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .nav-links { display: none; }
}
