/* ===== FieldOps Manager — Deep Slate + Cobalt Theme ===== */

:root {
    --bg: hsl(222 47% 11%);
    --bg-card: hsl(222 47% 7%);
    --bg-card-50: hsla(222,47%,7%,0.5);
    --fg: hsl(210 40% 98%);
    --fg-card: hsl(210 40% 96%);
    --fg-muted: hsl(217 19% 56%);

    --primary: hsl(217 91% 60%);
    --primary-fg: hsl(210 40% 98%);
    --primary-10: hsla(217,91%,60%,0.1);

    --secondary: hsl(217 33% 17%);
    --secondary-fg: hsl(210 40% 96%);

    --muted: hsl(215 28% 17%);
    --muted-fg: hsl(217 19% 56%);

    --border: hsl(217 33% 20%);
    --input-bg: hsl(217 33% 15%);
    --ring: hsl(217 91% 60%);

    --destructive: hsl(0 84% 60%);

    --sidebar-bg: hsl(222 47% 9%);
    --sidebar-fg: hsl(217 19% 66%);
    --sidebar-border: hsl(217 33% 15%);
    --sidebar-hover: hsl(217 33% 17%);
    --sidebar-active-bg: hsl(217 91% 60%);

    --status-scheduled: hsl(217 91% 60%);
    --status-in-progress: hsl(43 96% 56%);
    --status-completed: hsl(142 76% 36%);
    --status-at-risk: hsl(25 95% 53%);
    --status-overdue: hsl(0 84% 60%);
    --status-cancelled: hsl(215 16% 47%);

    --radius: 6px;
    --radius-lg: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

    --sidebar-width: 260px;
    --topbar-h: 56px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    height: 100%;
    overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ===== Layout ===== */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform 0.25s ease;
}
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 99;
}
.main-content {
    margin-left: var(--sidebar-width);
    height: 100vh; display: flex; flex-direction: column;
}

@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; }
}

/* ===== Sidebar ===== */
.sidebar-header {
    padding: 16px; border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
}
.logo-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--primary); display: flex;
    align-items: center; justify-content: center;
    color: var(--primary-fg);
}
.logo-icon svg { width: 18px; height: 18px; }
.logo-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.logo-subtitle {
    font-size: 10px; font-family: var(--font-mono);
    letter-spacing: 0.15em; color: var(--muted-fg);
}
.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 8px;
}
.nav-group { margin-bottom: 8px; }
.nav-group-label {
    font-size: 10px; font-family: var(--font-mono);
    text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--muted-fg); padding: 10px 12px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius);
    font-size: 13px; color: var(--sidebar-fg);
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--fg); }
.nav-item.active {
    background: var(--primary-10);
    color: var(--primary);
    font-weight: 500;
}
.nav-item svg { flex-shrink: 0; }
.nav-badge {
    margin-left: auto; font-size: 10px; padding: 2px 7px;
    border-radius: 10px; font-weight: 600;
}
.badge-danger { background: var(--destructive); color: #fff; }
.badge-accent { background: var(--primary); color: var(--primary-fg); }
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border); padding: 8px;
}

/* ===== Top bar ===== */
.top-bar {
    height: var(--topbar-h); flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    padding: 0 16px; background: var(--bg);
}
.sidebar-toggle { display: none; padding: 4px; }
.sidebar-toggle svg { width: 22px; height: 22px; }
@media (max-width: 1023px) { .sidebar-toggle { display: block; } }
.top-bar-title { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.top-bar-name { font-weight: 600; }
.top-bar-sep { color: var(--muted-fg); }
.top-bar-sub { color: var(--muted-fg); }

/* ===== Page content ===== */
.page-content {
    flex: 1; overflow-y: auto; padding: 24px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card-50);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }

/* ===== KPI stat cards ===== */
.stats-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.stat-card { padding: 16px 20px; }
.stat-label {
    font-size: 10px; font-family: var(--font-mono);
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--muted-fg); margin-bottom: 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.stat-label svg { width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 500; }
.stat-sub { font-size: 12px; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.stat-sub.up { color: var(--status-completed); }
.stat-sub.down { color: var(--status-overdue); }

/* ===== Page header ===== */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 22px; font-weight: 600; }
.page-subtitle { font-size: 13px; color: var(--muted-fg); margin-top: 2px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    font-size: 13px; font-weight: 500;
    transition: background 0.15s, opacity 0.15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { opacity: 0.9; }
.btn-outline {
    border: 1px solid var(--border); background: transparent;
    color: var(--fg);
}
.btn-outline:hover { background: var(--secondary); }
.btn-destructive { background: var(--destructive); color: #fff; }
.btn-secondary { background: var(--secondary); color: var(--secondary-fg); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--secondary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; justify-content: flex-start; }

/* ===== Badges ===== */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-outline {
    background: transparent; border: 1px solid var(--border);
    color: var(--fg-card); text-transform: none; font-weight: 500;
}
.badge-scheduled { background: var(--status-scheduled); color: #fff; }
.badge-in-progress { background: var(--status-in-progress); color: #fff; }
.badge-completed { background: var(--status-completed); color: #fff; }
.badge-at-risk { background: var(--status-at-risk); color: #fff; }
.badge-overdue { background: var(--status-overdue); color: #fff; }
.badge-cancelled { background: var(--status-cancelled); color: #fff; }
.badge-warning { background: var(--status-in-progress); color: #fff; }
.badge-muted { background: var(--muted); color: var(--muted-fg); }
.badge-critical { background: var(--status-overdue); color: #fff; }
.badge-high { background: var(--status-at-risk); color: #fff; }
.badge-medium { background: var(--status-in-progress); color: #fff; }
.badge-low { background: var(--status-scheduled); color: #fff; }
.badge-active { background: var(--status-completed); color: #fff; }
.badge-prospect { background: var(--status-in-progress); color: #fff; }
.badge-away { background: var(--status-in-progress); color: #fff; }
.badge-offline { background: var(--muted); color: var(--muted-fg); }
.badge-secondary { background: var(--secondary); color: var(--secondary-fg); text-transform: none; }

/* ===== Inputs ===== */
.input-wrap {
    position: relative; flex: 1;
}
.input-wrap svg {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); width: 16px; height: 16px;
    color: var(--muted-fg); pointer-events: none;
}
.input {
    width: 100%; padding: 8px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--input-bg);
    font-size: 13px; outline: none; color: var(--fg);
    transition: border-color 0.15s;
}
.input:focus { border-color: var(--ring); }
.input-icon { padding-left: 36px; }
.select {
    padding: 7px 30px 7px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--input-bg);
    font-size: 13px; color: var(--fg); outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.select:focus { border-color: var(--ring); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table th {
    font-size: 10px; font-family: var(--font-mono);
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--muted-fg); font-weight: 500;
    text-align: left; padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table td {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-size: 13px; vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: hsla(217,33%,17%,0.3); }
.cell-main { font-weight: 500; }
.cell-sub {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--muted-fg); margin-top: 3px;
}
.cell-sub svg { width: 12px; height: 12px; }

/* ===== Avatars ===== */
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary-10); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; flex-shrink: 0;
}

/* ===== Tabs ===== */
.tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
    padding: 10px 16px; font-size: 13px; font-weight: 500;
    color: var(--muted-fg); border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    cursor: pointer;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Two-col grid ===== */
.split-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; flex: 1; min-height: 0; }
@media (max-width: 1023px) { .split-grid { grid-template-columns: 1fr; } }

/* ===== Progress bars ===== */
.progress-track {
    height: 8px; border-radius: 4px; background: var(--muted); overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 4px; transition: width 0.4s ease;
}
.progress-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; margin-bottom: 4px;
}
.progress-row .label { color: var(--muted-fg); }
.progress-row .value { font-weight: 500; }
.progress-item { margin-bottom: 14px; }

/* ===== Kanban Board ===== */
.kanban {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    gap: 12px; overflow-x: auto; padding-bottom: 12px;
    height: 100%;
}
.kanban-col {
    background: var(--muted); border-radius: var(--radius-lg);
    display: flex; flex-direction: column; min-height: 0;
}
.kanban-col-header {
    padding: 12px 14px; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.kanban-col-count {
    font-size: 11px; font-weight: 400; color: var(--muted-fg);
    background: var(--bg-card); padding: 2px 8px; border-radius: 10px;
}
.kanban-col-body {
    flex: 1; overflow-y: auto; padding: 10px;
    display: flex; flex-direction: column; gap: 8px;
}
.kanban-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px;
    cursor: grab; transition: box-shadow 0.15s;
}
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.kanban-card-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.kanban-card-sub { font-size: 11px; color: var(--muted-fg); margin-bottom: 8px; }
.kanban-card-meta {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; color: var(--muted-fg);
}
.kanban-card-meta svg { width: 12px; height: 12px; }
.kanban-card-row { display: flex; align-items: center; gap: 4px; }

/* ===== Meeting / At-risk cards ===== */
.risk-card {
    border-width: 2px;
}
.risk-card .card-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.risk-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.risk-icon svg { width: 20px; height: 20px; }
.risk-title { font-size: 17px; font-weight: 600; }
.risk-subtitle { font-size: 13px; color: var(--muted-fg); margin-top: 2px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 767px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-section-label {
    font-size: 10px; font-family: var(--font-mono);
    text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--muted-fg); margin-bottom: 10px;
}
.detail-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; margin-bottom: 8px;
}
.detail-row svg { width: 16px; height: 16px; color: var(--muted-fg); flex-shrink: 0; }
.detail-row .label { color: var(--muted-fg); }
.detail-row .val { font-weight: 500; }
.detail-kv {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; margin-bottom: 8px;
}
.detail-kv .label { color: var(--muted-fg); }
.detail-kv .val { font-weight: 500; }
.separator {
    border: none; border-top: 1px solid var(--border); margin: 14px 0;
}
.notes-box {
    background: var(--muted); border-radius: var(--radius);
    padding: 12px; font-size: 13px; color: var(--muted-fg);
}
.actions-stack { display: flex; flex-direction: column; gap: 8px; }

/* ===== Timer card (My Time) ===== */
.timer-value {
    font-size: 38px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.timer-label { font-size: 12px; color: var(--muted-fg); margin-bottom: 4px; }
.timer-task { font-size: 13px; font-weight: 500; }
.three-col { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .three-col { grid-template-columns: 1fr; } }
.hours-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; margin-bottom: 6px;
}
.hours-row .label { color: var(--muted-fg); }
.hours-row .val { font-weight: 500; width: 50px; text-align: right; }
.mini-progress {
    width: 80px; height: 4px; background: var(--muted); border-radius: 2px;
    overflow: hidden; margin: 0 8px;
}
.mini-progress-fill { height: 100%; background: var(--primary); border-radius: 2px; }

/* ===== Calendar simple grid ===== */
.cal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month { font-size: 16px; font-weight: 600; }
.cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.cal-day-header {
    text-align: center; font-size: 11px; font-family: var(--font-mono);
    text-transform: uppercase; color: var(--muted-fg); padding: 8px 0;
}
.cal-day {
    min-height: 80px; padding: 6px; border-radius: var(--radius);
    border: 1px solid var(--border); font-size: 12px;
    background: var(--bg-card); position: relative;
}
.cal-day.other-month { opacity: 0.3; }
.cal-day.today { border-color: var(--primary); }
.cal-day-num { font-weight: 500; margin-bottom: 4px; }
.cal-event {
    font-size: 10px; padding: 2px 4px; border-radius: 3px;
    margin-bottom: 2px; color: #fff; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}

/* ===== Map legend ===== */
.legend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    font-size: 12px;
}
.legend-label {
    font-family: var(--font-mono); text-transform: uppercase;
    letter-spacing: 0.1em; font-size: 10px; color: var(--muted-fg);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ===== Map placeholder ===== */
.map-placeholder {
    height: 100%; min-height: 400px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--muted-fg); gap: 8px;
}
.map-placeholder svg { width: 48px; height: 48px; opacity: 0.3; }

/* Map container with Leaflet */
.map-container { height: 100%; min-height: 400px; border-radius: var(--radius-lg); overflow: hidden; }
.map-container .leaflet-container { height: 100%; width: 100%; }

/* ===== Performer list ===== */
.performer-row {
    display: flex; align-items: center; gap: 14px; padding: 10px 0;
}
.performer-rank {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary-10); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.performer-info { flex: 1; }
.performer-name { font-weight: 500; font-size: 14px; }
.performer-meta {
    font-size: 12px; color: var(--muted-fg); margin-top: 2px;
    display: flex; gap: 8px;
}

/* ===== Filter bar ===== */
.filter-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

/* ===== Empty state ===== */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 48px 24px; text-align: center; gap: 8px;
}
.empty-icon {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
}
.empty-title { font-size: 18px; font-weight: 600; }
.empty-sub { font-size: 13px; color: var(--muted-fg); }

/* ===== Utilities ===== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-4 { margin-top: 4px; }
.ml-auto { margin-left: auto; }
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.text-muted { color: var(--muted-fg); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.w-full { width: 100%; }
.flex-1 { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.col-span-2 { grid-column: span 2; }
.space-y-8 > * + * { margin-top: 8px; }
.space-y-12 > * + * { margin-top: 12px; }
.space-y-16 > * + * { margin-top: 16px; }
.overflow-hidden { overflow: hidden; }
.flex-col { flex-direction: column; }
.min-h-0 { min-height: 0; }

/* ===== Map popup styles (Leaflet overrides) ===== */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--fg) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}
.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
}
.leaflet-popup-content { margin: 12px 14px !important; font-family: var(--font) !important; font-size: 13px !important; }
.popup-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.popup-sub { font-size: 12px; color: var(--muted-fg); }
.popup-row { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 6px; }
.popup-row svg { width: 14px; height: 14px; color: var(--muted-fg); }

/* Dark tiles for Leaflet */
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.1) saturate(0.3); }

/* ===== Modal ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); z-index: 200;
    backdrop-filter: blur(2px);
}
.modal-overlay.open { display: block; }
.modal-container {
    display: none; position: fixed;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 90%; max-width: 560px; max-height: 85vh;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); z-index: 201;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    overflow: hidden; display: none; flex-direction: column;
}
.modal-container.open { display: flex; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s; cursor: pointer; color: var(--muted-fg);
}
.modal-close:hover { background: var(--secondary); color: var(--fg); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid var(--border);
}
.confirm-dialog { max-width: 400px; }
.confirm-dialog .modal-body p { font-size: 14px; color: var(--muted-fg); }

/* ===== Form fields (global — works in modals AND pages) ===== */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; font-size: 12px; font-weight: 500; margin-bottom: 6px;
    color: var(--muted-fg); text-transform: uppercase; letter-spacing: .04em;
}
.form-input {
    width: 100%; padding: 10px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--input-bg);
    font-size: 13px; color: var(--fg); outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px hsla(217,91%,60%,.12); }
.form-input::placeholder { color: var(--muted-fg); }
select.form-input {
    appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
textarea.form-input { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-submit { margin-top: 20px; }

/* ===== Sidebar user ===== */
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-top: 1px solid var(--sidebar-border); margin-top: 4px;
}

/* ===== Toast ===== */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--status-completed); color: #fff;
    padding: 12px 20px; border-radius: var(--radius);
    font-size: 13px; font-weight: 500; z-index: 300;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }

/* ===== Action buttons in tables ===== */
.action-btns { display: flex; gap: 4px; }
.action-btn {
    width: 30px; height: 30px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s; color: var(--muted-fg);
}
.action-btn:hover { background: var(--secondary); color: var(--fg); }
.action-btn.danger:hover { background: hsla(0,84%,60%,.15); color: var(--destructive); }
.action-btn svg { width: 15px; height: 15px; }

/* ===== Date input icon + white text fixes ===== */
input[type="date"].form-input {
    color: var(--fg);
    position: relative;
}
input[type="date"].form-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}
input[type="date"].form-input::-webkit-datetime-edit {
    color: var(--fg);
}
/* Ensure all form text is visible */
.form-input, select.form-input, textarea.form-input {
    color: var(--fg);
}
option {
    background: var(--bg-card);
    color: var(--fg);
}
/* Kanban card text always white */
.kanban-card-title { color: var(--fg); }
.kanban-card-meta span { color: var(--fg); }
/* Calendar day numbers */
.cal-day-num { color: var(--fg); }
/* Table text */
table td, table th { color: var(--fg); }
.cell-main { color: var(--fg); }
