/* =============================================================
   BAMBI DESIGN SYSTEM
   Global design tokens, shared utilities, and component overrides
   ============================================================= */

/* --- Design Tokens (Global) --- */
:root {
    /* Core palette — Slate scale (Tailwind-derived) */
    --sbl-navy:       #0f172a;
    --sbl-slate-800:  #1e293b;
    --sbl-slate-700:  #334155;
    --sbl-slate-600:  #475569;
    --sbl-slate-500:  #64748b;
    --sbl-slate-400:  #94a3b8;
    --sbl-slate-300:  #cbd5e1;
    --sbl-slate-200:  #e2e8f0;
    --sbl-slate-100:  #f1f5f9;
    --sbl-slate-50:   #f8fafc;
    --sbl-white:      #ffffff;

    /* Semantic colours */
    --sbl-green:       #16a34a;
    --sbl-green-light: #dcfce7;
    --sbl-green-bg:    #f0fdf4;
    --sbl-amber:       #f59e0b;
    --sbl-amber-dark:  #d97706;
    --sbl-amber-light: #fef3c7;
    --sbl-amber-bg:    #fffbeb;
    --sbl-red:         #dc2626;
    --sbl-red-light:   #fee2e2;
    --sbl-red-bg:      #fef2f2;
    --sbl-blue:        #2563eb;
    --sbl-blue-light:  #dbeafe;
    --sbl-blue-bg:     #eff6ff;
    --sbl-purple:      #7c3aed;
    --sbl-purple-light:#f3e8ff;
    --sbl-purple-bg:   #f5f3ff;

    /* Typography */
    --sbl-font-sans:  'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --sbl-font-mono:  'JetBrains Mono', 'Fira Code', 'SF Mono', ui-monospace, monospace;

    /* Spacing & Shape */
    --sbl-radius:     8px;
    --sbl-radius-sm:  6px;
    --sbl-radius-lg:  12px;

    /* Shadows */
    --sbl-shadow-sm:  0 1px 2px rgba(15, 23, 42, 0.05);
    --sbl-shadow:     0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
    --sbl-shadow-md:  0 4px 12px rgba(15, 23, 42, 0.1);
    --sbl-shadow-lg:  0 20px 60px rgba(0, 0, 0, 0.15);

    /* Motion */
    --sbl-ease:       0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --sbl-ease-fast:  0.15s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index layers */
    --sbl-z-topbar:   100;
    --sbl-z-dialog:   1000;
}

/* --- Google Font import (DM Sans — geometric, readable, modern) --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&display=swap');

/* --- Global Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--sbl-font-sans);
    margin: 0;
    background: var(--sbl-slate-50);
    color: var(--sbl-slate-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Top Bar --- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem;
    height: 56px;
    background: var(--sbl-navy);
    color: var(--sbl-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: var(--sbl-z-topbar);
}

.topbar a {
    color: var(--sbl-white);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    transition: color var(--sbl-ease-fast);
}

.topbar a:hover {
    color: #60a5fa;
}

/* --- Navigation --- */
.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--sbl-slate-300);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: var(--sbl-radius-sm);
    transition: background-color var(--sbl-ease-fast), color var(--sbl-ease-fast);
    margin-right: 0;
}

.nav a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--sbl-white);
}

/* Per-link hover colors matching the index.xhtml card palette */
.nav a.nav-missions:hover  { color: #f59e0b; background-color: rgba(245, 158,  11, 0.12); }
.nav a.nav-people:hover    { color: #a78bfa; background-color: rgba(139,  92, 246, 0.12); }
.nav a.nav-drones:hover    { color: #f87171; background-color: rgba(248, 113, 113, 0.12); }
.nav a.nav-flights:hover   { color: #2dd4bf; background-color: rgba( 20, 184, 166, 0.12); }
.nav a.nav-map:hover       { color: #4ade80; background-color: rgba( 34, 197,  94, 0.12); }
.nav a.nav-communes:hover  { color: #818cf8; background-color: rgba( 99, 102, 241, 0.12); }
.nav a.nav-dashboard:hover { color: #60a5fa; background-color: rgba( 59, 130, 246, 0.12); }
.nav a.nav-settings:hover  { color: #94a3b8; background-color: rgba(100, 116, 139, 0.12); }
.nav a.nav-users:hover     { color: #f472b6; background-color: rgba(236, 72, 153, 0.12); }

.locale-switch {
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--sbl-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.locale-switch a {
    margin: 0 2px;
    padding: 0.2rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 3px;
    transition: background var(--sbl-ease-fast);
}

.locale-switch a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.locale-switch span {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
}

/* --- Content Area --- */
.content {
    padding: 1.5rem;
    min-height: calc(100vh - 56px - 44px);
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* --- Footer --- */
.footer {
    padding: 0.75rem 1.25rem;
    background: var(--sbl-white);
    color: var(--sbl-slate-400);
    text-align: center;
    border-top: 1px solid var(--sbl-slate-200);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* =============================================================
   SHARED PRIMEFACES COMPONENT OVERRIDES
   ============================================================= */

/* --- Buttons --- */
.ui-button {
    border-radius: var(--sbl-radius-sm);
    font-weight: 600;
    font-family: var(--sbl-font-sans);
    transition: all var(--sbl-ease-fast);
    letter-spacing: 0.01em;
}

.ui-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--sbl-shadow);
}

.ui-button:active {
    transform: translateY(0);
}

/* --- Panels --- */
.ui-panel {
    border-radius: var(--sbl-radius);
    border: 1px solid var(--sbl-slate-200);
    box-shadow: var(--sbl-shadow-sm);
    overflow: hidden;
}

.ui-panel .ui-panel-titlebar {
    background: var(--sbl-navy);
    color: var(--sbl-white);
    border-color: var(--sbl-navy);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
    letter-spacing: 0.01em;
}

.ui-panel .ui-panel-content {
    padding: 1rem;
}

/* --- DataTables --- */
.ui-datatable .ui-datatable-header {
    background: var(--sbl-slate-100);
    color: var(--sbl-navy);
    font-weight: 700;
    border-bottom: 2px solid var(--sbl-slate-200);
}

.ui-datatable-striped .ui-datatable-data tr:nth-child(even) {
    background: var(--sbl-slate-50);
}

/* --- Dialogs --- */
.ui-dialog {
    border-radius: var(--sbl-radius-lg) !important;
    border: none !important;
    box-shadow: var(--sbl-shadow-lg) !important;
    overflow: hidden;
}

.ui-dialog .ui-dialog-titlebar {
    background: var(--sbl-slate-50);
    color: var(--sbl-navy);
    border-bottom: 1px solid var(--sbl-slate-200);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.85rem 1.25rem;
}

.ui-dialog .ui-dialog-content {
    padding: 0;
}

/* --- Messages --- */
.ui-messages {
    border-radius: var(--sbl-radius);
    font-family: var(--sbl-font-sans);
}

/* --- Inputs --- */
.ui-inputfield {
    font-family: var(--sbl-font-sans);
    border-radius: var(--sbl-radius-sm);
}

.ui-selectonemenu {
    font-family: var(--sbl-font-sans);
    border-radius: var(--sbl-radius-sm);
}

/* --- TabView --- */
.ui-tabs .ui-tabs-nav {
    border-radius: var(--sbl-radius) var(--sbl-radius) 0 0;
}

.ui-tabs .ui-tabs-nav li a {
    font-family: var(--sbl-font-sans);
    font-weight: 600;
    font-size: 0.82rem;
}

/* --- Shared Toolbar (table headers across People, Missions, Communes) --- */
.bambi-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; gap: 12px;
}
.bambi-toolbar-left { display: flex; align-items: center; gap: 8px; }
.bambi-toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bambi-toolbar-title { font-size: 0.88rem; color: #64748b; font-weight: 500; }

/* --- Confirm Dialog --- */
.ui-confirm-dialog .ui-dialog-titlebar {
    background: var(--sbl-amber-light);
    color: var(--sbl-navy);
    border-bottom: 1px solid var(--sbl-amber);
}

/* =============================================================
   SHARED UTILITY CLASSES
   ============================================================= */

/* Monospace text */
.sbl-mono {
    font-family: var(--sbl-font-mono);
}

/* Screen-reader only */
.sbl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus ring for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--sbl-blue);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.sbl-skip-link {
    position: absolute;
    top: -100%;
    left: 0.5rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--sbl-navy);
    color: var(--sbl-white);
    border-radius: 0 0 var(--sbl-radius-sm) var(--sbl-radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: top var(--sbl-ease-fast);
}

.sbl-skip-link:focus {
    top: 0;
}

/* =============================================================
   LANDING PAGE (index.xhtml)
   ============================================================= */
.sbl-landing {
    text-align: center;
    padding: 0.25rem 1.5rem 2rem;
}

/* ─── Drone hero banner ────────────────────────────────── */
.sbl-drone-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border-radius: var(--sbl-radius);
    padding: 1rem 2rem;
    margin: 0 auto 1.5rem;
    max-width: 1100px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
}

/* subtle grid overlay */
.sbl-drone-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.sbl-drone-img {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    filter: drop-shadow(0 8px 24px rgba(245,158,11,0.25));
}

.sbl-drone-hero-text {
    text-align: left;
}

.sbl-drone-hero .sbl-landing-title {
    color: #fff;
    font-size: 1.5rem;
}

.sbl-drone-hero .sbl-landing-subtitle {
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0;
    max-width: 420px;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .sbl-drone-hero {
        flex-direction: column;
        gap: 1.25rem;
        padding: 1.5rem 1rem;
        text-align: center;
    }
    .sbl-drone-img {
        width: 80px;
        height: 80px;
    }
    .sbl-drone-hero-text {
        text-align: center;
    }
    .sbl-drone-hero .sbl-landing-subtitle {
        max-width: 100%;
    }
}

.sbl-landing-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--sbl-navy);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.sbl-landing-subtitle {
    font-size: 1rem;
    color: var(--sbl-slate-500);
    margin: 0 0 2rem;
    font-weight: 400;
}

.sbl-landing-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.sbl-landing-card {
    background: var(--sbl-white);
    border: 1px solid var(--sbl-slate-200);
    border-radius: var(--sbl-radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: border-color var(--sbl-ease), box-shadow var(--sbl-ease), transform var(--sbl-ease);
    flex: 0 1 220px;
    box-shadow: var(--sbl-shadow-sm);
    /* whole-card link support */
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.sbl-landing-card:hover {
    border-color: var(--sbl-slate-300);
    box-shadow: var(--sbl-shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.sbl-landing-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--sbl-radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}

.sbl-landing-card-icon .pi {
    font-size: 1.25rem;
    color: var(--sbl-white);
}

.sbl-landing-card-icon.blue    { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.sbl-landing-card-icon.green   { background: linear-gradient(135deg, #22c55e, #16a34a); }
.sbl-landing-card-icon.amber   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.sbl-landing-card-icon.purple  { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.sbl-landing-card-icon.red     { background: linear-gradient(135deg, #f87171, #dc2626); }
.sbl-landing-card-icon.teal    { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.sbl-landing-card-icon.slate   { background: linear-gradient(135deg, #64748b, #334155); }
.sbl-landing-card-icon.indigo  { background: linear-gradient(135deg, #6366f1, #4338ca); }
.sbl-landing-card-icon.cyan    { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.sbl-landing-card-icon.rose    { background: linear-gradient(135deg, #fb7185, #e11d48); }

.sbl-landing-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sbl-navy);
    margin: 0 0 0.35rem;
}

.sbl-landing-card p {
    font-size: 0.8rem;
    color: var(--sbl-slate-500);
    margin: 0 0 1rem;
    line-height: 1.45;
}

/* .sbl-landing-card .ui-button — removed; cards are now fully clickable links */

/* =============================================================
   SETTINGS PAGE  (cfg- prefix)
   ============================================================= */

/* ── Page wrapper ──────────────────────────────────────────── */
.cfg-page {
    padding-bottom: 2rem;
}

/* ── Hero bar ──────────────────────────────────────────────── */
.cfg-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #64748b;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    padding: 20px 28px;
    border-radius: var(--sbl-radius);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

/* subtle grid overlay — same as ml-hero, dr-hero, fpe-hero */
.cfg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.cfg-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.cfg-hero-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #64748b, #334155);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.cfg-hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.cfg-hero-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

/* ── Two-column layout ─────────────────────────────────────── */
.cfg-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cfg-col-main {
    flex: 1 1 0;
    min-width: 0;
}

.cfg-col-aside {
    flex: 1 1 0;
    min-width: 0;
}

/* ── Card shell (shared by both columns) ───────────────────── */
.cfg-card {
    background: var(--sbl-white);
    border: 1px solid var(--sbl-slate-200);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--sbl-shadow-sm);
    margin-bottom: 16px;
}

.cfg-card-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--sbl-slate-100);
    background: var(--sbl-slate-50);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--sbl-slate-600);
}

/* ── Preference rows ───────────────────────────────────────── */
.cfg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid var(--sbl-slate-100);
    gap: 12px;
}

/* last row in a section — no bottom border (card handles it) */
.cfg-row-last {
    border-bottom: none;
}

.cfg-row-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* icon badge */
.cfg-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
}

.cfg-ico-blue   { background: var(--sbl-blue-light);   color: var(--sbl-blue); }
.cfg-ico-purple { background: var(--sbl-purple-light);  color: var(--sbl-purple); }
.cfg-ico-slate  { background: var(--sbl-slate-100);    color: var(--sbl-slate-600); }
.cfg-ico-green  { background: var(--sbl-green-light);  color: var(--sbl-green); }
.cfg-ico-amber  { background: var(--sbl-amber-light);  color: var(--sbl-amber-dark); }

.cfg-row-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cfg-row-name {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--sbl-navy);
}

.cfg-row-desc {
    font-size: 0.74rem;
    color: var(--sbl-slate-400);
    margin-top: 1px;
}

.cfg-row-ctrl {
    flex-shrink: 0;
}

/* normalise select widths */
.cfg-select      { width: 150px !important; }
.cfg-select-wide { width: 210px !important; }

/* ── Save row ──────────────────────────────────────────────── */
.cfg-save-row {
    padding: 12px 16px;
    border-top: 1px solid var(--sbl-slate-100);
    background: var(--sbl-slate-50);
}

/* ── Build Info card internals ─────────────────────────────── */
.bi-group {
    padding: 4px 14px 8px;
    border-bottom: 1px solid var(--sbl-slate-100);
}

.bi-group-last {
    border-bottom: none;
}

.bi-group-hdr {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 0 5px;
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sbl-slate-400);
}

.bi-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 0;
}

.bi-ico {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.63rem;
}

.bi-ico-blue    { background: var(--sbl-blue-light);   color: var(--sbl-blue); }
.bi-ico-purple  { background: var(--sbl-purple-light);  color: var(--sbl-purple); }
.bi-ico-slate   { background: var(--sbl-slate-100);    color: var(--sbl-slate-500); }
.bi-ico-emerald { background: var(--sbl-green-light);  color: var(--sbl-green); }
.bi-ico-amber   { background: var(--sbl-amber-light);  color: var(--sbl-amber-dark); }

.bi-lbl {
    font-size: 0.75rem;
    color: var(--sbl-slate-500);
    min-width: 72px;
    flex-shrink: 0;
}

.bi-val {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sbl-navy);
}

.bi-muted {
    font-size: 0.7rem;
    color: var(--sbl-slate-400);
}

.bi-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.bi-chip-blue   { background: var(--sbl-blue-light);   color: #1d4ed8; }
.bi-chip-purple { background: var(--sbl-purple-light);  color: #5b21b6; }

/* ── Libraries & External Data section ─────────────────────────────────── */
.cfg-libs-section {
    margin-top: 20px;
}

.cfg-lib-cols {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px;
}

.cfg-lib-group {
    flex: 1 1 300px;
    min-width: 0;
}

.cfg-lib-group-hdr {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sbl-slate-500);
    padding: 0 0 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--sbl-slate-100);
}

.cfg-lib-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.cfg-lib-table th {
    text-align: left;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--sbl-slate-400);
    padding: 3px 8px 6px 0;
    border-bottom: 1px solid var(--sbl-slate-100);
}

.cfg-lib-table td {
    padding: 6px 8px 6px 0;
    border-bottom: 1px solid var(--sbl-slate-100);
    color: var(--sbl-slate-700);
    vertical-align: top;
}

.cfg-lib-table tr:last-child td {
    border-bottom: none;
}

.cfg-lib-name {
    font-weight: 600;
    color: var(--sbl-navy);
    white-space: nowrap;
}

.cfg-lib-purpose {
    font-size: 0.75rem;
    color: var(--sbl-slate-500);
}

.cfg-ext-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 16px;
}

.cfg-ext-card {
    background: var(--sbl-white);
    border: 1px solid var(--sbl-slate-200);
    border-radius: 8px;
    overflow: hidden;
}

.cfg-ext-card-hdr {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    background: var(--sbl-slate-50);
    border-bottom: 1px solid var(--sbl-slate-100);
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--sbl-slate-600);
}

.cfg-ext-row {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-bottom: 1px solid var(--sbl-slate-100);
    gap: 3px;
    font-size: 0.8rem;
}

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

.cfg-ext-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cfg-ext-name {
    font-weight: 600;
    color: var(--sbl-navy);
}

.cfg-ext-url {
    font-size: 0.68rem;
    color: var(--sbl-blue);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: block;
}

.cfg-ext-url:hover {
    text-decoration: underline;
}

.cfg-ext-purpose {
    font-size: 0.73rem;
    color: var(--sbl-slate-500);
    margin-top: 1px;
}

.cfg-auth-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cfg-auth-none   { background: var(--sbl-green-light, #f0fff4); color: var(--sbl-green, #276749); }
.cfg-auth-apikey { background: #fef3c7; color: #92400e; }
.cfg-auth-token  { background: #fed7aa; color: #c2410c; }
.cfg-auth-self   { background: var(--sbl-slate-100, #f1f5f9); color: var(--sbl-slate-600, #475569); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cfg-hero {
        padding: 16px 18px;
    }

    .cfg-hero-title {
        font-size: 1.1rem;
    }

    .cfg-col-aside {
        flex: 1 1 100%;
    }

    .cfg-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cfg-row-ctrl {
        width: 100%;
    }

    .cfg-select,
    .cfg-select-wide {
        width: 100% !important;
    }

    .cfg-lib-cols { flex-direction: column; }
    .cfg-ext-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   RESPONSIVE TOPBAR
   ============================================================= */
@media (max-width: 768px) {
    .topbar {
        height: auto;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav {
        flex-wrap: wrap;
        gap: 0.15rem;
    }

    .nav a {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .nav a {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }

    .sbl-landing-title {
        font-size: 1.75rem;
    }

    .sbl-landing-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================
   MISSION DETAIL PAGE (md- prefix)
   ============================================================= */
.md-page {
    /* Inherits from :root design tokens */
    --md-navy: var(--sbl-navy);
    --md-slate-700: var(--sbl-slate-700);
    --md-slate-500: var(--sbl-slate-500);
    --md-slate-400: var(--sbl-slate-400);
    --md-slate-200: var(--sbl-slate-200);
    --md-slate-100: var(--sbl-slate-100);
    --md-slate-50: var(--sbl-slate-50);
    --md-white: var(--sbl-white);
    --md-green: var(--sbl-green);
    --md-green-light: var(--sbl-green-light);
    --md-amber: var(--sbl-amber);
    --md-amber-light: var(--sbl-amber-light);
    --md-red: var(--sbl-red);
    --md-red-light: var(--sbl-red-light);
    --md-blue: var(--sbl-blue);
    --md-blue-light: var(--sbl-blue-light);
    --md-card-radius: var(--sbl-radius);
    --md-card-shadow: var(--sbl-shadow);
    --md-font-mono: var(--sbl-font-mono);
    --md-transition: var(--sbl-ease);
    padding-bottom: 2rem;
}

/* --- Hero header bar --- */
.md-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    position: relative;
    overflow: hidden;
    color: #fff;
    border-radius: var(--md-card-radius);
    margin-bottom: 1.25rem;
}
/* subtle grid overlay on hero */
.md-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.md-hero-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.md-hero-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--md-white);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-hero-id {
    font-family: var(--md-font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--md-slate-400);
    white-space: nowrap;
}

.md-hero-badges {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}

.md-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.md-badge-status {
    background: var(--md-blue-light);
    color: var(--md-blue);
}

.md-badge-priority {
    background: var(--md-amber-light);
    color: #92400e;
}

.md-badge-priority.highest {
    background: var(--md-red-light);
    color: var(--md-red);
}

.md-badge-priority.high {
    background: #ffedd5;
    color: #c2410c;
}

.md-badge-priority.normal {
    background: var(--md-amber-light);
    color: #92400e;
}

.md-badge-priority.low {
    background: var(--md-blue-light);
    color: var(--md-blue);
}

.md-badge-priority.lowest {
    background: var(--md-slate-100);
    color: var(--md-slate-500);
}

.md-hero-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.md-hero-right .ui-button {
    font-size: 0.8rem;
    border-radius: 6px;
}

/* --- Two-column grid --- */
.md-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}

/* --- Card --- */
.md-card {
    background: var(--md-white);
    border: 1px solid var(--md-slate-200);
    border-radius: var(--md-card-radius);
    box-shadow: var(--md-card-shadow);
    overflow: hidden;
}

.md-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--md-slate-50);
    border-bottom: 1px solid var(--md-slate-200);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--md-slate-500);
}

.md-card-header .pi {
    font-size: 0.85rem;
    color: var(--md-slate-400);
}

.md-card-body {
    padding: 0.85rem 1rem;
}

/* --- Metrics row --- */
.md-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.md-metric {
    background: var(--md-white);
    border: 1px solid var(--md-slate-200);
    border-radius: var(--md-card-radius);
    padding: 0.75rem 1rem;
    text-align: center;
}

.md-metric-value {
    font-family: var(--md-font-mono);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--md-navy);
    line-height: 1.2;
}

.md-metric-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--md-slate-400);
    margin-top: 0.15rem;
}

/* --- Weather bar (emoji strip beneath metrics) --- */
.md-weather-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 40%, #fffbeb 100%);
    border: 1px solid var(--md-slate-200);
    border-radius: var(--md-card-radius);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--md-slate-300) transparent;
    -webkit-overflow-scrolling: touch;
}

.md-weather-bar::-webkit-scrollbar {
    height: 4px;
}

.md-weather-bar::-webkit-scrollbar-track {
    background: transparent;
}

.md-weather-bar::-webkit-scrollbar-thumb {
    background: var(--md-slate-300);
    border-radius: 2px;
}

.md-wb-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    padding: 0.4rem 0.65rem;
    background: var(--md-white);
    border: 1px solid var(--md-slate-200);
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.md-wb-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.md-wb-chip-ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.md-wb-chip-warn {
    background: #fef2f2;
    border-color: #fecaca;
}

.md-wb-emoji {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}

.md-wb-data {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.md-wb-value {
    font-family: var(--md-font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--md-navy);
    line-height: 1.2;
    white-space: nowrap;
}

.md-wb-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--md-slate-400);
    line-height: 1.3;
}

.md-wb-wind-arrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--md-blue);
    margin-left: 0.15rem;
    vertical-align: middle;
    line-height: 1;
}

@media (max-width: 768px) {
    .md-weather-bar {
        gap: 0.4rem;
        padding: 0.5rem 0.6rem;
    }

    .md-wb-chip {
        padding: 0.35rem 0.55rem;
    }

    .md-wb-emoji {
        font-size: 1.15rem;
    }

    .md-wb-value {
        font-size: 0.72rem;
    }
}

/* --- Timeline bar (status / priority / dates strip) --- */
.md-timeline-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.25rem;
    padding: 0.6rem 1rem;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
    flex-wrap: wrap;
    row-gap: 0.5rem;
}
.md-timeline-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.9rem;
}
.md-timeline-item:first-child { padding-left: 0; }
.md-timeline-sep {
    width: 1px;
    height: 1.4em;
    background: #e2e8f0;
    flex-shrink: 0;
}
.md-timeline-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.md-timeline-value {
    font-size: 0.82rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #0f172a;
    white-space: nowrap;
}
.md-timeline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.md-timeline-link:hover { text-decoration: underline; color: #2563eb; }
/* Status + Priority group pushed to the right end */
.md-timeline-right-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
}
.md-priority-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.md-priority-select {
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.md-priority-select:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.md-priority-select.high   { color: #b91c1c; border-color: #fca5a5; background: #fff1f1; }
.md-priority-select.normal { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.md-priority-select.low    { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
/* Individual option colours — value="1" High, "2" Normal, "3" Low */
.md-priority-select option[value="1"] { background: #fff1f1; color: #b91c1c; font-weight: 600; }
.md-priority-select option[value="2"] { background: #fffbeb; color: #92400e; font-weight: 600; }
.md-priority-select option[value="3"] { background: #f0fdf4; color: #166534; font-weight: 600; }

/* --- METAR bar (aviation data strip beneath weather bar) --- */
.md-metar-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding: 0.55rem 0.85rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf4 100%);
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    overflow-x: auto;
    scrollbar-width: thin;
}

.md-metar-label {
    font-weight: 600;
    font-size: 0.78rem;
    color: #475569;
    white-space: nowrap;
    flex-shrink: 0;
}

.md-metar-raw {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    color: #1e293b;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.65);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
}

/* Inline METAR in the weather table */
.md-metar-raw-inline {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.72rem;
    color: #334155;
    letter-spacing: 0.01em;
    white-space: nowrap;
    margin-left: 0.35rem;
}

/* Flight category badges (standard aviation colours) */
.md-metar-fltcat {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.md-metar-fltcat-vfr {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.md-metar-fltcat-mvfr {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.md-metar-fltcat-ifr {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.md-metar-fltcat-lifr {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #d8b4fe;
}

.md-metar-fltcat-unknown {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

@media (max-width: 768px) {
    .md-metar-bar {
        gap: 0.4rem;
        padding: 0.45rem 0.6rem;
    }

    .md-metar-raw {
        font-size: 0.72rem;
    }
}

/* --- Key/value rows inside cards --- */
.md-kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
}

.md-kv + .md-kv {
    border-top: 1px solid var(--md-slate-100);
}

.md-kv-label {
    font-size: 0.75rem;
    color: var(--md-slate-400);
    font-weight: 600;
}

.md-kv-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--md-navy);
    text-align: right;
}

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

/* --- Person card (crew) --- */
.md-person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
}

.md-person-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    background: var(--md-slate-50);
    border: 1px solid var(--md-slate-200);
    border-radius: 6px;
    transition: border-color var(--md-transition);
}

.md-person-card:hover {
    border-color: var(--md-slate-400);
}

.md-person-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--md-navy);
    color: var(--md-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.md-person-info {
    min-width: 0;
}

.md-person-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--md-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-person-detail {
    font-size: 0.7rem;
    color: var(--md-slate-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- FLIK parcel cards --- */
.md-flik-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.md-flik-card {
    border: 1px solid var(--md-slate-200);
    border-radius: 6px;
    overflow: hidden;
}

.md-flik-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: var(--md-slate-50);
    border-bottom: 1px solid var(--md-slate-200);
}

.md-flik-code {
    font-family: var(--md-font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--md-navy);
}

.md-flik-commune {
    font-size: 0.7rem;
    color: var(--md-slate-400);
}

.md-flik-commune-link {
    font-size: 0.7rem;
    color: var(--md-slate-400);
    text-decoration: none;
    transition: color 0.15s;
}
.md-flik-commune-link:hover {
    color: #16a34a;
    text-decoration: underline;
}

.md-flik-stats {
    display: flex;
    gap: 0.75rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.7rem;
}

.md-flik-stat-label {
    color: var(--md-slate-400);
    margin-right: 0.25rem;
}

.md-flik-stat-value {
    font-family: var(--md-font-mono);
    font-weight: 700;
    color: var(--md-navy);
}

.md-flik-map iframe {
    display: block;
    width: 100%;
    height: 280px;
    border: none;
    border-top: 1px solid var(--md-slate-200);
}

/* --- Flight plan artifacts table --- */
.md-fp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.md-fp-table thead th {
    padding: 0.5rem 0.85rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--md-slate-400);
    background: var(--md-slate-50);
    border-bottom: 1px solid var(--md-slate-200);
    text-align: left;
}

.md-fp-table tbody td {
    padding: 0.5rem 0.85rem;
    color: var(--md-navy);
    border-bottom: 1px solid var(--md-slate-100);
    vertical-align: middle;
}

.md-fp-table tbody tr:last-child td {
    border-bottom: none;
}

.md-fp-table tbody tr:hover td {
    background: var(--md-slate-50);
}

.md-fp-table .mono {
    font-family: var(--md-font-mono);
    font-size: 0.75rem;
    font-weight: 600;
}

.md-fp-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--md-slate-400);
    background: var(--md-slate-50);
    border: 1px solid var(--md-slate-200);
    text-decoration: none;
    transition: all 0.15s ease;
}

.md-fp-download-btn:hover {
    color: var(--md-white);
    background: #16a34a;
    border-color: #16a34a;
}

.md-fp-download-btn .pi {
    font-size: 0.8rem;
}

/* --- Navigation group (prev/next) --- */
.md-nav-group {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.md-nav-group .ui-button,
.md-nav-group .ui-button-outlined {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
}

/* --- Expanded person card --- */
.md-person-card-expanded {
    align-items: flex-start;
    padding: 0.75rem 0.95rem;
}

.md-person-card-expanded .md-person-avatar {
    margin-top: 0.15rem;
}

.md-person-card-expanded .md-person-detail {
    display: flex;
    align-items: center;
    margin-top: 0.2rem;
    white-space: normal;
}

.md-person-badge-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem !important;
}

.md-badge-license {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    background: #dbeafe;
    color: #1e40af;
    letter-spacing: 0.02em;
}

.md-person-license-num {
    display: inline-flex;
    align-items: center;
    font-family: var(--md-font-mono);
    font-size: 0.65rem;
    color: var(--md-slate-500);
}

/* --- Section (full-width crew) --- */
.md-section {
    margin-top: 1.25rem;
}

.md-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--md-slate-400);
    margin-bottom: 0.5rem;
    padding-left: 0.15rem;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .md-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .md-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .md-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .md-person-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .md-hero-title {
        font-size: 1rem;
    }

    .md-metrics {
        grid-template-columns: 1fr;
    }
}


/* =============================================================
   MISSIONS LIST PAGE (ml- prefix)
   ============================================================= */
.ml-page {
    /* Inherits from :root design tokens */
    --ml-navy: var(--sbl-navy);
    --ml-slate-700: var(--sbl-slate-700);
    --ml-slate-500: var(--sbl-slate-500);
    --ml-slate-400: var(--sbl-slate-400);
    --ml-slate-200: var(--sbl-slate-200);
    --ml-slate-100: var(--sbl-slate-100);
    --ml-slate-50: var(--sbl-slate-50);
    --ml-white: var(--sbl-white);
    --ml-green: var(--sbl-green);
    --ml-green-light: var(--sbl-green-light);
    --ml-amber: var(--sbl-amber);
    --ml-amber-light: var(--sbl-amber-light);
    --ml-red: var(--sbl-red);
    --ml-red-light: var(--sbl-red-light);
    --ml-blue: var(--sbl-blue);
    --ml-blue-light: var(--sbl-blue-light);
    --ml-card-radius: var(--sbl-radius);
    --ml-card-shadow: var(--sbl-shadow);
    --ml-font-mono: var(--sbl-font-mono);
    --ml-transition: var(--sbl-ease);
}

/* --- Hero header (consistent with pp-hero pattern) --- */
.ml-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    color: var(--sbl-white);
    padding: 20px 28px;
    border-radius: var(--sbl-radius);
    margin-bottom: 20px;
}
/* subtle grid overlay on hero */
.ml-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.ml-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ml-hero-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.ml-hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.ml-hero-subtitle {
    font-size: 0.82rem;
    color: var(--sbl-slate-400);
    margin: 2px 0 0;
}

.ml-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hero action buttons — normalise height */
.ml-hero-actions .ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600 !important;
    padding: 0.45rem 0.9rem;
    border-radius: 6px !important;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
}

/* --- Status counter cards --- */
.ml-counters {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ml-counter {
    background: var(--sbl-white);
    border: 1px solid var(--sbl-slate-200);
    border-radius: var(--sbl-radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: box-shadow var(--sbl-ease);
}

.ml-counter:hover {
    box-shadow: var(--sbl-shadow-md);
}

.ml-counter-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.ml-counter-icon.created     { background: var(--sbl-slate-100); color: var(--sbl-slate-600); }
.ml-counter-icon.unassigned  { background: var(--sbl-amber-bg);  color: var(--sbl-amber); }
.ml-counter-icon.dispatched  { background: var(--sbl-blue-bg);   color: var(--sbl-blue); }
.ml-counter-icon.in_progress { background: var(--sbl-purple-bg); color: var(--sbl-purple); }
.ml-counter-icon.completed   { background: var(--sbl-green-bg);  color: var(--sbl-green); }
.ml-counter-icon.cancelled   { background: var(--sbl-red-bg);    color: var(--sbl-red); }

.ml-counter-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sbl-slate-800);
    font-family: var(--sbl-font-mono);
    line-height: 1;
}

.ml-counter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sbl-slate-500);
    margin-top: 2px;
}

/* --- Filter bar --- */
.ml-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--ml-white);
    border: 1px solid var(--ml-slate-200);
    border-radius: var(--ml-card-radius);
    margin-bottom: 1rem;
}

.ml-filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ml-slate-400);
    white-space: nowrap;
}

.ml-filters .ui-selectonemenu {
    border-radius: 6px;
}

/* Reset button inside filter bar — match dropdown height */
.ml-filters .ui-button {
    padding: 0.4rem 0.55rem;
    min-height: 0;
    height: 33px;
    width: 33px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.ml-filter-active-count {
    font-family: var(--sbl-font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--sbl-blue);
    color: var(--sbl-white);
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    margin-left: auto;
}

/* --- Priority stripe (inline) --- */
.ml-priority-stripe {
    display: inline-block;
    width: 5px;
    border-radius: 3px;
    min-height: 28px;
}

.ml-priority-1 { background: #ef4444; }
.ml-priority-2 { background: #f59e0b; }
.ml-priority-3 { background: #22c55e; }

/* --- Priority badge --- */
.ml-priority-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ml-priority-badge {
    font-family: var(--ml-font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.ml-priority-badge-1 { background: #fee2e2; color: #b91c1c; }
.ml-priority-badge-2 { background: #fef9c3; color: #854d0e; }
.ml-priority-badge-3 { background: #dcfce7; color: #15803d; }

/* --- Title / status --- */
.ml-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ml-navy);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ml-status-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.ml-status-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Per-status colour-coded badges (consistent with dd-/cd-/sd- sections) */
.ml-status-created {
    background: var(--sbl-slate-100);
    color: var(--sbl-slate-600);
}

.ml-status-unassigned {
    background: var(--sbl-amber-light);
    color: #92400e;
}

.ml-status-dispatched {
    background: var(--sbl-blue-light);
    color: var(--sbl-blue);
}

.ml-status-in_progress {
    background: var(--sbl-purple-light);
    color: var(--sbl-purple);
}

.ml-status-completed {
    background: var(--sbl-green-light);
    color: var(--sbl-green);
}

.ml-status-cancelled {
    background: var(--sbl-red-light);
    color: var(--sbl-red);
}

/* --- Date column empty dash --- */
.ml-date-empty {
    color: var(--ml-slate-400);
}

/* --- Actions cell --- */
.ml-actions-cell {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
}

/* Normalise all action buttons to identical icon-only squares */
.ml-actions-cell .ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all var(--ml-transition);
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1;
}

.ml-actions-cell .ui-button:hover {
    transform: translateY(-1px);
}

/* ── Shared action-column widths (global, applies to all pages) ─────────── */
.bambi-col-actions-sm { width: 80px;  text-align: center; white-space: nowrap; }
.bambi-col-actions    { width: 132px; white-space: nowrap; }
.bambi-col-actions-lg { width: 168px; white-space: nowrap; }
.bambi-col-actions .ui-button,
.bambi-col-actions-sm .ui-button,
.bambi-col-actions-lg .ui-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    font-size: 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1;
    vertical-align: middle;
}
/* suppress the empty ui-button-text span that h:link generates */
.bambi-col-actions .ui-button-text,
.bambi-col-actions-sm .ui-button-text,
.bambi-col-actions-lg .ui-button-text {
    display: none !important;
}

/* Shared action-cell flex wrapper — use inside every action column */
.bambi-actions-cell {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}
/* legacy alias */
.ml-actions-cell { display: flex; gap: 0.35rem; align-items: center; }

/* ── Shared hero bar action button ──────────────────────────────────────── */
.bambi-hero-btn,
.pp-hero-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: var(--sbl-radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background var(--sbl-ease), border-color var(--sbl-ease), box-shadow var(--sbl-ease);
    background: var(--sbl-white);
    color: var(--sbl-slate-700);
    border-color: var(--sbl-slate-300);
}
.bambi-hero-btn:hover,
.pp-hero-map-btn:hover {
    background: var(--sbl-slate-100);
    border-color: var(--sbl-slate-400);
    color: var(--sbl-slate-800);
    text-decoration: none;
}
.bambi-hero-btn.ui-button-success,
.pp-hero-map-btn.ui-button-success {
    background: var(--sbl-green);
    border-color: var(--sbl-green);
    color: var(--sbl-white);
}
.bambi-hero-btn.ui-button-success:hover,
.pp-hero-map-btn.ui-button-success:hover {
    background: #15803d;
    border-color: #15803d;
}
.bambi-hero-btn.ui-button-secondary,
.pp-hero-map-btn.ui-button-secondary {
    background: var(--sbl-slate-100);
    border-color: var(--sbl-slate-300);
    color: var(--sbl-slate-600);
}
.bambi-hero-btn.ui-button-secondary:hover,
.pp-hero-map-btn.ui-button-secondary:hover {
    background: var(--sbl-slate-200);
}

/* ── Shared dialog footer action bar ────────────────────────────────────── */
.bambi-dlg-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 12px;
    border-top: 1px solid #e2e8f0;
    margin-top: 12px;
}

/* --- Pagination styling --- */
.ml-page .ui-paginator {
    background: transparent;
    border: none;
    padding: 1rem 0 0;
}

.ml-page .ui-paginator .ui-paginator-page,
.ml-page .ui-paginator .ui-paginator-first,
.ml-page .ui-paginator .ui-paginator-prev,
.ml-page .ui-paginator .ui-paginator-next,
.ml-page .ui-paginator .ui-paginator-last {
    border-radius: 6px;
    min-width: 28px;
    height: 28px;
    font-size: 0.8rem;
}

.ml-page .ui-paginator .ui-state-active {
    background: var(--ml-navy);
    border-color: var(--ml-navy);
    color: var(--ml-white);
}

.ml-page .ui-paginator .ui-paginator-current {
    font-family: var(--ml-font-mono);
    font-size: 0.75rem;
    color: var(--ml-slate-500);
}

/* --- Empty state --- */
.ml-empty {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--ml-white);
    border: 1px solid var(--ml-slate-200);
    border-radius: var(--ml-card-radius);
}

.ml-empty .pi {
    font-size: 2.5rem;
    color: var(--ml-slate-400);
    margin-bottom: 0.75rem;
    display: block;
}

.ml-empty-text {
    color: var(--ml-slate-500);
    font-size: 0.9rem;
}

/* --- PrimeFaces table styling inside ml-page --- */
.ml-page .ui-datatable {
    border: 1px solid var(--ml-slate-200);
    border-radius: var(--ml-card-radius);
    overflow: hidden;
    background: var(--ml-white);
}

.ml-page .ui-datatable .ui-datatable-header {
    display: none;
}

.ml-page .ui-datatable table {
    border-collapse: collapse;
}

.ml-page .ui-datatable thead th {
    background: var(--ml-slate-50) !important;
    border-bottom: 2px solid var(--ml-slate-200) !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ml-slate-400);
}

.ml-page .ui-datatable thead th .ui-sortable-column-icon {
    color: var(--ml-slate-400);
}

.ml-page .ui-datatable thead th.ui-state-active {
    color: var(--ml-navy);
}

.ml-page .ui-datatable thead th.ui-state-active .ui-sortable-column-icon {
    color: var(--ml-navy);
}

.ml-page .ui-datatable .ui-datatable-data td {
    border-bottom: 1px solid var(--ml-slate-200);
    border-right: none;
    border-left: none;
    padding: 0.55rem 0.85rem;
    vertical-align: middle;
    background: var(--ml-white);
}

.ml-page .ui-datatable .ui-datatable-data tr:last-child td {
    border-bottom: none;
}

.ml-page .ui-datatable .ui-datatable-data tr:hover td {
    background: var(--ml-slate-50);
}

/* Priority column - narrow */
.ml-page .ui-datatable .ml-col-priority {
    width: 90px;
    text-align: center;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Actions column */
.ml-page .ui-datatable .ml-col-actions {
    width: 160px;
    text-align: right;
}

.ml-section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.75rem 0 1.25rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ml-section-divider::before,
.ml-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Edit/create dialog action row */
.auth-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Date columns */
.ml-page .ui-datatable .ml-col-date {
    width: 130px;
    white-space: nowrap;
    font-family: var(--ml-font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ml-slate-700);
}

/* --- Missions list responsive --- */
@media (max-width: 1024px) {
    .ml-counters {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ml-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .ml-hero-actions {
        width: 100%;
    }

    .ml-hero-actions .ui-button {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .ml-counters {
        grid-template-columns: repeat(2, 1fr);
    }

    .ml-filters {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .ml-hero-title {
        font-size: 1.15rem;
    }

    .ml-counters {
        grid-template-columns: 1fr;
    }
}


/* =============================================================
   MISSION CREATE PAGE (mc- prefix)
   Multi-step mission creation wizard with progressive disclosure
   ============================================================= */

.mc-page {
    /* Inherits from :root design tokens */
    --mc-navy: var(--sbl-navy);
    --mc-slate: var(--sbl-slate-800);
    --mc-muted: var(--sbl-slate-500);
    --mc-light: var(--sbl-slate-100);
    --mc-bg: var(--sbl-slate-50);
    --mc-border: var(--sbl-slate-200);
    --mc-blue: var(--sbl-blue);
    --mc-blue-bg: var(--sbl-blue-bg);
    --mc-green: var(--sbl-green);
    --mc-green-bg: var(--sbl-green-bg);
    --mc-amber: var(--sbl-amber-dark);
    --mc-amber-bg: var(--sbl-amber-bg);
    --mc-red: var(--sbl-red);
    --mc-red-bg: var(--sbl-red-bg);
    --mc-purple: var(--sbl-purple);
    --mc-purple-bg: var(--sbl-purple-bg);
    --mc-radius: var(--sbl-radius);
    --mc-shadow: var(--sbl-shadow);
    --mc-mono: var(--sbl-font-mono);
    --mc-transition: var(--sbl-ease);
    max-width: 920px;
    margin: 0 auto;
    padding: 0 8px 2rem;
}

/* Hero Header */
.mc-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    border-radius: var(--mc-radius);
    margin-bottom: 1.25rem;
}
/* subtle grid overlay on hero */
.mc-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.mc-hero-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.mc-hero-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mc-hero-icon .pi {
    font-size: 1.15rem;
    color: #94a3b8;
}

.mc-hero-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.mc-hero-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

.mc-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mc-hero-actions .ui-button {
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
}

/* Step indicator */
.mc-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 800;
    flex-shrink: 0;
    line-height: 1;
    text-align: center;
}
.mc-step-badge span,
.mc-step-badge .ui-outputtext {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mc-step-badge.pending {
    background: var(--mc-border);
    color: var(--mc-muted);
}

.mc-step-badge.active {
    background: var(--mc-blue);
    color: #fff;
}

.mc-step-badge.done {
    background: var(--mc-green);
    color: #fff;
}

/* Card */
.mc-card {
    background: #fff;
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius);
    box-shadow: var(--mc-shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.mc-card.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.mc-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: var(--mc-light);
    border-bottom: 1px solid var(--mc-border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mc-muted);
}

.mc-card-header .pi {
    font-size: 0.85rem;
    color: var(--mc-muted);
}

.mc-card-body {
    padding: 1rem 1.25rem;
}

/* Farmer detail card (shown after selection) */
.mc-farmer-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.25rem;
}

.mc-farmer-detail .mc-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mc-farmer-detail .mc-detail-item.full-width {
    grid-column: 1 / -1;
}

.mc-detail-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mc-muted);
}

.mc-detail-value {
    font-size: 0.88rem;
    color: var(--mc-slate);
    font-weight: 500;
}

.mc-detail-value.mono {
    font-family: var(--mc-mono);
    font-size: 0.82rem;
}

.mc-farmer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--mc-border);
}

.mc-farmer-actions .ui-button {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    border-radius: 5px;
}

/* ── Step 1 — Selected farmer card ──────────────────────────────────── */
.mc-farmer-card {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.4rem 1.6rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.mc-farmer-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}
.mc-farmer-card-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: #1e293b;
    padding-right: 2rem; /* room for close button */
}
.mc-farmer-card-name .pi {
    font-size: 1rem;
    color: #64748b;
}
.mc-farmer-card .ms-client-address {
    font-size: 0.875rem;
}
.mc-farmer-card .ms-client-contacts {
    gap: 0.9rem;
}
.mc-farmer-card .ms-contact-link-sm {
    font-size: 0.84rem;
}

/* Contacts — stacked, no gap */
.mc-farmer-card-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Close (trash) button — top-right of the card */
.mc-farmer-card-close.ui-button {
    position: absolute !important;
    top: 0.6rem !important;
    right: 0.6rem !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s !important;
}
.mc-farmer-card-close.ui-button .ui-button-text { display: none !important; }
.mc-farmer-card-close.ui-button .ui-icon,
.mc-farmer-card-close.ui-button .pi {
    font-size: 0.7rem !important;
    margin: 0 !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
}
.mc-farmer-card-close.ui-button:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

/* ── Step 1 — Farmer autocomplete search bar ─────────────────────────── */
.mc-farmer-search-wrap {
    display: flex;
    gap: 0.65rem;
    align-items: flex-end;
}
.mc-farmer-search-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.mc-field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mc-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.mc-farmer-add-btn {
    font-size: 0.82rem !important;
    padding: 0.4rem 0.85rem !important;
    border-radius: 6px !important;
    white-space: nowrap;
}

/* Autocomplete dropdown item — farmer suggestion card */
.mc-farmer-suggestion {
    padding: 0.3rem 0.2rem;
    line-height: 1.4;
}
.mc-farmer-suggestion-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}
.mc-farmer-suggestion-sub {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: wrap;
}
.mc-farmer-suggestion-sub .pi {
    font-size: 0.65rem;
}

/* DataTable overrides inside mc-page */
.mc-page .ui-datatable {
    border: 1px solid var(--mc-border);
    border-radius: 6px;
    overflow: hidden;
}

.mc-page .ui-datatable thead th {
    background: var(--mc-light);
    color: var(--mc-slate);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    border-bottom: 2px solid var(--mc-border);
    border-right: none;
    white-space: nowrap;
}

.mc-page .ui-datatable tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--mc-border);
    border-right: none;
    font-size: 0.85rem;
    color: var(--mc-slate);
    vertical-align: middle;
}

.mc-page .ui-datatable tbody tr:hover {
    background: var(--mc-bg);
}

.mc-page .ui-datatable tbody tr:last-child td {
    border-bottom: none;
}

.mc-page .ui-datatable .ui-paginator {
    background: var(--mc-light);
    border-top: 1px solid var(--mc-border);
    padding: 6px 12px;
}

.mc-name {
    font-weight: 600;
    color: var(--mc-navy);
}

.mc-address {
    font-size: 0.78rem;
    color: var(--mc-muted);
    line-height: 1.3;
}

.mc-contact {
    font-size: 0.78rem;
    color: var(--mc-muted);
}

.mc-contact i {
    margin-right: 3px;
    font-size: 0.72rem;
}

/* Form grid */
.mc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.25rem;
}

.mc-form-grid .mc-field-full {
    grid-column: 1 / -1;
}

.mc-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.mc-field label,
.mc-field .mc-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mc-muted);
}

.mc-field label .mc-required {
    color: var(--mc-red);
    margin-left: 0.15rem;
}

/* PrimeFaces input overrides */
.mc-page .mc-field .ui-inputfield,
.mc-page .mc-field .ui-selectonemenu {
    border: 1px solid var(--mc-border) !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.7rem !important;
    font-size: 0.85rem;
    transition: border-color var(--mc-transition), box-shadow var(--mc-transition);
}

.mc-page .mc-field .ui-inputfield:focus,
.mc-page .mc-field .ui-inputfield.ui-state-focus {
    border-color: var(--mc-blue) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none;
}

/* Parcel cards */
.mc-parcel-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mc-parcel-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--mc-muted);
    font-size: 0.85rem;
    border: 1px dashed var(--mc-border);
    border-radius: 6px;
}

.mc-parcel-empty .pi {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.4rem;
    color: var(--mc-border);
}

/* Total area summary chip below parcel list (shown when ≥2 parcels) */
.mc-parcel-total {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.3rem 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    font-size: 0.79rem;
    font-weight: 600;
    color: #15803d;
}
.mc-parcel-total .pi { font-size: 0.72rem; }

/* Crew card distance badge (Haversine estimate = green, real routing = blue) */
.mc-crew-distance {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    color: #16a34a;
    margin-top: 0.2rem;
}
.mc-crew-distance .pi-directions { font-size: 0.78rem; }
.mc-crew-distance-real { color: #1d4ed8; font-weight: 600; }
.mc-crew-distance-none { color: #9ca3af; font-style: italic; }

/* Crew name row with availability badge */
.mc-crew-name-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

/* Availability badges (UNKNOWN = no badge shown) */
.mc-crew-availability { font-size: 0.68rem; padding: 0.1rem 0.45rem; border-radius: 10px; white-space: nowrap; }
.mc-avail-available { background: #dcfce7; color: #15803d; }
.mc-avail-not_available { background: #fee2e2; color: #b91c1c; }

/* Unavailable crew cards */
.mc-crew-card.mc-crew-unavailable { opacity: 0.55; }

.mc-parcel-card {
    border: 1px solid var(--mc-border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color var(--mc-transition);
}

.mc-parcel-card:hover {
    border-color: var(--mc-muted);
}

.mc-parcel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: var(--mc-light);
    border-bottom: 1px solid var(--mc-border);
}

.mc-parcel-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.mc-parcel-code {
    font-family: var(--mc-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mc-navy);
}

.mc-parcel-commune {
    font-size: 0.7rem;
    color: var(--mc-muted);
}

.mc-parcel-stat {
    font-family: var(--mc-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--mc-muted);
    background: var(--mc-light);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.mc-parcel-remove .ui-button {
    padding: 0.3rem 0.45rem !important;
    border-radius: 5px;
}

.mc-parcel-map iframe {
    display: block;
    width: 100%;
    height: 240px;
    border: none;
    border-top: 1px solid var(--mc-border);
}

/* Submit / action bar */
/* ── Step 3 — time slot card ─────────────────────────────────────────── */
.mc-time-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem 1.1rem;
    margin-top: 0.85rem;
}

.mc-time-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.mc-time-selected-badge {
    background: #16a34a;
    color: #fff;
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--mc-mono, monospace);
    letter-spacing: 0.04em;
}

.mc-time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.28rem;
}

.mc-time-slot {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    padding: 0.32rem 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    text-align: center;
    font-family: var(--mc-mono, monospace);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    line-height: 1.3;
}

.mc-time-slot:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.mc-time-slot--selected {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #fff !important;
    font-weight: 700;
}

/* ── Step 3 — compact details row ───────────────────────────────────── */
.mc-details-row {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

/* Priority toggle buttons */
.mc-priority-badges .ui-selectonebutton {
    display: flex;
    gap: 0;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--mc-border);
    width: 100%;
}
.mc-priority-badges .ui-selectonebutton .ui-button {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.45rem 0.5rem;
    background: #f8fafc;
    color: #64748b;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.02em;
}
.mc-priority-badges .ui-selectonebutton .ui-button:not(:last-child) {
    border-right: 1px solid var(--mc-border) !important;
}
/* High — red (matches ml-priority-badge-1) */
.mc-priority-badges .ui-selectonebutton .ui-button:nth-child(1).ui-state-active {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}
/* Normal — yellow (matches ml-priority-badge-2) */
.mc-priority-badges .ui-selectonebutton .ui-button:nth-child(2).ui-state-active {
    background: #fef9c3 !important;
    color: #854d0e !important;
    border-color: #fde047 !important;
}
/* Low — green (matches ml-priority-badge-3) */
.mc-priority-badges .ui-selectonebutton .ui-button:nth-child(3).ui-state-active {
    background: #dcfce7 !important;
    color: #15803d !important;
    border-color: #86efac !important;
}
/* hover on inactive */
.mc-priority-badges .ui-selectonebutton .ui-button:not(.ui-state-active):hover {
    background: #f1f5f9 !important;
    color: #334155 !important;
}

.mc-submit {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.mc-submit .ui-button {
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

/* Confirmation / success panel */
.mc-confirmation {
    background: var(--mc-green-bg);
    border: 1px solid #bbf7d0;
    border-radius: var(--mc-radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.mc-confirmation-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mc-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mc-confirmation-icon .pi {
    font-size: 0.9rem;
}

.mc-confirmation-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #166534;
}

.mc-confirmation-text {
    font-size: 0.8rem;
    color: #15803d;
}

.mc-confirmation-ref {
    display: inline-block;
    margin-top: 0.35rem;
    font-family: var(--mc-mono);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    background: rgba(255,255,255,0.7);
    border-radius: 4px;
    color: #166534;
}

/* ── Summary card (post-creation) ─────────────────────────────────────── */
.mc-summary-card {
    background: #fff;
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius);
    box-shadow: var(--mc-shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.mc-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
}

.mc-summary-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.mc-summary-check {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mc-summary-check .pi {
    font-size: 1.15rem;
}

.mc-summary-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #166534;
}

.mc-summary-ref {
    font-family: var(--mc-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: #15803d;
    margin-top: 0.1rem;
}

/* Priority badges on summary header */
.mc-summary-priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.mc-summary-priority-1 { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.mc-summary-priority-2 { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.mc-summary-priority-3 { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

.mc-summary-header-right {
    flex-shrink: 0;
}

.mc-summary-edit-btn.ui-button {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.9rem !important;
    border-radius: 6px !important;
}

/* Details grid: 2 equal columns */
.mc-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--mc-border);
    align-items: start;
}

/* Farmer card inside summary — reuse mc-farmer-card but no hover transform */
.mc-summary-farmer-card {
    margin: 0;
    cursor: default;
}
.mc-summary-farmer-card:hover {
    transform: none;
}

@media (max-width: 640px) {
    .mc-summary-grid { grid-template-columns: 1fr; }
}

.mc-summary-section {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.mc-summary-section:first-child {
    border-right: 1px solid var(--mc-border);
}

@media (max-width: 640px) {
    .mc-summary-section:first-child { border-right: none; border-bottom: 1px solid var(--mc-border); }
}

.mc-summary-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mc-muted);
    margin-bottom: 0.1rem;
}

.mc-summary-section-label .pi {
    font-size: 0.7rem;
}

.mc-summary-farmer-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.mc-summary-address {
    font-size: 0.84rem;
    color: #475569;
}

.mc-summary-schedule-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.mc-summary-no-date {
    color: var(--mc-muted);
    font-style: italic;
}

.mc-summary-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-family: var(--mc-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: #16a34a;
}

.mc-summary-divider {
    border: none;
    border-top: 1px solid var(--mc-border);
    margin: 0.35rem 0;
}

/* Parcel chips */
.mc-summary-parcel-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mc-summary-parcel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--mc-light);
    border: 1px solid var(--mc-border);
    border-radius: 5px;
    padding: 0.2rem 0.55rem;
}

.mc-summary-parcel-code {
    font-family: var(--mc-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--mc-navy);
}

.mc-summary-parcel-area {
    font-size: 0.7rem;
    color: var(--mc-muted);
}

.mc-summary-parcel-totals {
    font-size: 0.78rem;
    font-weight: 600;
    color: #15803d;
    margin-top: 0.1rem;
}

/* Read-only summary map */
.mc-summary-map-wrapper {
    padding: 0;
}

.mc-summary-map {
    display: block;
    width: 100%;
    height: 340px;
    border-top: 1px solid var(--mc-border);
}

/* Edit mode: Apply Changes + Cancel Edit side by side */
.mc-submit-edit-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.mc-cancel-edit-btn.ui-button {
    font-size: 0.82rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
}

/* License mismatch warning */
.mc-license-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    margin-bottom: 1rem;
}

.mc-license-warning-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.9rem;
}

.mc-license-warning-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 2px;
}

.mc-license-warning-text {
    font-size: 0.8rem;
    color: #92400e;
    line-height: 1.45;
}

/* Cert required badge in drone table */
.mc-cert-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #ede9fe;
    color: #6d28d9;
    letter-spacing: 0.3px;
}

/* ── Crew card grid (Step 4 checkbox-card selection) ──────────────────────── */
.mc-crew-section { }

.mc-crew-heading {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mc-crew-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
}

.mc-crew-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.mc-crew-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.mc-crew-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.mc-crew-card--selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.mc-crew-card--selected .mc-crew-check {
    display: block;
    color: #3b82f6;
}

.mc-crew-check {
    display: none;
    margin-left: auto;
    font-size: 1.1rem;
}

.mc-crew-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.mc-crew-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mc-crew-name {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mc-crew-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    padding: 1px 6px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 2px;
}

.mc-crew-licence-number {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 1px;
}

.mc-crew-address {
    font-size: 0.72rem;
    color: #475569;
    margin-top: 4px;
    line-height: 1.3;
}

.mc-crew-address i {
    font-size: 0.65rem;
    color: #94a3b8;
}

.mc-crew-contact {
    font-size: 0.72rem;
    color: #475569;
    margin-top: 1px;
    line-height: 1.3;
}

.mc-crew-contact i {
    font-size: 0.65rem;
    color: #94a3b8;
}

/* Non-clickable "assigned" card — green border, no hover/cursor */
.mc-crew-card--assigned {
    border-color: #16a34a;
    background: #f0fdf4;
    cursor: default;
}
.mc-crew-card--assigned .mc-crew-check {
    display: block;
    color: #16a34a;
}

/* "Done" badge for completed steps */
.mc-step-badge--done {
    background: #16a34a;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Drone detail block inside confirmation cards */
.mc-drone-detail-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-drone-detail-name { font-weight: 700; font-size: 0.95rem; }
.mc-drone-detail-meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.mc-drone-detail-serial { font-family: var(--mc-mono); font-size: 0.8rem; color: #64748b; }
.mc-drone-detail-owner { font-size: 0.78rem; color: #475569; }
.mc-drone-detail-owner i { font-size: 0.7rem; color: #94a3b8; }
.mc-drone-detail-specs { font-size: 0.72rem; color: #64748b; margin-top: 3px; }

/* Step badge variant used in crew panel header */
.mc-step-badge--active {
    background: #8b5cf6;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* PickList overrides */
.mc-page .ui-picklist {
    margin-top: 0.5rem;
}

.mc-page .ui-picklist .ui-picklist-list {
    border-radius: 6px;
    border: 1px solid var(--mc-border);
    min-height: 180px;
}

.mc-page .ui-picklist .ui-picklist-caption {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mc-muted);
    background: var(--mc-light);
    border: 1px solid var(--mc-border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 0.5rem 0.75rem;
}

.mc-page .ui-picklist .ui-picklist-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--mc-border);
}

.mc-page .ui-picklist .ui-picklist-item:last-child {
    border-bottom: none;
}

/* Messages override */
.mc-page .ui-messages {
    border-radius: var(--mc-radius);
    margin-bottom: 1rem;
}

/* Dialog overrides */
.mc-page ~ .ui-dialog,
.ui-dialog.mc-dialog {
    border-radius: 10px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

.mc-dialog-form {
    padding: 20px 24px;
}

.mc-dialog-form .ui-panelgrid {
    border: none;
}

.mc-dialog-form .ui-panelgrid .ui-panelgrid-cell {
    padding: 6px 4px;
    border: none;
}

.mc-dialog-form .ui-outputlabel {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mc-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mc-dialog-form .ui-inputfield {
    border-radius: 6px;
    border: 1px solid var(--mc-border);
    padding: 8px 12px;
    font-size: 0.88rem;
}

.mc-dialog-form .ui-inputfield:focus {
    border-color: var(--mc-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.mc-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    background: var(--mc-light);
    border-top: 1px solid var(--mc-border);
}

/* Back link */
.mc-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--mc-muted);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color var(--mc-transition);
}

.mc-back-link:hover {
    color: var(--mc-blue);
}

/* PrimeFaces autocomplete override */
.mc-page .ui-autocomplete-panel {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* Responsive */
@media (max-width: 768px) {
    .mc-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .mc-form-grid,
    .mc-farmer-detail {
        grid-template-columns: 1fr;
    }

    .mc-farmer-detail .mc-detail-item.full-width {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .mc-hero-title {
        font-size: 1rem;
    }

    .mc-parcel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
}


/* =============================================================
   MISSION REQUEST PAGE (mr- prefix)
   ============================================================= */
.mr-page {
    /* Inherits from :root design tokens */
    --mr-navy: var(--sbl-navy);
    --mr-slate-700: var(--sbl-slate-700);
    --mr-slate-500: var(--sbl-slate-500);
    --mr-slate-400: var(--sbl-slate-400);
    --mr-slate-200: var(--sbl-slate-200);
    --mr-slate-100: var(--sbl-slate-100);
    --mr-slate-50: var(--sbl-slate-50);
    --mr-white: var(--sbl-white);
    --mr-green: var(--sbl-green);
    --mr-green-light: var(--sbl-green-light);
    --mr-amber: var(--sbl-amber);
    --mr-amber-light: var(--sbl-amber-light);
    --mr-red: var(--sbl-red);
    --mr-red-light: var(--sbl-red-light);
    --mr-blue: var(--sbl-blue);
    --mr-blue-light: var(--sbl-blue-light);
    --mr-card-radius: var(--sbl-radius);
    --mr-card-shadow: var(--sbl-shadow);
    --mr-font-mono: var(--sbl-font-mono);
    --mr-transition: var(--sbl-ease);
    padding-bottom: 2rem;
    max-width: 860px;
}

/* --- Page header --- */
.mr-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    border-radius: var(--mr-card-radius);
    margin-bottom: 1.5rem;
}
/* subtle grid overlay on hero */
.mr-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.mr-hero-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.mr-hero-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--mr-white);
    margin: 0;
}

.mr-hero-subtitle {
    font-size: 0.75rem;
    color: var(--mr-slate-400);
    margin: 0;
    line-height: 1.4;
}

.mr-hero-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mr-hero-icon .pi {
    font-size: 1.1rem;
    color: var(--mr-slate-400);
}

/* --- Card --- */
.mr-card {
    background: var(--mr-white);
    border: 1px solid var(--mr-slate-200);
    border-radius: var(--mr-card-radius);
    box-shadow: var(--mr-card-shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.mr-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--mr-slate-50);
    border-bottom: 1px solid var(--mr-slate-200);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mr-slate-500);
}

.mr-card-header .pi {
    font-size: 0.85rem;
    color: var(--mr-slate-400);
}

.mr-card-body {
    padding: 1rem;
}

/* --- Form grid --- */
.mr-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.25rem;
}

.mr-form-grid .mr-field-full {
    grid-column: 1 / -1;
}

.mr-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.mr-field label,
.mr-field .mr-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mr-slate-400);
}

.mr-field label .mr-required {
    color: var(--mr-red);
    margin-left: 0.15rem;
}

/* PrimeFaces input overrides inside mr-page */
.mr-page .mr-field .ui-inputfield,
.mr-page .mr-field .ui-selectonemenu {
    border: 1px solid var(--mr-slate-200) !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.7rem !important;
    font-size: 0.85rem;
    transition: border-color var(--mr-transition), box-shadow var(--mr-transition);
}

.mr-page .mr-field .ui-inputfield:focus,
.mr-page .mr-field .ui-inputfield.ui-state-focus {
    border-color: var(--mr-blue) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none;
}

.mr-page .mr-field .ui-inputfield.ui-state-error {
    border-color: var(--mr-red) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08) !important;
}

.mr-page .mr-field .ui-inputtextarea {
    min-height: 80px;
    resize: vertical;
}

/* --- Parcel search row --- */
.mr-parcel-search {
    display: flex;
    gap: 0.65rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.mr-parcel-search .mr-field {
    flex: 1;
}

.mr-parcel-search .ui-button {
    height: 36px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Parcel list --- */
.mr-parcel-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mr-parcel-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--mr-slate-400);
    font-size: 0.85rem;
    border: 1px dashed var(--mr-slate-200);
    border-radius: 6px;
}

.mr-parcel-empty .pi {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.4rem;
    color: var(--mr-slate-200);
}

.mr-parcel-card {
    border: 1px solid var(--mr-slate-200);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color var(--mr-transition);
}

.mr-parcel-card:hover {
    border-color: var(--mr-slate-400);
}

.mr-parcel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: var(--mr-slate-50);
    border-bottom: 1px solid var(--mr-slate-200);
}

.mr-parcel-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.mr-parcel-code {
    font-family: var(--mr-font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mr-navy);
}

.mr-parcel-commune {
    font-size: 0.7rem;
    color: var(--mr-slate-400);
}

.mr-parcel-area {
    font-family: var(--mr-font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--mr-slate-500);
    background: var(--mr-slate-100);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.mr-parcel-remove {
    flex-shrink: 0;
}

.mr-parcel-remove .ui-button {
    padding: 0.3rem 0.45rem !important;
    border-radius: 5px;
}

.mr-parcel-map iframe {
    display: block;
    width: 100%;
    height: 240px;
    border: none;
    border-top: 1px solid var(--mr-slate-200);
}

/* --- Submit area --- */
.mr-submit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
}

.mr-submit .ui-button {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.65rem 1.5rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

/* --- Confirmation panel --- */
.mr-confirmation {
    background: var(--mr-green-light);
    border: 1px solid #bbf7d0;
    border-radius: var(--mr-card-radius);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-top: 1rem;
}

.mr-confirmation-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--mr-green);
    color: var(--mr-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mr-confirmation-icon .pi {
    font-size: 1rem;
}

.mr-confirmation-body {
    min-width: 0;
}

.mr-confirmation-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 0.2rem;
}

.mr-confirmation-text {
    font-size: 0.8rem;
    color: #15803d;
    line-height: 1.5;
}

.mr-confirmation-ref {
    display: inline-block;
    margin-top: 0.5rem;
    font-family: var(--mr-font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    color: #166534;
    letter-spacing: 0.03em;
}

/* --- Messages override inside mr-page --- */
.mr-page .ui-messages {
    border-radius: var(--mr-card-radius);
    margin-bottom: 1rem;
}

/* --- PrimeFaces autocomplete override --- */
.mr-page .ui-autocomplete-panel {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* --- FLIK Selection Map (interactive parcel picker) --- */
.mr-flik-map-wrapper {
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    max-height: 600px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin-bottom 0.3s ease;
}
.mr-flik-map-wrapper.flik-map-collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none;
}

.mr-flik-map-help {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--sbl-blue-bg, #eff6ff);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--sbl-radius-sm, 6px) var(--sbl-radius-sm, 6px) 0 0;
    font-size: 0.78rem;
    color: var(--sbl-slate-700, #334155);
}

.mr-flik-map-help .pi {
    color: var(--sbl-blue, #2563eb);
    font-size: 0.85rem;
}

.mr-flik-map {
    height: 450px;
    width: 100%;
    border: 1px solid var(--sbl-slate-200, #e2e8f0);
    border-top: none;
    border-radius: 0 0 var(--sbl-radius-sm, 6px) var(--sbl-radius-sm, 6px);
    background: var(--sbl-slate-100, #f1f5f9);
    z-index: 0;
}

/* Keep Leaflet layers below PrimeFaces overlays */
.mr-flik-map .leaflet-pane { z-index: 1; }
.mr-flik-map .leaflet-control { z-index: 2; }

/* Tooltip label for selected FLIK parcels on the selection map */
.mr-flik-map-label {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--sbl-green, #16a34a);
    color: #166534;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 3px 7px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Loading overlay inside the map wrapper */
.mr-flik-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--sbl-slate-500, #64748b);
    z-index: 3;
    border-radius: 0 0 var(--sbl-radius-sm, 6px) var(--sbl-radius-sm, 6px);
    pointer-events: none;
}

.mr-flik-map-loading .pi {
    font-size: 1.1rem;
    color: var(--sbl-blue, #2563eb);
}

/* Farmer home-address marker pin on the FLIK selection map */
.flik-farmer-pin {
    width: 36px;
    height: 36px;
    background: #fff;
    border: 2.5px solid #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}
.flik-farmer-pin .pi {
    font-size: 1rem;
    color: #16a34a;
    line-height: 1;
}

/* Toast notification inside the map */
.mr-flik-map-toast {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sbl-navy, #0f172a);
    color: var(--sbl-white, #fff);
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: opacity 0.4s ease;
}

.mr-flik-map-toast-fade {
    opacity: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .mr-hero {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .mr-parcel-search {
        flex-direction: column;
        align-items: stretch;
    }

    .mr-flik-map {
        height: 320px;
    }
}

@media (max-width: 480px) {
    .mr-hero-title {
        font-size: 1rem;
    }

    .mr-parcel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .mr-parcel-remove {
        align-self: flex-end;
    }

    .mr-flik-map {
        height: 260px;
    }

    .mr-flik-map-help {
        font-size: 0.72rem;
    }
}


/* =============================================================
   PERSON AVAILABILITY PAGE (pa- prefix)
   ============================================================= */
.pa-page {
    /* Inherits from :root design tokens */
    --pa-navy: var(--sbl-navy);
    --pa-slate-700: var(--sbl-slate-700);
    --pa-slate-500: var(--sbl-slate-500);
    --pa-slate-400: var(--sbl-slate-400);
    --pa-slate-200: var(--sbl-slate-200);
    --pa-slate-100: var(--sbl-slate-100);
    --pa-slate-50: var(--sbl-slate-50);
    --pa-white: var(--sbl-white);
    --pa-green: var(--sbl-green);
    --pa-green-light: var(--sbl-green-light);
    --pa-amber: var(--sbl-amber);
    --pa-amber-light: var(--sbl-amber-light);
    --pa-red: var(--sbl-red);
    --pa-red-light: var(--sbl-red-light);
    --pa-blue: var(--sbl-blue);
    --pa-blue-light: var(--sbl-blue-light);
    --pa-card-radius: var(--sbl-radius);
    --pa-card-shadow: var(--sbl-shadow);
    --pa-font-mono: var(--sbl-font-mono);
    --pa-transition: var(--sbl-ease);
    padding-bottom: 2rem;
    max-width: 920px;
}

/* --- Hero header --- */
.pa-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #8b5cf6;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    border-radius: var(--pa-card-radius);
    margin-bottom: 1.25rem;
}
/* subtle grid overlay on hero */
.pa-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.pa-hero-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.pa-hero-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pa-hero-avatar .pi {
    font-size: 1.1rem;
    color: var(--pa-slate-400);
}

.pa-hero-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--pa-white);
    margin: 0;
}

.pa-hero-subtitle {
    font-size: 0.75rem;
    color: var(--pa-slate-400);
    margin: 0;
}

.pa-hero-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.pa-hero-right .ui-button {
    font-size: 0.8rem;
    border-radius: 6px;
}

/* --- Person summary row --- */
.pa-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pa-summary-item {
    background: var(--pa-white);
    border: 1px solid var(--pa-slate-200);
    border-radius: var(--pa-card-radius);
    padding: 0.65rem 0.85rem;
}

.pa-summary-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pa-slate-400);
    margin-bottom: 0.15rem;
}

.pa-summary-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pa-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* --- Role badge --- */
.pa-role-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--pa-blue-light);
    color: var(--pa-blue);
}

/* --- Card --- */
.pa-card {
    background: var(--pa-white);
    border: 1px solid var(--pa-slate-200);
    border-radius: var(--pa-card-radius);
    box-shadow: var(--pa-card-shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.pa-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--pa-slate-50);
    border-bottom: 1px solid var(--pa-slate-200);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pa-slate-500);
}

.pa-card-header .pi {
    font-size: 0.85rem;
    color: var(--pa-slate-400);
}

.pa-card-body {
    padding: 1rem;
}

/* --- Add availability row --- */
.pa-add-row {
    display: flex;
    gap: 0.85rem;
    align-items: flex-end;
}

.pa-add-row .pa-field {
    flex: 1;
}

.pa-add-row .ui-button {
    height: 38px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.pa-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.pa-field .pa-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pa-slate-400);
}

/* PrimeFaces datepicker override */
.pa-page .pa-field .ui-inputfield {
    border: 1px solid var(--pa-slate-200) !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.7rem !important;
    font-size: 0.85rem;
    transition: border-color var(--pa-transition), box-shadow var(--pa-transition);
}

.pa-page .pa-field .ui-inputfield:focus,
.pa-page .pa-field .ui-inputfield.ui-state-focus {
    border-color: var(--pa-blue) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none;
}

/* --- Suggested next start badge --- */
.pa-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--pa-amber);
    background: var(--pa-amber-light);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

.pa-suggestion .pi {
    font-size: 0.7rem;
}

/* --- Availability table styling --- */
.pa-page .ui-datatable {
    border: 1px solid var(--pa-slate-200);
    border-radius: var(--pa-card-radius);
    overflow: hidden;
    background: var(--pa-white);
}

.pa-page .ui-datatable .ui-datatable-header {
    display: none;
}

.pa-page .ui-datatable table {
    border-collapse: collapse;
}

.pa-page .ui-datatable thead th {
    background: var(--pa-slate-50) !important;
    border-bottom: 2px solid var(--pa-slate-200) !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pa-slate-400);
}

.pa-page .ui-datatable thead th .ui-sortable-column-icon {
    color: var(--pa-slate-400);
}

.pa-page .ui-datatable thead th.ui-state-active {
    color: var(--pa-navy);
}

.pa-page .ui-datatable thead th.ui-state-active .ui-sortable-column-icon {
    color: var(--pa-navy);
}

.pa-page .ui-datatable .ui-datatable-data td {
    border-bottom: 1px solid var(--pa-slate-200);
    border-right: none;
    border-left: none;
    padding: 0.55rem 0.85rem;
    vertical-align: middle;
    background: var(--pa-white);
    font-family: var(--pa-font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pa-slate-700);
}

.pa-page .ui-datatable .ui-datatable-data tr:last-child td {
    border-bottom: none;
}

.pa-page .ui-datatable .ui-datatable-data tr:hover td {
    background: var(--pa-slate-50);
}

/* Actions column */
.pa-page .ui-datatable .pa-col-actions {
    width: 80px;
    text-align: right;
}

.pa-page .ui-datatable .pa-col-actions .ui-button {
    padding: 0.3rem 0.45rem;
    border-radius: 5px;
}

/* --- Pagination --- */
.pa-page .ui-paginator {
    background: transparent;
    border: none;
    padding: 1rem 0 0;
}

.pa-page .ui-paginator .ui-paginator-page,
.pa-page .ui-paginator .ui-paginator-first,
.pa-page .ui-paginator .ui-paginator-prev,
.pa-page .ui-paginator .ui-paginator-next,
.pa-page .ui-paginator .ui-paginator-last {
    border-radius: 6px;
    min-width: 28px;
    height: 28px;
    font-size: 0.8rem;
}

.pa-page .ui-paginator .ui-state-active {
    background: var(--pa-navy);
    border-color: var(--pa-navy);
    color: var(--pa-white);
}

.pa-page .ui-paginator .ui-paginator-current {
    font-family: var(--pa-font-mono);
    font-size: 0.75rem;
    color: var(--pa-slate-500);
}

/* --- Messages --- */
.pa-page .ui-messages {
    border-radius: var(--pa-card-radius);
    margin-bottom: 1rem;
}

/* --- Empty state --- */
.pa-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--pa-slate-400);
    font-size: 0.85rem;
}

.pa-empty .pi {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--pa-slate-200);
}

/* --- Not found state --- */
.pa-not-found {
    background: var(--pa-white);
    border: 1px solid var(--pa-slate-200);
    border-radius: var(--pa-card-radius);
    padding: 2rem;
    text-align: center;
}

.pa-not-found .pi {
    font-size: 2rem;
    color: var(--pa-slate-400);
    display: block;
    margin-bottom: 0.5rem;
}

.pa-not-found-title {
    font-weight: 700;
    color: var(--pa-navy);
    margin-bottom: 0.25rem;
}

.pa-not-found-text {
    font-size: 0.85rem;
    color: var(--pa-slate-500);
    margin-bottom: 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .pa-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .pa-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .pa-add-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .pa-hero-title {
        font-size: 1rem;
    }

    .pa-summary {
        grid-template-columns: 1fr;
    }
}


/* =============================================================
   PEOPLE MANAGEMENT PAGE (pp- prefix)
   ============================================================= */

.pp-page {
    /* Inherits from :root design tokens */
    --pp-navy: var(--sbl-navy);
    --pp-slate: var(--sbl-slate-800);
    --pp-muted: var(--sbl-slate-500);
    --pp-light: var(--sbl-slate-100);
    --pp-bg: var(--sbl-slate-50);
    --pp-border: var(--sbl-slate-200);
    --pp-green: var(--sbl-green);
    --pp-green-bg: var(--sbl-green-bg);
    --pp-amber: var(--sbl-amber-dark);
    --pp-amber-bg: var(--sbl-amber-bg);
    --pp-blue: var(--sbl-blue);
    --pp-blue-bg: var(--sbl-blue-bg);
    --pp-red: var(--sbl-red);
    --pp-purple: var(--sbl-purple);
    --pp-purple-bg: var(--sbl-purple-bg);
    --pp-cyan: #0891b2;
    --pp-cyan-bg: #ecfeff;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 8px;
}

/* Hero Header */
.pp-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #8b5cf6;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    color: #fff;
    padding: 20px 28px;
    border-radius: 8px;
    margin-bottom: 20px;
}
/* subtle grid overlay on hero */
.pp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.pp-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pp-hero-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.pp-hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.pp-hero-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

/* Summary Counters */
.pp-counters {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pp-counter {
    background: #fff;
    border: 1px solid var(--pp-border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pp-counter-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.pp-counter-icon.farmers { background: var(--pp-green-bg); color: var(--pp-green); }
.pp-counter-icon.owners { background: var(--pp-blue-bg); color: var(--pp-blue); }
.pp-counter-icon.pilots { background: var(--pp-amber-bg); color: var(--pp-amber); }
.pp-counter-icon.savers { background: var(--pp-purple-bg); color: var(--pp-purple); }
.pp-counter-icon.dispatchers { background: var(--pp-cyan-bg); color: var(--pp-cyan); }

.pp-counter-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pp-slate);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    line-height: 1;
}

.pp-counter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pp-muted);
    margin-top: 2px;
}

/* Card wrapper for tabs */
.pp-card {
    background: #fff;
    border: 1px solid var(--pp-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* PrimeFaces TabView overrides inside pp-page */
.pp-page .ui-tabs {
    border: none;
    background: transparent;
    padding: 0;
}

.pp-page .ui-tabs .ui-tabs-nav {
    background: #fff;
    border: none;
    border-bottom: 2px solid var(--pp-border);
    padding: 0 16px;
    border-radius: 8px 8px 0 0;
}

.pp-page .ui-tabs .ui-tabs-nav li {
    border: none;
    background: transparent;
    margin: 0;
    top: 2px;
}

.pp-page .ui-tabs .ui-tabs-nav li a {
    padding: 12px 18px;
    color: var(--pp-muted);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    border: none;
    background: transparent;
    transition: color 0.2s;
}

.pp-page .ui-tabs .ui-tabs-nav li.ui-tabs-selected a,
.pp-page .ui-tabs .ui-tabs-nav li.ui-state-active a {
    color: var(--pp-navy);
    border-bottom: 2px solid var(--pp-blue);
    background: transparent;
}

.pp-page .ui-tabs .ui-tabs-nav li:not(.ui-tabs-selected):not(.ui-state-active):hover a {
    color: var(--pp-slate);
}

.pp-page .ui-tabs .ui-tabs-panels {
    background: #fff;
    border: 1px solid var(--pp-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
}

/* Tab toolbar */
.pp-tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pp-tab-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pp-muted);
    font-weight: 600;
}

/* DataTable overrides */
.pp-page .ui-datatable {
    border: 1px solid var(--pp-border);
    border-radius: 6px;
    overflow: hidden;
}

.pp-page .ui-datatable thead th {
    background: var(--pp-light);
    color: var(--pp-slate);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    border-bottom: 2px solid var(--pp-border);
    border-right: none;
    white-space: nowrap;
}

.pp-page .ui-datatable tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--pp-border);
    border-right: none;
    font-size: 0.88rem;
    color: var(--pp-slate);
    vertical-align: middle;
}

.pp-page .ui-datatable tbody tr:hover {
    background: #f8fafc;
}

.pp-page .ui-datatable tbody tr:last-child td {
    border-bottom: none;
}

.pp-page .ui-datatable .ui-paginator {
    background: var(--pp-light);
    border-top: 1px solid var(--pp-border);
    padding: 8px 14px;
}

/* Name cell */
.pp-name {
    font-weight: 600;
    color: var(--pp-navy);
}

/* Address cell */
.pp-address {
    font-size: 0.82rem;
    color: var(--pp-muted);
    line-height: 1.4;
}

/* Mono cells */
.pp-page .pp-mono {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    color: var(--pp-muted);
}

/* Contact info */
.pp-contact {
    font-size: 0.82rem;
    color: var(--pp-muted);
}

.pp-contact i {
    margin-right: 4px;
    font-size: 0.78rem;
}

/* License badge */
.pp-license {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--pp-amber-bg);
    color: var(--pp-amber);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.pp-cert-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #ede9fe;
    color: #6d28d9;
    letter-spacing: 0.3px;
}

/* Action buttons */
.pp-page .pp-col-actions {
    white-space: nowrap;
}

.pp-page .pp-col-actions .ui-button {
    margin-right: 4px;
    padding: 6px 8px;
    min-width: 0;
}

/* Empty state */
.pp-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--pp-muted);
}

.pp-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* Dialog overrides */
.pp-page ~ .ui-dialog,
.ui-dialog.pp-dialog {
    border-radius: 10px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

.pp-dialog-form {
    padding: 20px 24px;
}

.pp-dialog-form .ui-panelgrid {
    border: none;
}

.pp-dialog-form .ui-panelgrid .ui-panelgrid-cell {
    padding: 6px 4px;
    border: none;
}

.pp-dialog-form .ui-outputlabel {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pp-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pp-dialog-form .ui-inputfield {
    border-radius: 6px;
    border: 1px solid var(--pp-border);
    padding: 8px 12px;
    font-size: 0.88rem;
}

.pp-dialog-form .ui-inputfield:focus {
    border-color: var(--pp-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pp-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    background: var(--pp-light);
    border-top: 1px solid var(--pp-border);
}

/* Responsive */
@media (max-width: 1024px) {
    .pp-counters {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .pp-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }

    .pp-counters {
        grid-template-columns: repeat(2, 1fr);
    }

    .pp-page .ui-tabs .ui-tabs-nav {
        padding: 0 8px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .pp-page .ui-tabs .ui-tabs-nav li a {
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    .pp-tab-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .pp-counters {
        grid-template-columns: 1fr;
    }

    .pp-hero-title {
        font-size: 1.1rem;
    }
}


/* =============================================================
   DRONE MANAGEMENT PAGE (dr- prefix)
   EU 2019/945 class markings · Fleet inventory · Type catalog
   ============================================================= */

/* --dr-* tokens available globally so badge styles work on any page */
:root {
    --dr-navy: var(--sbl-navy);
    --dr-slate: var(--sbl-slate-800);
    --dr-muted: var(--sbl-slate-500);
    --dr-light: var(--sbl-slate-100);
    --dr-bg: var(--sbl-slate-50);
    --dr-border: var(--sbl-slate-200);
    --dr-blue: var(--sbl-blue);
    --dr-blue-bg: var(--sbl-blue-bg);
    --dr-green: var(--sbl-green);
    --dr-green-bg: var(--sbl-green-bg);
    --dr-amber: var(--sbl-amber-dark);
    --dr-amber-bg: var(--sbl-amber-bg);
    --dr-red: var(--sbl-red);
    --dr-red-bg: var(--sbl-red-bg);
    --dr-purple: var(--sbl-purple);
    --dr-purple-bg: var(--sbl-purple-bg);
    --dr-cyan: #0891b2;
    --dr-cyan-bg: #ecfeff;
    --dr-teal: #0d9488;
    --dr-teal-bg: #f0fdfa;
}

.dr-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 8px;
}

/* Hero Header */
.dr-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #ef4444;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    color: #fff;
    padding: 20px 28px;
    border-radius: 8px;
    margin-bottom: 20px;
}
/* subtle grid overlay on hero */
.dr-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.dr-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dr-hero-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f87171, #dc2626);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.dr-hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.dr-hero-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

/* Summary Counters */
.dr-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.dr-counter {
    background: #fff;
    border: 1px solid var(--dr-border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dr-counter-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.dr-counter-icon.fleet    { background: var(--dr-blue-bg);  color: var(--dr-blue); }
.dr-counter-icon.thermal  { background: var(--dr-red-bg);   color: var(--dr-red); }
.dr-counter-icon.types    { background: var(--dr-purple-bg); color: var(--dr-purple); }

.dr-counter-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dr-slate);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    line-height: 1;
}

.dr-counter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dr-muted);
    margin-top: 2px;
}

/* Card wrapper */
.dr-card {
    background: #fff;
    border: 1px solid var(--dr-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    margin-bottom: 20px;
}

.dr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--dr-border);
    background: var(--dr-light);
}

.dr-card-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--dr-muted);
    font-weight: 600;
}

/* DataTable overrides */
.dr-page .ui-datatable {
    border: none;
}

.dr-page .ui-datatable thead th {
    background: var(--dr-light);
    color: var(--dr-slate);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    border-bottom: 2px solid var(--dr-border);
    border-right: none;
    white-space: nowrap;
}

.dr-page .ui-datatable tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--dr-border);
    border-right: none;
    font-size: 0.88rem;
    color: var(--dr-slate);
    vertical-align: middle;
}

.dr-page .ui-datatable tbody tr:hover {
    background: #f8fafc;
}

.dr-page .ui-datatable tbody tr:last-child td {
    border-bottom: none;
}

.dr-page .ui-datatable .ui-paginator {
    background: var(--dr-light);
    border-top: 1px solid var(--dr-border);
    padding: 8px 14px;
}

/* Drone name cell */
.dr-name {
    font-weight: 600;
    color: var(--dr-navy);
}

/* Commune owner link in drone table */
.dr-commune-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s;
}
.dr-commune-link:hover {
    color: #16a34a;
    text-decoration: underline;
}
.dr-commune-link .dr-name {
    color: inherit;
}

.dr-model-sub {
    font-size: 0.78rem;
    color: var(--dr-muted);
    margin-top: 1px;
}

/* Serial number mono */
.dr-serial {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    color: var(--dr-muted);
}

/* Registration number */
.dr-reg {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    color: var(--dr-navy);
    font-weight: 600;
}

/* EU Class Badges */
.dr-eu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dr-eu-badge.c0 { background: var(--dr-green-bg); color: var(--dr-green); }
.dr-eu-badge.c1 { background: var(--dr-blue-bg);  color: var(--dr-blue); }
.dr-eu-badge.c2 { background: var(--dr-amber-bg); color: var(--dr-amber); }
.dr-eu-badge.c3 { background: var(--dr-red-bg);   color: var(--dr-red); }
.dr-eu-badge.c4 { background: var(--dr-purple-bg); color: var(--dr-purple); }
.dr-eu-badge.c5,
.dr-eu-badge.c6 { background: var(--dr-cyan-bg);  color: var(--dr-cyan); }
.dr-eu-badge.unclassified {
    background: var(--dr-light);
    color: var(--dr-muted);
    font-weight: 600;
}

/* License / Certificate badge */
.dr-cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.dr-cert-badge.a1a3 { background: var(--dr-green-bg); color: var(--dr-green); }
.dr-cert-badge.a2   { background: var(--dr-amber-bg); color: var(--dr-amber); }
.dr-cert-badge.sts  { background: var(--dr-red-bg);   color: var(--dr-red); }
.dr-cert-badge.specific { background: var(--dr-purple-bg); color: var(--dr-purple); }

/* Thermal badge */
.dr-thermal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dr-red);
}

.dr-thermal i {
    font-size: 0.72rem;
}

/* Type display */
.dr-type-label {
    font-size: 0.85rem;
    color: var(--dr-slate);
    font-weight: 500;
}

.dr-type-specs {
    font-size: 0.72rem;
    color: var(--dr-muted);
    margin-top: 2px;
}

/* Action buttons */
.dr-page .dr-col-actions {
    white-space: nowrap;
}

.dr-page .dr-col-actions .ui-button {
    margin-right: 4px;
    padding: 6px 8px;
    min-width: 0;
}

/* Empty state */
.dr-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--dr-muted);
}

.dr-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* Dialog overrides */
.dr-page ~ .ui-dialog,
.ui-dialog.dr-dialog {
    border-radius: 10px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

.dr-dialog-form {
    padding: 20px 24px;
}

.dr-dialog-form .ui-panelgrid {
    border: none;
}

.dr-dialog-form .ui-panelgrid .ui-panelgrid-cell {
    padding: 6px 4px;
    border: none;
}

.dr-dialog-form .ui-outputlabel {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dr-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dr-dialog-form .ui-inputfield {
    border-radius: 6px;
    border: 1px solid var(--dr-border);
    padding: 8px 12px;
    font-size: 0.88rem;
}

.dr-dialog-form .ui-inputfield:focus {
    border-color: var(--dr-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dr-dialog-form .ui-selectonemenu {
    border-radius: 6px;
    border: 1px solid var(--dr-border);
}

.dr-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    background: var(--dr-light);
    border-top: 1px solid var(--dr-border);
}

/* Row-expanded spec panel */
.dr-spec-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 12px 16px;
    background: var(--dr-light);
    border-radius: 6px;
}

.dr-spec-item {
    display: flex;
    flex-direction: column;
}

.dr-spec-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dr-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.dr-spec-value {
    font-size: 0.85rem;
    color: var(--dr-slate);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .dr-counters {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dr-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }

    .dr-counters {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dr-counters {
        grid-template-columns: 1fr;
    }

    .dr-hero-title {
        font-size: 1.1rem;
    }
}


/* Responsive Design */
@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .content {
        padding: 12px;
    }
}

/* ======================================================================
   Person Detail Page (pd- prefix)
   ====================================================================== */

.pd-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Hero */
.pd-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #8b5cf6;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    color: #fff;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
    flex-wrap: wrap;
    gap: 1rem;
}
/* subtle grid overlay on hero */
.pd-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.pd-hero-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.pd-hero-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pd-hero-avatar.pd-role-farmer { background: rgba(234, 179, 8, 0.25); color: #fde047; }
.pd-hero-avatar.pd-role-dronepilot { background: rgba(96, 165, 250, 0.25); color: #93c5fd; }
.pd-hero-avatar.pd-role-assistant { background: rgba(248, 113, 113, 0.25); color: #fca5a5; }
.pd-hero-avatar.pd-role-missiondispatcher { background: rgba(167, 139, 250, 0.25); color: #c4b5fd; }
.pd-hero-avatar.pd-role-owner { background: rgba(52, 211, 153, 0.25); color: #6ee7b7; }

.pd-hero-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.pd-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.3rem;
}

.pd-role-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pd-role-badge.pd-role-farmer { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.pd-role-badge.pd-role-dronepilot { background: rgba(96, 165, 250, 0.2); color: #93c5fd; }
.pd-role-badge.pd-role-assistant { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
.pd-role-badge.pd-role-missiondispatcher { background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }
.pd-role-badge.pd-role-owner { background: rgba(52, 211, 153, 0.2); color: #6ee7b7; }

.pd-hero-id {
    font-size: 0.8rem;
    color: #94a3b8;
    font-family: ui-monospace, monospace;
}

.pd-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Subtle back link — replaces the old big button */
.pd-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    letter-spacing: 0.01em;
}

.pd-back-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.pd-back-arrow {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Cards */
.pd-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.pd-card-header {
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pd-card-header i {
    color: #64748b;
    font-size: 0.95rem;
}

.pd-card-header-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: auto;
}

.pd-card-body {
    padding: 1.25rem;
}

.pd-card-body-table {
    padding: 0;
}

.pd-card-body-table .pd-empty-state {
    padding: 2rem;
}

/* Info row */
.pd-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.pd-info-row-2col {
    grid-template-columns: 2fr 3fr;
}

.pd-counters {
    margin-bottom: 1.25rem;
}

.pd-card-stats {
    grid-column: span 2;
}

.pd-info-grid {
    display: grid;
    gap: 1rem;
}

.pd-info-item {}

.pd-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.pd-info-value {
    font-size: 0.88rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pd-info-icon {
    color: #94a3b8;
    font-size: 0.85rem;
}

.pd-empty {
    color: #cbd5e1;
    font-style: italic;
    font-size: 0.82rem;
}

/* Cert badge */
.pd-cert-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #ede9fe;
    color: #7c3aed;
    letter-spacing: 0.02em;
}

/* Stats */
.pd-stats-grid {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 0.5rem 0;
}

.pd-stat {
    text-align: center;
}

.pd-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.pd-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

/* Mission table items */
.pd-mission-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.88rem;
}

.pd-mission-meta {
    margin-top: 0.2rem;
}

.pd-mission-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #475569;
}

.pd-role-in-mission {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #eff6ff;
    color: #2563eb;
}

.pd-btn-view {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.78rem !important;
}

/* Empty state */
.pd-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
}

.pd-empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.pd-empty-state div {
    font-size: 0.88rem;
}

/* Error detail box */
.pd-error-detail {
    color: #dc2626;
    font-size: 0.78rem;
    font-family: ui-monospace, monospace;
    background: #fef2f2;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-align: left;
    max-width: 600px;
    margin: 0 auto 1rem;
}

/* Stat color accents */
.pd-stat-available .pd-stat-value { color: #16a34a; }
.pd-stat-blocked .pd-stat-value { color: #dc2626; }

/* ── Calendar Section ── */
.pd-card-body-calendar {
    padding: 1rem 1.25rem 1.25rem;
}

/* Legend in card header */
.pd-cal-legend {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.pd-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pd-cal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.pd-cal-dot-available { background: #22c55e; }
.pd-cal-dot-blocked { background: #ef4444; }

/* Schedule wrapper */
.pd-schedule-wrap {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

/* FullCalendar event overrides for availability types */
.pd-cal-available,
.pd-cal-available .fc-event-main {
    background: #dcfce7 !important;
    border-color: #22c55e !important;
    color: #166534 !important;
    border-left: 4px solid #22c55e !important;
    font-weight: 600;
    font-size: 0.78rem;
}

.pd-cal-blocked,
.pd-cal-blocked .fc-event-main {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
    border-left: 4px solid #ef4444 !important;
    font-weight: 600;
    font-size: 0.78rem;
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 4px,
        rgba(239, 68, 68, 0.08) 4px,
        rgba(239, 68, 68, 0.08) 8px
    ) !important;
}

/* FullCalendar header toolbar */
.pd-schedule-wrap .fc .fc-toolbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.pd-schedule-wrap .fc .fc-button {
    font-size: 0.78rem;
    padding: 0.3rem 0.65rem;
}

/* ── Add Entry Row ── */
.pd-cal-add {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.pd-cal-add-picker {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.pd-cal-add-picker label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pd-cal-add-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pd-cal-btn {
    white-space: nowrap;
}

.pd-datepicker {
    width: 100%;
}

/* Suggestion hint */
.pd-avail-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.4rem;
}

.pd-avail-suggestion i {
    font-size: 0.75rem;
    color: #3b82f6;
}

/* ── Entries Table ── */
.pd-cal-table-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: #0f172a;
    padding: 0.75rem 0 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.pd-cal-table-header i {
    color: #64748b;
}

/* Type badge in table */
.pd-avail-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pd-type-available {
    background: #dcfce7;
    color: #166534;
}

.pd-type-blocked {
    background: #fee2e2;
    color: #991b1b;
}

/* Row tinting */
.pd-row-available td { }
.pd-row-blocked td {
    background: #fef2f2 !important;
}

/* Availability datetime in table */
.pd-avail-datetime {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
}

.pd-avail-icon {
    font-size: 0.8rem;
}

.pd-avail-icon.pd-avail-start { color: #22c55e; }
.pd-avail-icon.pd-avail-end { color: #ef4444; }

/* DataTable inside pd-card */
.pd-datatable {
    border: none !important;
}

.pd-datatable .ui-datatable-header {
    border: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .pd-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .pd-hero-actions {
        width: 100%;
    }

    .pd-cal-add {
        flex-direction: column;
        align-items: stretch;
    }

    .pd-cal-add-actions {
        flex-direction: column;
    }

    .pd-cal-legend {
        display: none;
    }

    .pd-info-row {
        grid-template-columns: 1fr;
    }

    .pd-card-stats {
        grid-column: span 1;
    }
}

/* ── Mission Calendar (priority-colored events on person detail) ── */

.pd-mission-priority-1,
.pd-mission-priority-1 .fc-event-main {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: 4px;
}

.pd-mission-priority-2,
.pd-mission-priority-2 .fc-event-main {
    background: #f97316 !important;
    border-color: #f97316 !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: 4px;
}

.pd-mission-priority-3,
.pd-mission-priority-3 .fc-event-main {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: 4px;
}

.pd-mission-priority-4,
.pd-mission-priority-4 .fc-event-main {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: 4px;
}

.pd-mission-priority-5,
.pd-mission-priority-5 .fc-event-main {
    background: #94a3b8 !important;
    border-color: #94a3b8 !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: 4px;
}

/* ── Calendar / List tab bar (person detail) ── */
.pd-tabs-nav {
    display: flex;
    gap: 4px;
    background: transparent;
    padding: 0;
    margin-bottom: -1px;              /* overlap card top border */
}
.pd-tab-btn {
    padding: 10px 22px;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid transparent;
    background: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 8px 8px 0 0;
}
.pd-tab-btn:hover { background: #e2e8f0; color: #1e293b; }
.pd-tab-btn-active {
    background: #fff;
    color: #1e293b;
    border-bottom-color: #8b5cf6;
    border-bottom-width: 3px;
}
.pd-tab-panel-hidden { display: none !important; }

/* First card inside a tab panel connects flush to the tab bar */
.pd-tab-first-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

/* ── Unified Calendar (person detail — merged availability + missions) ── */

/* When used as a modifier alongside pd-card-header, override to a column layout */
.pd-card-header.pd-ucal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem 0.75rem;
}

.pd-ucal-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pd-ucal-title-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
}

/* Inline dot indicators for filter pills */
.pd-ucal-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pd-ucal-dot-mission { background: #3b82f6; }
.pd-ucal-dot-avail   { background: #22c55e; }

/* Filter pill container on the person-detail calendar header */
.pd-ucal-pills {
    background: #f1f5f9;
    border-radius: 7px;
    padding: 3px;
}

/* Filter pill toggles — unused standalone .pd-ucal-pill kept for backwards compat */
.pd-ucal-filter {
    display: inline-flex;
    gap: 0;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
}

.pd-ucal-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.pd-ucal-pill:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.pd-ucal-pill-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Extra padding inside the calendar card body */
.pd-cal-body {
    padding: 1rem 1.25rem 1.25rem;
}

/* Contextual legend */
.pd-ucal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    padding-top: 0.15rem;
}

.pd-ucal-leg-sep {
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 300;
}

/* Legend visibility driven by data-ucal-legend attribute */
[data-ucal-legend="availability"] .pd-ucal-leg-mission,
[data-ucal-legend="availability"] .pd-ucal-leg-sep {
    display: none;
}

[data-ucal-legend="missions"] .pd-ucal-leg-avail,
[data-ucal-legend="missions"] .pd-ucal-leg-sep {
    display: none;
}

/* Calendar event visibility driven by data-ucal-filter attribute */
[data-ucal-filter="availability"] .pd-mission-priority-1,
[data-ucal-filter="availability"] .pd-mission-priority-2,
[data-ucal-filter="availability"] .pd-mission-priority-3,
[data-ucal-filter="availability"] .pd-mission-priority-4,
[data-ucal-filter="availability"] .pd-mission-priority-5 {
    display: none !important;
}

[data-ucal-filter="missions"] .pd-cal-available,
[data-ucal-filter="missions"] .pd-cal-blocked {
    display: none !important;
}

/* Responsive: stack filter pills on small screens */
@media (max-width: 768px) {
    .pd-ucal-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .pd-ucal-legend {
        display: none;
    }
}


/* =============================================================
   MISSION SCHEDULE PAGE (ms- prefix)
   Calendar view of all missions, color-coded by priority
   ============================================================= */

.ms-page {
    /* Inherits from :root design tokens */
    --ms-navy: var(--sbl-navy);
    --ms-slate-700: var(--sbl-slate-700);
    --ms-slate-500: var(--sbl-slate-500);
    --ms-slate-400: var(--sbl-slate-400);
    --ms-slate-200: var(--sbl-slate-200);
    --ms-slate-100: var(--sbl-slate-100);
    --ms-slate-50: var(--sbl-slate-50);
    --ms-white: var(--sbl-white);
    --ms-green: var(--sbl-green);
    --ms-green-light: var(--sbl-green-light);
    --ms-amber: var(--sbl-amber);
    --ms-amber-light: var(--sbl-amber-light);
    --ms-red: var(--sbl-red);
    --ms-red-light: var(--sbl-red-light);
    --ms-blue: var(--sbl-blue);
    --ms-blue-light: var(--sbl-blue-light);
    --ms-card-radius: var(--sbl-radius);
    --ms-card-shadow: var(--sbl-shadow);
    --ms-font-mono: var(--sbl-font-mono);
    --ms-transition: var(--sbl-ease);
    padding-bottom: 2rem;
}

/* --- Hero --- */
.ms-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    border-radius: var(--ms-card-radius);
    margin-bottom: 1.25rem;
}
/* subtle grid overlay on hero */
.ms-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.ms-hero-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.ms-hero-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ms-hero-icon .pi {
    font-size: 1.2rem;
    color: var(--ms-slate-400);
}

.ms-hero-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ms-white);
    margin: 0;
}

.ms-hero-subtitle {
    font-size: 0.75rem;
    color: var(--ms-slate-400);
    margin: 0.15rem 0 0;
    line-height: 1.3;
}

.ms-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ms-hero-actions .ui-button {
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
}

/* --- Metrics row --- */
.ms-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ms-metric {
    background: var(--ms-white);
    border: 1px solid var(--ms-slate-200);
    border-radius: var(--ms-card-radius);
    padding: 0.85rem 1rem;
    text-align: center;
    box-shadow: var(--ms-card-shadow);
}

.ms-metric-value {
    font-family: var(--ms-font-mono);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ms-navy);
    line-height: 1.2;
}

.ms-metric-scheduled { color: var(--ms-blue); }
.ms-metric-unscheduled { color: var(--ms-amber); }
.ms-metric-bambis { color: var(--ms-green); }

.ms-metric-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ms-slate-400);
    margin-top: 0.15rem;
}

/* --- Main layout: calendar + detail side panel --- */
.ms-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}

/* --- Card --- */
.ms-card {
    background: var(--ms-white);
    border: 1px solid var(--ms-slate-200);
    border-radius: var(--ms-card-radius);
    box-shadow: var(--ms-card-shadow);
    overflow: hidden;
}

.ms-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--ms-slate-50);
    border-bottom: 1px solid var(--ms-slate-200);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ms-slate-500);
}

.ms-card-header .pi {
    font-size: 0.85rem;
    color: var(--ms-slate-400);
}

.ms-card-header-count {
    font-family: var(--ms-font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: var(--ms-amber-light);
    color: #92400e;
    margin-left: 0.25rem;
}

.ms-card-body {
    padding: 0.85rem 1rem;
}

.ms-card-body-calendar {
    padding: 0.5rem;
}

.ms-card-body-table {
    padding: 0;
}

/* --- Calendar legend --- */
.ms-cal-legend {
    display: flex;
    gap: 0.65rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.ms-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ms-slate-500);
    white-space: nowrap;
}

.ms-cal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ms-cal-dot-1 { background: #FF5F57; box-shadow: 0 0 0 1.5px rgba(255,95,87,0.35); }
.ms-cal-dot-2 { background: #FEBC2E; box-shadow: 0 0 0 1.5px rgba(254,188,46,0.35); }
.ms-cal-dot-3 { background: #28C840; box-shadow: 0 0 0 1.5px rgba(40,200,64,0.35); }

/* --- Calendar header hover hint --- */
.ms-cal-hint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.75rem;
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ms-slate-400);
    white-space: nowrap;
    font-style: italic;
}

.ms-cal-hint i {
    font-size: 0.75rem;
}

/* --- Schedule wrapper --- */
.ms-schedule-wrap {
    min-height: 520px;
}

.ms-schedule-wrap .fc .fc-toolbar-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ms-navy);
}

.ms-schedule-wrap .fc .fc-button {
    font-size: 0.72rem;
    padding: 0.3rem 0.55rem;
    border-radius: 5px;
}

.ms-schedule-wrap .fc .fc-daygrid-event {
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.ms-schedule-wrap .fc .fc-daygrid-event:hover {
    opacity: 0.85;
}

/* Priority-based event colors: 1=High (red), 2=Normal (yellow), 3=Low (green) */
.ms-priority-1,
.ms-priority-1 .fc-event-main {
    background: #FF5F57 !important;
    border-color: #d93a32 !important;
    color: #fff !important;
}

.ms-priority-2,
.ms-priority-2 .fc-event-main {
    background: #FEBC2E !important;
    border-color: #c9920a !important;
    color: #3d2800 !important;
}

.ms-priority-3,
.ms-priority-3 .fc-event-main {
    background: #28C840 !important;
    border-color: #189a2a !important;
    color: #0c2e0e !important;
}

/* --- Detail empty state --- */
.ms-detail-empty {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1.5px dashed #e2e8f0;
    border-radius: 10px;
}

.ms-detail-empty-content {
    text-align: center;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ms-detail-empty-content .pi {
    font-size: 2rem;
    color: #cbd5e1;
    display: block;
    width: 3.5rem;
    height: 3.5rem;
    line-height: 3.5rem;
    border-radius: 50%;
    background: #f1f5f9;
    margin-bottom: 0.25rem;
}

.ms-detail-empty-title {
    font-weight: 700;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.ms-detail-empty-text {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.5;
    max-width: 180px;
}

/* --- Detail card --- */
.ms-detail-card {
    position: sticky;
    top: 1rem;
}

/* Header — base: one-line flex row, colour set per priority below */
/* Drop target highlight when dragging detail header over a calendar day */
.fc-daygrid-day.bambi-drag-over { background: rgba(99,102,241,0.15) !important; outline: 2px dashed #6366f1; }

/* Drag hint strip below the coloured header */
.ms-drag-hint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    color: #94a3b8;
    padding: 0.2rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    user-select: none;
    pointer-events: none;
}
.ms-drag-hint .pi { font-size: 0.65rem; }

.ms-detail-header {
    padding: 0.6rem 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
    min-width: 0;
    border-radius: 0; /* inner — outer card has the radius */
    cursor: grab;
}
.ms-detail-header:active { cursor: grabbing; }
/* Priority-coloured header backgrounds — macOS traffic light palette */
.ms-priority-border-1 .ms-detail-header { background: #FF5F57; color: #fff; }
.ms-priority-border-2 .ms-detail-header { background: #FEBC2E; color: #3d2800; }
.ms-priority-border-3 .ms-detail-header { background: #28C840; color: #0c2e0e; }

.ms-detail-header-top {
    display: contents; /* dissolve — children are direct flex items of header */
}

.ms-detail-id {
    font-family: var(--ms-font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.18);
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    flex-shrink: 0;
}

.ms-detail-title {
    font-size: 0.92rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    color: #fff;
    flex: 1 1 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* status badge now inline in header row */
.ms-detail-status { display: contents; }

.ms-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.18);
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}

.ms-status-badge .pi {
    font-size: 0.45rem;
    color: rgba(255,255,255,0.7);
}

/* --- Detail body --- */
.ms-detail-body {
    padding: 0.75rem 1rem;
}

.ms-detail-section {
    padding-bottom: 0.65rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid var(--ms-slate-100);
}

.ms-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ms-detail-section-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ms-slate-400);
    margin-bottom: 0.5rem;
}

.ms-detail-section-title .pi {
    font-size: 0.72rem;
}

.ms-detail-count {
    font-family: var(--ms-font-mono);
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: var(--ms-slate-100);
    color: var(--ms-slate-500);
    margin-left: 0.25rem;
}

.ms-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.75rem;
}

.ms-detail-kv {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ms-detail-kv-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ms-slate-400);
}

.ms-detail-kv-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ms-navy);
}

.ms-detail-kv-value.mono {
    font-family: var(--ms-font-mono);
    font-size: 0.78rem;
}

.ms-detail-empty-val {
    color: var(--ms-slate-400);
}

.ms-bambis-val {
    color: var(--ms-green);
}

/* --- Crew rows --- */
.ms-crew-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
}

.ms-crew-row + .ms-crew-row {
    border-top: 1px solid var(--ms-slate-100);
}

.ms-crew-role {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ms-slate-400);
    min-width: 70px;
}

.ms-crew-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ms-navy);
    text-align: right;
}

/* --- Drone card --- */
.ms-drone-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: var(--ms-slate-50);
    border: 1px solid var(--ms-slate-200);
    border-radius: 6px;
}

.ms-drone-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ms-drone-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    flex-shrink: 0;
}


.ms-drone-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ms-navy);
}

.ms-drone-reg {
    font-family: var(--ms-font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ms-slate-500);
    padding: 0.15rem 0.4rem;
    background: var(--ms-white);
    border: 1px solid var(--ms-slate-200);
    border-radius: 3px;
}

.ms-drone-owner {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--ms-slate-600);
    margin-top: 0.1rem;
}

.ms-pilot-licence {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--ms-slate-100);
}

.ms-pilot-licence-number {
    font-family: var(--ms-font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ms-slate-500);
    background: var(--ms-slate-50);
    border: 1px solid var(--ms-slate-200);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
}

/* --- Parcel chips --- */
.ms-parcel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ms-parcel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--ms-font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ms-navy);
    padding: 0.2rem 0.5rem;
    background: var(--ms-slate-50);
    border: 1px solid var(--ms-slate-200);
    border-radius: 4px;
}

.ms-parcel-chip .pi {
    font-size: 0.65rem;
    color: var(--ms-slate-400);
}

/* --- Detail actions --- */
.ms-detail-actions {
    padding-top: 0.65rem;
    margin-top: 0.65rem;
    border-top: 1px solid var(--ms-slate-200);
}

.ms-btn-view {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* --- Unscheduled table hide rows --- */
.ms-row-hide {
    display: none !important;
}

/* --- DataTable styling inside ms-page --- */
.ms-page .ui-datatable {
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: var(--ms-white);
}

.ms-page .ui-datatable .ui-datatable-header {
    display: none;
}

.ms-page .ui-datatable thead th {
    background: var(--ms-slate-50) !important;
    border-bottom: 2px solid var(--ms-slate-200) !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ms-slate-400);
}

.ms-page .ui-datatable .ui-datatable-data td {
    border-bottom: 1px solid var(--ms-slate-200);
    border-right: none;
    border-left: none;
    padding: 0.55rem 0.85rem;
    vertical-align: middle;
    background: var(--ms-white);
}

.ms-page .ui-datatable .ui-datatable-data tr:last-child td {
    border-bottom: none;
}

.ms-page .ui-datatable .ui-datatable-data tr:hover td {
    background: var(--ms-slate-50);
}

.ms-page .ui-paginator {
    background: transparent;
    border: none;
    padding: 0.75rem 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .ms-layout {
        grid-template-columns: 1fr;
    }

    .ms-detail-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .ms-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .ms-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .ms-cal-legend {
        display: none;
    }
}

@media (max-width: 480px) {
    .ms-hero-title {
        font-size: 1rem;
    }

    .ms-metrics {
        grid-template-columns: 1fr;
    }

    .ms-hero-actions {
        width: 100%;
        flex-direction: column;
    }
}


/* =============================================================
   STATISTICS DASHBOARD PAGE (sd- prefix)
   KPI cards, Chart.js charts, progress bars, aging table
   ============================================================= */

.sd-page {
    /* Inherits from :root design tokens */
    --sd-navy: var(--sbl-navy);
    --sd-slate-700: var(--sbl-slate-700);
    --sd-slate-500: var(--sbl-slate-500);
    --sd-slate-400: var(--sbl-slate-400);
    --sd-slate-200: var(--sbl-slate-200);
    --sd-slate-100: var(--sbl-slate-100);
    --sd-slate-50: var(--sbl-slate-50);
    --sd-white: var(--sbl-white);
    --sd-green: var(--sbl-green);
    --sd-green-light: var(--sbl-green-light);
    --sd-amber: var(--sbl-amber);
    --sd-amber-light: var(--sbl-amber-light);
    --sd-red: var(--sbl-red);
    --sd-red-light: var(--sbl-red-light);
    --sd-blue: #3b82f6;
    --sd-blue-light: var(--sbl-blue-light);
    --sd-purple: #8b5cf6;
    --sd-purple-light: #ede9fe;
    --sd-card-radius: var(--sbl-radius);
    --sd-card-shadow: var(--sbl-shadow);
    --sd-transition: var(--sbl-ease);
    padding-bottom: 2rem;
}

/* --- Hero --- */
.sd-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    border-radius: var(--sd-card-radius);
    margin-bottom: 1.25rem;
}
/* subtle grid overlay on hero */
.sd-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.sd-hero-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.sd-hero-title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sd-hero-subtitle {
    color: rgba(255,255,255,0.65);
    font-size: 0.8rem;
    margin: 0.15rem 0 0 0;
    font-weight: 400;
}

.sd-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sd-btn-refresh {
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 0.45rem 1rem !important;
    font-size: 0.85rem !important;
    transition: var(--sd-transition) !important;
}

.sd-btn-refresh:hover {
    background: rgba(255,255,255,0.2) !important;
}

/* --- KPI Cards --- */
.sd-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.sd-kpi-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--sd-white);
    border-radius: var(--sd-card-radius);
    box-shadow: var(--sd-card-shadow);
    border-left: 4px solid transparent;
    transition: var(--sd-transition);
}

.sd-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.sd-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sd-kpi-data {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sd-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--sd-navy);
}

.sd-kpi-label {
    font-size: 0.78rem;
    color: var(--sd-slate-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* KPI accent colors */
.sd-kpi-blue { border-left-color: var(--sd-blue); }
.sd-kpi-blue .sd-kpi-icon { background: var(--sd-blue-light); color: var(--sd-blue); }

.sd-kpi-green { border-left-color: var(--sd-green); }
.sd-kpi-green .sd-kpi-icon { background: var(--sd-green-light); color: var(--sd-green); }

.sd-kpi-red { border-left-color: var(--sd-red); }
.sd-kpi-red .sd-kpi-icon { background: var(--sd-red-light); color: var(--sd-red); }

.sd-kpi-amber { border-left-color: var(--sd-amber); }
.sd-kpi-amber .sd-kpi-icon { background: var(--sd-amber-light); color: var(--sd-amber); }

.sd-kpi-purple { border-left-color: var(--sd-purple); }
.sd-kpi-purple .sd-kpi-icon { background: var(--sd-purple-light); color: var(--sd-purple); }

.sd-kpi-slate { border-left-color: var(--sd-slate-400); }
.sd-kpi-slate .sd-kpi-icon { background: var(--sd-slate-100); color: var(--sd-slate-500); }

/* --- Rates Row --- */
.sd-rates-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.sd-rate-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.sd-rate-label {
    opacity: 0.85;
}

.sd-rate-value {
    font-size: 1.05rem;
}

.sd-rate-green {
    background: var(--sd-green-light);
    color: #15803d;
}

.sd-rate-red {
    background: var(--sd-red-light);
    color: #b91c1c;
}

/* --- Cards --- */
.sd-card {
    background: var(--sd-white);
    border-radius: var(--sd-card-radius);
    box-shadow: var(--sd-card-shadow);
    overflow: hidden;
}

.sd-card-full {
    margin-bottom: 1.25rem;
}

.sd-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    background: var(--sd-slate-50);
    border-bottom: 1px solid var(--sd-slate-200);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sd-slate-700);
}

.sd-card-header-warning {
    background: #fef3c7;
    border-bottom-color: #fde68a;
    color: #92400e;
}

.sd-card-body {
    padding: 1rem 1.1rem;
}

.sd-card-body-table {
    padding: 0;
}

/* --- Charts Row (2-column) --- */
.sd-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* --- Key/Value rows --- */
.sd-kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--sd-slate-100);
}

.sd-kv:last-child {
    border-bottom: none;
}

.sd-kv-label {
    font-size: 0.85rem;
    color: var(--sd-slate-500);
}

.sd-kv-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sd-navy);
}

.sd-kv-separator {
    height: 1px;
    background: var(--sd-slate-200);
    margin: 0.5rem 0;
}

/* --- Progress bars (evidence completeness) --- */
.sd-progress-row {
    margin-bottom: 1rem;
}

.sd-progress-row:last-of-type {
    margin-bottom: 0.5rem;
}

.sd-progress-label {
    font-size: 0.82rem;
    color: var(--sd-slate-700);
    margin-bottom: 0.3rem;
}

.sd-progress-count {
    font-weight: 700;
    color: var(--sd-navy);
}

.sd-progress-bar {
    height: 8px;
    background: var(--sd-slate-100);
    border-radius: 4px;
    overflow: hidden;
}

.sd-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.sd-fill-blue { background: var(--sd-blue); }
.sd-fill-purple { background: var(--sd-purple); }
.sd-fill-amber { background: var(--sd-amber); }
.sd-fill-green { background: var(--sd-green); }

.sd-evidence-avg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--sd-slate-200);
}

.sd-evidence-avg-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sd-slate-700);
}

.sd-evidence-avg-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sd-navy);
}

/* --- Bambi summary --- */
.sd-bambi-summary {
    text-align: center;
    margin-bottom: 0.5rem;
}

.sd-bambi-total {
    font-size: 2rem;
    font-weight: 700;
    color: var(--sd-navy);
}

.sd-bambi-total-label {
    font-size: 0.85rem;
    color: var(--sd-slate-500);
}

/* --- Crew legend --- */
.sd-crew-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.sd-crew-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--sd-slate-700);
}

.sd-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.sd-dot-blue { background: var(--sd-blue); }
.sd-dot-purple { background: var(--sd-purple); }

/* --- Empty state --- */
.sd-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--sd-slate-400);
    font-size: 0.9rem;
}

/* --- Status badges --- */
.sd-status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sd-status-created { background: #f1f5f9; color: #475569; }
.sd-status-unassigned { background: #fef3c7; color: #92400e; }
.sd-status-dispatched { background: #dbeafe; color: #1e40af; }
.sd-status-in_progress { background: #ede9fe; color: #5b21b6; }
.sd-status-completed { background: #dcfce7; color: #166534; }
.sd-status-cancelled { background: #fee2e2; color: #991b1b; }

/* --- Aging table --- */
.sd-aging-table .ui-datatable-data td {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
}

.sd-aging-table .ui-datatable-header {
    display: none;
}

.sd-aging-table a {
    color: var(--sd-blue);
    font-weight: 600;
    text-decoration: none;
}

.sd-aging-table a:hover {
    text-decoration: underline;
}

/* Aging severity */
.sd-aging-normal { color: var(--sd-slate-700); }
.sd-aging-warning { color: var(--sd-amber); font-weight: 600; }
.sd-aging-critical { color: var(--sd-red); font-weight: 700; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .sd-charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sd-kpi-row {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .sd-hero {
        flex-direction: column;
        text-align: center;
    }

    .sd-hero-left {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sd-hero-title {
        font-size: 1rem;
    }

    .sd-kpi-row {
        grid-template-columns: 1fr;
    }

    .sd-kpi-value {
        font-size: 1.25rem;
    }

    .sd-rates-row {
        flex-direction: column;
    }
}

/* =============================================================
   STATISTICS DASHBOARD REDESIGN — dash- prefix
   Hero banner, sectioned layout, weather chips, hotspot list,
   no-fly table badges, availability capacity, cancellation card
   ============================================================= */

/* --- Hero banner --- */
.dash-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #0f172a 0%, #1a2f5e 55%, #0c2a4a 100%);
    border: 2px solid #3b82f6;
    border-radius: var(--sbl-radius-lg);
    box-shadow: 0 6px 32px rgba(15, 23, 42, 0.5);
    color: #fff;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.dash-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.dash-hero-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 50%;
    border: 2px solid rgba(245, 158, 11, 0.35);
}

.dash-hero-main {
    flex: 1;
    min-width: 0;
}

.dash-hero-rate {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dash-hero-rate-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1;
}

.dash-hero-rate-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
}

.dash-hero-counts {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.dash-hero-count {
    display: flex;
    flex-direction: column;
}

.dash-hero-count-num {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.dash-hero-count-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-hero-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.dash-hero-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
    max-width: 480px;
}

.dash-hero-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #16a34a, #4ade80);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-hero-actions {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
}

/* --- Section wrapper --- */
.dash-section {
    background: var(--sbl-white);
    border: 1px solid var(--sbl-slate-200);
    border-radius: var(--sbl-radius-lg);
    box-shadow: var(--sbl-shadow-sm);
    padding: 1.25rem 1.25rem 1rem;
    margin-bottom: 1.25rem;
}

/* --- Section title --- */
.dash-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sbl-navy);
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sbl-slate-100);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.dash-section-title i {
    font-size: 1rem;
    color: var(--sbl-slate-500);
}

/* --- KPI grid (5- or 4-column auto-fit) --- */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* --- 2-column chart grid --- */
.dash-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* --- Chart card (bordered inner card) --- */
.dash-chart-card {
    background: var(--sbl-slate-50);
    border: 1px solid var(--sbl-slate-200);
    border-radius: var(--sbl-radius);
    overflow: hidden;
}

.dash-chart-card-full {
    grid-column: 1 / -1;
}

/* --- Availability capacity card --- */
.dash-avail-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.dash-avail-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--sbl-radius);
    border: 1px solid transparent;
}

.dash-avail-stat.dash-avail-green {
    background: var(--sbl-green-bg);
    border-color: var(--sbl-green-light);
}

.dash-avail-stat.dash-avail-amber {
    background: var(--sbl-amber-bg);
    border-color: var(--sbl-amber-light);
}

.dash-avail-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--sbl-navy);
}

.dash-avail-stat.dash-avail-green .dash-avail-num { color: var(--sbl-green); }
.dash-avail-stat.dash-avail-amber .dash-avail-num { color: var(--sbl-amber-dark); }

.dash-avail-label {
    font-size: 0.78rem;
    color: var(--sbl-slate-500);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.2rem;
}

.dash-avail-capacity-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    color: var(--sbl-slate-600);
    margin-bottom: 0.35rem;
}

.dash-avail-pct {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sbl-navy);
}

/* --- Coverage block --- */
.dash-coverage-block {
    margin-bottom: 1rem;
}

.dash-coverage-headline {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.dash-coverage-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--sbl-navy);
    line-height: 1;
}

.dash-coverage-total {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sbl-slate-500);
}

.dash-coverage-suffix {
    font-size: 0.82rem;
    color: var(--sbl-slate-500);
    margin-right: 0.5rem;
}

.dash-coverage-pct {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sbl-green);
    margin-left: auto;
}

/* --- FLIK hotspots list --- */
.dash-hotspot-heading {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sbl-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.dash-hotspot-list {
    margin-bottom: 0.75rem;
}

.dash-hotspot-list .ui-datalist-content {
    padding: 0;
    background: none;
    border: none;
}

.dash-hotspot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--sbl-slate-100);
    gap: 0.5rem;
}

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

.dash-hotspot-name {
    font-size: 0.82rem;
    color: var(--sbl-slate-700);
    font-family: var(--sbl-font-mono);
    font-size: 0.78rem;
}

.dash-hotspot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    background: var(--sbl-blue-bg);
    color: var(--sbl-blue);
    border-radius: 11px;
    font-size: 0.78rem;
    font-weight: 700;
}

.dash-coverage-footer {
    border-top: 1px solid var(--sbl-slate-200);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* --- Weather summary chips --- */
.dash-weather-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dash-weather-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--sbl-radius);
    border: 1px solid transparent;
    min-width: 140px;
    flex: 1;
}

.dash-weather-chip i {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.dash-weather-chip-body {
    display: flex;
    flex-direction: column;
}

.dash-weather-chip-val {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--sbl-navy);
}

.dash-weather-chip-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sbl-slate-500);
}

.dash-weather-chip-amber {
    background: var(--sbl-amber-bg);
    border-color: var(--sbl-amber-light);
    color: var(--sbl-amber-dark);
}
.dash-weather-chip-amber i { color: var(--sbl-amber); }

.dash-weather-chip-blue {
    background: var(--sbl-blue-bg);
    border-color: var(--sbl-blue-light);
}
.dash-weather-chip-blue i { color: var(--sbl-blue); }

.dash-weather-chip-slate {
    background: var(--sbl-slate-100);
    border-color: var(--sbl-slate-200);
}
.dash-weather-chip-slate i { color: var(--sbl-slate-500); }

/* --- No-fly zone conflict badge --- */
.dash-nofly-count-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    background: #dc2626;
    color: #fff;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.dash-nofly-type-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fee2e2;
    color: #991b1b;
}

/* --- Cancellation analysis qualifier text --- */
.dash-cancel-qualifier {
    font-size: 0.78rem;
    color: var(--sbl-slate-400);
    font-style: italic;
}

/* --- Responsive breakpoints --- */
@media (max-width: 1024px) {
    .dash-chart-grid {
        grid-template-columns: 1fr;
    }

    .dash-hero {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .dash-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .dash-weather-chips {
        gap: 0.5rem;
    }

    .dash-weather-chip {
        min-width: 120px;
    }

    .dash-hero {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .dash-hero-counts {
        justify-content: center;
    }

    .dash-hero-progress-bar {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .dash-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dash-weather-chip {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 0;
    }

    .dash-hero-rate-value {
        font-size: 2rem;
    }

    .dash-avail-row {
        gap: 0.75rem;
    }
}

/* ============================================================
   Drone Detail Page (dd-)
   ============================================================ */

.dd-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Hero ─────────────────────────────────────────────────── */

.dd-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #ef4444;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    color: var(--sbl-white);
    border-radius: var(--sbl-radius);
    padding: 20px 28px;
}
/* subtle grid overlay on hero */
.dd-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.dd-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dd-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f87171, #dc2626);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dd-hero-icon i {
    color: var(--sbl-white);
    font-size: 1.3rem;
}

.dd-hero-title {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--sbl-white);
    letter-spacing: -0.01em;
}

.dd-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.dd-hero-id {
    font-size: 0.75rem;
    color: var(--sbl-slate-400);
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.dd-hero-owner {
    font-size: 0.82rem;
    color: var(--sbl-slate-400);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dd-hero-owner a,
.dd-hero-owner .dd-commune-link {
    color: var(--sbl-slate-300);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
}

.dd-hero-owner a:hover {
    color: var(--sbl-white);
}

.dd-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ── Fleet navigation ─────────────────────────────────────── */

.dd-nav-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dd-nav-group form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.dd-nav-btn.ui-button {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--sbl-white) !important;
    width: 34px;
    height: 34px;
    padding: 0 !important;
    border-radius: 8px !important;
}

.dd-nav-btn.ui-button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.dd-nav-position {
    font-size: 0.8rem;
    color: var(--sbl-slate-300);
    min-width: 48px;
    text-align: center;
}

/* Back to Fleet button on dark hero */
.dd-hero-actions > .ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600 !important;
    padding: 0.45rem 0.9rem;
    border-radius: 6px !important;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
}

/* ── EU & Feature badges ──────────────────────────────────── */

.dd-eu-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dd-eu-badge-lg {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dd-eu-c0, .dd-eu-badge.dd-eu-c0, .dd-eu-badge-lg.dd-eu-c0 { background: #dcfce7; color: #15803d; }
.dd-eu-c1, .dd-eu-badge.dd-eu-c1, .dd-eu-badge-lg.dd-eu-c1 { background: #d1fae5; color: #065f46; }
.dd-eu-c2, .dd-eu-badge.dd-eu-c2, .dd-eu-badge-lg.dd-eu-c2 { background: #dbeafe; color: #1d4ed8; }
.dd-eu-c3, .dd-eu-badge.dd-eu-c3, .dd-eu-badge-lg.dd-eu-c3 { background: #fef3c7; color: #b45309; }
.dd-eu-c4, .dd-eu-badge.dd-eu-c4, .dd-eu-badge-lg.dd-eu-c4 { background: #fee2e2; color: #b91c1c; }
.dd-eu-c5, .dd-eu-badge.dd-eu-c5, .dd-eu-badge-lg.dd-eu-c5 { background: #f3e8ff; color: #7c3aed; }
.dd-eu-c6, .dd-eu-badge.dd-eu-c6, .dd-eu-badge-lg.dd-eu-c6 { background: #fdf4ff; color: #a21caf; }
.dd-eu-unclassified, .dd-eu-badge.dd-eu-unclassified, .dd-eu-badge-lg.dd-eu-unclassified { background: #f1f5f9; color: #64748b; }

.dd-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dd-badge-thermal { background: #fff7ed; color: #c2410c; }
.dd-badge-rtk     { background: #eff6ff; color: #2563eb; }
.dd-badge-discontinued { background: #fef2f2; color: #dc2626; }

/* ── KPI counters ─────────────────────────────────────────── */

.dd-counters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dd-counter {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #fff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    flex: 1 1 160px;
}

.dd-counter-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dd-counter-icon i {
    font-size: 1.1rem;
}

.dd-counter-icon.missions { background: #eff6ff; color: #2563eb; }
.dd-counter-icon.missions i { color: #2563eb; }
.dd-counter-icon.flight   { background: #f0fdf4; color: #16a34a; }
.dd-counter-icon.flight i { color: #16a34a; }
.dd-counter-icon.weight   { background: #fef9c3; color: #a16207; }
.dd-counter-icon.weight i { color: #a16207; }
.dd-counter-icon.range    { background: #fdf4ff; color: #7c3aed; }
.dd-counter-icon.range i  { color: #7c3aed; }

.dd-counter-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.dd-counter-unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}

.dd-counter-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* ── Cards ────────────────────────────────────────────────── */

.dd-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}

.dd-card-header {
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
}

.dd-card-header i {
    color: #3b82f6;
    font-size: 0.95rem;
}

.dd-card-subtitle {
    font-weight: 400;
    color: #64748b;
    font-size: 0.82rem;
}

.dd-card-count {
    font-weight: 400;
    color: #64748b;
    font-size: 0.82rem;
}

.dd-card-body {
    padding: 1.25rem;
}

/* ── Info cards layout ────────────────────────────────────── */

.dd-info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.dd-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dd-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dd-info-item-wide {
    grid-column: 1 / -1;
}

.dd-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.dd-info-value {
    font-size: 0.88rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dd-info-icon {
    color: #94a3b8;
    font-size: 0.8rem;
}

.dd-empty {
    color: #cbd5e1;
    font-style: italic;
}

/* ── Commune link (in owner section) ─────────────────────── */

.dd-commune-link {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.dd-commune-link:hover {
    color: #16a34a;
    text-decoration: underline;
}

/* ── Owner type badge ─────────────────────────────────────── */

.dd-owner-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
}

/* ── Certificate badges ───────────────────────────────────── */

.dd-cert-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}

.dd-cert-a1a3 { background: #dcfce7; color: #15803d; }
.dd-cert-a2   { background: #fef3c7; color: #b45309; }
.dd-cert-sts01, .dd-cert-sts02 { background: #fee2e2; color: #b91c1c; }
.dd-cert-specific { background: #f3e8ff; color: #7c3aed; }
.dd-cert-unknown  { background: #f1f5f9; color: #64748b; }

/* ── Tech specs grid ──────────────────────────────────────── */

.dd-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.dd-spec-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dd-spec-group-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f1f5f9;
}

.dd-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.dd-spec-label {
    font-size: 0.82rem;
    color: #64748b;
}

.dd-spec-value {
    font-size: 0.85rem;
    color: #0f172a;
    font-weight: 500;
    text-align: right;
}

.dd-capability-yes {
    color: #16a34a;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dd-capability-no {
    color: #94a3b8;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ── Notes block ──────────────────────────────────────────── */

.dd-notes {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.dd-notes-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dd-notes-text {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.5;
}

/* ── Mission table ────────────────────────────────────────── */

.dd-mission-table.ui-datatable {
    border: none;
}

.dd-mission-table .ui-datatable-thead th {
    padding: 8px 10px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
}

.dd-mission-table .ui-datatable-data td {
    padding: 7px 10px;
    vertical-align: middle;
}

.dd-mission-table .ui-datatable-data tr:hover td {
    background: #f8fafc;
}

.dd-title-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.dd-title-cell > span:nth-child(2) {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.dd-title-cell .dd-priority-badge {
    flex-shrink: 0;
    margin-left: auto;
}

.dd-priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.dd-priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Priority colours (dot + badge) */
.dd-mission-priority-1 { background: #ef4444; }
.dd-mission-priority-1.dd-priority-badge { background: #fee2e2; color: #b91c1c; }
.dd-mission-priority-2 { background: #f59e0b; }
.dd-mission-priority-2.dd-priority-badge { background: #fef9c3; color: #854d0e; }
.dd-mission-priority-3 { background: #22c55e; }
.dd-mission-priority-3.dd-priority-badge { background: #dcfce7; color: #15803d; }
.dd-mission-priority-5.dd-priority-badge { background: #f1f5f9; color: #475569; }

/* Status badges */
.dd-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dd-status-completed  { background: #dcfce7; color: #15803d; }
.dd-status-cancelled  { background: #fee2e2; color: #b91c1c; }
.dd-status-in_progress { background: #dbeafe; color: #1d4ed8; }
.dd-status-dispatched { background: #fef3c7; color: #b45309; }
.dd-status-created    { background: #f1f5f9; color: #475569; }
.dd-status-unassigned { background: #fdf4ff; color: #7c3aed; }

.dd-table-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
}

.dd-table-link:hover {
    color: #1d4ed8;
}

/* ── Empty states ─────────────────────────────────────────── */

.dd-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    gap: 0.5rem;
}

.dd-empty-state-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

/* ── Error detail ─────────────────────────────────────────── */

.dd-error-detail {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #b91c1c;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .dd-hero {
        flex-direction: column;
    }

    .dd-hero-actions {
        align-items: flex-start;
    }

    .dd-counters {
        flex-direction: column;
    }

    .dd-info-row {
        grid-template-columns: 1fr;
    }

    .dd-info-grid {
        grid-template-columns: 1fr;
    }

    .dd-specs-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Commune Detail Page (cd-)
   ============================================================ */

.cd-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Hero ─────────────────────────────────────────────────── */

.cd-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #6366f1;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 4px 14px rgba(67, 56, 202, 0.3);
}
/* subtle grid overlay on hero */
.cd-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.cd-hero-left {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.cd-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cd-hero-icon i {
    color: #fff;
    font-size: 1.5rem;
}

.cd-hero-title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.cd-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.cd-hero-id {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.85);
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
}

.cd-hero-sub {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cd-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ── Badges ───────────────────────────────────────────────── */

.cd-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #dcfce7;
    color: #15803d;
    font-family: monospace;
}

.cd-geo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    background: #eff6ff;
    color: #1d4ed8;
}

.cd-geo-district {
    background: #f0fdf4;
    color: #166534;
}

/* ── Navigation ───────────────────────────────────────────── */

.cd-nav-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cd-nav-group form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.cd-nav-btn.ui-button {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    width: 34px;
    height: 34px;
    padding: 0 !important;
    border-radius: 8px !important;
}

.cd-nav-btn.ui-button:hover {
    background: #e2e8f0 !important;
}

.cd-nav-position {
    font-size: 0.8rem;
    color: #64748b;
    min-width: 56px;
    text-align: center;
}

/* ── KPI Counters ─────────────────────────────────────────── */

.cd-counters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cd-counter {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #fff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    flex: 1 1 150px;
}

.cd-counter-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cd-counter-icon i { font-size: 1.1rem; }

.cd-counter-icon.parcels    { background: #eff6ff; }
.cd-counter-icon.parcels i  { color: #2563eb; }
.cd-counter-icon.area       { background: #f0fdf4; }
.cd-counter-icon.area i     { color: #16a34a; }
.cd-counter-icon.missions   { background: #fef3c7; }
.cd-counter-icon.missions i { color: #b45309; }
.cd-counter-icon.completed  { background: #dcfce7; }
.cd-counter-icon.completed i{ color: #15803d; }
.cd-counter-icon.bambis     { background: #fce7f3; }
.cd-counter-icon.bambis i   { color: #be185d; }
.cd-counter-icon.drones     { background: #f3e8ff; }
.cd-counter-icon.drones i   { color: #7c3aed; }

.cd-counter-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.cd-counter-unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}

.cd-counter-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* ── Cards ────────────────────────────────────────────────── */

.cd-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}

.cd-card-header {
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
}

.cd-card-header i {
    color: #16a34a;
    font-size: 0.95rem;
}

.cd-card-count {
    font-weight: 400;
    color: #64748b;
    font-size: 0.82rem;
}

.cd-card-body {
    padding: 1.25rem;
}

/* ── Admin info grid ──────────────────────────────────────── */

.cd-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.cd-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cd-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.cd-info-value {
    font-size: 0.88rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cd-info-icon {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* ── Data tables ──────────────────────────────────────────── */

.cd-data-table.ui-datatable {
    border: none;
}

/* ── Mission priority dots + badges ──────────────────────── */

.cd-priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cd-priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.cd-mission-priority-1                   { background: #dc2626; }
.cd-mission-priority-1.cd-priority-badge { background: #fee2e2; color: #b91c1c; }
.cd-mission-priority-2                   { background: #f97316; }
.cd-mission-priority-2.cd-priority-badge { background: #ffedd5; color: #c2410c; }
.cd-mission-priority-3                   { background: #3b82f6; }
.cd-mission-priority-3.cd-priority-badge { background: #dbeafe; color: #1d4ed8; }
.cd-mission-priority-4                   { background: #16a34a; }
.cd-mission-priority-4.cd-priority-badge { background: #dcfce7; color: #15803d; }
.cd-mission-priority-5                   { background: #94a3b8; }
.cd-mission-priority-5.cd-priority-badge { background: #f1f5f9; color: #475569; }

/* ── Status badges ────────────────────────────────────────── */

.cd-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cd-status-completed    { background: #dcfce7; color: #15803d; }
.cd-status-cancelled    { background: #fee2e2; color: #b91c1c; }
.cd-status-in_progress  { background: #dbeafe; color: #1d4ed8; }
.cd-status-dispatched   { background: #fef3c7; color: #b45309; }
.cd-status-created      { background: #f1f5f9; color: #475569; }
.cd-status-unassigned   { background: #fdf4ff; color: #7c3aed; }

/* ── Drone EU class badges ────────────────────────────────── */

.cd-eu-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.cd-eu-badge.cd-eu-c0          { background: #dcfce7; color: #15803d; }
.cd-eu-badge.cd-eu-c1          { background: #d1fae5; color: #065f46; }
.cd-eu-badge.cd-eu-c2          { background: #dbeafe; color: #1d4ed8; }
.cd-eu-badge.cd-eu-c3          { background: #fef3c7; color: #b45309; }
.cd-eu-badge.cd-eu-c4          { background: #fee2e2; color: #b91c1c; }
.cd-eu-badge.cd-eu-c5          { background: #f3e8ff; color: #7c3aed; }
.cd-eu-badge.cd-eu-c6          { background: #fdf4ff; color: #a21caf; }
.cd-eu-badge.cd-eu-unclassified{ background: #f1f5f9; color: #64748b; }

/* ── Feature badges ───────────────────────────────────────── */

.cd-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cd-badge-thermal { background: #fff7ed; color: #c2410c; }

/* ── Drone name / registration ────────────────────────────── */

.cd-drone-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
}

.cd-drone-reg {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}

/* ── Table action links ───────────────────────────────────── */

.cd-table-link {
    color: #16a34a;
    text-decoration: none;
    font-size: 0.9rem;
}

.cd-table-link:hover {
    color: #15803d;
}

/* ── Empty states ─────────────────────────────────────────── */

.cd-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    gap: 0.5rem;
}

/* ── FLIK Map / List tabs (commune-detail) ──────────────────── */

.cd-flik-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0 1.25rem;
    border-bottom: 2px solid var(--sbl-slate-200, #e2e8f0);
}
.cd-flik-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sbl-slate-400, #94a3b8);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.cd-flik-tab:hover {
    color: var(--sbl-slate-600, #475569);
}
.cd-flik-tab--active {
    color: var(--sbl-blue-600, #2563eb);
    border-bottom-color: var(--sbl-blue-600, #2563eb);
}
.cd-flik-tab .pi {
    font-size: 0.9rem;
}
.cd-flik-map {
    height: 420px;
    width: 100%;
    border-radius: 0 0 12px 12px;
}

/* ── Error detail ─────────────────────────────────────────── */

.cd-error-detail {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #b91c1c;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .cd-hero {
        flex-direction: column;
    }

    .cd-hero-actions {
        align-items: flex-start;
    }

    .cd-counters {
        flex-direction: column;
    }

    .cd-info-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================
   UAS NO-FLY ZONE POPUPS & TOOLTIPS
   ============================================================= */

/* Leaflet popup wrapper override */
.nfz-leaflet-popup .leaflet-popup-content {
    margin: 0;
    min-width: 240px;
}

/* Popup container */
.nfz-popup {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #334155;
}

.nfz-popup-header {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.nfz-popup-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin: 6px 0 0;
}

.nfz-popup-body {
    padding: 10px 14px;
}

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

.nfz-field i {
    font-size: 0.78rem;
    color: #64748b;
    margin-right: 2px;
}

.nfz-message {
    font-style: italic;
    color: #64748b;
    font-size: 0.78rem;
    border-left: 3px solid #e2e8f0;
    padding-left: 8px;
    margin-top: 8px;
}

.nfz-authority {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.nfz-authority a {
    color: #1d4ed8;
    text-decoration: none;
}

.nfz-authority a:hover {
    text-decoration: underline;
}

/* Restriction badges */
.nfz-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nfz-badge-prohibited {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.nfz-badge-auth {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.nfz-badge-conditional {
    background: #fefce8;
    color: #ca8a04;
    border: 1px solid #fef08a;
}

/* Tooltip */
.nfz-tooltip {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

/* =============================================================
   NFZ FLIK WARNING BANNER (page-level, mission pages)
   ============================================================= */

.nfz-flik-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 6px;
    margin-bottom: 1rem;
    color: #9a3412;
    font-size: 0.875rem;
}

.nfz-flik-warning-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    color: #f97316;
    margin-top: 0.05rem;
}

.nfz-flik-warning-title {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.nfz-flik-warning-detail {
    font-size: 0.82rem;
    color: #b45309;
}

.nfz-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.nfz-auth-btn:hover:not(:disabled) {
    background: #fde68a;
    border-color: #f59e0b;
}

.nfz-auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nfz-auth-download {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.nfz-auth-download:hover {
    background: #dbeafe;
    text-decoration: none;
    color: #1e3a8a;
}

.nfz-auth-error {
    margin-top: 0.35rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
}

/* =============================================================
   AUTH PAGES — login, register, forgot-password, reset-password
   ============================================================= */

/* ── Page wrapper ─────────────────────────────────────────── */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 2rem 1rem;
    background: var(--sbl-slate-50);
}

/* ── Card ─────────────────────────────────────────────────── */
.auth-card {
    background: var(--sbl-white);
    border-radius: var(--sbl-radius-lg);
    box-shadow: var(--sbl-shadow-md);
    padding: 2.25rem 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-card-wide {
    background: var(--sbl-white);
    border-radius: var(--sbl-radius-lg);
    box-shadow: var(--sbl-shadow-md);
    padding: 2.25rem 2.5rem;
    width: 100%;
    max-width: 620px;
}

/* ── Card header ──────────────────────────────────────────── */
.auth-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.auth-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--sbl-radius);
    background: var(--sbl-blue-bg);
    color: var(--sbl-blue);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.auth-card-icon.green  { background: var(--sbl-green-bg);  color: var(--sbl-green); }
.auth-card-icon.amber  { background: var(--sbl-amber-bg);  color: var(--sbl-amber-dark); }

.auth-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sbl-slate-800);
    margin: 0;
}

/* ── Form layout ──────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.auth-field .ui-outputlabel,
.auth-field label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sbl-slate-600);
}

/* Two-column row (used in registration for first + last name) */
.auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

/* PrimeFaces full-width overrides inside auth forms */
.auth-form .ui-inputtext,
.auth-form .ui-password input,
.auth-form .ui-datepicker-trigger-only .ui-inputtext {
    width: 100%;
    box-sizing: border-box;
}

.auth-form .ui-calendar {
    width: 100%;
}

/* ── Submit button ────────────────────────────────────────── */
.auth-submit-btn,
.auth-submit-btn.ui-button {
    width: 100%;
    justify-content: center;
    margin-top: 0.4rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Helper links (forgot / register) ────────────────────── */
.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.auth-link,
.auth-link:visited {
    font-size: 0.82rem;
    color: var(--sbl-blue);
    text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

/* ── Info / error panels (forgot-password confirmation, etc.) */
.auth-info-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--sbl-radius);
    background: var(--sbl-blue-bg);
    border: 1px solid var(--sbl-blue-light);
}

.auth-info-icon {
    color: var(--sbl-blue);
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-info-text {
    font-size: 0.875rem;
    color: var(--sbl-slate-700);
    line-height: 1.5;
}

.auth-error-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--sbl-radius);
    background: var(--sbl-red-bg);
    border: 1px solid #fecaca;
}

.auth-error-icon {
    color: var(--sbl-red);
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-error-text {
    font-size: 0.875rem;
    color: #991b1b;
    line-height: 1.5;
}

.auth-success-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--sbl-radius);
    background: var(--sbl-green-bg);
    border: 1px solid #bbf7d0;
}

.auth-success-icon {
    color: var(--sbl-green);
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-success-text {
    font-size: 0.875rem;
    color: #166534;
    line-height: 1.5;
}

/* ── Admin user management page ───────────────────────────── */
.admin-tabs {
    margin-top: 1.5rem;
}

.admin-tabs .ui-tabview-nav {
    border-bottom: 2px solid var(--sbl-slate-200);
}

/* ── nav bar user info / logout ───────────────────────────── */
.nav-user-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sbl-slate-300);
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-logout {
    font-size: 0.82rem;
    color: var(--sbl-slate-400);
    text-decoration: none;
    transition: color var(--sbl-ease-fast);
}

.nav-logout:hover { color: var(--sbl-white); text-decoration: none; }

.nav-login-link a {
    font-size: 0.82rem;
    color: var(--sbl-slate-300);
    text-decoration: none;
}

.nav-login-link a:hover { color: var(--sbl-white); }

/* ============================================================
   Communes List Page (cm-)
   ============================================================ */

.cm-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Hero ─────────────────────────────────────────────────── */

.cm-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #6366f1;
    color: #fff;
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    position: relative;
    overflow: hidden;
}
/* subtle grid overlay on hero */
.cm-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}

.cm-hero-left {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.cm-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cm-hero-icon i {
    color: #fff;
    font-size: 1.5rem;
}

.cm-hero-title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.cm-hero-subtitle {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
}

/* ── TabView ──────────────────────────────────────────────── */

.cm-tabs .ui-tabs-nav {
    background: #fff;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 1rem;
}

.cm-tab-title {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Map Tab ──────────────────────────────────────────────── */

.cm-map-card {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cm-map-hint {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cm-map-hint i {
    color: #2563eb;
}

.cm-map-container {
    height: 560px;
    width: 100%;
    background: #e2e8f0;
}

/* ── List Tab ─────────────────────────────────────────────── */

.cm-list-card {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cm-commune-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #0f172a;
    font-size: 0.9rem;
}

.cm-commune-icon {
    font-size: 0.78rem;
    color: #2563eb;
    flex-shrink: 0;
}

.cm-code-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--sbl-font-mono);
    letter-spacing: 0.03em;
}

.cm-district-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

.cm-detail-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #eff6ff;
    color: #2563eb;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.cm-detail-link:hover {
    background: #2563eb;
    color: #fff;
    text-decoration: none;
}

.cm-detail-link i {
    font-size: 0.82rem;
}

.cm-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.cm-detail-btn:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    text-decoration: none;
}

.cm-detail-btn i {
    font-size: 0.8rem;
}

/* Align p:dataTable rows with cd- (commune-detail) table style */
.cm-data-table.ui-datatable .ui-datatable-tablewrapper table {
    font-size: 0.87rem;
}

.cm-data-table.ui-datatable th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 12px;
}

.cm-data-table.ui-datatable td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.cm-data-table.ui-datatable .ui-datatable-even td { background: #fff; }
.cm-data-table.ui-datatable .ui-datatable-odd td  { background: #fafafa; }

.cm-data-table.ui-datatable tr:hover td {
    background: #eff6ff;
    cursor: pointer;
}

/* ── Search Bar ───────────────────────────────────────────── */

.cm-search-bar {
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.cm-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 280px;
}

.cm-search-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.cm-search-input {
    width: 100%;
    padding: 6px 12px 6px 32px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

.cm-search-input:focus {
    border-color: #3b82f6;
}

/* ── Stat Badges ──────────────────────────────────────────── */

.cm-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.cm-stat-icon {
    font-size: 0.72rem;
}

.cm-stat-parcel {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.cm-stat-mission {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ── Drone cell ───────────────────────────────────────────── */

.cm-drone-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cm-drone-model {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #1e293b;
}

.cm-drone-icon {
    color: #64748b;
    font-size: 0.78rem;
}

.cm-drone-extra {
    display: inline-flex;
    align-items: center;
    background: #e2e8f0;
    color: #475569;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.cm-drone-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.cm-pilot-cert {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1px 7px;
}

/* ── Counter Cards ────────────────────────────────────────── */

.cm-counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.cm-counter {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(15,23,42,0.07);
    transition: box-shadow 0.15s, transform 0.15s;
}

.cm-counter:hover {
    box-shadow: 0 4px 16px rgba(15,23,42,0.12);
    transform: translateY(-1px);
}

.cm-counter-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.cm-counter-icon.communes { background: #ede9fe; color: #6d28d9; box-shadow: 0 2px 8px rgba(109,40,217,0.15); }
.cm-counter-icon.parcels  { background: #dbeafe; color: #1d4ed8; box-shadow: 0 2px 8px rgba(29,78,216,0.15); }
.cm-counter-icon.missions { background: #fef3c7; color: #b45309; box-shadow: 0 2px 8px rgba(180,83,9,0.15); }

.cm-counter-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1; }
.cm-counter-label { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* ── List Card Header ─────────────────────────────────────── */

.cm-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.cm-list-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cm-list-title i { color: #6366f1; font-size: 0.9rem; }

.cm-count-badge {
    display: inline-block;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    vertical-align: middle;
}

.cm-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cm-export-btn { padding: 5px 10px !important; font-size: 0.83rem !important; }

/* ── Canton Badge ─────────────────────────────────────────── */

.cm-canton-badge {
    display: inline-block;
    padding: 2px 9px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

/* ── Tab Icons ────────────────────────────────────────────── */

.cm-tab-liste::before {
    font-family: 'primeicons';
    content: '\e90d';
    margin-right: 6px;
    font-size: 0.85rem;
    vertical-align: middle;
}

.cm-tab-carte::before {
    font-family: 'primeicons';
    content: '\e933';
    margin-right: 6px;
    font-size: 0.85rem;
    vertical-align: middle;
}

/* ── Empty State ──────────────────────────────────────────── */

.cm-empty-state {
    padding: 3rem 2rem;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   AD Account Card  —  person-details.xhtml
   ═══════════════════════════════════════════════════════════ */

.pd-ad-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
    border-left: 4px solid #94a3b8;   /* default — overridden by role modifier */
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* Role-based left-border colours */
.pd-ad-role-dronepilot    { border-left-color: #4f46e5; }
.pd-ad-role-assistant     { border-left-color: #10b981; }
.pd-ad-role-missiondispatcher { border-left-color: #f59e0b; }
.pd-ad-role-owner         { border-left-color: #8b5cf6; }

/* ── Header ── */
.pd-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.pd-ad-header-left {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.pd-ad-shield-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    font-size: 1rem;
    flex-shrink: 0;
}
.pd-ad-role-dronepilot        .pd-ad-shield-icon { background: #e0e7ff; color: #4f46e5; }
.pd-ad-role-assistant         .pd-ad-shield-icon { background: #d1fae5; color: #059669; }
.pd-ad-role-missiondispatcher .pd-ad-shield-icon { background: #fef3c7; color: #d97706; }
.pd-ad-role-owner             .pd-ad-shield-icon { background: #f3e8ff; color: #7c3aed; }

.pd-ad-title-group {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.pd-ad-card-title {
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .01em;
}
.pd-ad-role-tag {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .15rem .55rem;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
}
.pd-ad-role-tag-dronepilot        { background: #e0e7ff; color: #4338ca; }
.pd-ad-role-tag-assistant         { background: #d1fae5; color: #047857; }
.pd-ad-role-tag-missiondispatcher { background: #fef3c7; color: #b45309; }
.pd-ad-role-tag-owner             { background: #f3e8ff; color: #6d28d9; }

/* Status indicator */
.pd-ad-status {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    font-weight: 600;
    color: #94a3b8;
}
.pd-ad-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    display: inline-block;
}
.pd-ad-status-active .pd-ad-status-dot {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,.2);
}
.pd-ad-status-active .pd-ad-status-label { color: #059669; }
.pd-ad-status-none   .pd-ad-status-label { color: #94a3b8; }

/* ── Messages ── */
.pd-ad-messages {
    margin: .75rem 1.25rem 0;
}

/* ── Body ── */
.pd-ad-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Section blocks ── */
.pd-ad-section {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.pd-ad-section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding-bottom: .4rem;
    border-bottom: 1px dashed #e2e8f0;
}

/* ── Inputs ── */
.pd-ad-input .ui-inputfield,
.pd-ad-input.ui-inputfield {
    width: 100% !important;
    border-radius: 7px !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: .55rem .75rem !important;
    font-size: .875rem !important;
    color: #1e293b !important;
    transition: border-color .15s, box-shadow .15s !important;
}
.pd-ad-input .ui-inputfield:focus,
.pd-ad-input.ui-inputfield:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,.1) !important;
    outline: none !important;
}
.pd-ad-input-mono .ui-inputfield,
.pd-ad-input-mono.ui-inputfield {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
    letter-spacing: .03em !important;
}

/* PrimeFaces password widget wraps input in a span — target it */
.pd-ad-input.ui-password { width: 100% !important; }
.pd-ad-input.ui-password > input { width: 100% !important; }

.pd-ad-hint {
    font-size: .75rem;
    color: #94a3b8;
    line-height: 1.5;
}
.pd-ad-hint code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #f1f5f9;
    padding: .1em .35em;
    border-radius: 4px;
    font-size: .85em;
    color: #4f46e5;
}

/* ── Password grid (side-by-side pair) ── */
.pd-ad-pw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 640px) {
    .pd-ad-pw-grid { grid-template-columns: 1fr; }
}
.pd-ad-pw-col {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.pd-ad-pw-label {
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
}

/* ── Match indicator ── */
.pd-ad-match-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .78rem;
    font-weight: 600;
    padding: .35rem .1rem;
    transition: opacity .2s;
}
.pd-ad-match-hidden { opacity: 0; pointer-events: none; height: 0; padding: 0; overflow: hidden; }
.pd-ad-match-ok {
    display: none;
    align-items: center;
    gap: .35rem;
    color: #059669;
}
.pd-ad-match-fail {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: #dc2626;
}

/* ── Requirements pills ── */
.pd-ad-requirements {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .75rem 1rem;
}
.pd-ad-req-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.pd-ad-req-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.pd-ad-req-pill {
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .6rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    color: #475569;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Create / action buttons ── */
.pd-ad-create-action {
    display: flex;
}
.pd-ad-create-btn.ui-button {
    width: 100%;
    justify-content: center;
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    border-radius: 8px !important;
    padding: .65rem 1.25rem !important;
    font-weight: 700 !important;
    font-size: .875rem !important;
    letter-spacing: .02em !important;
    transition: background .15s, box-shadow .15s !important;
}
.pd-ad-create-btn.ui-button:hover {
    background: #4338ca !important;
    box-shadow: 0 4px 12px rgba(79,70,229,.3) !important;
}

/* ── Separator ── */
.pd-ad-sep {
    height: 1px;
    background: #f1f5f9;
    margin: .25rem 0;
}

/* ── Account info strip (STATE 2) ── */
.pd-ad-info-strip {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.pd-ad-info-chip {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1;
    min-width: 160px;
}
.pd-ad-chip-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94a3b8;
}
.pd-ad-chip-value {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .875rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: .45rem .7rem;
}
.pd-ad-chip-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: .8rem;
    letter-spacing: .03em;
}

/* ── Control buttons ── */
.pd-ad-control-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}
.pd-ad-btn-disable.ui-button {
    background: #fff !important;
    color: #d97706 !important;
    border: 1.5px solid #fcd34d !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    transition: background .15s !important;
}
.pd-ad-btn-disable.ui-button:hover {
    background: #fffbeb !important;
}
.pd-ad-btn-enable.ui-button {
    background: #fff !important;
    color: #059669 !important;
    border: 1.5px solid #6ee7b7 !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    transition: background .15s !important;
}
.pd-ad-btn-enable.ui-button:hover {
    background: #f0fdf4 !important;
}
.pd-ad-btn-reset.ui-button {
    background: #fff !important;
    color: #4f46e5 !important;
    border: 1.5px solid #c7d2fe !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    width: 100% !important;
    justify-content: center !important;
    transition: background .15s !important;
}
.pd-ad-btn-reset.ui-button:hover {
    background: #eef2ff !important;
}

/* ═══════════════════════════════════════════════════════════
   People page — role creation dialogs (Pilot, Assistant, Dispatcher, Farmer, Owner)
   ═══════════════════════════════════════════════════════════ */

/* Dialog chrome */
.pp-role-dialog .ui-dialog-titlebar {
    background: #fff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 1rem 1.25rem !important;
}
.pp-dlg-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-weight: 700;
    font-size: .95rem;
    color: #1e293b;
}
.pp-dlg-role-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.pp-dlg-dot-pilot      { background: #4f46e5; }
.pp-dlg-dot-assistant  { background: #10b981; }
.pp-dlg-dot-dispatcher { background: #f59e0b; }
.pp-dlg-dot-farmer     { background: #0ea5e9; }
.pp-dlg-dot-owner      { background: #8b5cf6; }

.pp-role-dialog .ui-dialog-content {
    padding: 0 !important;
    background: #fff !important;
}

/* ── Form layout ── */
.pp-form {
    display: flex;
    flex-direction: column;
}
.pp-form-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f8fafc;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.pp-form-section:last-child { border-bottom: none; }

.pp-form-section-label {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .1rem;
}

/* AD section variant — subtle separator to distinguish it */
.pp-form-section-ad {
    border-top: 1px dashed #e2e8f0;
    padding-top: 1rem;
    margin-top: .25rem;
}
.pp-form-section-ad .pp-form-section-label {
    color: #6366f1;
}

/* "Optional" badge next to section labels */
.pp-optional {
    display: inline-block;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: .1rem .4rem;
    margin-left: .25rem;
}

/* Hint text below a section label */
.pp-form-hint {
    font-size: .75rem;
    color: #94a3b8;
    margin: 0 0 .25rem;
    line-height: 1.4;
}

/* Password match indicator row */
.pp-pw-match-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .75rem;
    font-weight: 600;
    padding: .25rem 0;
}
.pp-pw-match-ok  { color: #16a34a; }
.pp-pw-match-fail { color: #dc2626; }
.pp-form-row {
    display: flex;
    gap: .875rem;
}
.pp-form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
}
.pp-form-field-sm { flex: 0 0 110px; }
.pp-form-field-lg { flex: 1; }

.pp-form-label {
    font-size: .775rem;
    font-weight: 600;
    color: #475569;
    display: block;
}
.pp-req { color: #ef4444; }

.pp-form-input .ui-inputfield,
.pp-form-input.ui-inputfield {
    width: 100% !important;
    border-radius: 7px !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: .5rem .7rem !important;
    font-size: .85rem !important;
    color: #1e293b !important;
    background: #fff !important;
    transition: border-color .15s, box-shadow .15s !important;
}
.pp-form-input .ui-inputfield:focus,
.pp-form-input.ui-inputfield:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,.1) !important;
    outline: none !important;
}
.pp-form-input.ui-selectonemenu {
    width: 100% !important;
    border-radius: 7px !important;
    border: 1.5px solid #e2e8f0 !important;
}

/* ── Dialog action bar ── */
.pp-dlg-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    padding: .875rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.pp-dlg-btn-cancel.ui-button {
    background: #fff !important;
    color: #64748b !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 7px !important;
    font-weight: 600 !important;
    padding: .5rem 1rem !important;
}
.pp-dlg-btn-cancel.ui-button:hover { background: #f8fafc !important; }

.pp-dlg-btn-pilot.ui-button {
    background: #4f46e5 !important; border-color: #4f46e5 !important;
    color: #fff !important; border-radius: 7px !important;
    font-weight: 700 !important; padding: .5rem 1.1rem !important;
}
.pp-dlg-btn-pilot.ui-button:hover {
    background: #4338ca !important;
    box-shadow: 0 3px 10px rgba(79,70,229,.3) !important;
}
.pp-dlg-btn-assistant.ui-button {
    background: #10b981 !important; border-color: #10b981 !important;
    color: #fff !important; border-radius: 7px !important;
    font-weight: 700 !important; padding: .5rem 1.1rem !important;
}
.pp-dlg-btn-assistant.ui-button:hover {
    background: #059669 !important;
    box-shadow: 0 3px 10px rgba(16,185,129,.3) !important;
}
.pp-dlg-btn-dispatcher.ui-button {
    background: #f59e0b !important; border-color: #f59e0b !important;
    color: #fff !important; border-radius: 7px !important;
    font-weight: 700 !important; padding: .5rem 1.1rem !important;
}
.pp-dlg-btn-dispatcher.ui-button:hover {
    background: #d97706 !important;
    box-shadow: 0 3px 10px rgba(245,158,11,.3) !important;
}
.pp-dlg-btn-farmer.ui-button {
    background: #0ea5e9 !important; border-color: #0ea5e9 !important;
    color: #fff !important; border-radius: 7px !important;
    font-weight: 700 !important; padding: .5rem 1.1rem !important;
}
.pp-dlg-btn-farmer.ui-button:hover {
    background: #0284c7 !important;
    box-shadow: 0 3px 10px rgba(14,165,233,.3) !important;
}
.pp-dlg-btn-owner.ui-button {
    background: #8b5cf6 !important; border-color: #8b5cf6 !important;
    color: #fff !important; border-radius: 7px !important;
    font-weight: 700 !important; padding: .5rem 1.1rem !important;
}
.pp-dlg-btn-owner.ui-button:hover {
    background: #7c3aed !important;
    box-shadow: 0 3px 10px rgba(139,92,246,.3) !important;
}

/* --- People Dialog: scrollable body --- */
.pp-dlg-body {
    overflow-y: auto;
    max-height: calc(85vh - 200px);
    padding-right: 4px;
}

/* --- People Dialog: sticky action bar (override existing rule for stickiness) --- */
.pp-dlg-actions {
    position: sticky;
    bottom: 0;
    background: var(--sbl-white);
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--sbl-slate-200);
    z-index: 1;
}

/* --- Phone prefix + input --- */
.pp-phone-wrap {
    display: flex;
    align-items: stretch;
}

/* PrimeFaces prefix selectOneMenu fused to the left of the phone input */
.pp-phone-prefix-sel.ui-selectonemenu {
    border-radius: var(--sbl-radius-sm) 0 0 var(--sbl-radius-sm) !important;
    border-right: none !important;
    min-width: 100px;
    flex-shrink: 0;
    background: var(--sbl-slate-100);
}

.pp-phone-prefix-sel .ui-selectonemenu-trigger {
    border-radius: 0 !important;
    background: var(--sbl-slate-100) !important;
}

.pp-phone-prefix-sel .ui-selectonemenu-label {
    background: var(--sbl-slate-100) !important;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sbl-slate-700);
    border-radius: var(--sbl-radius-sm) 0 0 var(--sbl-radius-sm) !important;
}

.pp-phone-wrap .pp-phone-input {
    flex: 1;
    min-width: 0;
}

.pp-phone-wrap .pp-phone-input .ui-inputfield {
    border-radius: 0 var(--sbl-radius-sm) var(--sbl-radius-sm) 0 !important;
    width: 100% !important;
}


/* ── FPV download buttons ───────────────────────────────────────────── */
.uas-view-btn-dl { border-style: dashed; opacity: 0.55; }
.uas-view-btn-dl:not([disabled]) { opacity: 1; }
.uas-view-btn-dl:not([disabled]):hover { background: #0ea5e9; color: #fff; border-color: #0284c7; }

/* ── User Location Control ───────────────────────────────────────────── */
.user-loc-control { margin-top: 0 !important; }

/* Button resets — sits inside a standard leaflet-bar <div> */
.user-loc-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 26px !important;
    height: 26px !important;
    text-decoration: none !important;
    color: #555 !important;
    cursor: pointer;
    transition: color 0.2s ease;
}
.user-loc-btn:hover { color: #3b82f6 !important; }

/* State colours */
.user-loc-btn--locating { color: #f59e0b !important; }
.user-loc-btn--tracking { color: #3b82f6 !important; }
.user-loc-btn--error    { color: #ef4444 !important; }

/* Spinning animation for the "locating" state SVG */
@keyframes userLocSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.user-loc-btn--locating svg { animation: userLocSpin 1s linear infinite; }

/* Pulsing dot marker */
.user-loc-dot-icon { background: transparent !important; border: none !important; }
.user-loc-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 0 rgba(59,130,246,0.5);
    animation: userLocPulse 2s ease-in-out infinite;
}
@keyframes userLocPulse {
    0%   { box-shadow: 0 0 0 0   rgba(59,130,246,0.55); }
    50%  { box-shadow: 0 0 0 7px rgba(59,130,246,0); }
    100% { box-shadow: 0 0 0 0   rgba(59,130,246,0); }
}

/* ── HUD REC button ──────────────────────────────────────────────────── */
/* Idle state: subtle red dot */
.uas-pb-btn-rec { color: #ef4444; }
.uas-pb-btn-rec .pi { font-size: 0.7rem; }

/* Active (recording) state: pulsing red glow */
.uas-pb-btn-rec-active {
    color: #ef4444 !important;
    animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5);  opacity: 1; }
    50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); opacity: 0.75; }
}

/* ── Mission Schedule — Priority border on detail header ──────────────── */
.ms-priority-border-1 { border: 2px solid #FF5F57 !important; overflow: hidden; }
.ms-priority-border-2 { border: 2px solid #FEBC2E !important; overflow: hidden; }
.ms-priority-border-3 { border: 2px solid #28C840 !important; overflow: hidden; }

/* ── Mission Schedule — Dispatcher block in header ───────────────────── */
.ms-header-dispatcher {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.ms-header-dispatcher-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ms-header-dispatcher-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}
.ms-header-dispatcher-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.2rem;
}
.ms-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: color 0.15s;
}
.ms-contact-link:hover { color: #fff; text-decoration: underline; }
.ms-contact-icon { font-size: 0.75rem; }

/* ── Mission Schedule — Client card ──────────────────────────────────── */
.ms-client-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.ms-client-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e293b;
}
.ms-client-address {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #475569;
}
.ms-client-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.1rem;
}
.ms-contact-link-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.79rem;
    color: #475569 !important;
    text-decoration: none !important;
    transition: color 0.15s;
}
.ms-contact-link-sm:hover { color: #1e293b !important; text-decoration: underline !important; }
.ms-contact-icon-sm { font-size: 0.72rem; color: #64748b; }

/* Drone owner label next to farmer name */
.ms-client-drone-owner {
    font-size: 0.8rem;
    font-weight: 400;
    color: #64748b;
    margin-left: 0.25rem;
}

/* Crew card — same as ms-client-card but with gap between repeated items */
.ms-crew-card { margin-bottom: 0.5rem; }
.ms-crew-card:last-child { margin-bottom: 0; }

/* Role badge (Pilot / Assistant) shown next to the name */
.ms-crew-role-badge {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 6px;
}

/* ── Mission Schedule — Crew person rows with contacts ───────────────── */
.ms-crew-person {
    padding: 0.55rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.ms-crew-person:last-child { border-bottom: none; }
.ms-crew-person-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.ms-crew-person-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
}
.ms-crew-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding-left: 0.5rem;
}

/* ================================================================
   RESCHEDULE DIALOG
   ================================================================ */

.ms-reschedule-dialog .ui-dialog-content {
    padding: 1.25rem 1.5rem 0.75rem;
}

.ms-reschedule-dialog-desc {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
}

.ms-reschedule-icon {
    font-size: 1.1rem;
    color: var(--primary, #4f46e5);
}

.ms-reschedule-reasons {
    margin-bottom: 0.75rem;
}

.ms-reason-radio .ui-radiobutton {
    margin-right: 0.5rem;
}

.ms-reason-radio .ui-radiobutton-label {
    font-size: 0.9rem;
}

.ms-reschedule-other {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.ms-reason-other-input {
    width: 100% !important;
    font-size: 0.875rem;
}

.ms-reschedule-dialog-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.75rem 0 0.25rem;
}

.ms-btn-confirm-reschedule {
    font-weight: 600;
}

/* ================================================================
   RESCHEDULE TIMELINE  (schedule side panel — bottom of card)
   ================================================================ */

.ms-rh-timeline {
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    margin: 0 -0px; /* flush with card edges */
}

.ms-rh-timeline-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    border-bottom: 1px dashed #e2e8f0;
}

.ms-rh-timeline-icon {
    font-size: 0.7rem;
    color: #94a3b8;
}

.ms-rh-timeline-body {
    padding: 0.5rem 1rem 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Each entry row */
.ms-rh-entry {
    display: flex;
    gap: 0.6rem;
    position: relative;
    padding-bottom: 0.65rem;
}

/* Vertical connecting line between dots */
.ms-rh-entry:not(:last-child) .ms-rh-dot-col::after {
    content: '';
    position: absolute;
    top: 8px;
    left: calc(0.85rem + 3px);  /* aligns under the dot centre */
    width: 1px;
    height: calc(100% - 8px);
    background: repeating-linear-gradient(
        to bottom,
        #cbd5e1 0px,
        #cbd5e1 3px,
        transparent 3px,
        transparent 7px
    );
}

/* Last entry has no bottom padding */
.ms-rh-entry:last-child {
    padding-bottom: 0;
}

.ms-rh-dot-col {
    flex-shrink: 0;
    width: 14px;
    display: flex;
    justify-content: center;
    padding-top: 3px;
}

.ms-rh-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1.5px #94a3b8;
    flex-shrink: 0;
}

/* First entry dot is more prominent */
.ms-rh-entry:first-child .ms-rh-dot {
    background: #4f46e5;
    box-shadow: 0 0 0 1.5px #4f46e5;
}

.ms-rh-entry-content {
    flex: 1;
    min-width: 0;
}

.ms-rh-entry-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.ms-rh-entry-dates {
    font-family: var(--ms-font-mono, 'Courier New', monospace);
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.ms-rh-entry-arrow {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Reason pill — base */
.ms-rh-entry-pill {
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    white-space: nowrap;
    /* default: indigo */
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

/* Per-reason pill colour variants */
.ms-rh-pill-WEATHER        { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.ms-rh-pill-FARMER_REQUEST { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.ms-rh-pill-CREW_UNAVAILABLE { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.ms-rh-pill-EQUIPMENT_ISSUE  { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.ms-rh-pill-REGULATORY       { background: #fdf4ff; color: #7e22ce; border-color: #e9d5ff; }
.ms-rh-pill-OPERATIONAL      { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.ms-rh-pill-OTHER            { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.ms-rh-pill-NONE             { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }

.ms-rh-entry-note {
    margin-top: 0.2rem;
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-style: italic;
}

.ms-rh-entry-note .pi {
    font-size: 0.62rem;
    color: #94a3b8;
}

.ms-rh-entry-meta {
    margin-top: 0.15rem;
    font-size: 0.65rem;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

/* ================================================================
   MISSION SCHEDULE: CREW AVAILABILITY OVERLAY
   ================================================================ */

/* Availability event pill colours inside FullCalendar */
.ms-av-available .fc-event-main {
    background: rgba(40, 200, 64, 0.18);
    color: #15803d;
    border-left: 3px solid #28C840;
}
.ms-av-blocked .fc-event-main {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    border-left: 3px solid #ef4444;
}

/* Filter pill bar */
.ms-cal-filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.ms-ucal-pills {
    display: flex;
    gap: 0.4rem;
}
.ms-ucal-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ms-ucal-pill:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.ms-ucal-pill-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}
.ms-ucal-pill-active:hover {
    background: #1e293b;
    border-color: #1e293b;
}

/* Legend dots */
.ms-ucal-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    font-size: 0.75rem;
    color: #64748b;
}
.ms-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.ms-cal-dot-mission   { background: #3b82f6; }
.ms-cal-dot-available { background: #28C840; }
.ms-cal-dot-blocked   { background: #ef4444; }

/* ── Availability detail side card ── */
.ms-av-detail-card {
    position: sticky;
    top: 1rem;
    overflow: hidden;
    border: 2px solid #7c3aed; /* full purple border matching people card colour */
}
/* Header — purple gradient matching People icon card on index.xhtml */
.ms-av-detail-header {
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ms-av-detail-header .pi { color: rgba(255,255,255,0.8); font-size: 0.95rem; }
.ms-av-detail-person-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ms-av-role-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Availability slot rows (all slots list) ── */
.ms-av-slot-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.ms-av-slot-row:last-child { margin-bottom: 0; }
.ms-av-slot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ms-av-slot-available .ms-av-slot-dot { background: #28C840; }
.ms-av-slot-blocked   .ms-av-slot-dot { background: #ef4444; }
.ms-av-slot-type {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.ms-av-slot-available .ms-av-slot-type { color: #15803d; }
.ms-av-slot-blocked   .ms-av-slot-type { color: #b91c1c; }
.ms-av-slot-dates {
    flex: 1;
    color: #475569;
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    align-items: center;
}
.ms-av-slot-arrow { color: #94a3b8; font-size: 0.7rem; }
/* Highlight the currently selected slot */
.ms-av-slot-current {
    border-color: #3b82f6;
    background: #eff6ff;
}
.ms-av-slot-current .ms-av-slot-dates { color: #1d4ed8; }

/* Filter CSS rules: hide events not matching the selected filter */
.ms-cal-filter-wrap[data-cal-filter="missions"] .ms-av-available,
.ms-cal-filter-wrap[data-cal-filter="missions"] .ms-av-blocked {
    display: none !important;
}
.ms-cal-filter-wrap[data-cal-filter="availability"] .ms-priority-1,
.ms-cal-filter-wrap[data-cal-filter="availability"] .ms-priority-2,
.ms-cal-filter-wrap[data-cal-filter="availability"] .ms-priority-3 {
    display: none !important;
}

/* ================================================================
   RESCHEDULE HISTORY TABLE  (mission-detail page)
   ================================================================ */

.md-reschedule-table-wrap {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.md-reschedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.md-reschedule-table thead tr {
    background: #f3f4f6;
}

.md-reschedule-table th {
    padding: 0.55rem 0.85rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
}

.md-reschedule-table td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}

.md-reschedule-table tbody tr:last-child td {
    border-bottom: none;
}

.md-reschedule-table tbody tr:hover {
    background: #f9fafb;
}

.md-rh-reason-badge {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 500;
}

.md-empty-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 0.75rem 0;
}

/* ═══════════════════════════════════════════════════════════════════
   FLIGHT PLAN EDITOR (fpe-*)
   Komoot-style route builder + simulation playback + 3D/FPV
   ═══════════════════════════════════════════════════════════════════ */

.fpe-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    border: 2px solid #06b6d4;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
    color: #fff;
    padding: 20px 28px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.fpe-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    border-radius: inherit;
}
.fpe-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.fpe-hero-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #22d3ee, #0891b2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.fpe-hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}
.fpe-hero-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

.fpe-error-card {
    max-width: 480px; margin: 4rem auto; padding: 2rem; text-align: center;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; color: #991b1b;
}
.fpe-error-card i { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.fpe-error-link { display: inline-block; margin-top: 1rem; color: #2563eb; text-decoration: underline; }

/* ── Page Layout ─────────────────────────────────────────────── */
.fpe-page {
    display: flex; flex-direction: column; min-height: calc(100vh - 56px);
    background: #f8fafc; overflow-y: auto;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.fpe-toolbar {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 0.5rem 1rem; background: #fff; border-bottom: 1px solid #e2e8f0;
    gap: 1rem; flex-shrink: 0; z-index: 50;
}
.fpe-toolbar-left, .fpe-toolbar-center, .fpe-toolbar-right {
    display: flex; align-items: center; gap: 0.5rem;
}
/* Drone selector */
.fpe-drone-group { display: flex; align-items: center; gap: 0.35rem; }
.fpe-drone-icon { color: #3b82f6; font-size: 0.85rem; flex-shrink: 0; }
.fpe-drone-select {
    border: 1px solid #e2e8f0; background: #f8fafc; padding: 0.35rem 0.5rem;
    border-radius: 6px; font-size: 0.85rem; color: #0f172a; font-weight: 600;
    font-family: 'JetBrains Mono', monospace; cursor: pointer; height: auto;
    transition: all 0.15s; min-width: 70px;
}
.fpe-drone-select:focus { border-color: #3b82f6; outline: none; background: #fff; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.fpe-drone-select:hover { border-color: #cbd5e1; background: #f1f5f9; }

/* Filename input (right side of toolbar) */
.fpe-name-group { display: flex; align-items: center; gap: 0; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; transition: border-color 0.15s; }
.fpe-name-group:focus-within { border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.fpe-name-icon { color: #64748b; font-size: 0.8rem; padding: 0 0 0 0.5rem; flex-shrink: 0; }
.fpe-name-input {
    border: none; background: transparent; font-size: 0.85rem;
    font-weight: 600; color: #0f172a; padding: 0.35rem 0.35rem;
    font-family: 'JetBrains Mono', monospace; width: 160px; outline: none;
}
.fpe-name-ext { color: #94a3b8; font-size: 0.8rem; padding: 0 0.5rem 0 0; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

/* KMZ download button — shows label alongside icon */
.fpe-kmz-btn {
    width: auto; height: 34px; border-radius: 8px;
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.9rem; font-size: 0.85rem; font-weight: 500;
    border: 1.5px solid #2563eb; color: #2563eb; background: #fff;
}
.fpe-kmz-btn:hover:not(:disabled) { background: #eff6ff; border-color: #1d4ed8; color: #1d4ed8; }
/* disabled state inherited from .fpe-tool-btn:disabled */

/* ── Reset button ────────────────────────────────────────────── */
.fpe-reset-btn { color: #ef4444; }
.fpe-reset-btn:hover:not(:disabled) { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }

/* ── FLIK selector (PrimeFaces p:autoComplete in toolbar) ─────── */
.fpe-flik-form { margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }

/* Multi-FLIK chip list */
.fpe-flik-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; min-height: 1.4rem; align-items: center; }
.fpe-flik-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.18rem 0.5rem 0.18rem 0.55rem;
    border-radius: 99px; font-size: 0.75rem; font-weight: 600;
    font-family: 'JetBrains Mono', monospace; line-height: 1;
    white-space: nowrap; user-select: none;
}
.fpe-flik-chip-primary {
    background: #dcfce7; color: #15803d; border: 1.5px solid #86efac;
}
.fpe-flik-chip-extra {
    background: #cffafe; color: #0e7490; border: 1.5px solid #67e8f9;
}
.fpe-flik-chip-remove {
    cursor: pointer; font-size: 0.9rem; line-height: 1;
    opacity: 0.55; transition: opacity 0.15s, color 0.15s;
    margin-left: 0.1rem;
}
.fpe-flik-chip-remove:hover { opacity: 1; color: #dc2626; }
.fpe-flik-hint { font-size: 0.73rem; color: #94a3b8; font-style: italic; }
.fpe-flik-group { display: flex; align-items: center; gap: 0.35rem; }
.fpe-flik-icon { color: #64748b; font-size: 0.85rem; flex-shrink: 0; }

/* Override PF autocomplete input to fit toolbar */
.fpe-flik-ac .ui-autocomplete { display: block; }
.fpe-flik-ac .ui-autocomplete-input {
    border: 1px solid #e2e8f0; background: #f8fafc; padding: 0.35rem 0.5rem;
    border-radius: 6px; font-size: 0.85rem; width: 140px;
    font-family: 'JetBrains Mono', monospace; color: #0f172a;
    transition: all 0.15s; height: auto;
}
.fpe-flik-ac .ui-autocomplete-input:focus {
    border-color: #3b82f6; outline: none; background: #fff;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
/* Dropdown trigger button (when dropdown=true) */
.fpe-flik-ac .ui-autocomplete-dropdown {
    background: #f1f5f9; border: 1px solid #e2e8f0; border-left: none;
    border-radius: 0 6px 6px 0; padding: 0 0.5rem; color: #64748b;
    height: auto; width: auto; cursor: pointer;
}
.fpe-flik-ac .ui-autocomplete-dropdown:hover { background: #e2e8f0; }

/* Suggestion panel */
.ui-autocomplete-panel .ui-autocomplete-list-item {
    font-size: 0.85rem; font-family: 'JetBrains Mono', monospace;
    padding: 0.45rem 0.75rem; cursor: pointer;
}
.ui-autocomplete-panel .ui-autocomplete-list-item:hover,
.ui-autocomplete-panel .ui-autocomplete-list-item.ui-state-highlight {
    background: #eff6ff; color: #1d4ed8;
}

/* ── Mode Toggle ─────────────────────────────────────────────── */
.fpe-mode-toggle {
    display: flex; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden;
}
.fpe-mode-btn {
    display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.9rem;
    background: #fff; border: none; cursor: pointer; font-size: 0.82rem;
    color: #64748b; transition: all 0.15s;
}
.fpe-mode-btn:first-child { border-right: 1px solid #e2e8f0; }
.fpe-mode-btn:hover { background: #f1f5f9; }
.fpe-mode-btn.fpe-mode-active { background: #0f172a; color: #fff; }
.fpe-mode-btn.fpe-mode-active:hover { background: #1e293b; }

/* ── Editor Mode Toggle (Simple / Advanced) ──────────────────── */
.fpe-editor-mode-toggle {
    display: flex; border: 1.5px solid #14b8a6; border-radius: 8px; overflow: hidden;
    margin-left: 8px;
}
.fpe-editor-mode-btn {
    display: flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.8rem;
    background: #fff; border: none; cursor: pointer; font-size: 0.8rem;
    color: #0f766e; transition: all 0.15s; white-space: nowrap;
}
.fpe-editor-mode-btn:first-child { border-right: 1.5px solid #14b8a6; }
.fpe-editor-mode-btn:hover { background: #f0fdfa; }
.fpe-editor-mode-btn.fpe-editor-mode-active { background: #0f766e; color: #fff; }
.fpe-editor-mode-btn.fpe-editor-mode-active:hover { background: #0d6460; }

/* ── Mission Configuration Panel — below the map, shown only in Advanced mode */
.fpe-mission-cfg {
    background: #fff; border-top: 1px solid #e2e8f0; overflow: hidden;
}
.fpe-cfg-hint {
    font-size: 0.75rem; color: #94a3b8; font-weight: 400;
}
.fpe-cfg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px 16px;
    padding: 12px 16px 14px;
}
.fpe-cfg-field { display: flex; flex-direction: column; gap: 3px; }
.fpe-cfg-label {
    font-size: 0.73rem; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.fpe-cfg-select, .fpe-cfg-input {
    padding: 4px 8px; font-size: 0.82rem; color: #0f172a;
    border: 1px solid #cbd5e1; border-radius: 6px; background: #fff;
    transition: border-color 0.15s;
}
.fpe-cfg-select:focus, .fpe-cfg-input:focus {
    outline: none; border-color: #14b8a6;
    box-shadow: 0 0 0 2px rgba(20,184,166,0.12);
}
.fpe-cfg-input { width: 100%; }

/* ── Tool & Save Buttons ─────────────────────────────────────── */
.fpe-tool-btn {
    width: 34px; height: 34px; border: 1px solid #e2e8f0; border-radius: 8px;
    background: #fff; cursor: pointer; color: #475569; display: flex;
    align-items: center; justify-content: center; transition: all 0.15s;
}
.fpe-tool-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; }
.fpe-tool-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.fpe-save-btn {
    display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 1rem;
    background: #2563eb; color: #fff; border: none; border-radius: 8px;
    font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.fpe-save-btn:hover { background: #1d4ed8; }

/* ── Stats Counter Row ───────────────────────────────────────── */
.fpe-counters {
    display: flex; align-items: stretch; gap: 10px;
    padding: 10px 16px; background: #fff; border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0; overflow-x: auto;
}
.fpe-counter {
    display: flex; align-items: center; gap: 10px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 10px 14px; flex: 1; min-width: 110px; white-space: nowrap;
}
.fpe-counter-icon {
    width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.fpe-ci-dist  { background: #dbeafe; color: #1d4ed8; }
.fpe-ci-time  { background: #e0e7ff; color: #4338ca; }
.fpe-ci-wp    { background: #dcfce7; color: #16a34a; }
.fpe-ci-alt   { background: #fef3c7; color: #d97706; }
.fpe-ci-spd   { background: #fce7f3; color: #db2777; }
.fpe-counter-value {
    font-size: 1.1rem; font-weight: 700; color: #0f172a;
    font-family: 'JetBrains Mono', monospace; line-height: 1.2;
}
.fpe-counter-unit { font-size: 0.78rem; font-weight: 500; color: #64748b; }
.fpe-counter-label {
    font-size: 0.68rem; color: #94a3b8; text-transform: uppercase;
    letter-spacing: 0.05em; margin-top: 2px;
}

/* ── Editor body ─────────────────────────────────────────────── */
.fpe-editor-body {
    flex: none; overflow: hidden; display: flex; flex-direction: column;
    height: 740px; /* fixed — terrain profile and mission cfg sit below, never push map */
}

/* ── Main Area ───────────────────────────────────────────────── */
.fpe-main {
    display: flex; flex: 1; overflow: hidden; min-height: 0;
    padding: 12px; gap: 12px;
}

/* ── Map Card ────────────────────────────────────────────────── */
.fpe-map-card {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; min-width: 0;
}
.fpe-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
    flex-shrink: 0; gap: 1rem;
}
.fpe-card-title {
    font-weight: 600; font-size: 0.92rem; color: #1e293b;
    display: flex; align-items: center;
}
.fpe-map-wrap {
    flex: 1; position: relative; min-height: 0; overflow: hidden;
}
.fpe-map { width: 100%; height: 100%; }

/* ── Waypoints Card ──────────────────────────────────────────── */
.fpe-wp-card {
    width: 310px; flex-shrink: 0; display: flex; flex-direction: column;
    overflow: hidden; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
}

/* ── 3D Container ────────────────────────────────────────────── */
.fpe-3d-container {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 10;
}

/* ── Gimbal Pitch Slider (vertical, right edge of 3D view) ──── */
.fpe-gimbal-slider {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    z-index: 20; display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 10px 6px; border-radius: 10px;
    background: rgba(20,20,30,0.80); backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.fpe-gimbal-label {
    font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.55);
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}
.fpe-gimbal-val {
    font-size: 0.72rem; font-weight: 700; color: #38bdf8;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    margin-top: 2px;
}
.fpe-gimbal-range {
    writing-mode: vertical-lr; direction: rtl;   /* 0° at top, -90° at bottom */
    width: 28px; height: 140px; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background: transparent;
}
.fpe-gimbal-range::-webkit-slider-runnable-track {
    width: 4px; border-radius: 2px;
    background: linear-gradient(to bottom, #38bdf8 0%, #f97316 100%);
}
.fpe-gimbal-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 2px solid #38bdf8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    margin-left: -6px;
}
.fpe-gimbal-range::-moz-range-track {
    width: 4px; border-radius: 2px;
    background: linear-gradient(to bottom, #38bdf8 0%, #f97316 100%);
}
.fpe-gimbal-range::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 2px solid #38bdf8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── View Toggle Buttons ─────────────────────────────────────── */
/* Base styles shared between map-overlay and toolbar variants */
.fpe-view-toggles {
    display: flex; border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); flex-shrink: 0;
}
/* Toolbar-embedded variant — inline, no absolute positioning */
.fpe-view-toggles-tb {
    position: static; box-shadow: none;
    border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden;
}
.fpe-view-btn {
    padding: 0.38rem 0.7rem; background: #fff; border: 1px solid #e2e8f0;
    cursor: pointer; font-size: 0.78rem; font-weight: 600; color: #475569;
    transition: all 0.15s; border-left: none;
}
.fpe-view-btn:first-child { border-left: 1px solid #e2e8f0; border-radius: 8px 0 0 8px; }
.fpe-view-btn:last-child { border-radius: 0 8px 8px 0; }
.fpe-view-btn:hover { background: #f1f5f9; }
.fpe-view-btn.fpe-view-active { background: #0f172a; color: #fff; border-color: #0f172a; }

/* ── Click Hint ──────────────────────────────────────────────── */
/* ── Home point overlay ──────────────────────────────────────── */
.fpe-home-overlay {
    position: absolute; inset: 0; z-index: 25;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.35); backdrop-filter: blur(2px);
    cursor: crosshair;
}
.fpe-home-overlay-card {
    background: #fff; border-radius: 14px; padding: 1.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25); text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
    pointer-events: none;
}
.fpe-home-overlay-icon { font-size: 2.2rem; color: #16a34a; }
.fpe-home-overlay-card p { margin: 0; font-size: 0.95rem; color: #334155; }

/* Home waypoint marker */
.fpe-wp-home { background: #16a34a !important; }

.fpe-click-hint {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 20; background: rgba(15,23,42,0.85); color: #fff; padding: 0.5rem 1rem;
    border-radius: 20px; font-size: 0.82rem; display: flex; align-items: center;
    gap: 0.5rem; pointer-events: none; backdrop-filter: blur(4px);
}


/* ── Waypoints panel shared layout (used by .fpe-wp-card) ────── */
.fpe-wp-card .fpe-card-header { border-radius: 10px 10px 0 0; }

.fpe-wp-list { flex: 1; overflow-y: auto; padding: 0.5rem; }
.fpe-wp-empty {
    text-align: center; padding: 3rem 1rem; color: #94a3b8;
}
.fpe-wp-empty i { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.fpe-wp-empty p { font-size: 0.85rem; }

/* ── Waypoint Row ────────────────────────────────────────────── */
.fpe-wp-row {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem;
    border-radius: 8px; cursor: pointer; transition: background 0.1s;
    border: 1px solid transparent; margin-bottom: 2px;
}
.fpe-wp-row:hover { background: #f1f5f9; }
.fpe-wp-row.fpe-wp-selected { background: #eff6ff; border-color: #bfdbfe; }

.fpe-wp-num {
    width: 26px; height: 26px; border-radius: 50%; background: #3b82f6; color: #fff;
    font-size: 0.7rem; font-weight: 700; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; font-family: 'JetBrains Mono', monospace;
}
.fpe-wp-action-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.fpe-wp-info {
    flex: 1; display: flex; flex-direction: row; align-items: center; gap: 0.4rem; min-width: 0; overflow: hidden;
}
.fpe-wp-data {
    font-size: 0.72rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fpe-wp-del {
    width: 26px; height: 26px; border: none; background: transparent; color: #94a3b8;
    cursor: pointer; border-radius: 6px; display: flex; align-items: center;
    justify-content: center; transition: all 0.15s; flex-shrink: 0; padding: 0;
}
.fpe-wp-del svg { pointer-events: none; }
.fpe-wp-del:hover { background: #fef2f2; color: #ef4444; transform: scale(1.1); }

/* ── Waypoint Properties ─────────────────────────────────────── */
.fpe-wp-props {
    border-top: 1px solid #e2e8f0; padding: 0.5rem 0.75rem;
    background: #f8fafc; flex-shrink: 0;
}
.fpe-props-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.75rem;
}
.fpe-props-header span { font-weight: 600; font-size: 0.85rem; color: #0f172a; }
.fpe-props-close {
    width: 24px; height: 24px; border: none; background: transparent; color: #94a3b8;
    cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.fpe-props-close:hover { background: #e2e8f0; color: #475569; }

/* One-row layout: label text on the left, input on the right */
.fpe-props-body { display: flex; flex-direction: column; gap: 0.3rem; }
.fpe-props-body > label {
    display: flex; flex-direction: row; align-items: center;
    justify-content: space-between; gap: 0.5rem;
    font-size: 0.72rem; color: #64748b; font-weight: 500; white-space: nowrap;
}
.fpe-prop-input {
    margin-top: 0; padding: 0.22rem 0.4rem; border: 1px solid #e2e8f0;
    border-radius: 6px; font-size: 0.78rem; background: #fff;
    width: 108px; flex-shrink: 0; box-sizing: border-box;
}
.fpe-prop-input:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,0.1); }

/* Gimbal slider row — inlined on the same line as its label */
.fpe-gimbal-row { display: flex; align-items: center; gap: 0.35rem; width: 108px; flex-shrink: 0; }
.fpe-gimbal-row input[type=range] { flex: 1; min-width: 0; cursor: pointer; }
.fpe-gimbal-row span { font-size: 0.7rem; font-family: 'JetBrains Mono', monospace; color: #334155; min-width: 34px; text-align: right; }

/* ── HUD Bar (inside map card, always visible) ───────────────── */
.fpe-sim-bar {
    background: #282c34; border-top: 2px solid #1e293b; flex-shrink: 0;
    display: flex; flex-direction: column; border-radius: 0 0 10px 10px;
}
.fpe-hud-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; padding: 8px 16px 12px; overflow-x: auto;
}
/* Left: transport buttons stacked above time */
.fpe-hud-left {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 6px; flex-shrink: 0;
}
/* Center: instruments, truly centred in remaining space */
.fpe-hud-center {
    display: flex; align-items: center; justify-content: center;
    gap: 20px; flex: 1;
}
/* Right: speed gauge */
.fpe-hud-right {
    display: flex; align-items: center; flex-shrink: 0;
}

/* ── Playback Progress Bar ───────────────────────────────────── */
.fpe-progress-track {
    height: 3px; background: #1e293b; flex-shrink: 0; position: relative; width: 100%;
    cursor: pointer;
}
.fpe-progress-track:hover { height: 5px; }
.fpe-progress-fill {
    height: 100%; width: 0%; background: #f59e0b; transition: width 0.05s linear;
    border-radius: 0 2px 2px 0;
}

/* ── Transport Controls ──────────────────────────────────────── */
.fpe-transport { display: flex; gap: 0.25rem; }
.fpe-transport-btn {
    width: 34px; height: 34px; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
    background: rgba(255,255,255,0.08); color: #cbd5e1; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.15s; font-size: 0.82rem;
}
.fpe-transport-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
.fpe-play-btn { background: #22c55e !important; border-color: #16a34a !important; color: #fff !important; }
.fpe-play-btn:hover { background: #16a34a !important; }
.fpe-play-btn.fpe-playing { background: #f59e0b !important; border-color: #d97706 !important; }
.fpe-stop-btn { background: #ef4444 !important; border-color: #dc2626 !important; color: #fff !important; }
.fpe-stop-btn:hover { background: #dc2626 !important; }

/* ── Time Display ────────────────────────────────────────────── */
.fpe-time {
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
    color: rgba(255,255,255,0.7); white-space: nowrap; font-weight: 600;
}
.fpe-time-sep { margin: 0 0.2rem; color: rgba(255,255,255,0.4); }

/* ── Speed Gauge + Slower/Faster wrap ───────────────────────── */
.fpe-speed-wrap { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.fpe-speed-gauge { width: 150px; height: 100px; flex-shrink: 0; cursor: pointer; }
.fpe-speed-gauge svg { width: 100%; height: 100%; }

/* ── HUD Items ───────────────────────────────────────────────── */
.fpe-hud-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0;
}
.fpe-hud-label {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.6); font-weight: 600;
}

/* ── Sticks ──────────────────────────────────────────────────── */
.fpe-stick-bg {
    width: 70px; height: 70px; border-radius: 10px; background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.5); position: relative;
}
/* Crosshair lines */
.fpe-stick-bg::before, .fpe-stick-bg::after {
    content: ''; position: absolute; background: rgba(255,255,255,0.15);
}
.fpe-stick-bg::before { left: 50%; top: 0; width: 1px; height: 100%; }
.fpe-stick-bg::after  { top: 50%; left: 0; height: 1px; width: 100%; }
.fpe-stick-dot {
    width: 14px; height: 14px; border-radius: 50%;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    transition: top 0.08s linear, left 0.08s linear; z-index: 1;
}
.fpe-stick-dot-l { background: #f97316; box-shadow: 0 0 6px rgba(249,115,22,0.7); }
.fpe-stick-dot-r { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.7); }

/* ── Toast Notifications ─────────────────────────────────────── */
.fpe-toast {
    position: fixed; top: 72px; right: 16px; z-index: 9999;
    padding: 0.75rem 1.25rem; border-radius: 10px; font-size: 0.85rem;
    font-weight: 500; color: #fff; display: flex; align-items: center;
    gap: 0.5rem; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: fpeToastIn 0.3s ease-out;
}
.fpe-toast-success { background: #16a34a; }
.fpe-toast-error { background: #dc2626; }
.fpe-toast-info { background: #2563eb; }
.fpe-toast-out { animation: fpeToastOut 0.3s ease-in forwards; }

@keyframes fpeToastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fpeToastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ── Segment distance labels (midpoint of each route leg) ───── */
.fpe-seg-dist-wrap {
    position: relative; display: flex; align-items: center; justify-content: center;
    pointer-events: auto; cursor: pointer;
}
.fpe-seg-dist-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,0.9); border: 2px solid #3b82f6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.fpe-seg-dist-label {
    position: absolute; left: 50%; transform: translateX(-50%);
    top: -22px; white-space: nowrap;
    background: rgba(15,23,42,0.78); color: #fff;
    font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
    padding: 2px 6px; border-radius: 10px;
    pointer-events: none; backdrop-filter: blur(3px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ── Waypoint marker pulse ───────────────────────────────────── */
@keyframes fpePulse {
    0% { box-shadow: 0 0 0 0 rgba(59,130,246,0.6); }
    70% { box-shadow: 0 0 0 12px rgba(59,130,246,0); }
    100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}
.fpe-wp-marker-pulse { animation: fpePulse 0.8s ease-out; }

/* ── FLIK border snap indicator ──────────────────────────────── */
@keyframes fpeSnapPulse {
    0%   { stroke-opacity: 1;   r: 10; }
    100% { stroke-opacity: 0.3; r: 16; }
}
.fpe-snap-ring { animation: fpeSnapPulse 0.5s ease-out infinite alternate; }
@keyframes fpeClosePulse {
    0%   { stroke-opacity: 0.9; r: 12; }
    100% { stroke-opacity: 0.3; r: 18; }
}
.fpe-close-hint-ring { animation: fpeClosePulse 0.6s ease-in-out infinite alternate; }

/* ── Opacity control (collapsible) ──────────────────────────── */
.fpe-opacity-control { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fpe-opacity-toggle {
    background: rgba(15,23,42,0.82); color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.12); border-radius: 6px;
    width: 32px; height: 32px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: background 0.15s;
}
.fpe-opacity-toggle:hover, .fpe-opacity-toggle.fpe-opacity-active {
    background: rgba(59,130,246,0.7);
}
.fpe-opacity-panel {
    background: rgba(15,23,42,0.92); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 10px 12px; min-width: 200px;
    backdrop-filter: blur(6px); box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.fpe-opacity-row { margin-bottom: 8px; }
.fpe-opacity-row:last-child { margin-bottom: 0; }
.fpe-opacity-row label {
    display: block; font-size: 11px; color: #94a3b8; margin-bottom: 3px;
}
.fpe-opacity-row input[type=range] { width: 100%; cursor: pointer; }

/* ── Fawn-probability threshold slider (shared across all map pages) ── */
.fawn-prob-filter {
    display: flex; flex-direction: column; gap: 2px;
    background: rgba(15,23,42,0.92); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 8px 12px; min-width: 180px;
    backdrop-filter: blur(6px); box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.fawn-prob-filter label {
    font-size: 11px; color: #94a3b8; margin-bottom: 2px; white-space: nowrap;
}
.fawn-prob-filter input[type=range] { width: 100%; cursor: pointer; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(to right, #22c55e, #84cc16, #eab308, #f97316, #ef4444); outline: none; }
.fawn-prob-filter input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #475569; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.fawn-prob-filter input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #475569; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.fawn-prob-filter input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, #22c55e, #84cc16, #eab308, #f97316, #ef4444); }
.fawn-prob-filter .fawn-prob-labels {
    display: flex; justify-content: space-between;
    font-size: 9px; color: #64748b; margin-top: 1px; user-select: none;
}
.fawn-prob-filter .fawn-prob-value {
    font-size: 11px; color: #e2e8f0; font-weight: 600; text-align: center;
    margin-top: 2px;
}
/* Leaflet control wrapper */
.leaflet-control.fawn-prob-control { margin-bottom: 6px; }

/* bambi-map inline variant (inside layers panel, no background box) */
.bmap-prob-filter { padding: 4px 0 0 24px; }
.bmap-prob-filter input[type=range] { width: 100%; cursor: pointer; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(to right, #22c55e, #84cc16, #eab308, #f97316, #ef4444); outline: none; }
.bmap-prob-filter input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #475569; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.bmap-prob-filter input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #475569; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.bmap-prob-filter input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, #22c55e, #84cc16, #eab308, #f97316, #ef4444); }
.bmap-prob-filter .fawn-prob-labels {
    display: flex; justify-content: space-between;
    font-size: 9px; color: #64748b; margin-top: 1px; user-select: none;
}
.bmap-prob-filter .fawn-prob-value {
    font-size: 10px; color: var(--bmap-text, #e2e8f0); text-align: center; margin-top: 2px;
}

/* ── Terrain slope threshold slider (bambi-map inline) ── */
.bmap-slope-filter { padding: 4px 0 0 24px; }
.bmap-slope-filter input[type=range] { width: 100%; cursor: pointer; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(to right, #15803d, #22c55e, #84cc16, #a3e635, #eab308, #f59e0b, #f97316, #ef4444, #b91c1c); outline: none; }
.bmap-slope-filter input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #475569; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.bmap-slope-filter input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #475569; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.bmap-slope-filter input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, #15803d, #22c55e, #84cc16, #a3e635, #eab308, #f59e0b, #f97316, #ef4444, #b91c1c); }
.bmap-slope-filter .slope-labels {
    display: flex; justify-content: space-between;
    font-size: 9px; color: #64748b; margin-top: 1px; user-select: none;
}
.bmap-slope-filter .slope-value {
    font-size: 10px; color: var(--bmap-text, #e2e8f0); text-align: center; margin-top: 2px;
}

/* ── GPS position button ─────────────────────────────────────── */
.fpe-gps-btn {
    background: rgba(15,23,42,0.82); color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.12); border-radius: 6px;
    width: 32px; height: 32px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: background 0.15s, color 0.15s;
}
.fpe-gps-btn:hover        { background: rgba(37,99,235,0.6); }
.fpe-gps-btn.fpe-gps-active {
    background: rgba(37,99,235,0.85); color: #fff;
    animation: fpeGpsPulse 1.5s ease-in-out infinite;
}
.fpe-gps-btn.fpe-gps-error { background: rgba(220,38,38,0.8); color: #fff; animation: none; }
@keyframes fpeGpsPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(96,165,250,0.6); }
    50%       { box-shadow: 0 0 0 6px rgba(96,165,250,0); }
}
.fpe-gps-dot { animation: fpeGpsDotPulse 1.5s ease-in-out infinite; }
@keyframes fpeGpsDotPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* ── Coordinate display (bottom-center) ─────────────────────── */
.fpe-coords-display {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(15,23,42,0.78);
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.08);
}
/* ── Ratio scale (bottom-left) ───────────────────────────────── */
.fpe-ratio-scale {
    background: rgba(15,23,42,0.78);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ── Pilot Licence PDF ───────────────────────────────────────────────────── */
.licence-pdf-section  { margin-top: 16px; }
.licence-pdf-viewer   { width: 100%; height: 500px; border: 1px solid rgba(148,163,184,0.2); border-radius: var(--sbl-radius, 6px); display: block; }
.licence-pdf-actions  { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ── Licence upload form controls ── */
.sbl-field--row       { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sbl-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 1px solid #cbd5e1; border-radius: 6px;
    background: #fff; color: #334155; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.sbl-btn:hover        { background: #f1f5f9; border-color: #94a3b8; }
.sbl-btn--sm          { padding: 6px 12px; font-size: 0.78rem; }
.sbl-btn--primary     { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }
.sbl-btn--primary:hover { background: #7c3aed; border-color: #7c3aed; }
.sbl-btn--warn        { color: #d97706; border-color: #fbbf24; }
.sbl-btn--warn:hover  { background: #fffbeb; border-color: #d97706; }
.sbl-input[type="file"] {
    font-size: 0.82rem; color: #334155; padding: 6px 0;
}
.sbl-input[type="file"]::file-selector-button {
    padding: 7px 14px; border: 1px solid #cbd5e1; border-radius: 6px;
    background: #f8fafc; color: #334155; font-size: 0.8rem; font-weight: 600;
    cursor: pointer; margin-right: 10px; transition: all 0.15s;
}
.sbl-input[type="file"]::file-selector-button:hover {
    background: #e2e8f0; border-color: #94a3b8;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .fpe-wp-card { width: 270px; }
    .fpe-name-input { width: 140px; }
}
@media (max-width: 700px) {
    .fpe-main { flex-direction: column; padding: 8px; gap: 8px; }
    .fpe-wp-card { width: 100%; height: 240px; }
    .fpe-counters { gap: 6px; padding: 8px; }
    .fpe-counter { min-width: 90px; padding: 8px 10px; }
}

/* ── Map resize handle ───────────────────────────────────────────── */
.fpe-resize-handle {
    height: 10px; cursor: row-resize; display: flex; align-items: center;
    justify-content: center; background: transparent; flex-shrink: 0;
    margin: 0 12px; border-radius: 4px; transition: background 0.15s;
    user-select: none;
}
.fpe-resize-handle:hover,
body.fpe-resizing .fpe-resize-handle { background: #e2e8f0; }
.fpe-resize-grip {
    width: 40px; height: 4px; border-radius: 2px;
    background: #cbd5e1; pointer-events: none; transition: background 0.15s;
}
.fpe-resize-handle:hover .fpe-resize-grip,
body.fpe-resizing .fpe-resize-grip { background: #94a3b8; }
body.fpe-resizing { cursor: row-resize !important; user-select: none !important; }

/* ── Terrain Profile Panel ────────────────────────────────────────── */
.fpe-terrain-profile {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin: 0 12px 12px;
    overflow: hidden;
    flex-shrink: 0;
}
.fpe-terrain-body {
    padding: 10px 16px 12px;
}
.fpe-terrain-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-left: auto;
}
.fpe-terrain-chart-wrap {
    width: 100%;
    height: 110px;
    position: relative;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.fpe-terrain-svg {
    display: block;
    width: 100%;
    height: 100%;
}
.fpe-terrain-legend {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 0.71rem;
    color: #64748b;
    align-items: center;
}
.fpe-terrain-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.fpe-terrain-legend-item::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 3px;
    border-radius: 2px;
}
.fpe-terrain-legend-ground::before  { background: #92400e; }
.fpe-terrain-legend-flight::before  { background: #0ea5e9; border-top: 2px dashed #0ea5e9; height: 0; }
.fpe-terrain-legend-min             { color: #64748b; margin-left: auto; }

/* ── Cesium rotate / tilt nav overlay (uas-flight-detail + flightplan-editor) ── */
.cesium-nav-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 200;           /* above Cesium widgets (z=1), below HUDs (z=800) */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: auto;
    user-select: none;
}
.cesium-nav-compass {
    width: 40px;
    height: 40px;
    transition: transform 0.1s linear;  /* smooth needle rotation */
}
.cesium-nav-btns {
    display: grid;
    grid-template-columns: repeat(3, 30px);
    gap: 2px;
}
.cesium-nav-btn {
    width: 30px;
    height: 30px;
    background: rgba(20,20,30,0.80);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}
.cesium-nav-btn:hover  { background: rgba(245,158,11,0.75); color: #fff; border-color: rgba(245,158,11,0.4); }

/* =============================================================
   BAMBI MAP PAGE  (bambi-map.xhtml)
   Full-viewport dark tactical operational map.
   All classes use the bmap- prefix.
   ============================================================= */

/* --- Design tokens local to this page --- */
:root {
    --bmap-bg:            #0a0f1a;
    --bmap-panel-bg:      rgba(15, 20, 35, 0.82);
    --bmap-panel-blur:    blur(12px);
    --bmap-panel-border:  rgba(255, 255, 255, 0.08);
    --bmap-panel-shadow:  0 8px 32px rgba(0, 0, 0, 0.55);
    --bmap-accent:        #3b82f6;
    --bmap-accent-hover:  #60a5fa;
    --bmap-accent-glow:   rgba(59, 130, 246, 0.35);
    --bmap-green:         #22c55e;
    --bmap-red:           #ef4444;
    --bmap-amber:         #f59e0b;
    --bmap-text:          #e2e8f0;
    --bmap-text-dim:      #94a3b8;
    --bmap-text-faint:    #475569;
    --bmap-radius:        10px;
    --bmap-radius-sm:     7px;
    --bmap-topbar:        56px;   /* matches layout.xhtml topbar height */
    --bmap-toolbar-w:     44px;
    --bmap-ease:          0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Page-level overrides for full-screen map experience --- */
/* Suppress the layout's <main> padding and the footer when on this page.
   We target using a body data attribute set by the page or via a class
   added to <main> via JSF. The cleanest approach is to give the content
   div full height and remove overflow so the map can fill it. */
.content:has(#mapContainer) {
    padding: 0 !important;
    overflow: hidden;
    height: calc(100vh - var(--bmap-topbar));
    position: relative;
}

/* Suppress the footer when the map content is present */
.content:has(#mapContainer) ~ footer,
.content:has(#mapContainer) + footer {
    display: none;
}

/* --- Map wrapper --- */
.bmap-map-wrap {
    position: absolute;
    inset: 0;
    background: var(--bmap-bg);
}

#map {
    position: absolute;
    inset: 0;
    width:  100%;
    height: 100%;
}

/* Create mode: change cursor to crosshair */
.bmap-create-mode #map,
.bmap-create-mode .leaflet-container {
    cursor: crosshair !important;
}

/* --- Loading overlay --- */
.bmap-loading {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 26, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity var(--bmap-ease);
}

.bmap-loading--hidden {
    opacity: 0;
    pointer-events: none;
}

.bmap-spinner {
    width:  44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--bmap-green);
    border-radius: 50%;
    animation: bmapSpin 0.8s linear infinite;
}

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

.bmap-loading-text {
    color: var(--bmap-text-dim);
    margin-top: 14px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    font-family: var(--sbl-font-mono, monospace);
}

/* --- Error banner --- */
.bmap-error-banner {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bmap-red);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 2100;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--bmap-ease), transform var(--bmap-ease);
    white-space: nowrap;
}

.bmap-error-banner--visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* --- Create-mode indicator pill --- */
.bmap-create-indicator {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: linear-gradient(135deg, #166534, #15803d);
    color: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--bmap-ease), transform var(--bmap-ease);
    box-shadow: 0 4px 16px rgba(22, 101, 52, 0.5);
    white-space: nowrap;
    font-family: var(--sbl-font-mono, monospace);
}

.bmap-create-indicator--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Floating toolbar --- */
.bmap-toolbar {
    position: absolute;
    top: 88px;   /* below Leaflet zoom controls (~80px) */
    right: 12px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: var(--bmap-panel-bg);
    backdrop-filter: var(--bmap-panel-blur);
    -webkit-backdrop-filter: var(--bmap-panel-blur);
    border: 1px solid var(--bmap-panel-border);
    border-radius: var(--bmap-radius);
    padding: 6px;
    box-shadow: var(--bmap-panel-shadow);
}

.bmap-tb-btn {
    width:  34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--bmap-radius-sm);
    color: var(--bmap-text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--bmap-ease), color var(--bmap-ease), border-color var(--bmap-ease);
    flex-shrink: 0;
    padding: 0;
}

.bmap-tb-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: var(--bmap-text);
    border-color: var(--bmap-panel-border);
}

.bmap-tb-btn--active {
    background: var(--bmap-accent-glow);
    color: var(--bmap-accent-hover);
    border-color: rgba(59, 130, 246, 0.4);
}

.bmap-tb-btn--create {
    color: var(--bmap-green);
}

.bmap-tb-btn--create:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.35);
}

.bmap-tb-btn--danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--bmap-red);
    border-color: rgba(239, 68, 68, 0.35);
}

.bmap-tb-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 2D / 3D view toggle buttons */
.bmap-view-btn {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    width: 32px;
    min-width: 32px;
}
.bmap-view-btn--active {
    background: var(--sbl-primary);
    color: #fff;
    border-color: var(--sbl-primary);
}

.bmap-tb-divider {
    width: 22px;
    height: 1px;
    background: var(--bmap-panel-border);
    margin: 2px 0;
}

/* --- Overlay panels (shared base) --- */
.bmap-panel {
    position: absolute;
    top: 88px;
    right: 64px;  /* toolbar width (44px) + 8px gap + some breathing room — opens left of toolbar */
    z-index: 1100;
    min-width: 220px;
    max-width: 280px;
    background: var(--bmap-panel-bg);
    backdrop-filter: var(--bmap-panel-blur);
    -webkit-backdrop-filter: var(--bmap-panel-blur);
    border: 1px solid var(--bmap-panel-border);
    border-radius: var(--bmap-radius);
    box-shadow: var(--bmap-panel-shadow);
    color: var(--bmap-text);
    font-size: 0.82rem;
    /* closed state */
    opacity: 0;
    pointer-events: none;
    transform: translateX(-12px);
    transition: opacity var(--bmap-ease), transform var(--bmap-ease);
}

.bmap-panel--open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* Panel header */
.bmap-panel-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--bmap-panel-border);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bmap-text-dim);
}

.bmap-panel-hdr .pi {
    color: var(--bmap-accent);
    margin-right: 6px;
}

.bmap-panel-close {
    background: none;
    border: none;
    color: var(--bmap-text-faint);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color var(--bmap-ease), background var(--bmap-ease);
    display: flex;
    align-items: center;
}

.bmap-panel-close:hover {
    color: var(--bmap-text);
    background: rgba(255, 255, 255, 0.07);
}

/* Panel body */
.bmap-panel-body {
    padding: 10px 12px 12px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.bmap-panel-body::-webkit-scrollbar { width: 4px; }
.bmap-panel-body::-webkit-scrollbar-track { background: transparent; }
.bmap-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* --- Layer group label --- */
.bmap-layer-group-lbl {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bmap-accent);
    margin-bottom: 6px;
}

/* --- Radio rows (basemap switcher) --- */
.bmap-radio-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 5px;
    cursor: pointer;
    transition: background var(--bmap-ease);
    color: var(--bmap-text-dim);
    font-size: 0.8rem;
    line-height: 1.4;
    user-select: none;
}

.bmap-radio-row:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--bmap-text);
}

.bmap-radio-row input[type="radio"] {
    accent-color: var(--bmap-accent);
    flex-shrink: 0;
}

/* --- Checkbox rows (overlay toggles) --- */
.bmap-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 5px;
    cursor: pointer;
    transition: background var(--bmap-ease);
    color: var(--bmap-text-dim);
    font-size: 0.8rem;
    line-height: 1.4;
    user-select: none;
}

.bmap-check-row:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--bmap-text);
}

.bmap-check-row input[type="checkbox"] {
    accent-color: var(--bmap-accent);
    flex-shrink: 0;
}

/* --- Legend panel rows --- */
.bmap-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--bmap-text-dim);
}

.bmap-legend-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.bmap-legend-swatch {
    display: inline-block;
    width: 18px;
    height: 12px;
    border: 2px solid;
    flex-shrink: 0;
}

.bmap-legend-meta {
    font-size: 0.72rem;
    color: var(--bmap-text-faint);
}

.bmap-legend-stat {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--bmap-panel-border);
    font-size: 0.75rem;
    color: var(--bmap-text-faint);
    font-family: var(--sbl-font-mono, monospace);
}

.bmap-legend-stat strong {
    color: var(--bmap-accent-hover);
}

/* --- Opacity panel --- */
.bmap-opacity-row {
    margin-bottom: 10px;
}

.bmap-opacity-lbl {
    display: block;
    font-size: 0.75rem;
    color: var(--bmap-text-dim);
    margin-bottom: 4px;
}

.bmap-slider {
    width: 100%;
    cursor: pointer;
    accent-color: var(--bmap-accent);
}

/* --- Mission filter panel --- */
.bmap-panel--missions {
    max-height: calc(100vh - var(--bmap-topbar) - 100px);
    overflow-y: auto;
}

.bmap-panel--missions .bmap-panel-body {
    max-height: none;
}

.bmap-quick-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bmap-qf-btn {
    padding: 4px 10px;
    border-radius: var(--bmap-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: var(--bmap-text);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bmap-qf-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.bmap-qf-btn--active {
    background: var(--bmap-accent);
    border-color: var(--bmap-accent);
    color: #fff;
}

.bmap-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
}

.bmap-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    flex-shrink: 0;
    vertical-align: middle;
}

.bmap-status-bulk {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    padding-top: 4px;
}

.bmap-link-btn {
    background: none;
    border: none;
    color: var(--bmap-accent);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: underline;
    transition: color 0.15s;
}

.bmap-link-btn:hover {
    color: #93C5FD;
}

.bmap-date-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.bmap-date-custom input[type="date"] {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--bmap-radius-sm);
    color: var(--bmap-text);
    padding: 3px 6px;
    font-size: 0.72rem;
    flex: 1;
}

.bmap-date-custom span {
    color: var(--bmap-text-dim);
    font-size: 0.72rem;
}

.bmap-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--bmap-accent);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

#tbtnMissions {
    position: relative;
}

/* --- Toast notifications --- */
.bmap-toast-container {
    position: fixed;
    top: calc(var(--bmap-topbar) + 16px);
    right: 16px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.bmap-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--bmap-radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    animation: bmapToastIn 0.25s ease forwards;
    pointer-events: auto;
    color: #fff;
    border-left: 3px solid transparent;
}

.bmap-toast--success {
    background: rgba(15, 20, 35, 0.92);
    border-left-color: var(--bmap-green);
}

.bmap-toast--error {
    background: rgba(15, 20, 35, 0.92);
    border-left-color: var(--bmap-red);
}

.bmap-toast--info {
    background: rgba(15, 20, 35, 0.92);
    border-left-color: var(--bmap-accent);
}

.bmap-toast-close {
    background: none;
    border: none;
    color: var(--bmap-text-dim);
    cursor: pointer;
    padding: 0 0 0 6px;
    font-size: 1rem;
    opacity: 0.7;
    flex-shrink: 0;
    line-height: 1;
}

.bmap-toast-close:hover { opacity: 1; }

@keyframes bmapToastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes bmapToastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL APP TOAST SYSTEM
   Bridge: layout.xhtml hidden <p:messages> → JS MutationObserver → toasts
   Same visual language as bmap-toast but scoped globally with --sbl-* tokens.
   ═══════════════════════════════════════════════════════════════ */

/* Sink div always invisible regardless of PrimeFaces rendering */
#appToastSink {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Fixed container — stacks toasts top-right below topbar */
.app-toast-container {
    position: fixed;
    top: calc(56px + 16px);
    right: 16px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: 340px;
}

/* Individual toast — starts invisible/offset; animated by JS class */
.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--sbl-radius);
    font-size: 0.83rem;
    font-weight: 500;
    font-family: var(--sbl-font-sans);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.35);
    pointer-events: auto;
    color: #fff;
    border-left: 3px solid transparent;
    background: rgba(15, 20, 35, 0.92);
    opacity: 0;
    transform: translateX(40px);
    max-width: 100%;
    line-height: 1.45;
}

.app-toast--visible { animation: appToastIn  0.25s ease forwards; }
.app-toast--out     { animation: appToastOut 0.3s  ease forwards; }

.app-toast--info    { border-left-color: var(--sbl-blue);  }
.app-toast--warn    { border-left-color: var(--sbl-amber); }
.app-toast--error   { border-left-color: var(--sbl-red);   }
.app-toast--success { border-left-color: var(--sbl-green); }

.app-toast-text { flex: 1; word-break: break-word; }

.app-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0 0 0 4px;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color var(--sbl-ease-fast);
    margin-top: -1px;
}

.app-toast-close:hover { color: #fff; }

@keyframes appToastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0);    }
}

@keyframes appToastOut {
    from { opacity: 1; transform: translateX(0);    }
    to   { opacity: 0; transform: translateX(40px); }
}

@media (max-width: 768px) {
    .app-toast-container {
        right: 8px;
        left: 8px;
        width: auto;
        top: calc(56px + 8px);
    }
}

/* --- Mission creation modal --- */
.bmap-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 26, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3500;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--bmap-ease), visibility var(--bmap-ease);
}

.bmap-modal-overlay--visible {
    opacity: 1;
    visibility: visible;
}

.bmap-modal {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--bmap-radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.94) translateY(16px);
    transition: transform var(--bmap-ease);
}

.bmap-modal-overlay--visible .bmap-modal {
    transform: scale(1) translateY(0);
}

.bmap-modal-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--bmap-text);
    background: rgba(255, 255, 255, 0.03);
}

.bmap-modal-close {
    background: none;
    border: none;
    color: var(--bmap-text-faint);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--bmap-ease), background var(--bmap-ease);
}

.bmap-modal-close:hover {
    color: var(--bmap-text);
    background: rgba(255, 255, 255, 0.07);
}

.bmap-modal-body {
    padding: 18px;
    overflow-y: auto;
    max-height: 55vh;
}

.bmap-modal-ftr {
    padding: 12px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
}

/* --- Modal form elements --- */
.bmap-form-group {
    margin-bottom: 14px;
}

.bmap-form-lbl {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bmap-text-dim);
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.bmap-form-select {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--bmap-radius-sm);
    color: var(--bmap-text);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: auto;
}

.bmap-form-select:focus {
    outline: none;
    border-color: var(--bmap-accent);
    box-shadow: 0 0 0 3px var(--bmap-accent-glow);
}

.bmap-form-select option {
    background: #1e293b;
    color: var(--bmap-text);
}

.bmap-coords-preview {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--bmap-radius-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
}

.bmap-coords-lbl {
    font-size: 0.72rem;
    color: var(--bmap-text-faint);
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.bmap-coords-val {
    font-family: var(--sbl-font-mono, monospace);
    font-size: 0.88rem;
    color: var(--bmap-accent-hover);
    font-weight: 600;
}

.bmap-form-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--bmap-radius-sm);
    padding: 10px 12px;
    font-size: 0.78rem;
    color: #93c5fd;
    line-height: 1.5;
}

.bmap-form-hint .pi {
    color: var(--bmap-accent);
    flex-shrink: 0;
    margin-top: 1px;
}

/* --- Buttons --- */
.bmap-btn {
    padding: 8px 18px;
    border-radius: var(--bmap-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--bmap-ease), color var(--bmap-ease), border-color var(--bmap-ease);
    border: 1px solid transparent;
}

.bmap-btn--primary {
    background: var(--bmap-green);
    color: #fff;
    border-color: var(--bmap-green);
}

.bmap-btn--primary:hover:not(:disabled) {
    background: #16a34a;
}

.bmap-btn--primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bmap-btn--ghost {
    background: transparent;
    color: var(--bmap-text-dim);
    border-color: rgba(255, 255, 255, 0.12);
}

.bmap-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--bmap-text);
}

/* --- Leaflet popup dark theming --- */
.bmap-map-wrap .leaflet-popup-content-wrapper {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--bmap-radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    color: var(--bmap-text);
}

.bmap-map-wrap .leaflet-popup-tip {
    background: #111827;
}

.bmap-map-wrap .popup-header {
    border-radius: 6px 6px 0 0;
    padding: 8px 12px;
    margin: -12px -12px 8px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
}

.bmap-map-wrap .popup-content {
    padding: 12px;
    min-width: 190px;
}

.bmap-map-wrap .popup-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.bmap-map-wrap .popup-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bmap-text-faint);
    margin-right: 8px;
    flex-shrink: 0;
}

.bmap-map-wrap .popup-value {
    font-size: 0.82rem;
    color: var(--bmap-text);
    text-align: right;
    flex: 1;
    font-family: var(--sbl-font-mono, monospace);
}

/* --- Leaflet marker cluster overrides (dark) --- */
.bmap-map-wrap .marker-cluster-small  { background-color: rgba(34, 197, 94, 0.35); }
.bmap-map-wrap .marker-cluster-small div  { background-color: rgba(34, 197, 94, 0.75); color: #fff; }
.bmap-map-wrap .marker-cluster-medium { background-color: rgba(245, 158, 11, 0.35); }
.bmap-map-wrap .marker-cluster-medium div { background-color: rgba(245, 158, 11, 0.75); color: #fff; }
.bmap-map-wrap .marker-cluster-large  { background-color: rgba(239, 68, 68, 0.35); }
.bmap-map-wrap .marker-cluster-large div  { background-color: rgba(239, 68, 68, 0.75); color: #fff; }

/* --- Leaflet controls: dark override on this page --- */
.bmap-map-wrap .leaflet-bar {
    border-radius: var(--bmap-radius-sm);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.bmap-map-wrap .leaflet-bar a {
    background: #111827;
    color: var(--bmap-text-dim);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    transition: background var(--bmap-ease), color var(--bmap-ease);
}

.bmap-map-wrap .leaflet-bar a:hover {
    background: #1e293b;
    color: var(--bmap-text);
}

.bmap-map-wrap .leaflet-control-scale-line {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--bmap-text-dim);
    font-size: 0.7rem;
}

/* --- Dragging marker feedback --- */
.deer-icon.dragging {
    filter: drop-shadow(0 4px 12px rgba(34, 197, 94, 0.6));
    transform: scale(1.2);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .bmap-toolbar {
        top: auto;
        bottom: 48px;
        right: 8px;
        flex-direction: row;
        flex-wrap: wrap;
        max-width: calc(100vw - 16px);
    }

    .bmap-panel {
        top: auto;
        bottom: 110px;
        right: 8px;
        max-width: calc(100vw - 16px);
        min-width: 0;
        width: calc(100vw - 16px);
    }

    .bmap-toast-container {
        right: 8px;
        left: 8px;
    }

    .bmap-toast {
        max-width: 100%;
    }
}
.cesium-nav-btn:active { background: rgba(245,158,11,0.95); }

/* =============================================================
   MISSION WORKFLOW — Action buttons, ack badges, ETA panel,
   activity log notes, farmer portal, and status timeline.
   Added: v84/v85 mission status workflow feature.
   ============================================================= */

/* ── Workflow action button bar ──────────────────────────────── */
.md-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
}

.md-btn {
    padding: 8px 16px;
    border-radius: var(--sbl-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    transition: opacity 0.15s;
    font-family: var(--sbl-font-sans);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.md-btn:hover { opacity: 0.85; }
.md-btn--primary   { background: var(--sbl-blue);      color: #fff; }
.md-btn--success   { background: var(--sbl-green);     color: #fff; }
.md-btn--warn      { background: var(--sbl-amber);     color: #fff; }
.md-btn--danger    { background: var(--sbl-red);       color: #fff; }
.md-btn--secondary { background: var(--sbl-slate-600); color: #fff; }
.md-btn--sm        { padding: 5px 10px; font-size: 0.78rem; }

/* ── Crew acknowledgement badges ─────────────────────────────── */
.crew-ack-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
    vertical-align: middle;
}
.crew-ack-badge--acked   { background: var(--sbl-green-light); color: var(--sbl-green); }
.crew-ack-badge--pending { background: var(--sbl-amber-light); color: var(--sbl-amber-dark); }

/* ── Crew ETA panel ──────────────────────────────────────────── */
.crew-eta-list  { display: flex; flex-direction: column; gap: 8px; padding: 0.5rem 0; }
.crew-eta-item  { display: flex; align-items: center; gap: 12px; padding: 8px 12px;
                  background: var(--sbl-slate-50); border-radius: 6px; }
.crew-eta-name  { flex: 1; font-weight: 600; font-size: 0.88rem; }
.crew-eta-distance, .crew-eta-time { font-size: 0.82rem; color: var(--sbl-slate-600); min-width: 60px; }
.crew-eta-nav   { margin-left: auto; color: var(--sbl-blue); font-size: 0.82rem;
                  text-decoration: none; white-space: nowrap; }
.crew-eta-nav:hover { text-decoration: underline; }
.crew-eta-empty,
.crew-eta-error { color: var(--sbl-slate-400); font-style: italic; padding: 8px; margin: 0; }

/* ── Mission Detail Crew Map ─────────────────────────────────── */
.md-crew-map {
    height: 420px;
    width: 100%;
    border-bottom: 1px solid var(--sbl-slate-200, #e2e8f0);
}
.md-crew-map .leaflet-pane { z-index: 1; }
.md-crew-map .leaflet-control { z-index: 2; }
.md-crew-popup-name { font-weight: 600; font-size: 0.88rem; }
.md-crew-popup-info { font-size: 0.8rem; color: #64748b; margin-top: 2px; }
.md-crew-marker, .md-centroid-marker { background: none; border: none; }

/* ── RV (Rendez-Vous) marker pin ─────────────────────────────── */
.rv-marker-pin-wrapper { background: none !important; border: none !important; }
.rv-marker-pin {
    width: 40px; height: 40px;
    background: #7c3aed; border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex; align-items: center; justify-content: center;
    border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}
.rv-marker-pin span {
    transform: rotate(45deg);
    color: #fff; font-weight: 700; font-size: 14px;
    line-height: 1;
}

/* RV address bar (mission-create map panel) */
.rv-address-bar {
    padding: 6px 12px;
    background: var(--sbl-slate-50, #f8fafc);
    border-bottom: 1px solid var(--sbl-slate-200, #e2e8f0);
    font-size: 0.82rem;
    color: var(--sbl-slate-700, #334155);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rv-address-bar::before {
    content: '\e92c'; /* pi-map-marker */
    font-family: 'primeicons';
    margin-right: 6px;
    color: #dc2626;
}

/* RV address in mission-detail */
.rv-address-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--sbl-slate-50, #f8fafc);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}
.rv-address-detail .pi-map-marker { color: #dc2626; }
.rv-address-label { font-weight: 600; color: var(--sbl-slate-600, #475569); white-space: nowrap; }
.rv-address-text { color: var(--sbl-slate-700, #334155); }

/* ── Time grid collapse animation ────────────────────────────── */
.mc-time-card .mc-time-grid {
    max-height: 600px;
    transition: max-height 0.3s ease;
    overflow: hidden;
}
.mc-time-collapsed .mc-time-grid {
    max-height: 0;
}
.mc-time-change-btn {
    display: none;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--sbl-blue-500, #3b82f6);
    background: none;
    border: none;
    padding: 0;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.mc-time-collapsed .mc-time-change-btn {
    display: inline-flex;
}

/* ── FLIK Map / List tabs ──────────────────────────────────────── */
.mc-flik-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--sbl-slate-200, #e2e8f0);
}
.mc-flik-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sbl-slate-400, #94a3b8);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.mc-flik-tab:hover {
    color: var(--sbl-slate-600, #475569);
}
.mc-flik-tab--active {
    color: var(--sbl-blue-600, #2563eb);
    border-bottom-color: var(--sbl-blue-600, #2563eb);
}
.mc-flik-tab .pi {
    font-size: 0.9rem;
}
.mc-flik-tab-count {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--sbl-slate-400, #94a3b8);
    font-weight: 500;
}

/* ── Map mode toggle group (Parcels / RV Pin) ────────────────── */
.mc-map-mode-group {
    display: inline-flex;
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.2rem;
    background: var(--sbl-slate-100, #f1f5f9);
    border-radius: 999px;
}
.mc-map-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sbl-slate-500, #64748b);
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.mc-map-mode-btn:hover {
    color: var(--sbl-slate-700, #334155);
    background: var(--sbl-white, #ffffff);
}
.mc-map-mode-btn--active {
    background: var(--sbl-navy, #0f172a);
    color: var(--sbl-white, #ffffff);
    border-color: var(--sbl-navy, #0f172a);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}
.mc-map-mode-btn--active:hover {
    background: var(--sbl-slate-800, #1e293b);
    color: var(--sbl-white, #ffffff);
}
/* Icon colours per mode */
.mc-map-mode-btn--parcel .pi { color: #d4a017; }
.mc-map-mode-btn--parcel.mc-map-mode-btn--active .pi { color: #facc15; }
.mc-map-mode-btn--rv .pi { color: #7c3aed; }
.mc-map-mode-btn--rv.mc-map-mode-btn--active .pi { color: #c4b5fd; }
.mc-rv-cursor { cursor: crosshair !important; }
.mc-rv-cursor .leaflet-container { cursor: crosshair !important; }
.mc-rv-help-active {
    color: var(--sbl-red-600, #dc2626) !important;
    font-weight: 500;
}

/* ── Notes / Activity Log ────────────────────────────────────── */
.notes-list  { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px;
               max-height: 400px; overflow-y: auto; }
.note-item   { padding: 8px 12px; border-radius: 6px; }
.note-item--system { background: var(--sbl-slate-100);
                     border-left: 3px solid var(--sbl-slate-400); }
.note-item--manual { background: var(--sbl-white);
                     border: 1px solid var(--sbl-slate-200);
                     border-left: 3px solid var(--sbl-blue); }
.note-header { display: flex; justify-content: space-between;
               font-size: 0.78rem; color: var(--sbl-slate-500); margin-bottom: 4px; }
.note-author { font-weight: 600; }
.note-time   { color: var(--sbl-slate-400); }
.note-body   { font-size: 0.85rem; color: var(--sbl-slate-700);
               white-space: pre-wrap; margin: 0; }
.notes-empty { color: var(--sbl-slate-400); font-style: italic; padding: 8px 0; margin: 0; }

/* ── Farmer portal ───────────────────────────────────────────── */
.farmer-hero {
    padding: 20px 0 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.farmer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sbl-navy);
    margin: 0;
}
.farmer-parcel-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.farmer-parcel-list li {
    background: var(--sbl-slate-100);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-family: var(--sbl-font-mono);
}

/* ── Status timeline (farmer portal) ────────────────────────── */
.status-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}
.timeline-step::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 24px;
    bottom: -8px;
    width: 2px;
    background: var(--sbl-slate-200);
}
.timeline-step:last-child::before { display: none; }

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}
.timeline-step--past   .timeline-dot { background: var(--sbl-green); }
.timeline-step--active .timeline-dot { background: var(--sbl-blue);
                                        box-shadow: 0 0 0 4px rgba(37,99,235,0.18); }
.timeline-step--future .timeline-dot { background: var(--sbl-slate-300); }

.timeline-content { display: flex; flex-direction: column; }
.timeline-label   { font-weight: 600; font-size: 0.88rem; }
.timeline-step--past   .timeline-label { color: var(--sbl-slate-600); }
.timeline-step--active .timeline-label { color: var(--sbl-blue); }
.timeline-step--future .timeline-label { color: var(--sbl-slate-400); }
.timeline-time { font-size: 0.75rem; color: var(--sbl-slate-500); margin-top: 2px; }

/* ── Address block (shared fragment bb-address) ──────────────────────────── */
.bb-address {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.bb-address__icon {
    color: var(--primary-color, #4a90d9);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.bb-address__lines {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.4;
}

.bb-address__line {
    display: block;
}

/* Used when the address is rendered as a single h:outputText with white-space: pre-line */
.bb-address__text {
    white-space: pre-line;
    line-height: 1.5;
}

/* ========================================
   Dashboard Redesign - Section Layout
   ======================================== */

.dash-hero {
    background: linear-gradient(135deg, #1a5f2e 0%, #2d8a47 50%, #1a5f2e 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dash-hero-title {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}

.dash-hero-stat {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.dash-hero-sub {
    font-size: 0.85rem;
    opacity: 0.75;
    margin-top: 0.25rem;
}

.dash-hero-progress {
    flex: 1 1 300px;
}

.dash-hero-progress-bar-bg {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    height: 8px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.dash-hero-progress-bar-fill {
    background: rgba(255,255,255,0.85);
    height: 100%;
    border-radius: 4px;
    transition: width 1.2s ease;
}

.dash-section {
    margin-bottom: 2.5rem;
}

.dash-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.dash-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.dash-section-icon {
    font-size: 1.1rem;
    color: #4a9e6f;
}

.dash-kpi-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.dash-kpi {
    flex: 1 1 160px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    min-width: 140px;
}

.dash-kpi-label {
    font-size: 0.78rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.dash-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.dash-kpi-sub {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.25rem;
}

.dash-charts-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.dash-chart-card {
    flex: 1 1 300px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    min-width: 260px;
}

.dash-chart-card-full {
    flex: 1 1 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
}

.dash-chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-availability-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    flex: 0 0 280px;
}

.dash-avail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f7fafc;
    font-size: 0.9rem;
}

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

.dash-avail-badge {
    font-weight: 600;
    font-size: 1.05rem;
}

.dash-weather-chips {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dash-weather-chip {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: #2b6cb0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-coverage-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    flex: 0 0 280px;
}

.dash-coverage-pct {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.dash-coverage-bar-bg {
    background: #e2e8f0;
    border-radius: 4px;
    height: 8px;
    margin: 0.75rem 0;
    overflow: hidden;
}

.dash-coverage-bar-fill {
    background: #4a9e6f;
    height: 100%;
    border-radius: 4px;
}

.dash-hotspot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dash-hotspot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f7fafc;
    font-size: 0.85rem;
}

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

.dash-hotspot-count {
    background: #f0fff4;
    color: #276749;
    border-radius: 10px;
    padding: 0.1rem 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .dash-kpi { flex: 1 1 140px; }
    .dash-chart-card { flex: 1 1 100%; }
    .dash-hero { flex-direction: column; }
    .dash-hero-stat { font-size: 2rem; }
}

/* ── Address Map Preview ──────────────────────────────────────────────── */
.pp-address-map-preview {
    display: none;
    height: 180px;
    margin-top: 8px;
    border: 1px solid var(--surface-border, #dee2e6);
    border-radius: 6px;
    z-index: 0;
}

/* ── Clickable row navigation ─────────────────────────────────── */
.bambi-row-nav.ui-datatable tbody tr:hover td,
.bambi-row-nav.ui-datatable tbody tr:hover th {
    background-color: #eff6ff !important;
    cursor: pointer;
}
.bambi-row-nav.ui-datatable tbody tr:active td {
    background-color: #dbeafe !important;
}
