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

/* MDM Staff — dark "Crew Ops" theme (charcoal + orange) */

:root {
    color-scheme: dark !important;
    --mdm-bg: #191b1f;
    --mdm-bg2: #1d2025;
    --mdm-surface: #23262c;
    --mdm-surface2: #2a2e35;
    --mdm-ink: #eceef1;
    --mdm-muted: #9aa2ae;
    --mdm-soft: #6f7784;
    --mdm-line: #33373f;
    --mdm-line-soft: #2a2e35;
    --mdm-acc: #ff6a2b;
    --mdm-acc2: #ff9455;
    --mdm-accdim: rgba(255, 106, 43, .14);
    --mdm-blue: #57a6ff;
    --mdm-green: #3ecf8e;
    --mdm-amber: #f6b53f;
    --mdm-red: #f2686a;
    --mdm-shadow: rgba(0, 0, 0, .28) 0 1px 0 0 inset, rgba(0, 0, 0, .5) 0 14px 34px -20px, rgba(255, 255, 255, .03) 0 0 0 1px;

    --bg: var(--mdm-bg) !important;
    --panel: var(--mdm-surface) !important;
    --panel-strong: var(--mdm-surface2) !important;
    --text: var(--mdm-ink) !important;
    --muted: var(--mdm-muted) !important;
    --line: var(--mdm-line) !important;
    --cyan: var(--mdm-acc) !important;
    --blue: var(--mdm-acc) !important;
    --green: var(--mdm-green) !important;
    --danger: var(--mdm-red) !important;
}

html, body {
    background: var(--mdm-bg) !important;
    color: var(--mdm-ink) !important;
    font-family: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-feature-settings: "liga" !important;
    -webkit-font-smoothing: antialiased;
}

body::before, body::after { display: none !important; }

a { color: inherit; }

.wrap, .container, main.wrap {
    width: min(1180px, calc(100% - 36px)) !important;
}

.topbar, header.topbar, .header, .nav, .footer {
    background: rgba(25, 27, 31, .92) !important;
    color: var(--mdm-ink) !important;
    border-color: var(--mdm-line) !important;
    box-shadow: none !important;
    backdrop-filter: blur(14px);
}

.brand strong, .brand b, .brand-mark strong, .logo-text, h1, h2, h3, h4 {
    color: var(--mdm-ink) !important;
    font-family: 'Geist', system-ui, sans-serif !important;
}

h1 { font-weight: 700 !important; letter-spacing: -2px !important; line-height: 1.04 !important; }
h2 { font-weight: 700 !important; letter-spacing: -.9px !important; }
h3 { letter-spacing: -.4px !important; }

p, .intro, .sub, .meta, .accepted-meta, .punch-meta, .section-head p, .footer, .nav-actions, small {
    color: var(--mdm-muted) !important;
}

.eyebrow, .label, .nav-title, .kicker {
    color: var(--mdm-acc2) !important;
    font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace !important;
    font-weight: 600 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase;
}

label {
    color: var(--mdm-ink) !important;
    font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.panel, .card, .box, .content-card, .shift-card, .accepted-card, .punch-card, .action-panel, .message-card, .message-detail, .metric, .summary-card, .stat-card, .status-card, .form-card, .quickbooks-card, .table, .calendar, .day, .notice, .error-box, .message-alert, .empty, .next-job, .crew-card, .work-order-card, .record-card, .report-card, .backup-card, .legal-card {
    background: var(--mdm-surface) !important;
    color: var(--mdm-ink) !important;
    border: 1px solid var(--mdm-line) !important;
    border-radius: 12px !important;
    box-shadow: var(--mdm-shadow) !important;
}

.panel, .card, .box, .content-card, .form-card, .quickbooks-card, .report-card, .backup-card, .legal-card {
    padding: clamp(18px, 3vw, 28px) !important;
}

.hero {
    padding: clamp(38px, 6vw, 72px) 0 28px !important;
    border-bottom: 1px solid var(--mdm-line) !important;
    margin-bottom: 26px !important;
    background: transparent !important;
}

.hero h1, .page-title, .title { color: var(--mdm-ink) !important; }

button, .button, .btn, .login-button, .button-link, .decline-button, input[type="submit"], .fi-btn, a.button, a.btn {
    border: 1px solid var(--mdm-line) !important;
    border-radius: 8px !important;
    background: var(--mdm-surface2) !important;
    color: var(--mdm-ink) !important;
    box-shadow: none !important;
    font-family: 'Geist', system-ui, sans-serif !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-shadow: none !important;
}

button:hover, .button:hover, .btn:hover, .login-button:hover, .button-link:hover, a.button:hover, a.btn:hover {
    background: #313640 !important;
}

button[type="submit"], .btn.primary, .button.primary, .login-button, .primary, .save-button, .fi-btn-color-primary {
    background: linear-gradient(120deg, var(--mdm-acc), var(--mdm-acc2)) !important;
    color: #160c05 !important;
    border: 0 !important;
    box-shadow: 0 8px 20px -10px var(--mdm-acc) !important;
}

.decline-button, .btn.secondary, .button.secondary, .secondary {
    background: var(--mdm-surface2) !important;
    color: var(--mdm-ink) !important;
    box-shadow: none !important;
    border: 1px solid var(--mdm-line) !important;
}

input, textarea, select, .input, .select, .form-control {
    background: var(--mdm-surface2) !important;
    color: var(--mdm-ink) !important;
    border: 1px solid var(--mdm-line) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-family: 'Geist', system-ui, sans-serif !important;
}

input::placeholder, textarea::placeholder { color: var(--mdm-soft) !important; }

input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(255, 106, 43, .45) !important;
    outline-offset: 2px !important;
    border-color: var(--mdm-acc) !important;
}

.meta div, .accepted-meta div, .punch-meta div, .quick-actions a, .quick-actions button, .service-option, .checkbox-card, .calendar-job, .mobilecard {
    background: var(--mdm-surface2) !important;
    color: var(--mdm-ink) !important;
    border: 1px solid var(--mdm-line) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.role, .badge, .status, .pill, .month-pill, .tag {
    border: 0 !important;
    border-radius: 20px !important;
    background: var(--mdm-surface2) !important;
    color: var(--mdm-muted) !important;
    box-shadow: none !important;
    font-family: 'Geist Mono', ui-monospace, monospace !important;
    font-weight: 600 !important;
}

.role { color: var(--mdm-acc2) !important; background: var(--mdm-accdim) !important; }
.status.green, .success { color: var(--mdm-green) !important; background: rgba(62, 207, 142, .14) !important; }
.status.amber, .warning { color: var(--mdm-amber) !important; background: rgba(246, 181, 63, .14) !important; }
.status.red, .danger, .error { color: var(--mdm-red) !important; background: rgba(242, 104, 106, .14) !important; }

.notice, .message-alert {
    color: var(--mdm-green) !important;
    background: rgba(62, 207, 142, .12) !important;
    border-color: rgba(62, 207, 142, .3) !important;
}
.error-box {
    color: var(--mdm-red) !important;
    background: rgba(242, 104, 106, .12) !important;
    border-color: rgba(242, 104, 106, .3) !important;
}

table, .data-table {
    background: var(--mdm-surface) !important;
    color: var(--mdm-ink) !important;
    border-collapse: collapse !important;
    box-shadow: var(--mdm-shadow) !important;
}
th, td { border-color: var(--mdm-line) !important; }
th { background: var(--mdm-bg2) !important; color: var(--mdm-soft) !important; }

.bottom-nav {
    background: rgba(29, 32, 37, .96) !important;
    border-top: 1px solid var(--mdm-line) !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .3) !important;
}
.bottom-nav a { color: var(--mdm-muted) !important; border-radius: 8px !important; }
.bottom-nav a.active { color: #160c05 !important; background: linear-gradient(120deg, var(--mdm-acc), var(--mdm-acc2)) !important; }

.message-popup-backdrop {
    background: rgba(9, 11, 14, .7) !important;
    backdrop-filter: blur(8px) !important;
}
.message-popup {
    background: var(--mdm-surface) !important;
    color: var(--mdm-ink) !important;
    border: 1px solid var(--mdm-line) !important;
    border-radius: 14px !important;
    box-shadow: rgba(0, 0, 0, .6) 0 30px 90px !important;
}
.message-popup-subject {
    background: var(--mdm-surface2) !important;
    border: 1px solid var(--mdm-line) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.brand-mark img, .login-logo, .auth-logo, .logo img {
    background: transparent !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.calendar { box-shadow: none !important; background: transparent !important; border: 0 !important; }
.day { min-height: 92px; }
.day.empty-day { opacity: .3; }

/* Filament shell — recolor to neutral charcoal (pairs with panel dark mode) */
.fi-body, .fi-main, .fi-page { background-color: var(--mdm-bg) !important; color: var(--mdm-ink) !important; }
.fi-sidebar, .fi-topbar { background-color: var(--mdm-bg2) !important; color: var(--mdm-ink) !important; border-color: var(--mdm-line) !important; }
.fi-section, .fi-ta, .fi-modal-window, .fi-wi {
    background-color: var(--mdm-surface) !important;
    color: var(--mdm-ink) !important;
    border-radius: 12px !important;
    box-shadow: var(--mdm-shadow) !important;
    border: 1px solid var(--mdm-line) !important;
}
.fi-sidebar-item-active a { background: var(--mdm-accdim) !important; color: var(--mdm-acc2) !important; }
.fi-sidebar-item a:hover { background: var(--mdm-surface2) !important; color: var(--mdm-ink) !important; }
.fi-sidebar-group-label { color: var(--mdm-soft) !important; }
.fi-input, .fi-select-input, .fi-textarea { background-color: var(--mdm-surface2) !important; color: var(--mdm-ink) !important; }
.fi-btn { border-radius: 8px !important; }

@media (max-width: 820px) {
    h1 { letter-spacing: -1.4px !important; }
    .panel, .card, .box, .shift-card { border-radius: 12px !important; }
    .wrap, .container, main.wrap { width: min(100% - 24px, 1180px) !important; }
}

/* Filament contrast corrections: preserve layout, improve dark-mode readability */
.fi-sidebar-item-label,
.fi-sidebar-group-label,
.fi-breadcrumbs-item-label,
.fi-breadcrumbs-item a,
.fi-ta-text-item-label,
.fi-ta-text-item-description,
.fi-ta-table tbody td,
.fi-ta-table tbody td span,
.fi-ta-table tbody td a,
.fi-ta-table tbody td button,
.fi-ta-col-wrp,
.fi-ta-record,
.fi-section-header-heading,
.fi-section-header-description,
.fi-fo-field .fi-fo-field-label,
.fi-fo-field .fi-fo-field-label-content,
.fi-input-wrp input,
.fi-input-wrp textarea,
.fi-input-wrp select {
    color: #eceef1 !important;
}

.fi-ta-table thead th,
.fi-ta-table thead th span,
.fi-ta-header-cell,
.fi-ta-header-cell button,
.fi-ta-header-cell span {
    color: #b8c0cc !important;
}

.fi-sidebar-item a,
.fi-sidebar-item a span,
.fi-topbar a,
.fi-breadcrumbs a,
.fi-ta-text-item-label a,
.fi-ta-table a {
    color: #d8dee8 !important;
}

.fi-sidebar-item a:hover,
.fi-sidebar-item a:hover span,
.fi-breadcrumbs a:hover,
.fi-ta-text-item-label a:hover,
.fi-ta-table a:hover {
    color: #ff9455 !important;
}

.fi-sidebar-item-active a,
.fi-sidebar-item-active a span {
    color: #ff9455 !important;
}

.fi-ta-table tbody tr,
.fi-ta-table tbody tr td {
    background-color: var(--mdm-surface) !important;
}

.fi-ta-table tbody tr:hover td {
    background-color: var(--mdm-surface2) !important;
}

.fi-ta-search-field input,
.fi-ta-filters-trigger,
.fi-ta-columns-trigger,
.fi-ta-header-toolbar button {
    color: #eceef1 !important;
}

/* Resource-page table text: applies consistently to Events, Crew, Users, Shifts, Work Orders, and reports */
.fi-ta-table tbody td,
.fi-ta-table tbody td *:not(svg),
.fi-ta-table tbody td [class*="fi-ta-"],
.fi-ta-table tbody td [class*="fi-text-"],
.fi-ta-table tbody td [class*="fi-color-"],
.fi-ta-table tbody td .fi-icon,
.fi-ta-table tbody td time,
.fi-ta-table tbody td a,
.fi-ta-table tbody td button {
    color: #eceef1 !important;
    opacity: 1 !important;
}

.fi-ta-table tbody td .text-gray-400,
.fi-ta-table tbody td .text-gray-500,
.fi-ta-table tbody td .text-gray-600,
.fi-ta-table tbody td .text-gray-700,
.fi-ta-table tbody td .text-gray-800,
.fi-ta-table tbody td .text-gray-900 {
    color: #b8c0cc !important;
}

.fi-ta-table tbody td a:hover,
.fi-ta-table tbody td button:hover {
    color: #ff9455 !important;
}

.fi-ta-table tbody td svg {
    color: currentColor !important;
    stroke: currentColor !important;
}

.fi-ta-table tbody td input,
.fi-ta-table tbody td textarea,
.fi-ta-table tbody td select,
.fi-ta-table tbody td input::placeholder {
    color: #eceef1 !important;
}

/* Filament table toolbar: replace the bright white strip with the Crew Ops theme */
.fi-ta-header-toolbar,
.fi-ta-header,
.fi-ta-filter-indicators,
.fi-ta-header-toolbar > div {
    background-color: var(--mdm-surface2) !important;
    color: var(--mdm-ink) !important;
    border-color: var(--mdm-line) !important;
}

.fi-ta-header-toolbar {
    border-bottom: 2px solid var(--mdm-acc) !important;
    box-shadow: inset 0 -1px 0 rgba(255, 148, 85, .18) !important;
}

.fi-ta-header-toolbar input,
.fi-ta-header-toolbar .fi-input,
.fi-ta-header-toolbar button,
.fi-ta-header-toolbar a {
    background-color: #313640 !important;
    color: #eceef1 !important;
    border-color: #596579 !important;
}

.fi-ta-header-toolbar button:hover,
.fi-ta-header-toolbar a:hover {
    background-color: #3b424f !important;
    color: #ff9455 !important;
}

/* Readable status badges across all Filament tables and detail pages */
.fi-badge,
.fi-badge-label,
.fi-ta-badge,
.fi-ta-table .fi-badge,
.fi-ta-table [class*="fi-badge"],
.fi-ta-table [class*="fi-color-"] {
    color: #f8fafc !important;
    background-color: #374151 !important;
    border: 1px solid #596579 !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

.fi-badge.fi-color-success,
.fi-badge[class*="fi-color-success"],
.fi-ta-table [class*="fi-color-success"] {
    color: #b7f7d1 !important;
    background-color: rgba(22, 101, 52, .72) !important;
    border-color: #3ecf8e !important;
}

.fi-badge.fi-color-warning,
.fi-badge[class*="fi-color-warning"],
.fi-ta-table [class*="fi-color-warning"] {
    color: #ffe3a3 !important;
    background-color: rgba(120, 70, 18, .78) !important;
    border-color: #f6b53f !important;
}

.fi-badge.fi-color-danger,
.fi-badge[class*="fi-color-danger"],
.fi-ta-table [class*="fi-color-danger"] {
    color: #ffd0d1 !important;
    background-color: rgba(127, 29, 29, .78) !important;
    border-color: #f2686a !important;
}

.fi-badge.fi-color-info,
.fi-badge[class*="fi-color-info"],
.fi-ta-table [class*="fi-color-info"] {
    color: #c9e4ff !important;
    background-color: rgba(30, 64, 175, .72) !important;
    border-color: #57a6ff !important;
}

.fi-badge.fi-color-primary,
.fi-badge[class*="fi-color-primary"],
.fi-ta-table [class*="fi-color-primary"] {
    color: #ffe0cc !important;
    background-color: rgba(154, 52, 18, .78) !important;
    border-color: #ff9455 !important;
}

.fi-badge.fi-color-gray,
.fi-badge[class*="fi-color-gray"],
.fi-ta-table [class*="fi-color-gray"] {
    color: #e5e7eb !important;
    background-color: #374151 !important;
    border-color: #6b7280 !important;
}

/* Mobile sidebar: no slide animation. Taps during the transition were landing
   on the wrong menu item (rows still moving when the tap fires). */
.fi-sidebar, .fi-sidebar-nav, .fi-sidebar-close-overlay {
    transition: none !important;
}
