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

:root {
    --bg-app: #F5F7FA;
    --bg-main: #F5F7FA;
    --bg-surface: #ffffff;
    --bg-muted: #EEF2F7;
    --bg-soft: #E7EDF5;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #7B8796;
    --border-color: rgba(15, 23, 42, 0.12);
    --border-light: rgba(15, 23, 42, 0.08);
    --accent-primary: #84CC16;
    --accent-hover: #65A30D;
    --accent-soft: rgba(132, 204, 22, 0.14);
    --accent-line: rgba(132, 204, 22, 0.42);
    --telemetry: #0F766E;
    --success: #16A34A;
    --warning: #F97316;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --shell-bg: rgba(255, 255, 255, 0.86);
    --shell-text: #111827;
    --shell-muted: #64748B;
    --shell-border: rgba(15, 23, 42, 0.10);
    --shell-hover: rgba(132, 204, 22, 0.10);
    --shell-active-bg: #111827;
    --shell-active-text: #F8FAFC;
    --shell-control-bg: #EEF2F7;
    --summary-bg: #ffffff;
    --summary-text: #111827;
    --summary-muted: #64748B;
    --summary-panel: #EEF2F7;
    --summary-border: rgba(15, 23, 42, 0.10);
    --summary-dashed: rgba(15, 23, 42, 0.22);
    --grid-line: rgba(15, 23, 42, 0.045);
    --scan-line: rgba(132, 204, 22, 0.055);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, .10);
    --shadow-lg: 0 26px 70px rgba(15, 23, 42, .14);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-width: 280px;
    --transition: 180ms cubic-bezier(.2, .8, .2, 1);
}

[data-theme="dark"] {
    --bg-app: #0B0F14;
    --bg-main: #0B0F14;
    --bg-surface: #151B24;
    --bg-muted: #111827;
    --bg-soft: #1C2430;
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --text-tertiary: #6B7280;
    --border-color: rgba(255, 255, 255, 0.12);
    --border-light: rgba(255, 255, 255, 0.08);
    --accent-primary: #A3E635;
    --accent-hover: #BEF264;
    --accent-soft: rgba(163, 230, 53, 0.11);
    --accent-line: rgba(163, 230, 53, 0.46);
    --telemetry: #22D3EE;
    --danger-soft: #4c1d22;
    --shell-bg: rgba(11, 15, 20, 0.92);
    --shell-text: #E5E7EB;
    --shell-muted: #9CA3AF;
    --shell-border: rgba(255, 255, 255, 0.08);
    --shell-hover: rgba(163, 230, 53, 0.08);
    --shell-active-bg: rgba(163, 230, 53, 0.14);
    --shell-active-text: #F9FAFB;
    --shell-control-bg: #111827;
    --summary-bg: #151B24;
    --summary-text: #E5E7EB;
    --summary-muted: #9CA3AF;
    --summary-panel: #111827;
    --summary-border: rgba(255, 255, 255, 0.08);
    --summary-dashed: rgba(255, 255, 255, 0.18);
    --grid-line: rgba(255, 255, 255, 0.045);
    --scan-line: rgba(163, 230, 53, 0.07);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .24);
    --shadow-md: 0 18px 36px rgba(0, 0, 0, .34);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .42);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--accent-primary) 10%, transparent), transparent 28%),
        var(--bg-app);
    background-size: 40px 40px, 40px 40px, 100% 100%, auto;
    color: var(--text-primary);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(105deg, transparent 0 42%, var(--scan-line) 48%, transparent 54%),
        repeating-linear-gradient(0deg, transparent 0 11px, rgba(255,255,255,.012) 12px);
    opacity: .7;
    animation: telemetrySweep 18s linear infinite;
}

@keyframes telemetrySweep {
    from { background-position: -120vw 0, 0 0; }
    to { background-position: 120vw 0, 0 40px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

svg {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    isolation: isolate;
    position: relative;
}

.app-shell::before,
.app-shell::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -1;
}

.app-shell::before {
    right: 32px;
    top: 96px;
    width: 360px;
    height: 360px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 0 31%, var(--grid-line) 32% 33%, transparent 34% 62%, var(--grid-line) 63% 64%, transparent 65%),
        conic-gradient(from 90deg, transparent 0 76%, var(--scan-line) 82%, transparent 88%);
    opacity: .42;
    animation: radarRotate 22s linear infinite;
}

.app-shell::after {
    right: 72px;
    top: 160px;
    width: 260px;
    height: 120px;
    background:
        linear-gradient(90deg, transparent, var(--accent-line), transparent) 0 20px / 100% 1px no-repeat,
        linear-gradient(90deg, transparent, var(--border-light), transparent) 0 60px / 100% 1px no-repeat,
        linear-gradient(90deg, transparent, var(--border-light), transparent) 0 100px / 100% 1px no-repeat;
    opacity: .25;
}

@keyframes radarRotate {
    to { transform: rotate(360deg); }
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 22px 16px;
    background: var(--shell-bg);
    color: var(--shell-text);
    border-right: 1px solid var(--shell-border);
    backdrop-filter: blur(18px);
    box-shadow: 10px 0 40px rgba(0, 0, 0, .04);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 18px;
    border-bottom: 1px solid var(--shell-border);
    position: relative;
}

.brand::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-primary) 22%, var(--shell-active-bg)), var(--shell-active-bg));
    color: var(--shell-active-text);
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 0 0 1px var(--shell-border), 0 0 22px color-mix(in srgb, var(--accent-primary) 22%, transparent);
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.9) contrast(1.08);
}

.brand-title {
    font-family: Space Grotesk, Manrope, sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .02em;
}

.brand-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: var(--shell-muted);
}

.nav-tabs {
    display: grid;
    gap: 6px;
}

.tab-btn {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--shell-muted);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    position: relative;
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.tab-btn:hover {
    background: var(--shell-hover);
    color: var(--shell-text);
    border-color: var(--shell-border);
    transform: translateX(2px);
}

.tab-btn.active {
    background: var(--shell-active-bg);
    color: var(--shell-active-text);
    border-color: var(--accent-line);
    box-shadow: inset 3px 0 0 var(--accent-primary), 0 0 24px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.nav-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    color: currentColor;
    flex: 0 0 auto;
}

.sidebar-footer {
    margin-top: auto;
}

.theme-toggle {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-md);
    background: var(--shell-control-bg);
    color: var(--shell-text);
    font-weight: 600;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent-line);
    transform: translateY(-1px);
}

.app-main {
    min-width: 0;
    background: transparent;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 78px;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: color-mix(in srgb, var(--bg-main) 92%, transparent);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    position: sticky;
}

.topbar::before {
    content: "UAV LINK ONLINE";
    position: absolute;
    left: 28px;
    bottom: -10px;
    padding: 2px 8px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--accent-primary);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.eyebrow {
    color: var(--accent-primary);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-family: Space Grotesk, Manrope, sans-serif;
    font-size: 27px;
    line-height: 1.15;
    letter-spacing: .01em;
}

h2 {
    margin-bottom: 4px;
    font-family: Space Grotesk, Manrope, sans-serif;
    font-size: 21px;
    line-height: 1.2;
}

h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.topbar-actions,
.action-row,
.filter-row,
.inline-form,
.danger-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
}

.user-chip::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.main-container {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 24px 28px 40px;
    position: relative;
}

.main-container::before {
    content: "";
    position: fixed;
    right: 82px;
    bottom: 48px;
    width: 190px;
    height: 190px;
    pointer-events: none;
    opacity: .13;
    background:
        radial-gradient(circle at 20% 20%, transparent 0 11px, var(--accent-line) 12px 13px, transparent 14px),
        radial-gradient(circle at 80% 20%, transparent 0 11px, var(--accent-line) 12px 13px, transparent 14px),
        radial-gradient(circle at 20% 80%, transparent 0 11px, var(--accent-line) 12px 13px, transparent 14px),
        radial-gradient(circle at 80% 80%, transparent 0 11px, var(--accent-line) 12px 13px, transparent 14px),
        linear-gradient(45deg, transparent 47%, var(--accent-line) 48% 52%, transparent 53%),
        linear-gradient(-45deg, transparent 47%, var(--accent-line) 48% 52%, transparent 53%),
        radial-gradient(circle at 50% 50%, var(--accent-line) 0 3px, transparent 4px);
    filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent-primary) 36%, transparent));
    transform: rotate(8deg);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.page-card {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    animation: panelEnter .28s var(--transition) both;
}

.page-card::before,
.br-panel::before,
.history-hero::before,
.history-toolbar::before,
.br-command::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, var(--accent-line), transparent 18%, transparent 82%, var(--accent-line)),
        linear-gradient(var(--border-light), transparent 52%);
    opacity: .22;
    mask: linear-gradient(#000, transparent 42%);
}

@keyframes panelEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.section-head p,
.settings-panel p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.filter-row {
    margin-bottom: 14px;
}

.filter-row input {
    flex: 1 1 420px;
}

.filter-row select {
    flex: 0 0 260px;
}

.btn {
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--bg-muted);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: .01em;
    position: relative;
    overflow: hidden;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.18), transparent);
    transform: translateX(-120%);
    transition: transform 420ms ease;
}

.btn:hover::after {
    transform: translateX(120%);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #0B0F14;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 20%, transparent), 0 10px 24px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 28%, transparent), 0 14px 30px color-mix(in srgb, var(--accent-primary) 24%, transparent);
}

.btn-secondary {
    background: color-mix(in srgb, var(--bg-muted) 76%, var(--bg-surface));
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-line);
    background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-muted));
}

.btn-danger {
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 22%, var(--border-color));
    color: var(--danger);
}

.btn-icon,
.icon-btn,
.v-btn,
.s-btn {
    min-width: 32px;
    min-height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg-surface) 86%, var(--bg-muted));
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 16%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-group label,
.checkbox-item {
    margin: 0;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
}

.radio-group input,
.checkbox-item input {
    width: auto;
    min-height: auto;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.data-table,
.v-table,
.s-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.v-table th,
.s-table th {
    padding: 11px 12px;
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    font-family: "IBM Plex Mono", monospace;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border-light);
}

.data-table td,
.v-table td,
.s-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tr:hover,
.v-table tr:hover,
.s-table tr:hover {
    background: color-mix(in srgb, var(--accent-primary) 6%, var(--bg-muted));
}

.empty-cell {
    text-align: center;
    padding: 42px !important;
    color: var(--text-tertiary);
}

.selectable-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) !important;
    background: var(--bg-surface);
    transition: border-color var(--transition), background var(--transition);
}

.selectable-item:hover {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
}

.modal.active {
    display: flex;
}

.modal-content {
    width: min(720px, 100%);
    max-height: 92vh;
    overflow: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.modal-header,
.modal-footer {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border-light);
    border-bottom: 0;
}

.modal-body {
    padding: 18px;
}

.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 20px;
}

.admin-grid {
    display: grid;
    gap: 18px;
}

.danger-zone,
.settings-panel {
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-muted);
}

.danger-actions {
    flex-wrap: wrap;
}

.inline-form {
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form label {
    flex: 1 1 260px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.role-badge.admin {
    background: var(--danger-soft);
    color: var(--danger);
}

.role-badge.user {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.summary-kicker {
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.summary-number {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.summary-meta {
    padding: 12px;
    display: grid;
    gap: 3px;
    border: 1px solid var(--summary-border);
    border-radius: 12px;
    background: var(--summary-panel);
}

.summary-meta span,
.summary-route span {
    color: var(--summary-muted);
    font-size: 12px;
    font-weight: 700;
}

.summary-meta strong {
    color: var(--summary-text);
    font-size: 15px;
}

.summary-route {
    min-height: 84px;
    padding: 12px;
    border: 1px dashed var(--summary-dashed);
    border-radius: 12px;
    background: var(--summary-panel);
}

.summary-route strong {
    display: block;
    margin-top: 6px;
    color: var(--summary-text);
    font-size: 15px;
}

.summary-route small {
    display: block;
    margin-top: 6px;
    color: var(--summary-muted);
    font-size: 12px;
    line-height: 1.35;
}

.summary-actions {
    margin-top: auto;
    display: grid;
    gap: 8px;
}

.summary-actions .btn-secondary {
    background: var(--summary-panel);
    border-color: var(--summary-border);
    color: var(--summary-text);
}

.br-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .86fr);
    gap: 18px;
}

.br-panel {
    padding: 18px;
    border: 1px solid var(--border-light);
    border-radius: 18px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.br-panel:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 24%, var(--border-light));
}

.br-panel-wide {
    grid-column: 1 / -1;
}

.panel-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-title h2 {
    margin: 0 0 3px;
    font-size: 20px;
}

.panel-title p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.step-pill {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #0B0F14;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.mode-card {
    min-height: 86px;
    padding: 13px;
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 12px;
    align-content: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-muted);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.mode-card input {
    grid-row: span 2;
    appearance: none;
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 3px 0 0;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-surface);
    box-shadow: inset 0 0 0 4px var(--bg-surface);
}

.mode-card strong {
    font-size: 14px;
}

.mode-card span {
    color: var(--text-secondary);
    font-size: 12px;
}

.mode-card:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-color));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.mode-card:has(input:checked) {
    border-color: var(--accent-primary);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-primary) 15%, var(--bg-muted)), var(--bg-muted));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 22%, transparent), inset 3px 0 0 var(--accent-primary);
}

.mode-card input:checked {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
}

.mode-card input:focus,
.mode-card input:focus-visible {
    box-shadow: inset 0 0 0 4px var(--bg-surface);
    outline: none;
}

.br-field-grid {
    display: grid;
    gap: 12px;
}

.br-field-grid.six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.br-field-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-current {
    min-height: 70px;
    padding: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-muted);
}

.route-current > span,
.route-list-head strong {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.route-inline-empty,
.route-inline-selected {
    min-height: 46px;
    padding: 10px 12px;
    display: grid;
    align-content: center;
    gap: 6px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 700;
}

.route-inline-selected {
    border-style: solid;
    border-color: var(--accent-primary);
    box-shadow: inset 3px 0 0 var(--accent-primary);
    color: var(--text-primary);
}

.route-inline-selected strong {
    font-size: 16px;
}

.route-inline-selected small {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
}

.route-list-head {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.route-rail,
.personnel-board,
.vehicle-board {
    max-height: 420px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-muted);
}

.route-rail {
    max-height: 178px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.personnel-board {
    max-height: 520px;
}

.route-rail .selectable-item,
.vehicle-board .selectable-item {
    margin-bottom: 8px;
    padding: 12px !important;
    background: var(--bg-surface);
}

.route-card {
    min-height: 78px;
    padding: 12px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    text-align: left;
    border: 1px solid var(--border-light);
    border-radius: 9px;
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
}

.route-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.route-card.selected {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent-primary);
}

.route-card-check {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg-muted);
    color: var(--accent-primary);
    font-weight: 900;
}

.route-card.selected .route-card-check {
    background: var(--accent-primary);
    color: #0B0F14;
}

.route-card strong,
.route-card small {
    display: block;
}

.route-card strong {
    margin-bottom: 5px;
    font-size: 14px;
}

.route-card small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-line {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 10px;
}

.unit-filter-wrap {
    position: relative;
}

.unit-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 100;
    min-width: 240px;
    max-height: 320px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
}

.unit-dropdown label {
    margin: 0;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-primary);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.selected-strip {
    margin-top: 10px;
    min-height: 44px;
    padding: 8px;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background: var(--bg-muted);
}

.vehicle-panel {
    display: none;
}

.driver-box {
    display: none;
    margin-top: 10px;
}

.batch-card {
    margin: 14px 0;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-muted);
    color: var(--text-primary);
}

.batch-card input {
    width: auto;
    min-height: auto;
}

.final-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.br-builder {
    max-width: 1280px;
    margin: 0 auto;
}

.br-builder-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.br-command {
    position: sticky;
    top: 86px;
    z-index: 20;
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(0, 2.2fr) auto;
    gap: 14px;
    align-items: stretch;
    border: 1px solid var(--border-light);
    border-radius: 18px;
    background: var(--bg-surface);
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
}

.br-command::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 12px;
    width: 76px;
    height: 18px;
    pointer-events: none;
    background:
        radial-gradient(circle, var(--accent-primary) 0 2px, transparent 3px) 0 50% / 18px 18px repeat-x,
        linear-gradient(90deg, transparent, var(--accent-line), transparent) 0 50% / 100% 1px no-repeat;
    opacity: .42;
}

.br-command-main {
    padding: 8px 10px;
    display: grid;
    align-content: center;
    gap: 6px;
}

.br-command .summary-number {
    font-size: 28px;
}

.br-command-stats {
    min-width: 0;
    display: grid;
    grid-template-columns: 120px minmax(190px, 1fr) 88px minmax(190px, 1.2fr);
    gap: 8px;
}

.br-command-main::after {
    content: "MISSION DOC";
    width: max-content;
    padding: 2px 7px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    color: var(--text-tertiary);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
}

.br-command .summary-meta,
.br-command .summary-route {
    min-height: 62px;
    padding: 10px 12px;
    border-style: solid;
    background: var(--bg-muted);
}

.br-command .summary-route {
    overflow: hidden;
}

.br-command .summary-route strong,
.br-command .summary-route small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.br-command-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 150px;
}

.br-motion-panel {
    padding: 16px;
}

.br-motion-panel .mode-grid {
    margin-bottom: 0;
}

.br-motion-panel .mode-card {
    min-height: 74px;
}

.br-route-workbench,
.br-people-workbench {
    min-height: 560px;
}

.br-route-workbench {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 12px;
}

.br-route-workbench .panel-title,
.br-people-workbench .panel-title {
    margin-bottom: 0;
}

.br-route-workbench .route-current {
    grid-template-columns: 1fr;
}

.br-route-workbench .route-rail {
    max-height: none;
    align-content: start;
    grid-template-columns: 1fr;
}

.br-route-workbench .route-card {
    min-height: 92px;
}

.br-people-workbench {
    display: grid;
    grid-template-rows: auto auto auto minmax(280px, 1fr) auto;
}

.br-people-workbench .personnel-board {
    max-height: 540px;
}

.br-sign-panel {
    grid-column: 2;
}

.br-studio {
    max-width: 1320px;
}

.br-studio-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.br-studio-command {
    top: 84px;
    grid-template-columns: minmax(170px, .55fr) minmax(0, 2.4fr) minmax(150px, .45fr);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

.br-studio-command .summary-kicker {
    font-size: 10px;
}

.br-studio-command .summary-number {
    font-size: 26px;
}

.br-studio-command .summary-meta,
.br-studio-command .summary-route {
    min-height: 58px;
    border-radius: 10px;
}

.br-studio-grid {
    display: grid;
    grid-template-columns: minmax(380px, .9fr) minmax(0, 1.35fr);
    gap: 14px;
    align-items: start;
}

.br-studio-left,
.br-studio-main {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.br-studio-card {
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.br-studio-card .panel-title {
    margin-bottom: 12px;
}

.br-studio-card .panel-title h2 {
    font-size: 17px;
}

.br-studio-card .panel-title p {
    font-size: 12px;
}

.br-studio-card .step-pill {
    width: 5px;
    height: 32px;
    border-radius: 999px;
    color: transparent;
    overflow: hidden;
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.br-studio .br-sign-panel .step-pill,
.br-studio .vehicle-panel .step-pill {
    width: 5px;
    height: 32px;
    border-radius: 999px;
    color: transparent;
    overflow: hidden;
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.br-studio .btn {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.br-studio .btn-primary {
    box-shadow: none;
}

.br-studio .btn-secondary {
    background: color-mix(in srgb, var(--bg-muted) 86%, var(--bg-surface));
}

.br-studio .br-command-actions .btn {
    min-height: 40px;
}

.br-studio .route-list-head .btn,
.br-studio .quick-actions .btn {
    min-height: 34px;
    padding-inline: 11px;
}

.mode-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
}

.mode-grid-compact .mode-card {
    min-height: 70px;
    padding: 12px;
    border-radius: 10px;
}

.studio-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.br-studio .route-current {
    min-height: 58px;
    padding: 10px;
    border-radius: 10px;
}

.br-studio .route-list-head {
    margin-top: 10px;
}

.br-studio .route-rail {
    max-height: 294px;
    grid-template-columns: 1fr;
    border-radius: 10px;
    background:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        var(--bg-muted);
    background-size: 28px 28px;
}

.br-studio .br-route-workbench::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 18px;
    width: 54px;
    height: 54px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--accent-line) 0 2px, transparent 3px),
        conic-gradient(from 0deg, transparent 0 72%, var(--scan-line) 84%, transparent 94%);
    opacity: .42;
    animation: radarRotate 14s linear infinite;
}

.br-studio .br-people-workbench::after {
    content: "SIGNAL / PERSONNEL SYNC";
    position: absolute;
    right: 18px;
    top: 20px;
    color: var(--text-tertiary);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    opacity: .72;
}

.br-studio .route-card {
    min-height: 78px;
    border-radius: 10px;
}

.br-studio .br-people-workbench {
    min-height: 686px;
    display: grid;
    grid-template-rows: auto auto auto minmax(360px, 1fr) auto;
}

.br-studio .personnel-board {
    max-height: 520px;
    border-radius: 10px;
}

.br-studio .checkbox-item {
    min-height: 38px;
}

.br-studio .search-line {
    margin-bottom: 8px;
}

.br-studio .quick-actions {
    margin-bottom: 8px;
}

.br-studio-bottom {
    display: grid;
    grid-template-columns: minmax(380px, .9fr) minmax(0, 1.35fr);
    gap: 14px;
    align-items: start;
}

.br-studio-bottom .vehicle-panel {
    border-radius: 12px;
}

.br-studio-bottom .vehicle-panel[style*="none"] {
    display: none !important;
}

.br-studio-bottom .vehicle-panel:not([style*="block"]) + .br-sign-panel {
    grid-column: 1 / -1;
}

.br-studio-bottom .vehicle-panel[style*="block"] + .br-sign-panel {
    grid-column: auto;
}

.br-studio .br-sign-panel {
    border-radius: 12px;
}

.br-studio .final-actions {
    justify-content: flex-start;
}

.br-studio .final-actions .btn-primary {
    min-width: 180px;
}

.history-page {
    display: grid;
    gap: 14px;
}

.history-hero {
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
    gap: 14px;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-surface);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.history-hero h2 {
    margin: 4px 0 0;
    font-size: 28px;
    line-height: 1.1;
}

.history-hero > div:first-child::after {
    content: "DOC REGISTRY / FLIGHT OPS";
    display: inline-flex;
    margin-top: 12px;
    padding: 3px 8px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    color: var(--text-tertiary);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.history-stats div {
    min-height: 64px;
    padding: 10px 12px;
    display: grid;
    align-content: center;
    gap: 3px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-muted);
    position: relative;
}

.history-stats div::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 14px var(--accent-primary);
    opacity: .75;
}

.history-stats span,
.history-row-meta span,
.history-detail-grid span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.history-stats strong {
    font-size: 20px;
}

.history-toolbar {
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 150px 160px auto auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-surface);
    position: relative;
    overflow: hidden;
}

.history-toolbar input,
.history-toolbar select {
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-muted);
    color: var(--text-primary);
}

#historyCount {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.history-day {
    display: grid;
    gap: 10px;
}

.history-day + .history-day {
    margin-top: 18px;
}

.history-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-day-head h3 {
    margin: 0;
    font-size: 17px;
}

.history-day-head span {
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.history-list {
    display: grid;
    gap: 8px;
}

.history-row {
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(250px, 1.1fr) minmax(360px, 1.35fr) minmax(160px, .65fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.history-row:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--accent-primary) 8%, transparent);
}

.history-row-main,
.history-row-meta,
.history-actions {
    min-width: 0;
}

.history-number {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-number strong {
    font-size: 17px;
}

.history-number span {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-primary);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.history-route {
    margin-top: 6px;
    display: grid;
    gap: 2px;
}

.history-route strong,
.history-route span,
.history-people {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-route strong {
    font-size: 13px;
}

.history-route span,
.history-people {
    color: var(--text-secondary);
    font-size: 12px;
}

.history-row-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.history-row-meta div {
    min-height: 50px;
    padding: 8px;
    display: grid;
    align-content: center;
    gap: 2px;
    border-radius: 8px;
    background: var(--bg-muted);
    border: 1px solid transparent;
}

.history-row-meta strong {
    font-size: 12px;
}

.history-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.history-vehicle {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.history-empty {
    padding: 56px 20px;
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 700;
}

.history-modal {
    max-width: 820px;
}

.history-modal .modal-header p {
    margin: 3px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.history-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.history-detail-grid div,
.history-detail-section {
    padding: 10px;
    display: grid;
    gap: 4px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-muted);
}

.history-detail-grid strong {
    font-size: 13px;
}

.history-detail-section {
    margin-top: 10px;
}

.history-detail-section h4 {
    margin: 0;
    font-size: 14px;
}

.history-detail-section p {
    max-height: 110px;
    margin: 0;
    overflow: auto;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.history-personnel-list {
    max-height: 220px;
    overflow: auto;
    display: grid;
    gap: 6px;
}

.history-personnel-list div {
    padding: 8px;
    display: grid;
    gap: 2px;
    border-radius: 8px;
    background: var(--bg-surface);
}

.history-personnel-list strong {
    font-size: 12px;
}

.history-personnel-list span {
    color: var(--text-secondary);
    font-size: 11px;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .sidebar {
        position: sticky;
        z-index: 50;
        height: auto;
        padding: 12px;
        width: 100%;
        min-width: 0;
        overflow-x: auto;
    }

    .brand,
    .sidebar-footer {
        display: none;
    }

    .nav-tabs {
        display: flex;
        overflow-x: auto;
        max-width: 100%;
        gap: 8px;
        padding-bottom: 2px;
    }

    .tab-btn {
        width: auto;
        flex: 0 0 auto;
    }

    .topbar {
        padding: 14px 18px;
        min-width: 0;
    }

    .main-container {
        padding: 18px;
        min-width: 0;
    }

    .app-main,
    .tab-content,
    #page-create,
    .page-card {
        min-width: 0;
        max-width: 100vw;
    }

    .br-form {
        grid-template-columns: 1fr;
    }

    .br-command,
    .br-studio-command,
    .br-studio-grid,
    .br-studio-bottom,
    .history-hero,
    .history-toolbar,
    .history-row {
        grid-template-columns: 1fr;
    }

    .history-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-row-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .br-command {
        position: static;
    }

    .br-command-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .br-command-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .br-route-workbench,
    .br-people-workbench {
        min-height: auto;
    }

    .br-sign-panel,
    .br-studio-bottom .vehicle-panel:not([style*="block"]) + .br-sign-panel {
        grid-column: auto;
    }

    .br-field-grid.six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .route-current {
        min-height: auto;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-head,
    .filter-row {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .action-row,
    .danger-actions {
        flex-wrap: wrap;
    }

    .filter-row select {
        flex-basis: auto;
    }

    .page-card {
        padding: 16px;
    }

    .mode-grid,
    .br-field-grid.six,
    .br-field-grid.two,
    .search-line,
    .br-command,
    .br-command-stats,
    .br-command-actions,
    .studio-dates {
        grid-template-columns: 1fr;
    }

    .mode-grid-compact {
        grid-template-columns: 1fr;
    }

    .br-studio .br-people-workbench {
        min-height: auto;
    }

    .history-stats,
    .history-row-meta,
    .history-detail-grid {
        grid-template-columns: 1fr;
    }

    .history-toolbar {
        align-items: stretch;
    }

    #historyCount {
        text-align: left;
    }

    .br-command {
        padding: 12px;
    }

    .br-command-main {
        padding: 0;
    }

    .br-command .summary-number {
        font-size: 26px;
    }

    .br-command .summary-meta,
    .br-command .summary-route {
        min-height: auto;
    }

    .route-list-head {
        align-items: stretch;
        flex-direction: column;
    }

    .route-current {
        grid-template-columns: 1fr;
    }

    .route-rail {
        grid-template-columns: 1fr;
    }

    .final-actions {
        flex-direction: column;
    }

    #brForm > div[style*="grid-template-columns: repeat(3"],
    #brForm > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    #brForm .form-group > div[style*="display: flex"],
    #brForm > div[style*="display: flex"] {
        flex-wrap: wrap;
    }

    #brForm .form-group > div[style*="display: flex"] > *,
    #brForm > div[style*="display: flex"] > * {
        min-width: 0;
    }

    #brForm input,
    #brForm select,
    #brForm textarea {
        min-width: 0 !important;
    }
}
