/* ========================================================================
   MISSION CONTROL - Unified Design System
   Theme: "Aerospace Glass"
   ======================================================================== */

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

:root {
    --bg-deep: #040b16;
    --bg-primary: #0b1527;
    --bg-secondary: #13213a;
    --bg-tertiary: #1a2c49;
    --bg-card: rgba(15, 30, 53, 0.82);
    --bg-hover: rgba(89, 172, 255, 0.14);
    --bg-active: rgba(92, 205, 255, 0.22);

    --text-primary: #eff8ff;
    --text-secondary: #b5c7dc;
    --text-muted: #7e93ae;

    --accent-blue: #4fd1ff;
    --accent-cyan: #2be4cb;
    --accent-green: #34d399;
    --accent-yellow: #f7be57;
    --accent-red: #ff6378;
    --accent-purple: #8fa8ff;

    --border-color: rgba(132, 174, 216, 0.28);
    --border-light: rgba(156, 196, 233, 0.4);
    --surface-shadow: 0 18px 48px rgba(2, 8, 18, 0.5);

    --gradient-header: linear-gradient(120deg, #42d4ff 0%, #3ba5ff 55%, #2be4cb 100%);
    --gradient-button: linear-gradient(135deg, #57d8ff 0%, #319dff 100%);
    --gradient-success: linear-gradient(135deg, #40d8a2 0%, #10b981 100%);
    --gradient-panel: linear-gradient(160deg, rgba(19, 33, 58, 0.94) 0%, rgba(9, 19, 36, 0.9) 100%);

    --status-online: var(--accent-green);
    --status-flying: var(--accent-yellow);
    --status-offline: #6f839e;
    --status-conflict: var(--accent-red);

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    --header-height: 66px;
    --sidebar-width: 340px;
    --status-bar-height: 38px;

    --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 0.16s ease;
    --transition-normal: 0.28s ease;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.42);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

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

html,
body {
    height: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: radial-gradient(circle at 18% 12%, rgba(40, 130, 214, 0.2) 0%, rgba(4, 11, 22, 0) 40%),
        radial-gradient(circle at 82% 8%, rgba(21, 211, 180, 0.12) 0%, rgba(4, 11, 22, 0) 48%),
        var(--bg-deep);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    overflow: hidden;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
    color: #8ddfff;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.main-header {
    height: var(--header-height);
    background: linear-gradient(180deg, rgba(11, 21, 39, 0.95), rgba(8, 17, 32, 0.92));
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-lg);
    z-index: 120;
    position: relative;
}

.main-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(79, 209, 255, 0) 0%, rgba(79, 209, 255, 0.55) 50%, rgba(79, 209, 255, 0) 100%);
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, rgba(59, 145, 240, 0.15), rgba(4, 11, 22, 0) 35%),
        linear-gradient(180deg, rgba(7, 14, 28, 0.86) 0%, rgba(4, 11, 22, 0.95) 100%);
}

.content-area {
    flex: 1;
    overflow: auto;
    padding: var(--spacing-lg);
    scrollbar-gutter: stable;
}

.content-area.no-padding {
    padding: 0;
}

.sidebar-panel,
.map-sidebar,
.geofence-sidebar,
.rid-sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-panel);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.02), -8px 0 24px rgba(0, 0, 0, 0.35);
}

.geofence-sidebar {
    border-left: none;
    border-right: 1px solid var(--border-color);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02), 8px 0 24px rgba(0, 0, 0, 0.35);
}

.status-bar {
    height: var(--status-bar-height);
    background: rgba(6, 14, 26, 0.92);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-lg);
    font-size: 12px;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

.brand {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-stack {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.brand::before {
    content: 'ATC';
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.18em;
    color: #06172e;
    background: var(--gradient-header);
    border-radius: var(--radius-full);
    padding: 8px 10px;
    font-weight: 700;
}

.brand-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    white-space: nowrap;
}

.brand-subtext {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1;
}

.nav-tabs {
    display: flex;
    gap: 6px;
    margin-left: 4px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast),
        transform var(--transition-fast);
}

.nav-tab-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 6px;
    margin-left: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    color: #06172e;
    background: linear-gradient(135deg, #ffd37d 0%, #f7be57 100%);
    box-shadow: 0 0 0 1px rgba(247, 190, 87, 0.45), 0 6px 12px rgba(247, 190, 87, 0.35);
}

.nav-tab-badge.visible {
    display: inline-flex;
}

.nav-tab:hover {
    background: rgba(79, 209, 255, 0.1);
    border-color: rgba(79, 209, 255, 0.25);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-tab.active {
    color: #031225;
    background: var(--gradient-header);
    border-color: rgba(133, 233, 255, 0.5);
    box-shadow: 0 10px 20px rgba(29, 111, 184, 0.35);
}

.header-spacer {
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.icon-btn {
    border: 1px solid var(--border-color);
    background: rgba(10, 21, 39, 0.7);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast),
        transform var(--transition-fast);
}

.icon-btn:hover {
    color: var(--text-primary);
    border-color: rgba(98, 201, 255, 0.5);
    background: rgba(23, 45, 72, 0.84);
    transform: translateY(-1px);
}

.icon-btn:focus-visible {
    outline: 2px solid rgba(79, 209, 255, 0.65);
    outline-offset: 2px;
}

.mobile-nav-toggle {
    display: none;
}

.notification-bell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.icon-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0;
    color: #06172e;
    background: linear-gradient(135deg, #ffd47d 0%, #f7be57 100%);
}

.icon-badge.visible {
    display: inline-flex;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.user-name {
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 18, 0.68);
    backdrop-filter: blur(3px);
    z-index: 300;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 92vw);
    background: linear-gradient(180deg, rgba(10, 20, 37, 0.98) 0%, rgba(8, 18, 34, 0.98) 100%);
    border-left: 1px solid var(--border-color);
    box-shadow: -14px 0 40px rgba(0, 0, 0, 0.45);
    z-index: 310;
    display: flex;
    flex-direction: column;
    transform: translateX(104%);
    transition: transform var(--transition-normal);
    pointer-events: none;
}

.mobile-nav-drawer.open {
    transform: translateX(0);
    pointer-events: auto;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: 14px var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-title {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--text-secondary);
}

.mobile-nav-close {
    padding: 8px 10px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--spacing-md);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.mobile-nav-link:hover {
    border-color: rgba(92, 205, 255, 0.35);
    background: rgba(79, 209, 255, 0.1);
    color: var(--text-primary);
}

.mobile-nav-link.active {
    border-color: rgba(133, 233, 255, 0.5);
    background: var(--gradient-header);
    color: #031225;
}

.mobile-nav-user {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mobile-nav-user-name {
    color: var(--text-secondary);
    font-size: 13px;
}

.mobile-nav-logout {
    min-width: 84px;
}

.notification-panel {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    right: 14px;
    width: min(410px, calc(100vw - 28px));
    max-height: min(70vh, 620px);
    background: linear-gradient(160deg, rgba(12, 24, 42, 0.96) 0%, rgba(9, 19, 35, 0.94) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--surface-shadow);
    z-index: 350;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px;
    border-bottom: 1px solid var(--border-color);
}

.notification-panel-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.notification-panel-list {
    overflow: auto;
    max-height: 60vh;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-panel-empty {
    padding: 14px;
    color: var(--text-muted);
    font-size: 12px;
}

.notification-item {
    border: 1px solid rgba(129, 166, 205, 0.22);
    border-radius: var(--radius-md);
    background: rgba(11, 24, 44, 0.72);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-item.unread {
    border-color: rgba(92, 205, 255, 0.42);
    box-shadow: inset 2px 0 0 rgba(92, 205, 255, 0.8);
}

.notification-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notification-item-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.notification-item-time {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.notification-item-message {
    font-size: 12px;
    color: var(--text-secondary);
}

.notification-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notification-level {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.notification-level.success {
    color: var(--accent-green);
}

.notification-level.warn {
    color: var(--accent-yellow);
}

.notification-level.error {
    color: var(--accent-red);
}

.notification-level.info {
    color: var(--accent-blue);
}

.notification-audit {
    color: var(--text-muted);
    font-size: 11px;
}

.toast-stack {
    position: fixed;
    right: 14px;
    bottom: calc(var(--status-bar-height) + 14px);
    width: min(380px, calc(100vw - 28px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 360;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    border: 1px solid rgba(129, 166, 205, 0.24);
    border-radius: var(--radius-md);
    background: rgba(9, 20, 36, 0.96);
    box-shadow: var(--shadow-md);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.toast.success {
    border-color: rgba(52, 211, 153, 0.45);
}

.toast.warn {
    border-color: rgba(247, 190, 87, 0.45);
}

.toast.error {
    border-color: rgba(255, 99, 120, 0.5);
}

.toast.info {
    border-color: rgba(79, 209, 255, 0.45);
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.toast-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.toast-message {
    font-size: 12px;
    color: var(--text-secondary);
}

.toast-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.safety-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 18, 0.72);
    backdrop-filter: blur(3px);
    z-index: 370;
}

.safety-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 30px));
    background: linear-gradient(160deg, rgba(14, 26, 46, 0.98) 0%, rgba(8, 19, 34, 0.98) 100%);
    border: 1px solid rgba(136, 176, 214, 0.38);
    border-radius: var(--radius-lg);
    box-shadow: var(--surface-shadow);
    z-index: 380;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.safety-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.safety-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.safety-modal-body {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.safety-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.notification-panel[hidden],
.mobile-nav-backdrop[hidden],
.mobile-nav-drawer[hidden],
.safety-modal-backdrop[hidden],
.safety-modal[hidden] {
    display: none !important;
}

.page-header {
    margin-bottom: var(--spacing-lg);
}

.page-title {
    font-size: clamp(22px, 2.5vw, 30px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    max-width: 80ch;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.section-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: 13px var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(14, 27, 47, 0.86), rgba(12, 24, 43, 0.72));
}

.card-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    font-weight: 600;
}

.card-body {
    padding: var(--spacing-md);
}

.card-body.chart-body {
    height: 300px;
}

.card-body.chart-body-sm {
    height: 280px;
}

.card-body.scroll-body {
    max-height: 300px;
    overflow-y: auto;
}

.card-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    background: rgba(6, 15, 28, 0.72);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

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

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

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

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

.stats-grid.tight {
    gap: 8px;
}

.stat-card {
    position: relative;
    background: linear-gradient(155deg, rgba(19, 35, 58, 0.95) 0%, rgba(13, 24, 43, 0.88) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 96px;
    overflow: hidden;
}

.stat-card.compact {
    padding: 12px;
    min-height: auto;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
}

.stat-value {
    font-size: clamp(22px, 3.2vw, 34px);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.stat-label {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.stat-value.sm {
    font-size: 20px;
}

.stat-label.sm {
    font-size: 10px;
}

.stat-card.highlight-green .stat-value,
.stat-value.highlight-green {
    color: var(--accent-green);
}

.stat-card.highlight-yellow .stat-value,
.stat-value.highlight-yellow {
    color: var(--accent-yellow);
}

.stat-card.highlight-red .stat-value,
.stat-value.highlight-red {
    color: var(--accent-red);
}

.stat-card.highlight-blue .stat-value,
.stat-value.highlight-blue {
    color: var(--accent-blue);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast),
        color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
    text-decoration: none;
    line-height: 1.1;
}

a.btn {
    display: inline-flex;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-button);
    color: #031225;
    box-shadow: 0 8px 22px rgba(34, 140, 216, 0.42);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(50, 160, 236, 0.52);
}

.btn-success {
    background: var(--gradient-success);
    color: #052115;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.34);
}

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

.btn-warning {
    background: linear-gradient(135deg, #ffd57b 0%, #f7be57 100%);
    color: #332000;
    box-shadow: 0 8px 18px rgba(247, 190, 87, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff7f95 0%, #ff6378 100%);
    color: #2d0712;
    box-shadow: 0 8px 18px rgba(255, 99, 120, 0.36);
}

.btn-ghost {
    background: rgba(20, 40, 67, 0.52);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-ghost:hover:not(:disabled),
.btn-ghost.active,
.btn-ghost[aria-pressed='true'] {
    background: rgba(79, 209, 255, 0.13);
    border-color: rgba(79, 209, 255, 0.44);
    color: var(--text-primary);
}

.btn-sm {
    padding: 7px 10px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-input,
.form-select,
textarea.form-input,
input[type='datetime-local'].form-input,
input[type='number'].form-input,
input[type='text'].form-input,
input[type='password'].form-input,
input[type='email'].form-input {
    width: 100%;
    padding: 11px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(9, 19, 35, 0.85);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-input::placeholder,
.form-select::placeholder {
    color: #7e93ad;
}

.form-input:hover,
.form-select:hover {
    border-color: rgba(126, 198, 255, 0.45);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(79, 209, 255, 0.85);
    box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.16);
    background: rgba(12, 24, 44, 0.95);
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-select-inline {
    width: auto;
    min-width: 170px;
}

textarea.form-input {
    resize: vertical;
    min-height: 82px;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-label input[type='checkbox'] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--status-online);
    box-shadow: 0 0 9px rgba(52, 211, 153, 0.9);
}

.status-dot.flying,
.status-dot.idle {
    background: var(--status-flying);
    box-shadow: 0 0 10px rgba(247, 190, 87, 0.85);
}

.status-dot.offline {
    background: var(--status-offline);
}

.status-dot.conflict {
    background: var(--status-conflict);
    box-shadow: 0 0 10px rgba(255, 99, 120, 0.86);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid transparent;
}

.status-badge.online {
    background: rgba(52, 211, 153, 0.14);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--accent-green);
}

.status-badge.flying,
.status-badge.idle,
.status-badge.warn {
    background: rgba(247, 190, 87, 0.14);
    border-color: rgba(247, 190, 87, 0.3);
    color: var(--accent-yellow);
}

.status-badge.offline,
.status-badge.pending {
    background: rgba(129, 153, 184, 0.18);
    border-color: rgba(133, 167, 203, 0.3);
    color: #bdd0e5;
}

.status-badge.conflict,
.status-badge.fail,
.status-badge.non-compliant {
    background: rgba(255, 99, 120, 0.14);
    border-color: rgba(255, 99, 120, 0.34);
    color: var(--accent-red);
}

.status-badge.pass,
.status-badge.completed,
.status-badge.compliant {
    background: rgba(52, 211, 153, 0.14);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--accent-green);
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 12px;
    background: rgba(15, 30, 53, 0.74);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.list-item:hover {
    transform: translateY(-1px);
    border-color: rgba(132, 199, 255, 0.48);
    background: rgba(28, 54, 88, 0.72);
}

.list-item + .list-item {
    margin-top: 8px;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.list-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    height: 6px;
    background: rgba(122, 149, 183, 0.24);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-button);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    background: rgba(10, 20, 38, 0.45);
    border: 1px dashed rgba(128, 168, 211, 0.3);
    border-radius: var(--radius-md);
}

.empty-state-icon {
    font-size: 42px;
    margin-bottom: var(--spacing-sm);
    opacity: 0.55;
}

.empty-state-text {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.data-table th,
.data-table td {
    padding: 11px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: rgba(64, 126, 190, 0.12);
}

.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.alert-danger {
    color: #ffb7c2;
    border-color: rgba(255, 99, 120, 0.5);
    background: rgba(255, 99, 120, 0.12);
}

.alert-warning {
    color: #ffe3a7;
    border-color: rgba(247, 190, 87, 0.5);
    background: rgba(247, 190, 87, 0.14);
}

.alert-success {
    color: #96f2cf;
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(52, 211, 153, 0.13);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: 10px 0;
    border-bottom: 1px solid rgba(130, 167, 205, 0.2);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-size: 12px;
}

.detail-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    text-align: right;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(18, 35, 59, 0.8);
}

.step.active .step-number {
    border-color: var(--accent-blue);
    background: rgba(79, 209, 255, 0.18);
    color: var(--accent-blue);
}

.step.complete .step-number {
    border-color: var(--accent-green);
    background: rgba(52, 211, 153, 0.2);
    color: var(--accent-green);
}

.step-label {
    font-size: 11px;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--text-primary);
}

.step-connector {
    width: 52px;
    height: 2px;
    background: var(--border-color);
    margin-bottom: 20px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.stacked-col {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.compliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--spacing-md);
}

.compliance-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    background: rgba(12, 25, 44, 0.65);
}

.compliance-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.compliance-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.compliance-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-bar-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.status-bar-divider {
    width: 1px;
    height: 15px;
    background: var(--border-color);
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--accent-green);
}

.text-warning {
    color: var(--accent-yellow);
}

.text-danger {
    color: var(--accent-red);
}

.text-info {
    color: var(--accent-blue);
}

.font-mono {
    font-family: var(--font-mono);
}

.font-bold {
    font-weight: 600;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.ml-sm {
    margin-left: var(--spacing-sm);
}

.split-layout {
    display: flex;
    height: 100%;
}

.map-main {
    flex: 1;
    position: relative;
}

.inline-note {
    font-size: 12px;
    margin-top: 4px;
}

.mono-detail-block {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.mini-map-shell {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 18, 34, 0.62);
}

.compact-empty {
    padding: 12px;
}

#cesiumContainer,
#missionMap,
#missionDetailMap,
#geofenceMap {
    border: 1px solid rgba(125, 180, 224, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 21, 38, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 139, 177, 0.7);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(130, 172, 215, 0.9);
}

@media (max-width: 1280px) {
    :root {
        --sidebar-width: 320px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 980px) {
    :root {
        --header-height: auto;
    }

    .main-header {
        flex-wrap: nowrap;
        align-items: center;
        padding: 10px var(--spacing-md);
        gap: 10px;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-tabs {
        display: none;
    }

    .header-actions {
        gap: 8px;
    }

    .header-actions > .btn,
    .header-actions .user-menu {
        display: none;
    }

    .header-spacer {
        display: none;
    }

    .grid-2-col,
    .grid-3-col {
        grid-template-columns: 1fr;
    }

    .stats-grid.cols-3,
    .stats-grid.cols-4,
    .stats-grid.cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-area {
        padding: var(--spacing-md);
    }

    .status-bar {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--status-bar-height);
        padding: 6px var(--spacing-md);
        gap: 10px;
    }

    .status-bar-divider {
        display: none;
    }

    .notification-panel {
        top: 74px;
    }
}

@media (max-width: 720px) {
    .card-header,
    .card-body,
    .card-footer {
        padding: 12px;
    }

    .btn {
        width: 100%;
    }

    .section-header .btn,
    .section-header .flex .btn,
    .list-item-actions .btn,
    .card-header .btn {
        width: auto;
    }

    .stat-card {
        min-height: 88px;
    }

    .stats-grid.cols-2,
    .stats-grid.cols-3,
    .stats-grid.cols-4,
    .stats-grid.cols-5 {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 22px;
    }

    .notification-panel {
        right: 8px;
        width: calc(100vw - 16px);
    }

    .toast-stack {
        right: 8px;
        width: calc(100vw - 16px);
    }

    .safety-modal {
        width: calc(100vw - 16px);
    }
}
