* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: 0;
}



:root {
    --mdc-dark-bg: #000000;
    --mdc-dark-text: #ffc857;
}

select {
  appearance: none !important;       /* Removes default arrow */
  -webkit-appearance: none !important;
  -moz-appearance: none !important;

  /* background-color: white; */
  background-image: none;  /* No arrow at all */
}

/* Dark Mode Styles */
body.mdc-night-mode .dispatch-index-box,
body.mdc-night-mode .dispatch-index-box {
    background-color: var(--mdc-dark-bg);
    color: var(--mdc-dark-text);
    border: 2px solid grey;
}

body.mdc-night-mode .dispatch-detail-box,
body.mdc-night-mode .dispatch-detail-box {
    background-color: var(--mdc-dark-bg);
    color: var(--mdc-dark-text);
    border: 2px solid grey;
}

body.mdc-night-mode .message-detail-box,
body.mdc-night-mode .message-detail-box {
    background-color: var(--mdc-dark-bg);
    color: var(--mdc-dark-text);
    border: 2px solid grey;
}

body.mdc-night-mode .message-index-box,
body.mdc-night-mode .message-index-box {
    background-color: var(--mdc-dark-bg);
    color: var(--mdc-dark-text);
    border: 1px solid grey;
}

body.mdc-night-mode .detail-content,
body.mdc-night-mode .detail-content {
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .mdetail-content,
body.mdc-night-mode .mdetail-content {
    color: var(--mdc-dark-text);
}

/* Ensure dispatch rows have proper text color in night mode */
body.mdc-night-mode .dispatch-row,
body.mdc-night-mode .dispatch-row {
    color: var(--mdc-dark-text);
}

/* Ensure dispatch row cells inherit color properly */
body.mdc-night-mode .dispatch-row > div,
body.mdc-night-mode .dispatch-row > div {
    color: inherit;
}

/* REMOVED - This was too broad and affected all elements
   Specific classes are now used for each element instead */

/* Highlight boxes keep their day mode colors in night mode (no override needed) */

/* Night mode: force black text on footer buttons and title bar */
body.mdc-night-mode .footer-btn,
body.mdc-night-mode .footer-btn,
body.mdc-night-mode .windows-title-bar,
body.mdc-night-mode .windows-title-bar,
body.mdc-night-mode .windows-title-bar *:not(span[data-stack] span:nth-child(2)),
body.mdc-night-mode .windows-title-bar *:not(span[data-stack] span:nth-child(2)) {
    color: #000 !important;
}

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap");

:root {
    --mdc-mono-font: "IBM Plex Mono", "Lucida Console", Consolas, monospace;
}

body.mdc-night-mode #btn-last-form span[data-stack] span,
body.mdc-night-mode #btn-last-form span[data-stack] span,
body.mdc-night-mode #switch-index-btn span[data-stack] span,
body.mdc-night-mode #switch-index-btn span[data-stack] span {
    color: #6ec0ff !important;
}

body.mdc-night-mode .highlight-box,
body.mdc-night-mode .highlight-box,
body.mdc-night-mode .highlight-box-1,
body.mdc-night-mode .highlight-box-1,
body.mdc-night-mode .highlight-box-2,
body.mdc-night-mode .highlight-box-2,
body.mdc-night-mode .highlight-box-3,
body.mdc-night-mode .highlight-box-3,
body.mdc-night-mode .highlight-box-4,
body.mdc-night-mode .highlight-box-4 {
    color: #000 !important;
}

/* Force uppercase across the MDC window regardless of Caps Lock */
.mdc-window,
.mdc-window * {
    text-transform: uppercase;
}

/* Global font override so capital I uses serifs (avoid breaking icon fonts). */
.mdc-window :where(*):not(i):not(svg):not(path):not([class^="fa"]):not([class*=" fa-"]) {
    font-family: var(--mdc-mono-font) !important;
}

html, body {
    height: 100%;
    /* Desktop background default (RUN_ID 20260930-desktop-background) —
     * replaced the near-white "washed out" day gradient with a richer
     * Windows-11-bloom-style blue. Night mode and custom user backgrounds
     * (body.has-custom-desktop-bg) override this below. */
    background: radial-gradient(130% 130% at 50% 30%, #3e6db8 0%, #2c549c 45%, #1b3771 100%);
    background-attachment: fixed;
    overflow: hidden;
    position: relative;
}

body.mdc-night-mode,
body.mdc-night-mode {
    /* Night (existing, unchanged) */
    background: linear-gradient(135deg, #0d1117 0%, #1a1f2e 40%, #161b22 100%);
}

body.has-custom-desktop-bg {
    background: var(--mdc-desktop-bg) center/cover no-repeat fixed !important;
}

/* Subtle LASD badge watermark in bottom right corner */
body::after {
    content: '';
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: url('../assets/imgs/bg.png') center/contain no-repeat;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Lucida Console', monospace;
}

/* Windows 11-style Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(32, 32, 32, 0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1000;
}

.taskbar-left {
    display: flex;
    align-items: center;
}

.taskbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.taskbar-right {
    display: flex;
    align-items: center;
}

.start-button {
    width: 40px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.start-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.start-icon {
    font-size: 16px;
    font-weight: bold;
}

.taskbar-icon {
    width: 40px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    margin: 0 4px;
}

.taskbar-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.taskbar-icon.active {
    background: rgba(255, 255, 255, 0.3);
    border-bottom: 2px solid #0078d4;
}

.taskbar-icon-image {
    width: 20px;
    height: 20px;
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tray-icon {
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.tray-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Volume icon specific styles for MDC sound control */
.volume-icon {
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.volume-icon:active {
    transform: scale(0.95);
}

/* Logout icon specific styles */
.logout-icon {
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ff6b6b !important;
}

.logout-icon:hover {
    background: rgba(255, 107, 107, 0.2) !important;
    transform: scale(1.1);
}

.logout-icon:active {
    transform: scale(0.95);
}

.system-time {
    color: #ffffff;
    font-size: 13px;
    font-family: 'Lucida Console', monospace;
    text-align: center;
    line-height: 1.2;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.system-time:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Desktop Icon */
.desktop-icon {
    position: fixed;
    top: 50px;
    left: 50px;
    width: 64px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px;
    transition: background 0.2s ease;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.icon-image {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
}

.icon-label {
    color: #ffffff;
    font-size: 11px;
    font-family: 'Lucida Console', monospace;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* MDC Window Container */
.mdc-window {
    position: absolute;
    /* Normal MDCS chrome follows the fixed-width outline, not the viewport. */
    width: max-content;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    display: none;
    /* Day (new default) — RUN_ID 20260825-day-night-mode-and-themes */
    box-shadow: var(--win11-shadow-window-light, 0 32px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06));
}

body.mdc-night-mode .mdc-window,
body.mdc-night-mode .mdc-window {
    /* Night (existing, unchanged) */
    box-shadow: var(--win11-shadow-window, 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08));
}

/* Dispatch Console Window */
.dispatcher-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 820px;
    max-width: calc(100% - 80px);
    height: 560px;
    max-height: calc(100% - 140px);
    background: #f0f0f0;
    border: 1px solid #999999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: none;
    z-index: 5000;
    overflow: hidden;
}

.dispatcher-window.show {
    display: block;
}

.dispatcher-content {
    height: calc(100% - 30px);
    overflow: hidden;
}

.dispatch-console-grid {
    display: grid;
    grid-template-columns: minmax(340px, 1.6fr) minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 12px;
    height: 100%;
    box-sizing: border-box;
}

.dispatch-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    min-width: 0;
}

.dispatch-column-form {
    overflow: auto;
    padding-right: 4px;
}

.dispatch-column .dispatch-list {
    flex: 1;
    max-height: none;
}

.dispatch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dispatch-location-input {
    flex: 1;
    min-width: 260px;
}

.dispatch-location-line2 {
    margin-left: 74px;
}

.dispatch-code-input {
    width: 80px;
}

.dispatch-priority-input {
    width: 60px;
}

.dispatch-remark-input {
    flex: 1;
    min-width: 220px;
}

.dispatch-upd-input {
    flex: 1;
    min-width: 220px;
}

.dispatch-action-row {
    gap: 6px;
}

.dispatch-simple-submit {
    background: #e6e6e6;
    border: 1px solid #999999;
    height: 24px;
    padding: 0 10px;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    cursor: pointer;
}

.dispatch-simple-submit:hover {
    background: #d4d4d4;
}

.dispatch-section-header {
    margin-top: 4px;
}

.dispatch-simple-action {
    background: #e6e6e6;
    border: 1px solid #999999;
    padding: 2px 8px;
    font-size: 10px;
    font-family: 'Lucida Console', monospace;
    cursor: pointer;
}

.dispatch-list {
    border: 1px solid #999999;
    background: #ffffff;
    padding: 4px;
    max-height: 140px;
    overflow: auto;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
}

body.mdc-night-mode .dispatcher-window .obs-layout,
body.mdc-night-mode .dispatcher-window .obs-layout {
    background-color: #f0f0f0;
    color: #000000;
}

body.mdc-night-mode .dispatcher-window .obs-label-left,
body.mdc-night-mode .dispatcher-window .obs-label-inline,
body.mdc-night-mode .dispatcher-window .obs-label-left,
body.mdc-night-mode .dispatcher-window .obs-label-inline {
    background-color: #f0f0f0;
    color: #000000;
}

body.mdc-night-mode .dispatcher-window .dispatch-row,
body.mdc-night-mode .dispatcher-window .dispatch-row {
    color: #000000;
}

body.mdc-night-mode .dispatcher-window .dispatch-row > div,
body.mdc-night-mode .dispatcher-window .dispatch-row > div {
    color: inherit;
}

.dispatch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
}

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

.dispatch-item.selected {
    background: #d7f0f4;
}

.dispatch-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dispatch-actions {
    display: flex;
    gap: 4px;
}

.dispatch-action {
    background: #e6e6e6;
    border: 1px solid #999999;
    padding: 2px 6px;
    font-size: 10px;
    font-family: 'Lucida Console', monospace;
    cursor: pointer;
}

.dispatch-action.detach {
    color: #b00000;
}

.dispatch-action.delete {
    color: #7a0f0f;
    border-color: #9d6b6b;
}

.dispatch-empty {
    text-align: center;
    padding: 6px;
    color: #555555;
    font-size: 11px;
}

/* Windows-style title bar */
.windows-title-bar {
    width: 100%;
    box-sizing: border-box;
    height: 30px;
    background: linear-gradient(to bottom, #e6e6e6, #cccccc);
    border: 1px solid #999999;
    border-bottom: 2px solid #666666;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    font-family: var(--win11-font, 'Segoe UI', 'Segoe UI Variable', Tahoma, Geneva, Verdana, sans-serif);
    font-size: 11px;
    font-weight: normal;
    color: #000;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    cursor: move; /* Show move cursor */
    user-select: none; /* Prevent text selection while dragging */
}

#dispatcher-title-bar {
    width: 100%;
    box-sizing: border-box;
}

/* MDCS #title-bar — Day/Night mode (RUN_ID 20260825-day-night-mode-and-themes).
 * !important + ID-anchoring required to reliably beat two live cascade
 * competitors: the black-text-forcing exception above
 * (body.mdc-night-mode/.mdc-night-mode .windows-title-bar *:not(...)) and
 * .mdc-window.fullscreen .windows-title-bar's unconditional light
 * background-color below. See Implementation Plan §0.2/§3c.
 * Deliberately does NOT touch .minimize-btn/.fullscreen-btn/.close-btn
 * (their own permanently-light beveled background never darkens, so the
 * pre-existing forced-black text above stays legible against them
 * regardless of theme) and does NOT touch the title bar's own beveled
 * #999999/#666666 border divider (left unchanged in both themes, matching
 * MDCS's own retro identity — Tradeoff #2).
 */
#title-bar {
    background: var(--win11-bg-solid-light, #F3F3F3) !important;
    color: #1B1B1B !important;
    box-shadow: none !important;
}

/* Font fix (RUN_ID 20260904-unify-title-bar-across-windows, design spec §14):
 * #title-bar had no descendant-scoped !important font-family
 * re-declaration of its own — unlike #dispatcher-title-bar (below), which
 * already has one — so this window's title bar has been silently
 * rendering in fonts.css's Courier New fallback, the same confirmed defect
 * this run fixes for Settings. Scoped to #title-bar's own subtree only.
 */
#title-bar,
#title-bar * {
    font-family: var(--win11-font, 'Segoe UI', 'Segoe UI Variable', Tahoma, Geneva, Verdana, sans-serif) !important;
}

body.mdc-night-mode #title-bar,
body.mdc-night-mode #title-bar {
    background: var(--win11-bg-solid-dark, #202020) !important;
    color: #f3f3f3 !important;
}

#title-bar .title-text,
#title-bar .title-icon {
    color: #1B1B1B !important;
}

body.mdc-night-mode #title-bar .title-text,
body.mdc-night-mode #title-bar .title-text,
body.mdc-night-mode #title-bar .title-icon,
body.mdc-night-mode #title-bar .title-icon {
    color: #f3f3f3 !important;
}

body.mdc-night-mode #title-bar .title-icon,
body.mdc-night-mode #title-bar .title-icon {
    filter: brightness(1.6) saturate(0);
}

.title-icon {
    height: 16px;
    width: 16px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.title-text {
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.title-buttons {
    display: flex;
    gap: 2px;
}

.minimize-btn {
    width: 16px;
    height: 16px;
    background: linear-gradient(to bottom, #e6e6e6, #cccccc);
    border: 1px solid #999999;
    color: #333;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0;
    line-height: 1;
}

.minimize-btn:hover {
    background: linear-gradient(to bottom, #d4d4d4, #b8b8b8);
}

.minimize-btn:active {
    background: #aaaaaa;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.fullscreen-btn {
    width: 16px;
    height: 16px;
    background: linear-gradient(to bottom, #e6e6e6, #cccccc);
    border: 1px solid #999999;
    color: #333;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0;
    line-height: 1;
}

.fullscreen-btn:hover {
    background: linear-gradient(to bottom, #d4d4d4, #b8b8b8);
}

.fullscreen-btn:active {
    background: #aaaaaa;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.close-btn {
    width: 16px;
    height: 16px;
    background: linear-gradient(to bottom, #ff6b6b, #ff5252);
    border: 1px solid #d32f2f;
    color: white;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0;
}

.close-btn:hover {
    background: linear-gradient(to bottom, #ff5252, #f44336);
}

.close-btn:active {
    background: #d32f2f;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

/* Accessibility fix (design spec §7), Title-bar unification
 * (RUN_ID 20260904-unify-title-bar-across-windows): every title-bar button
 * needs a visible keyboard-focus ring. Shared across #title-bar (main
 * window shell) and #dispatcher-title-bar (Dispatch Console), the two
 * remaining consumers of these classes.
 */
.minimize-btn:focus-visible,
.fullscreen-btn:focus-visible,
.close-btn:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

body.mdc-night-mode .minimize-btn:focus-visible,
body.mdc-night-mode .fullscreen-btn:focus-visible,
body.mdc-night-mode .close-btn:focus-visible {
    outline-color: #fff;
}



/* Changes Summary Styling */
.changes-summary {
    font-size: 11px;
    line-height: 1.4;
    color: #333;
}

/* --- Fullscreen Mode Styles --- */

/* Make body black in fullscreen to hide edges if any */
body.fullscreen-mode {
    background-color: #000;
    overflow: hidden; /* Prevent scrolling */
}

/* MDC Window in Fullscreen */
.mdc-window.fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Title Bar in Fullscreen */
.mdc-window.fullscreen .windows-title-bar {
    width: 100% !important;
    height: 30px !important; /* Keep fixed height for title bar */
    border-radius: 0;
    border: none;
    /* Superseded by #title-bar's own !important background rule above
     * (Day/Night mode, RUN_ID 20260825-day-night-mode-and-themes) — left
     * in place, harmless/dead-in-effect, since removing unrelated
     * pre-existing code is out of this run's scope. */
    background-color: #e6e6e6; /* Ensure background persists */
}

/* Main Content Outline in Fullscreen */
.mdc-window.fullscreen .outline {
    width: 100% !important;
    height: calc(100vh - 30px) !important; /* Subtract title bar height */
    border: none;
    grid-template-columns: 40% 50% 10% !important; /* Explicit columns 40/50/10 */
    grid-template-rows: 12.5% repeat(7, 1fr) !important; /* Top row 12.5% (matches ~80px/640px) */
    display: grid;
}

/* Button Row (Top) */
.mdc-window.fullscreen .button-row {
    height: 100% !important; /* Fill the 12.5% row */
    grid-template-columns: repeat(10, 1fr) !important;
}

/* Right Column Buttons */
.mdc-window.fullscreen .right-column {
    width: 100% !important;
    height: 100% !important;
    grid-column: 3 !important; /* 3rd column in our 40/50/10 grid */
    grid-row: 2 / -1 !important; /* Span from row 2 to end */
}

/* --- Left Column Elements (40% width) --- */

/* 1. Highlight Box 1 (Top of Dispatch Index) */
.mdc-window.fullscreen .highlight-box-1 {
    width: 40% !important;
    left: 0 !important;
    top: 12.5% !important; /* Starts after button row */
    height: 2.5% !important; /* Increased to accommodate padding */
    padding-top: 0.4% !important; /* Added top padding */
    padding-bottom: 0.4% !important; /* Added bottom padding */
}

/* 2. Dispatch Index Box */
.mdc-window.fullscreen .dispatch-index-box {
    width: 40% !important;
    left: 0 !important;
    top: 15% !important; /* Flush with bottom of highlight-box-1 (12.5% + 2.5%) */
    height: 17% !important; /* Flush with top of highlight-box-3 (32% - 15%) */
}

/* 3. Highlight Box 3 (Top of Dispatch Detail) */
.mdc-window.fullscreen .highlight-box-3 {
    width: 40% !important;
    left: 0 !important;
    top: 32% !important; /* Flush with bottom of dispatch-index-box (15% + 17%) */
    height: 2.5% !important; /* Increased to accommodate padding */
    padding-top: 0.4% !important; /* Added top padding */
    padding-bottom: 0.4% !important; /* Added bottom padding */
}

/* 4. Dispatch Detail Box */
.mdc-window.fullscreen .dispatch-detail-box {
    width: 40% !important;
    left: 0 !important;
    top: 34.5% !important; /* Flush with bottom of highlight-box-3 (32% + 2.5%) */
    height: 29% !important; /* Flush with top of highlight-box-4 (63.5% - 34.5%) */
}

/* 5. Highlight Box 4 (Top of Message Index) */
.mdc-window.fullscreen .highlight-box-4 {
    width: 40% !important;
    left: 0 !important;
    top: 63.5% !important; /* Flush with bottom of dispatch-detail-box (34.5% + 29%) */
    height: 2.5% !important; /* Increased to accommodate padding */
    padding-top: 0.4% !important; /* Added top padding */
    padding-bottom: 0.4% !important; /* Added bottom padding */
}

/* 6. Message Index Box */
.mdc-window.fullscreen .message-index-box {
    width: 40% !important;
    left: 0 !important;
    top: 66% !important; /* Flush with bottom of highlight-box-4 (63.5% + 2.5%) */
    bottom: 48px !important; /* Flush with top of footer */
    height: auto !important; /* Let top/bottom define height */
}

/* 7. Left Footer */
.mdc-window.fullscreen .left-footer {
    width: 40% !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 48px !important; /* Fixed height matching normal mode */
}


/* --- Center Column Elements (50% width) --- */

/* 1. Highlight Box 2 (Top of Message Detail) */
.mdc-window.fullscreen .highlight-box-2 {
    width: 50% !important;
    left: 40% !important; /* Start after left column */
    top: 12.5% !important;
    height: 2.5% !important; /* Increased to accommodate padding */
    padding-top: 0.4% !important; /* Added top padding */
    padding-bottom: 0.4% !important; /* Added bottom padding */
}

/* 2. Message Detail Box */
.mdc-window.fullscreen .message-detail-box {
    width: 50% !important;
    left: 40% !important;
    top: 15% !important; /* 12.5% + 2.5% to account for highlight-box-2 height */
    bottom: 0 !important;
    height: auto !important;
}

/* Ensure buttons stretch in fullscreen */
.mdc-window.fullscreen .blue-btn {
    width: 100% !important;
    height: 100% !important;
    font-size: 1.2vw;
}

/* Adjust font sizes for readability in large mode */
.mdc-window.fullscreen .detail-content,
.mdc-window.fullscreen #dispatch-index-list {
    font-size: 1.4em !important; /* Significantly larger */
    width: 100% !important;
    min-width: 0 !important;
}

.mdc-window.fullscreen .dispatch-row div {
    font-size: 1.4em !important; /* Ensure individual row cells also scale */
}

.mdc-window.fullscreen .dispatch-row {
    width: 100% !important;
    min-width: 0;
    grid-template-columns: 5em 7.5em 8.5em 5em 1fr;
    padding: 4px 0;
}

/* Also for message detail box content */
.mdc-window.fullscreen .message-detail-box .mdetail-content {
    font-size: 1.4em !important;
}

/* For input fields, if any are present in content boxes */
.mdc-window.fullscreen input,
.mdc-window.fullscreen textarea,
.mdc-window.fullscreen select {
    font-size: 1.2em !important;
}

/* Erase buttons in fullscreen - fit to default window */
.mdc-window.fullscreen .message-detail-box .erase-buttons {
    position: absolute;
    left: 0 !important;
    right: 0 !important;
    bottom: 88px !important; /* Position above message-input, same as non-fullscreen */
    width: 100% !important;
    display: flex;
    justify-content: center;
    gap: 0px;
    padding: 0px;
    z-index: 20;
}

.mdc-window.fullscreen .message-detail-box .ncic-action-buttons {
    position: absolute;
    left: 0 !important;
    right: 0 !important;
    bottom: 88px !important;
    width: 100% !important;
    justify-content: center;
    gap: 0px;
    padding: 0px;
    z-index: 20;
}

.mdc-window.fullscreen .erase-btn {
    min-width: 25vw !important; /* Scale with viewport width */
    height: 4vh !important; /* Scale with viewport height */
    font-size: 1.4vw !important; /* Scale font size with viewport */
    padding: 1vh 2vw !important; /* Scale padding proportionally */
}

/* Message input in fullscreen */
.mdc-window.fullscreen .message-input {
    position: absolute;
    left: 0 !important;
    right: 0 !important;
    bottom: 48px !important; /* Above footer */
    width: 100% !important;
    height: 40px !important;
}

/* Message footer in fullscreen */
.mdc-window.fullscreen .message-footer {
    position: absolute;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 48px !important;
}

/* Hide desktop taskbar in fullscreen */
body.fullscreen-mode .taskbar, 
body.fullscreen-mode .desktop-icons-container {
    display: none;
}

.changes-summary .field-label {
    color: #fff598;
    font-weight: bold;
}

.changes-summary .old-value {
    color: #ff6b6b;
    text-decoration: line-through;
    margin-right: 10px;
}

.changes-summary .new-value {
    color: #4caf50;
    font-weight: bold;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Logout button styling */
.logout-button {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.outline {
    width: 800px;
    height: 640px;
    border: 2px solid rgb(0, 0, 0);
    border-top: none; /* Connect seamlessly with title bar */
    background-color: rgb(0, 0, 0);
    position: relative;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(8, 1fr);
}

.highlight-box {
    position: absolute;
    left: 0;
    top: 80px; /* bottom of row 1 (80px tall) */
    width: 320px; /* columns 1-4 (4 * 80px) */
    height: 12px; /* max height 12px */
    background-color: #fff598; /* yellow-ish */
}

.button-row {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    width: 100%;
    gap: 0;
    padding: 0;
    height: 100%;
    grid-column: 1 / -1;
    grid-row: 1;
}

.right-column {
    grid-row: 2 / span 7;
    grid-column: 10;
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    gap: 0;
    width: 100%;
    height: 100%;
}

.blue-btn {
    background-color: #1e90ff;
    color: #ffffff !important;
    border: 2px groove #1565c0;
    padding: 0;
    border-radius: 0;
    font-family: 'Lucida Console', monospace;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin: 0;
    width: 100%;
    height: 100%;
}

.mdc-window .blue-btn span {
    color: #ffffff !important;
}

.blue-btn:focus,
.blue-btn:focus-visible,
.blue-btn:active {
    outline: none;
    box-shadow: none;
}

/* per-button color overrides for 11–17 */
/* SEND button state colors - ID selector for highest specificity */
#send-btn.btn-red { background-color: #ff3b30 !important; }
#send-btn.btn-green { background-color: #34c759 !important; }
#send-btn.btn-yellow { background-color: #ffd60a !important; color: #000 !important; }
#send-btn.btn-purple { background-color: #8e44ad !important; }

/* Generic button state colors for other buttons */
.btn-red { background-color: #ff3b30 !important; color: #000 !important; }
.btn-green { background-color: #34c759 !important; color: #000 !important; }
.btn-yellow { background-color: #ffd60a !important; color: #000 !important; }
.btn-purple { background-color: #8e44ad !important; }

/* New Message button styling */
#btn-new-message {
    background-color: #fff !important;
    color: #000 !important;
}

#btn-new-message span,
.new-message-text {
    color: #000 !important;
}

body.mdc-night-mode #btn-clear-disp span[data-stack="clear-disp"],
body.mdc-night-mode #btn-clear-disp span[data-stack="clear-disp"],
body.mdc-night-mode #btn-clear-def span[data-stack="clear-def"],
body.mdc-night-mode #btn-clear-def span[data-stack="clear-def"],
body.mdc-night-mode #btn-call-log span[data-stack="call-log"],
body.mdc-night-mode #btn-call-log span[data-stack="call-log"],
body.mdc-night-mode #btn-other-functions span[data-stack="other-functions"],
body.mdc-night-mode #btn-other-functions span[data-stack="other-functions"] {
    color: #ffffff !important;
}

/* Messages Unread button - separate class, black text in night mode */
.msgs-unread-text {
    color: #000 !important;
}

/* Send button hover effects */
#send-btn.btn-purple:hover {
    background-color: #9b59b6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.4);
    transition: all 0.3s ease;
}

#send-btn.btn-purple:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(142, 68, 173, 0.6);
}

/* thin separators between adjacent buttons only */
.button-row .blue-btn:not(:first-child) {
    border-left: 1px solid #000;
}

.right-column .blue-btn:not(:first-child) {
    border-top: 1px solid #000;
}

/* stacked label for button 1 */
button span[data-stack] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    line-height: 1;
    text-align: center;
}
button span[data-stack] > span {
    display: block;
}

.nowrap { white-space: nowrap; }

.btn-small { font-size: 12px; line-height: 1; }

/* yellow highlight bars under 1–4 and 5–9 */
.highlight-box-1,
.highlight-box-2,
.highlight-box-3,
.highlight-box-4 {
    position: absolute;
    top: 79px; /* align border flush to bottom of top row */
    height: 18px; /* Increased from 12px to accommodate padding */
    background-color: #fff598;
    border: 1.5px solid #000; /* Thin 1.5px border around all highlight boxes */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b0b0b;
    text-transform: uppercase;
    font-family: 'Bebas Neue', 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    padding-top: 3px; /* Added top padding */
    padding-bottom: 3px; /* Added bottom padding */
}

.highlight-box-1 { left: 0; width: 320px; top: 79px; border-right: 1.5px solid #000; } /* Vertical separator */
.highlight-box-2 { left: 319px; width: 398px; top: 79px; border-left: 1.5px solid #000; } /* Vertical separator */
.highlight-box-3 { left: 0; width: 320px; top: 204px; border-right: 1.5px solid #000; } /* Vertical separator */
.highlight-box-4 { left: 0; width: 320px; top: 406px; border-right: 1.5px solid #000; } /* Vertical separator */

/* ensure separation between button 10 and 11 */
.button-row .blue-btn:nth-child(10) {
    border-bottom: 1px solid #000;
}

/* Dispatch Index content box (~400 x 120) */
.dispatch-index-box {
    position: absolute;
    left: 0;
    top: 97px; /* Flush with bottom of highlight-box-1 (79px + 18px) */
    width: 320px;
    height: 107px; /* Flush with top of highlight-box-3 (204px - 97px) */
    border: none; /* No borders */
    border-right: 1.5px solid #000; /* Vertical separator */
    background-color: #fff;
    box-sizing: border-box;
    padding: 0; /* No padding */
    display: flex;
    flex-direction: column;
    gap: 0;
    font-size: 10px; /* Kept small for non-fullscreen */
    line-height: 1.1;
    font-family: 'Lucida Console', monospace;
    font-weight: 500; /* Bold 500 */
    white-space: nowrap; /* prevent wrapping inside box */
    overflow-x: auto; /* Enable horizontal scroll for long content */
    overflow-y: auto; /* Allow vertical scroll when calls overflow */
}

#dispatch-index-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0; /* No padding */
    width: max-content; /* allow list to expand with content */
    min-width: 100%; /* maintain minimum width to fill container */
    font-family: 'Lucida Console', monospace;
    font-weight: 500; /* Bold 500 */
}

/* Fullscreen: Highlighted dispatch rows should take full width */
.mdc-window.fullscreen #dispatch-index-list .dispatch-row.selected,
.mdc-window.fullscreen #dispatch-index-list .dispatch-row.user-active {
    width: 100% !important;
}

/* Message Detail big area (text-focused; loose sizing) */
.message-detail-box {
    position: absolute;
    left: 319px; /* under highlight-box-2 */
    top: 97px; /* Flush with bottom of highlight-box-2 (79px + 18px) */
    width: 398px;
    bottom: 0; /* extend to panel bottom to fill space */
    border: none; /* No borders */
    border-left: 1.5px solid #000; /* Vertical separator */
    background-color: #fff;
    box-sizing: border-box;
    padding: 0; /* no padding - handle spacing with inner content */
    overflow: hidden; /* hide overflow on container */
    font-family: 'Lucida Console', monospace;
    font-weight: 500; /* Bold 500 */
}

.message-detail-box .mdetail-content {
    white-space: pre-wrap; /* preserve newlines, allow wrapping */
    color: #000;
    font-size: 14px;
    font-family: 'Lucida Console', monospace;
    font-weight: 500; /* Bold 500 */
    display: block; /* Fixed: Changed from flex to block for proper caret behavior */
    line-height: 1.2;
    /* padding inside scrollable content */
    padding: 0 8px;
    height: calc(100% - 88px); /* full height minus footer space */
    overflow-y: auto; /* content area handles its own scrolling */
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    cursor: text; /* Show text cursor when hovering */
    caret-color: #000; /* Black blinking cursor */
    outline: none; /* Remove focus outline */

}

/* Dark/Night mode: the base `.message-detail-box .mdetail-content { color: #000 }` rule is more specific
   than the earlier `.mdetail-content` dark-mode override, so enforce readable text here. */
body.mdc-night-mode .message-detail-box .mdetail-content,
body.mdc-night-mode .message-detail-box .mdetail-content {
    color: var(--mdc-dark-text) !important;
    caret-color: var(--mdc-dark-text) !important;
}

.message-detail-box .mdetail-content.mdetail-locked {
    cursor: default;
    display:flex;
    flex-direction:column;
    padding:0 8px !important;
    margin:0px !important;
}

/* Incident Report ready banner — appended into .mdetail-content immediately
   after the Clear Tag confirmation text (frontend/js/clear-tag-form.js) so
   the follow-up action is impossible to miss without relying on the
   message-index list. Opens the Incident Report program window on click. */
.message-detail-box .mdetail-content .ir-ready-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid #00a4c5;
    background: rgba(0, 164, 197, 0.12);
    flex-shrink: 0;
}

.message-detail-box .mdetail-content .ir-ready-banner-text {
    font-family: 'Lucida Console', monospace;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #00728a;
}

.message-detail-box .mdetail-content .ir-ready-banner-btn {
    font-family: 'Lucida Console', monospace;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #fff;
    background: #00a4c5;
    border: 1px solid #00728a;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.message-detail-box .mdetail-content .ir-ready-banner-btn:hover {
    background: #00b8dd;
}

.message-detail-box .mdetail-content .ir-ready-banner-btn:active {
    background: #00728a;
    transform: scale(0.97);
}

body.mdc-night-mode .message-detail-box .mdetail-content .ir-ready-banner,
body.mdc-night-mode .message-detail-box .mdetail-content .ir-ready-banner {
    background: rgba(0, 164, 197, 0.18);
}

body.mdc-night-mode .message-detail-box .mdetail-content .ir-ready-banner-text,
body.mdc-night-mode .message-detail-box .mdetail-content .ir-ready-banner-text {
    color: #4fd6f0;
}

/* URN issuance transcript uses fixed-width teletype alignment. */
.message-detail-box .mdetail-content.urn-output {
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
    overflow-x: auto;
    overflow-y: auto;
    line-height: 1.4em;
}

/* Every line div gets a consistent line height so blank lines render as visible space. */
.message-detail-box .mdetail-content.urn-output > div {
    white-space: pre;
    min-height: 1.4em;
    line-height: 1.4em;
}

/* URN return screen should not show erase buttons. */
.message-detail-box .mdetail-content.urn-output ~ .erase-buttons {
    display: none !important;
}

.message-detail-box .mdetail-content .mdetail-line--alert {
    color: #ef4444 !important;
    font-weight: 700;
}

body.mdc-night-mode .message-detail-box .mdetail-content .mdetail-line--alert,
body.mdc-night-mode .message-detail-box .mdetail-content .mdetail-line--alert {
    color: #ff6b6b !important;
}

.message-detail-box .mdetail-content .mdetail-flag-value {
    color: #ef4444;
    font-weight: 700;
}

body.mdc-night-mode .message-detail-box .mdetail-content .mdetail-flag-value,
body.mdc-night-mode .message-detail-box .mdetail-content .mdetail-flag-value {
    color: #ff6b6b;
}

.message-detail-box .mdetail-content .mdetail-trash-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 3px;
    vertical-align: -3px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(28%) sepia(92%) saturate(2878%) hue-rotate(344deg) brightness(99%) contrast(89%);
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.15s ease;
}

.message-detail-box .mdetail-content .mdetail-trash-icon:hover {
    transform: scale(1.25);
    filter: brightness(0) saturate(100%) invert(18%) sepia(100%) saturate(4000%) hue-rotate(344deg) brightness(110%) contrast(95%);
}

.message-detail-box .mdetail-content .mdetail-trash-icon:active {
    transform: scale(0.9);
}

.message-detail-box .mdetail-content:focus {
    outline: none; /* Keep no outline even when focused */
}

.new-message-form {
    position: absolute;
    top: calc(22% - 60px);
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 34%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    pointer-events: auto;
    box-sizing: border-box;
}

.new-message-label {
    font-size: 12px;
    letter-spacing: 1px;
    color: #000;
    text-align: left;
    margin-bottom: 0;
    text-transform: uppercase;
    font-weight: bold;
    font-family: 'Lucida Console', monospace;
}

.new-message-from-unit,
.new-message-box-small {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.92);
    border: none;
    padding: 4px 8px;
    font-family: 'Lucida Console', monospace;
    font-size: 13px;
    color: #00ff00;
}

.new-message-box {
    width: 100%;
    flex: 1;
    background: rgba(0, 0, 0, 0.92);
    border: none;
    padding: 8px;
    font-family: 'Lucida Console', monospace;
    font-size: 13px;
    color: #00ff00;
    resize: vertical;
    min-height: 150px;
}

body.mdc-night-mode .new-message-box,
body.mdc-night-mode .new-message-box,
body.mdc-night-mode .new-message-from-unit,
body.mdc-night-mode .new-message-from-unit,
body.mdc-night-mode .new-message-box-small,
body.mdc-night-mode .new-message-box-small {
    background: #000;
    color: #f5f0ff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
body.mdc-night-mode .new-message-label,
body.mdc-night-mode .new-message-label {
    color: #ffc857;
}

@keyframes overlayPulse {
    0% { opacity: 0; transform: translateX(-50%) scale(0.92); }
    20% { opacity: 1; transform: translateX(-50%) scale(1); }
    60% { opacity: 0.2; }
    100% { opacity: 0; transform: translateX(-50%) scale(1); }
}

.message-detail-box .mdetail-content:empty:before {
    content: '';
    color: transparent; /* Invisible placeholder */
}

/* VEH form */
.veh-form {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    line-height: 1.2;
    font-family: 'Lucida Console', monospace;
    font-weight: bold;
    height: calc(100% - 88px); /* full height minus footer space */
    overflow-y: auto; /* form handles its own scrolling */
    box-sizing: border-box;
}

/* Dark/Night Mode Support for VEH form */
body.mdc-night-mode .veh-form,
body.mdc-night-mode .veh-form,
body.mdc-night-mode .veh-form *:not(input):not(select):not(textarea),
body.mdc-night-mode .veh-form *:not(input):not(select):not(textarea) {
    color: var(--mdc-dark-text);
}

.message-detail-box .mdetail-content:focus::after {
    content: '▌';
    display: inline-block;
    margin-left: 4px;
    width: 6px;
    animation: mdetailCursorBlink 1s steps(2, start) infinite;
}

.message-detail-box .mdetail-content:not(:focus)::after {
    display: none;
}

@keyframes mdetailCursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* #obs-form-portal-root { display: contents; } removed 2026-08-18
   (RUN_ID 20260818-react-migration-phase2, Replan #1). The wrapper node it
   targeted no longer exists as a separate element — ObsFormPortal.jsx (and
   BikePortal.jsx) now mount into a single node that carries both the
   #<form>-portal-root id and the form's own class name (see
   frontend-react/src/formPortalBridge.js), so .obs-form's own
   `height: calc(100% - 88px)` scroll-convention rule below now applies
   directly to that same node. Leaving this rule in place after the
   collapse would strip that node of its own box entirely via
   `display: contents`, defeating the very rule it needs. See TASK.md's
   "Replan #1 addendum" for the full root-cause analysis this removal is
   part of. Do not re-add an equivalent rule for #bike-form-portal-root —
   under the collapse there is no separate wrapper for BIKE either. */

/* All forms in message detail box should scroll */
.want-form, .obs-form, .veh-reg-form {
    height: calc(100% - 88px);
    overflow-y: auto;
    box-sizing: border-box;
}

/* Forms that replace .message-detail-box's content directly (no nesting
   inside #mdetail-content) must scroll their own content — see
   .want-form/.obs-form/.veh-reg-form above for the same pattern. */
.gun-form, .booking-form, .property-form, .bike-form, .boat-form,
.modify-form {
    height: calc(100% - 88px);
    overflow-y: auto;
    box-sizing: border-box;
    line-height: 1.2;
}

/* MODIFY LOG's real margin (post line-height:1.2) measured 22px conservative
   (baseline font, windowed) by runtime-engineer Pass 1 — this padding gives
   real headroom against the remaining, disclosed Lucida-Console-metric
   measurement uncertainty. See TASK.md Runtime Verification Findings
   (RUN_ID 20260816-mdc-form-scroll-room-recurrence). */
.modify-form {
    padding-bottom: 16px;
}

/* OBS form - compact layout matching reference image */
.obs-form {
    padding: 0;
    display: block;
    font-size: 11px;
    line-height: 1.2;
    font-family: 'Lucida Console', monospace;
    font-weight: normal;
    color: #000;
}

/* OBS form specific field styling - matching reference image */
.obs-form .veh-label {
    display: inline-block;
    font-weight: bold;
    color: #000;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
}

.obs-form .veh-input {
    border: none;
    background: #00a4c5;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    color: #000;
    padding: 1px 3px;
    height: 18px;
    box-sizing: border-box;
}

.obs-form .veh-row-full {
    margin-bottom: 12px;
    display: block;
}

.obs-form .veh-title-stack {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ccc;
}

/* OBS field groups */
.obs-field-group {
    margin-bottom: 8px;
}

/* OBS labels */
.obs-label {
    display: block;
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 2px;
    color: #000;
    font-family: 'Lucida Console', monospace;
}

/* OBS inputs - matching reference image styling */
.obs-input {
    display: inline-block;
    border: none;
    background: #00a4c5;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    color: #000;
    padding: 1px 3px;
    height: 18px;
    box-sizing: border-box;
}

/* Update Call form */
.update-call-form {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 11px;
    line-height: 1.2;
    font-family: 'Lucida Console', monospace;
    font-weight: bold;
    background: #fff;
    height: calc(100% - 88px);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.form-static-text {
    background: #e9ecef;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 2px;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.veh-title { 
    font-weight: 700; 
    font-size: 12px;
    margin-right: 8px;
    line-height: 1.1;
}
.veh-title-stack {
    display: flex;
    flex-direction: column;
    margin-right: 8px;
}
.veh-title-stack .veh-title:nth-child(2) {
    padding-left: 8px;
}
.veh-input-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}
.veh-sub { 
    padding-left: 10px; 
}
.veh-label {
    display: inline-block;
    width: 60px;
    margin-right: 8px;
    white-space: nowrap;
}
.veh-input { 
    border: 1px solid #000; 
    background: #d6ecff; 
    padding: 2px 4px; 
    font-family: 'Lucida Console', monospace; font-size: 13px; font-weight: normal; 
    font-size: 11px;
}
.veh-input.one { 
    width: 20px; 
    text-align: center; 
    margin-left: -25px;
}
.veh-input.two {
    width: 22px;
    text-align: center;
    margin-left: -55px;
}
.veh-input.plate {
    width: 80px;
    margin-left: -35px;
}
.veh-input.long {
    width: 200px;
}
.veh-input.make-input {
    width: 60px;
    margin-left: 100px;
}
.veh-input.svrn-input {
    width: 50px;
    margin-left: -15px;
}
.veh-input.unedited-input {
    width: 15px;
    height: 15px;
    text-align: center;
    margin-left: -5px;
}
.veh-input.info-only-input {
    width: 15px;
    height: 15px;
    text-align: center;
    margin-left: 5px;
}
.veh-label.info-only-label {
    margin-left: 20px;
}
.veh-input.dmv-input {
    width: 15px;
    text-align: center;
    margin: 0 4px;
}
.veh-input.vin-input {
    width: 200px;
    margin-left: -20px;
}
.veh-input.eng-input {
    width: 200px;
    margin-left: -20px;
}
.veh-checkbox {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 4px;
}
.veh-row { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 4px;
}
.veh-row-full { 
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}
.veh-offset { 
    margin-left: 16px; 
}
.veh-make-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.veh-make-label {
    min-width: 150px;
}
.veh-svrn-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.veh-svrn-label {
    min-width: 60px;
}
.veh-bottom { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    margin-top: 10px; 
}

/* Login Form */
.login-form {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.2;
    font-family: 'Lucida Console', monospace;
}


.login-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
}

.login-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.login-label {
    display: inline-block;
    min-width: 80px;
    margin-right: 4px;
    white-space: nowrap;
}

.login-input {
    border: 1px solid #000;
    background: #d6ecff;
    padding: 2px 4px;
    font-family: 'Lucida Console', monospace; font-size: 13px; font-weight: normal;
    font-size: 11px;
    height: 18px;
}

.login-input.unit-input { width: 60px; }
.login-input.shift-input { width: 25px; }
.login-input.date-input { width: 100px; }
.login-input.dispatch-input { width: 25px; }
.login-input.class-input { width: 25px; }
.login-input.time-input { width: 50px; }
.login-input.ot-input { width: 40px; }
.login-input.deputy-input { width: 80px; }
.login-input.password-input { width: 150px; }
.login-input.name-input { width: 300px; }
.login-input.mileage-input { width: 80px; }
.login-input.vehicle-input { width: 80px; }
.login-input.equip-input { width: 80px; }
.login-input.large-input { width: 400px; height: 40px; }
.login-input.radio-input { width: 90px; }
.login-input.port-input { width: 70px; }
.login-input.patrol-input { width: 150px; }

/* Dispatch Detail content box */
.dispatch-detail-box {
    position: absolute;
    left: 0;
    top: 222px; /* Flush with bottom of highlight-box-3 (204px + 18px) */
    width: 320px;
    height: 184px; /* Flush with top of highlight-box-4 (406px - 222px) */
    border: none; /* No border */
    border-right: 1.5px solid #000; /* Vertical separator */
    background-color: #fff;
    box-sizing: border-box;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    line-height: 1.1;
    font-family: 'Lucida Console', monospace;
    font-weight: 500; /* Bold 500 */
    white-space: pre-wrap;
    overflow: hidden; /* prevent scrollbar from appearing */
    cursor: pointer; /* show pointer cursor to indicate it's clickable */
    transition: border-color 0.2s ease, box-shadow 0.2s ease; /* smooth transition for hover effects */
}

/* Hover effect for dispatch detail box - removed since no border */

/* Message Index content box */
.message-index-box {
    position: absolute;
    left: 0;
    top: 424px; /* Flush with bottom of highlight-box-4 (406px + 18px) */
    width: 320px;
    bottom: 48px; /* Flush with top of footer */
    height: auto; /* Let top/bottom define height */
    border: none; /* No borders */
    border-right: 1.5px solid #000; /* Vertical separator */
    background-color: #fff;
    box-sizing: border-box;
    padding: 2px; /* reduced padding for more text space */
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px; /* Increased from 10px */
    line-height: 1.2;
    font-family: 'Lucida Console', monospace;
    font-weight: 500; /* Bold 500 */
    white-space: pre-wrap; /* allow wrapping for long text */
    color: #000;
    overflow-y: auto; /* enable vertical scrollbar when content is too long */
    overflow-x: hidden; /* prevent horizontal scrollbar */
}

/* Left footer under Message Index (field + magnifier + arrow) */
.left-footer {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 320px;
    height: 48px;
    display: flex;
    gap: 0;
    background: #e9e9e9;
    border: 1px solid #000;
    box-sizing: border-box;
    z-index: 1;
}
.left-footer .lf-field {
    flex: 1 1 0;
    background: #d6ecff;
    border-right: 1px solid #000;
    position: relative;
    z-index: 10;
}

.left-footer .lf-field input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: #000;
    font-size: 12px;
    padding: 4px;
    outline: none;
    z-index: 11;
    position: relative;
}
.left-footer .lf-btn {
    width: 44px;
    background: #d6ecff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #000;
}
.left-footer svg { 
    width: 18px; 
    height: 18px; 
    fill: #000; 
}

.dispatch-row {
    display: grid;
    grid-template-columns: 55px 80px 90px 55px 1fr; /* time, tag, code, status, units */
    align-items: center;
    gap: 0;
    cursor: pointer;
    min-width: 320px; /* minimum width to match container */
    width: max-content; /* allow row to expand beyond container width */
    margin: 0;
    padding: 2px 0;
}

.dispatch-row > div {
    white-space: nowrap;
    overflow: visible;
    padding-right: 16px;
}

/* Remove padding from the last column (units) */
.dispatch-row > div:last-child {
    padding-right: 0;
}

/* When call has 3 radio codes, use tighter spacing */
.dispatch-row.three-codes > div {
    padding-right: 12px;
}

.dispatch-row.three-codes > div:last-child {
    padding-right: 0;
}

/* Dispatch index (MDCS): a little room on the left so the row text does not touch the border. */
#dispatch-index-list .dispatch-row {
    padding-left: 4px;
}

/* Disable special highlight styling for dispatch rows */
#dispatch-index-list .dispatch-row.selected,
#dispatch-index-list .dispatch-row.user-active {
    background: #000000 !important;
    color: #ffffff !important;
}

.dispatch-row.user-attached {
    /* Removed green border and background highlight */
}

body.mdc-night-mode .dispatch-row.user-attached {
    /* Removed green border and background highlight */
}


/* dispatch detail content formatting */
.detail-content {
    white-space: pre-wrap; /* preserve newlines, allow wrapping */
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 100%;
    overflow: hidden; /* prevent scrollbar - will be overridden for message index */
    font-family: 'Lucida Console', monospace;
    font-weight: 500; /* Bold 500 */
}

/* Message index specific styling */
.message-index-box .detail-content {
    width: 100%;
    padding: 0 2px; /* minimal padding for full width usage */
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-all; /* break long words if needed */
    overflow-y: auto; /* enable vertical scrollbar when content is too long */
    overflow-x: auto; /* enable horizontal scrollbar when content overflows */
    max-height: 100%; /* ensure it respects container height */
}

/* Message index font size */
pre#message-index-pre.detail-content {
    font-size: 15px; /* smaller font size to fit more messages */
    height: 100%; /* ensure it takes full height of container */
    overflow-y: auto; /* enable vertical scrollbar when content overflows */
    overflow-x: hidden; /* rows clip themselves; no horizontal scroll on the pre */
    margin: 0; /* remove any default margins */
    padding: 0; /* remove any default padding */
    white-space: pre; /* preserve spacing and prevent text wrapping */
    width: 100%;
    box-sizing: border-box;
}

/* Message index selection highlighting */
.message-line.selected {
    background: #000000 !important;
    color: #ffffff !important;
}

/* Night mode message index highlighting - using maximum specificity */
body.mdc-night-mode .message-line.selected,
.mdc-night-mode .message-line.selected,
.message-line.selected.night-mode {
    background: #e8e8e8 !important; /* grey background */
    color: #0066cc !important; /* blue text */
}

/* Night mode dispatch row highlighting - blue over grey */
body.mdc-night-mode #dispatch-index-list .dispatch-row.selected,
.night-mode #dispatch-index-list .dispatch-row.selected,
body.mdc-night-mode #dispatch-index-list .dispatch-row.user-active,
.night-mode #dispatch-index-list .dispatch-row.user-active {
    background: #e8e8e8 !important;
    color: #0066cc !important;
}

/* Ensure attached style can still override when desired */
body #dispatch-index-list .dispatch-row.user-attached.selected,
body #dispatch-index-list .dispatch-row.user-attached.user-active {
    background: #000000 !important;
    color: #ffffff !important;
}

body.mdc-night-mode #dispatch-index-list .dispatch-row.user-attached.selected,
body.mdc-night-mode #dispatch-index-list .dispatch-row.user-attached.user-active {
    background: #e8e8e8 !important;
    color: #0066cc !important;
}

/* Night mode message index - consistent with day mode */

body.mdc-night-mode .message-index-box .detail-content {
    word-break: normal;
}

body.mdc-night-mode pre#message-index-pre.detail-content {
    font-size: 15; /* Keep same font size as day mode */
}

/* Toast Notification System */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff4444;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-family: 'Lucida Console', monospace;
    font-size: 14px;
    font-weight: bold;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
    max-width: 350px;
    word-wrap: break-word;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.success {
    background-color: #28a745;
}

.toast-notification.warning {
    background-color: #ffc107;
    color: #212529;
}

.toast-notification.info {
    background-color: #17a2b8;
}

/* Account Linking Modal */
.account-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.account-modal-overlay.show {
    opacity: 1;
}

.account-modal {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: 2px solid #4a90e2;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    color: white;
    font-family: 'Lucida Console', monospace;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
}

.account-modal-overlay.show .account-modal {
    transform: scale(1);
}

.account-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.account-modal-title {
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.account-modal-subtitle {
    font-size: 16px;
    color: #b8d4ff;
    margin-bottom: 20px;
}

.account-modal-body {
    margin-bottom: 25px;
}

.account-modal-label {
    display: block;
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 500;
}

.account-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-family: 'Lucida Console', monospace;
    color: #333;
    transition: border-color 0.3s ease;
}

.account-modal-input:focus {
    outline: none;
    border-color: #66b3ff;
    box-shadow: 0 0 0 3px rgba(102, 179, 255, 0.2);
}

.account-modal-example {
    font-size: 12px;
    color: #b8d4ff;
    margin-top: 5px;
    font-family: 'Lucida Console', monospace;
}

.account-modal-info {
    font-size: 13px;
    color: #e6f2ff;
    margin-top: 15px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border-left: 4px solid #4a90e2;
}

.account-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.account-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-modal-btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.account-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.account-modal-btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.account-modal-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}


/* Message read/unread styling */
.message-line {
    font-weight: bold; /* Unread messages are bold */
    padding: 2px 4px; /* maintain compact row height, horizontal padding so text doesn't hug edge */
    margin: 0; /* remove any default margins */
    line-height: 1.1; /* keep compact line height */
    font-size: inherit; /* inherit from parent */
    white-space: nowrap; /* single line per row */
    overflow: hidden; /* clip text that exceeds row width */
    text-overflow: ellipsis; /* indicate clipped text */
    width: 100%; /* fill container width so highlight spans full row */
    box-sizing: border-box;
    display: block;
}

.message-line.read {
    font-weight: normal; /* Read messages are normal weight */
    opacity: 0.7; /* Slightly faded to show they've been read */
}

/* Override read opacity when message is selected */
.message-line.read.selected {
    opacity: 1.0 !important; /* Full opacity when selected */
}

/* VEH form disabled fields styling */
.disabled-field {
    cursor: not-allowed !important;
    opacity: 0.6;
    background-color: #f5f5f5 !important;
    color: #999 !important;
}

.disabled-field:hover {
    cursor: not-allowed !important;
}

/* Disabled checkboxes */
input[type="checkbox"].disabled-field {
    cursor: not-allowed !important;
    opacity: 0.6;
}

input[type="checkbox"].disabled-field:hover {
    cursor: not-allowed !important;
}

/* Unread messages button styling */
#btn-unread {
    transition: all 0.3s ease;
}

/* Green button when no unread messages */
#btn-unread.no-unread {
    background-color: #28a745;
    color: white;
}

/* Red/yellow flashing button when unread messages exist */
#btn-unread.has-unread {
    color: white;
    animation: unread-flash 2s infinite alternate;
}

@keyframes unread-flash {
    0% {
        background-color: #dc3545; /* red */
    }
    100% {
        background-color: #ffc107; /* yellow */
    }
}
.detail-content .update { 
    font-weight: 600; 
}

/* footer buttons inside message detail */
.message-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0; /* fill to bottom of panel with no gap */
    height: 48px; /* taller buttons */
    display: flex;
    gap: 0; /* buttons must touch */
    background: #e9e9e9;
    border: 1px solid #000;
    padding: 0;
    box-sizing: border-box;
    z-index: 20; /* above content */
}
.footer-btn {
    background: #d6ecff; /* faint light blue */
    color: #000;
    border: none;
    border-radius: 0;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0; /* stretch to fill, touching edges */
}

/* Footer button separators - adds visual lines around LAST FORM USED */
.footer-btn.footer-separator {
    border-left: 1px solid #000 !important;
    border-right: 1px solid #000 !important;
}
.message-footer span[data-stack] {
    font-size: 12px;
    line-height: 1.05;
    white-space: nowrap;
    gap: 0;
}

#btn-unread span[data-stack="btn-unread"] > span:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Erase Buttons */
.erase-buttons {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 88px; /* Position above the compose input */
    display: none; /* Hidden by default, shown only when forms are active */
    justify-content: center;
    gap: 0px;
    padding: 0px;
    z-index: 20; /* above content */
}

.erase-btn {
    background: #007bff;
    color: white;
    border: 2px solid #0056b3;
    padding: 8px 16px;
    font-family: 'Lucida Console', monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0;
    min-width: 198px;
    height: 30px;
    text-transform: uppercase;
}

.erase-btn:hover {
    background: #0056b3;
}

.erase-btn:active {
    background: #004085;
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Haptic feedback for all buttons */
.blue-btn:active,
.footer-btn:active,
.erase-btn:active,
.ncic-action-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.blue-btn,
.footer-btn,
.erase-btn,
.ncic-action-btn {
    transition: transform 0.1s ease;
}

/* NCIC result action buttons (Manage Entry, Add to Call, Add Flag) */
.ncic-action-buttons {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 88px;
    display: none;
    justify-content: center;
    gap: 0px;
    padding: 0px;
    z-index: 20;
}

.ncic-action-btn {
    background: #007bff;
    color: white;
    border: 2px solid #0056b3;
    padding: 8px 16px;
    font-family: 'Lucida Console', monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0;
    flex: 1;
    min-width: 0;
    height: 30px;
    text-transform: uppercase;
}

.ncic-action-btn:hover {
    background: #0056b3;
}

.ncic-action-btn:active {
    background: #004085;
}

.ncic-action-btn.ncic-btn-disabled {
    background: #6c757d;
    border-color: #5a6268;
    cursor: not-allowed;
}

.ncic-action-btn.ncic-btn-disabled:hover {
    background: #6c757d;
}

.ncic-action-btn.ncic-btn-disabled:active {
    background: #6c757d;
    transform: none;
}

/* NCIC inline forms (Manage Entry, Add to Call, Add Flag) */
.ncic-form {
    height: calc(100% - 88px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 8px 10px;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    color: #000;
    line-height: 1.3;
}

.ncic-form.ncic-incident-report {
    /* Leaves room so rightmost input text is not under scrollbar */
    padding-right: 18px;
}

.ncic-title {
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ccc;
}

.ncic-subject-info {
    font-weight: bold;
    font-size: 10px;
    color: #0056b3;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.ncic-field {
    margin-bottom: 6px;
}

.ncic-label {
    display: block;
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.ncic-input {
    display: block;
    width: 100%;
    border: none;
    background: #00a4c5;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    color: #000;
    padding: 3px 4px;
    height: 20px;
    box-sizing: border-box;
    text-transform: uppercase;
}

.ncic-input:focus {
    outline: none;
    background: #26c6da;
}

select.ncic-input {
    appearance: none;
    cursor: pointer;
    height: 22px;
}

textarea.ncic-input,
.ncic-textarea {
    height: auto;
    min-height: 48px;
    resize: vertical;
}

.ncic-results-pre {
    white-space: pre-wrap;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    color: #000;
    background: rgba(0,164,197,0.1);
    padding: 6px;
    margin-top: 6px;
    border: 1px solid #ccc;
    max-height: 250px;
    overflow-y: auto;
}

/* NCIC submenu list */
.ncic-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ncic-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    color: #000;
    border: none;
    border-bottom: 1px solid #ddd;
    padding: 7px 6px;
    cursor: pointer;
    font-family: 'Lucida Console', monospace;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.ncic-menu-item:hover {
    background: rgba(0, 164, 197, 0.2);
}

.ncic-menu-item:active {
    background: rgba(0, 164, 197, 0.4);
}

/* NCIC back button */
.ncic-back-btn {
    display: inline-block;
    background: transparent;
    color: #0056b3;
    border: none;
    padding: 4px 0;
    margin-bottom: 4px;
    cursor: pointer;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.ncic-back-btn:hover {
    color: #003d80;
    text-decoration: underline;
}

/* Dark / Night mode support for NCIC forms */
body.mdc-night-mode .ncic-form,
body.mdc-night-mode .ncic-form {
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .ncic-title,
body.mdc-night-mode .ncic-title {
    border-bottom-color: #666;
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .ncic-label,
body.mdc-night-mode .ncic-label {
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .ncic-subject-info,
body.mdc-night-mode .ncic-subject-info {
    color: #4da6ff;
}

body.mdc-night-mode .ncic-input,
body.mdc-night-mode .ncic-input {
    background: #00a4c5;
    color: #000;
}

body.mdc-night-mode .ncic-input:focus,
body.mdc-night-mode .ncic-input:focus {
    background: #26c6da;
}

body.mdc-night-mode .ncic-menu-item,
body.mdc-night-mode .ncic-menu-item {
    color: var(--mdc-dark-text);
    border-bottom-color: rgba(255,255,255,0.1);
}

body.mdc-night-mode .ncic-menu-item:hover,
body.mdc-night-mode .ncic-menu-item:hover {
    background: rgba(0, 164, 197, 0.25);
}

body.mdc-night-mode .ncic-back-btn,
body.mdc-night-mode .ncic-back-btn {
    color: #4da6ff;
}

body.mdc-night-mode .ncic-back-btn:hover,
body.mdc-night-mode .ncic-back-btn:hover {
    color: #80c0ff;
}

body.mdc-night-mode .ncic-results-pre,
body.mdc-night-mode .ncic-results-pre {
    color: var(--mdc-dark-text);
    background: rgba(0,164,197,0.15);
    border-color: #555;
}

/* Field validation styles */
.veh-input.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

.veh-input.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Field highlighting */
.field-highlight {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
    background-color: #f8f9fa !important;
}

/* Recent entries dropdown */
.recent-entries-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recent-header {
    background: #f8f9fa;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 11px;
    border-bottom: 1px solid #ccc;
}

.recent-entry {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
}

.recent-entry:hover {
    background: #e9ecef;
}

.recent-vin {
    font-weight: bold;
}

.recent-plate {
    color: #6c757d;
}

/* VEH Form Buttons */
.veh-btn {
    background: #007bff;
    color: white;
    border: 2px solid #0056b3;
    padding: 6px 12px;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0;
    margin-right: 8px;
    text-transform: uppercase;
    transition: transform 0.1s ease;
}

.veh-btn:hover {
    background: #0056b3;
}

.veh-btn:active {
    transform: scale(0.95);
}

.check-plate-btn {
    background: #28a745;
    border-color: #1e7e34;
}

.check-plate-btn:hover {
    background: #1e7e34;
}

.create-call-btn {
    background: #dc3545;
    border-color: #c82333;
}

.create-call-btn:hover {
    background: #c82333;
}



/* compose input above footer */
.message-input {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 48px; /* sits directly above taller footer (no gap) */
    height: 40px; /* slightly taller to tuck under OTHER FUNCTIONS */
    padding: 0 0; /* flush to edges */
    box-sizing: border-box;
    z-index: 20; /* above content */
}
/* Keyframe animation for blinking cursor effect */
@keyframes blink-cursor {
    0%, 49% { border-right-color: #00a4c5; }
    50%, 100% { border-right-color: transparent; }
}

.message-input input {
    width: 100%;
    height: 100%;
    border: 1px solid #000;
    padding: 0 8px;
    border-radius: 0;
    background-color: #fffacd; /* Light yellowish tint */
    text-transform: none;
    font-family: 'Lucida Console', monospace; font-size: 25px; font-weight: normal;
    box-sizing: border-box;
    caret-color: transparent; /* Hide default cursor */
    /* Create custom wide cursor using border */
    border-right: 4px solid #00a4c5;
    padding-right: 4px; /* Adjust padding to compensate */
    animation: blink-cursor 1s step-end infinite;
}

/* Stop animation when input loses focus */
.message-input input:not(:focus) {
    border-right-color: transparent;
    animation: none;
}

/* Hide message-input when new message form is active */
.new-message-active .message-input {
    display: none;
}

.message-input input::selection {
    background-color: #00a4c5;
    color: white;
}

.message-buttons {
    display: flex;
    gap: 8px;
    padding: 4px 8px;
    background: #fff;
    margin-top: 88px; /* Adjusted to align with the compose-input box */
}

.msg-btn {
    background: #d6ecff;
    border: 1px solid #000;
    padding: 4px 8px;
    font-family: 'Lucida Console', monospace; font-size: 13px; font-weight: normal;
    cursor: pointer;
    border-radius: 0;
}

/* Page Builder Interface */
#builder-toolbar {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 300px;
    background: #fff;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    padding: 10px;
    z-index: 10000;
    max-height: 80vh;
    overflow-y: auto;
}

.builder-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.builder-toolbar button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.builder-toolbar button:hover {
    background: #45a049;
}

.builder-properties {
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 3px;
}

.builder-properties h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.builder-properties h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #4CAF50;
}

.builder-properties label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
}

.builder-properties input {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 11px;
}

.code-output {
    margin-top: 15px;
}

.code-output h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.code-output textarea {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: 'Lucida Console', monospace;
    font-size: 10px;
    resize: vertical;
}

.builder-element {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    min-width: 50px;
    min-height: 20px;
}

.builder-element:hover {
    background: rgba(76, 175, 80, 0.1);
}

.builder-element input {
    border: 1px solid #ccc;
    padding: 2px 4px;
    font-size: 11px;
}

/* OBS Form Styles - Match Reference Design */
.obs-layout {
    padding: 10px;
    font-family: 'Lucida Console', monospace;
    background-color: #f0f0f0;
    color: black;
}

.obs-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.obs-label-left {
    font-weight: bold;
    color: black;
    background-color: #f0f0f0;
    padding: 2px 4px;
    min-width: 60px;
    font-size: 12px;
    text-align: left;
}

.obs-label-inline {
    font-weight: bold;
    color: black;
    background-color: #f0f0f0;
    padding: 2px 4px;
    font-size: 12px;
    min-width: auto;
}

.obs-input-cyan {
    background-color: #00bcd4;
    color: black;
    border: 1px solid #00acc1;
    padding: 4px 6px;
    font-family: 'Lucida Console', monospace;
    font-size: 12px;
    height: 24px;
    box-sizing: border-box;
}

.obs-input-cyan:focus {
    outline: none;
    background-color: #26c6da;
    border: 1px solid #0097a7;
}

/* Specific field widths to match reference design */
.obs-location-input {
    flex: 1;
    min-width: 300px;
}

.obs-code1-input,
.obs-code2-input,
.obs-code3-input {
    width: 80px;
}

.obs-veh-input {
    width: 120px;
}

.obs-st-input {
    width: 30px;
}

.obs-lc-input {
    width: 60px;
}

.obs-srch-input {
    width: 60px;
}

.obs-remarks-input {
    min-width: 250px;
}

.obs-line1-input,
.obs-line2-input,
.obs-line3-input,
.obs-line4-input,
.obs-line5-input,
.obs-line6-input {
    flex: 1;
    min-width: 235px;
}

.obs-1097time-input,
.obs-1098time-input {
    width: 80px;
}

.obs-date-input {
    width: 100px;
}

/* Dark mode support for OBS form */
body.mdc-night-mode .obs-layout,
body.mdc-night-mode .obs-layout {
    background-color: var(--mdc-dark-bg);
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .obs-label-left,
body.mdc-night-mode .obs-label-inline,
body.mdc-night-mode .obs-label-left,
body.mdc-night-mode .obs-label-inline {
    background-color: var(--mdc-dark-bg);
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .obs-input-cyan,
body.mdc-night-mode .obs-input-cyan {
    background-color: #00bcd4;
    color: black;
}

body.mdc-night-mode .obs-input-cyan:focus,
body.mdc-night-mode .obs-input-cyan:focus {
    background-color: #26c6da;
}

/* Dark mode support for older OBS form styles */
body.mdc-night-mode .obs-form,
body.mdc-night-mode .obs-form {
    background-color: var(--mdc-dark-bg);
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .obs-form .veh-label,
body.mdc-night-mode .obs-form .veh-label {
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .obs-form .veh-input,
body.mdc-night-mode .obs-form .veh-input {
    background: #00a4c5;
    color: black;
}

body.mdc-night-mode .obs-label,
body.mdc-night-mode .obs-label {
    color: var(--mdc-dark-text);
}

body.mdc-night-mode .obs-input,
body.mdc-night-mode .obs-input {
    background: #00a4c5;
    color: black;
}

body.mdc-night-mode .obs-form .veh-title-stack,
body.mdc-night-mode .obs-form .veh-title-stack {
    border-bottom: 1px solid #666;
}

/* Additional comprehensive dark mode overrides with higher specificity */
body.mdc-night-mode .obs-form .veh-label,
body.mdc-night-mode .obs-form .veh-label {
    color: var(--mdc-dark-text) !important;
}

body.mdc-night-mode .obs-layout,
body.mdc-night-mode .obs-layout {
    color: var(--mdc-dark-text) !important;
}

body.mdc-night-mode .obs-label-left,
body.mdc-night-mode .obs-label-left {
    color: var(--mdc-dark-text) !important;
    background-color: var(--mdc-dark-bg) !important;
}

body.mdc-night-mode .obs-label-inline,
body.mdc-night-mode .obs-label-inline {
    color: var(--mdc-dark-text) !important;
    background-color: var(--mdc-dark-bg) !important;
}

/* Override any general text in OBS forms */
body.mdc-night-mode .obs-form,
body.mdc-night-mode .obs-form *:not(input),
body.mdc-night-mode .obs-form,
body.mdc-night-mode .obs-form *:not(input) {
    color: var(--mdc-dark-text) !important;
}

body.mdc-night-mode .want-form,
body.mdc-night-mode .want-form *:not(input):not(select) {
    color: var(--mdc-dark-text) !important;
}

/* Dark mode input fields in message detail box forms (exclude compose-input) */
body.mdc-night-mode .message-detail-box input[type="text"]:not(#compose-input),
body.mdc-night-mode .message-detail-box input[type="number"]:not(#compose-input),
body.mdc-night-mode .message-detail-box input[type="password"]:not(#compose-input),
body.mdc-night-mode .message-detail-box select,
body.mdc-night-mode .message-detail-box textarea,
body.mdc-night-mode .message-detail-box input[type="text"]:not(#compose-input),
body.mdc-night-mode .message-detail-box input[type="number"]:not(#compose-input),
body.mdc-night-mode .message-detail-box input[type="password"]:not(#compose-input),
body.mdc-night-mode .message-detail-box select,
body.mdc-night-mode .message-detail-box textarea {
    background-color: #163084 !important;
    color: #fff !important;
    border: none !important;
    border-right: 2px solid #fff !important;
    border-bottom: 2px solid #fff !important;
}

body.mdc-night-mode .message-detail-box input[type="text"]:not(#compose-input):focus,
body.mdc-night-mode .message-detail-box input[type="number"]:not(#compose-input):focus,
body.mdc-night-mode .message-detail-box input[type="password"]:not(#compose-input):focus,
body.mdc-night-mode .message-detail-box select:focus,
body.mdc-night-mode .message-detail-box textarea:focus,
body.mdc-night-mode .message-detail-box input[type="text"]:not(#compose-input):focus,
body.mdc-night-mode .message-detail-box input[type="number"]:not(#compose-input):focus,
body.mdc-night-mode .message-detail-box input[type="password"]:not(#compose-input):focus,
body.mdc-night-mode .message-detail-box select:focus,
body.mdc-night-mode .message-detail-box textarea:focus {
    background-color: #3d2a5c !important; /* dark purple */
    color: #fff !important;
    border: none !important;
    border-right: 2px solid #fff !important;
    border-bottom: 2px solid #fff !important;
    outline: none;
}

/* Universal SEND Flash Animation */
@keyframes sendFlash {
    0% { background-color: inherit; }
    50% { background-color: #ffff00; color: #000; }
    100% { background-color: inherit; }
}

.send-flash {
    animation: sendFlash 0.2s ease-in-out;
}

/* URN Input Focus Enhancement */
.urn-input:focus {
    background-color: #00bcd4 !important;
    outline: 1px solid #ffffff;
}

.urn-input.input-highlight {
    background-color: #00bcd4 !important;
}
/* Clear Dispatch Window button - separate class */
.clear-disp-text {
    color: #ffffff !important;
}

/* Clear Default Window button - separate class */
.clear-def-text {
    color: #ffffff !important;
}

/* Call & Log Functions button - separate class */
.call-log-text {
    color: #ffffff !important;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    font-weight: 700;
}

/* Other Functions button - separate class  */
.other-functions-text {
    color: #ffffff !important;
    font-family: 'Lucida Console', monospace;
    font-size: 11px;
    font-weight: 700;
}

/* New Message button - always black text (button is always white) */
.new-message-text {
    color: #000 !important;
}



/* Dark/Night mode text selection (highlight) */
body.mdc-night-mode ::selection,
body.mdc-night-mode ::selection {
    background-color: #e8e8e8 !important;  /* Light greyish background */
    color: #0066cc !important;             /* Blue text */
}

body.mdc-night-mode ::-moz-selection,
body.mdc-night-mode ::-moz-selection {
    background-color: #e8e8e8 !important;  /* Light greyish background */
    color: #0066cc !important;             /* Blue text */
}

/* Dark Mode support for Modify Log form */
body.mdc-night-mode .modify-form,
body.mdc-night-mode .modify-form,
body.mdc-night-mode .modify-tag-form,
body.mdc-night-mode .modify-tag-form {
    color: var(--mdc-dark-text) !important;
}

/* Override all text elements in modify form for dark mode */
body.mdc-night-mode .modify-form *,
body.mdc-night-mode .modify-form *,
body.mdc-night-mode .modify-tag-form *,
body.mdc-night-mode .modify-tag-form * {
    color: var(--mdc-dark-text) !important;
}

/* Input fields - override inline color:#000 */
body.mdc-night-mode .modify-form input,
body.mdc-night-mode .modify-form input.mod-log-input,
body.mdc-night-mode .modify-form input,
body.mdc-night-mode .modify-form input.mod-log-input {
    color: var(--mdc-dark-text) !important;
}

/* Span and label elements */
body.mdc-night-mode .modify-form span,
body.mdc-night-mode .modify-form span {
    color: var(--mdc-dark-text) !important;
}

/* Dark Mode support for Clear Tag form */
body.mdc-night-mode .clear-tag-form,
body.mdc-night-mode .clear-tag-form,
body.mdc-night-mode .clear-tag-form *,
body.mdc-night-mode .clear-tag-form * {
    color: var(--mdc-dark-text) !important;
}

body.mdc-night-mode .clear-tag-form input,
body.mdc-night-mode .clear-tag-form input {
    color: var(--mdc-dark-text) !important;
    -webkit-text-fill-color: var(--mdc-dark-text) !important;
    background: #00a4c5 !important;
    caret-color: var(--mdc-dark-text) !important;
}

/* Dark Mode support for URN form */
body.mdc-night-mode .urn-form,
body.mdc-night-mode .urn-form,
body.mdc-night-mode .urn-form *,
body.mdc-night-mode .urn-form * {
    color: var(--mdc-dark-text) !important;
    -webkit-text-fill-color: var(--mdc-dark-text) !important;
}

body.mdc-night-mode .urn-form input.urn-input,
body.mdc-night-mode .urn-form input.urn-input {
    color: var(--mdc-dark-text) !important;
    -webkit-text-fill-color: var(--mdc-dark-text) !important;
    background: #00a4c5 !important;
    caret-color: var(--mdc-dark-text) !important;
}

/* ── MDCS title bar + frame: same look as PremierOne Mobile ───────────────────────────────────────
 * PremierOne Mobile (mdc-cad-titlebar, cad-incident-window.css) has a rounded 12px window frame, a flat 32px
 * title bar and Windows 11 style 46x32 caption buttons (red close on hover). MDCS (#title-bar) used a square
 * frame, a beveled 30px bar and tiny 16px beveled buttons. Only the look changes here: the title text, the
 * buttons' behaviour and the window logic are untouched.
 * Desktop only: on a phone the window is fullscreen with its own 44px bar (mobile.css).
 * Fullscreen means no rounded corners (the window fills the screen).
 */
@media (min-width: 769px) {
    .mdc-window {
        border-radius: var(--win11-radius-lg, 12px);
    }

    .mdc-window > #title-bar {
        height: 32px;
        padding: 0 0 0 8px;
        border: none !important;
        border-bottom: 1px solid currentColor !important;
        border-radius: var(--win11-radius-lg, 12px) var(--win11-radius-lg, 12px) 0 0;
        background: var(--win11-bg-solid-light, #F3F3F3) !important;
    }
    body.mdc-night-mode .mdc-window > #title-bar {
        background: var(--win11-bg-solid-dark, #202020) !important;
    }

    .mdc-window > #title-bar .title-text {
        font-size: 13px;
        font-weight: normal;
    }

    .mdc-window > #title-bar .title-buttons {
        gap: 0;
        height: 100%;
        align-items: stretch;
    }

    .mdc-window > #title-bar .minimize-btn,
    .mdc-window > #title-bar .fullscreen-btn,
    .mdc-window > #title-bar .close-btn {
        width: 46px;
        height: 32px;
        background: transparent !important;
        border: none !important;
        border-radius: 0;
        box-shadow: none !important;
        color: #1B1B1B !important;
        font-size: 14px;
        font-weight: normal;
        line-height: 1;
        transition: background 0.1s;
    }
    body.mdc-night-mode .mdc-window > #title-bar .minimize-btn,
    body.mdc-night-mode .mdc-window > #title-bar .fullscreen-btn,
    body.mdc-night-mode .mdc-window > #title-bar .close-btn {
        color: #f3f3f3 !important;
    }

    .mdc-window > #title-bar .minimize-btn:hover,
    .mdc-window > #title-bar .fullscreen-btn:hover {
        background: rgba(0, 0, 0, 0.06) !important;
    }
    body.mdc-night-mode .mdc-window > #title-bar .minimize-btn:hover,
    body.mdc-night-mode .mdc-window > #title-bar .fullscreen-btn:hover {
        background: rgba(255, 255, 255, 0.08) !important;
    }

    /* The close button's corner follows the window's rounded corner. */
    .mdc-window > #title-bar .close-btn {
        border-top-right-radius: var(--win11-radius-lg, 12px);
    }
    .mdc-window > #title-bar .close-btn:hover {
        background: #e81123 !important;
        color: #fff !important;
    }

    .mdc-window > #mdc-container {
        border-radius: 0 0 var(--win11-radius-lg, 12px) var(--win11-radius-lg, 12px);
    }

    /* Fullscreen fills the screen: square corners. */
    .mdc-window.fullscreen,
    .mdc-window.fullscreen > #title-bar,
    .mdc-window.fullscreen > #title-bar .close-btn,
    .mdc-window.fullscreen > #mdc-container {
        border-radius: 0;
    }
}
