/* Text selection highlight */
::selection      { background: #2a5bd7; color: #fff; }
::-moz-selection { background: #2a5bd7; color: #fff; }

/* General styles */
body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    background-color: #1a1f2e;
    color: #e8eaf0;
}

h2, h3 {
    color: #e8eaf0;
}

.navbar {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    background-color: #2c3e50;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.navbar a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
}

.navbar a:hover {
    background-color: #34495e;
    border-radius: 4px;
}

.container {
    max-width: 900px;
    margin: auto;
    padding: 20px;
}

.card {
    background: #252b3b;
    color: #e8eaf0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    border: 1px solid #2d3548;
}

@media screen and (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: center;
    }
}

/* Card heading styles */
h4 {
    margin-bottom: 5px;
}

/* Dash DataTable — global dark overrides */
.dash-spreadsheet-container .dash-spreadsheet-inner th,
.dash-spreadsheet-container .dash-spreadsheet-inner td {
    background-color: #252b3b !important;
    color: #e8eaf0 !important;
    border-color: #2d3548 !important;
}
.dash-spreadsheet-container .dash-header {
    background-color: #1e2537 !important;
}
.dash-filter input {
    background-color: #1a1f2e !important;
    color: #e8eaf0 !important;
    border-color: #3a4258 !important;
}
.dash-table-container .previous-page, .dash-table-container .next-page,
.dash-table-container .last-page, .dash-table-container .first-page {
    color: #e8eaf0 !important;
    background-color: #252b3b !important;
    border-color: #3a4258 !important;
}
.dash-table-container .page-number {
    color: #e8eaf0 !important;
    background-color: #1a1f2e !important;
}

/* Action/download links */
a.button-link, .download-link {
    background-color: #3498db;
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

a.button-link:hover, .download-link:hover {
    background-color: #2980b9;
}

/* DatePickerRange Styles */
.dash-date-picker-range input {
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #3a4258 !important;
    background-color: #1e2537 !important;
    color: #e8eaf0 !important;
    transition: all 0.3s ease;
    width: 100%;
}

/* Focus state for DatePickerRange */
.dash-date-picker-range input:focus {
    border-color: #4a9eff !important;
    box-shadow: 0 0 0 0.2rem rgba(74,158,255,0.25);
    outline: none;
}

/* Hover Effect for DatePicker */
.dash-date-picker-range input:hover {
    border-color: #4a9eff !important;
    cursor: pointer;
}

/* DatePickerRange Clear Button */
.dash-date-picker-range .react-datepicker__close-icon {
    color: #3498db;
}

/* Tooltip style for DatePicker */
.dash-date-picker-range .react-datepicker__tooltip {
    background-color: #3498db;
    color: white;
    border-radius: 5px;
}

/* ── FEAT-258-P2 — Shared DatePickerSingle (YYYY-MM-DD standard) ────────────
   Use className='hi-date-picker' on every dcc.DatePickerSingle/Range.
   Per-page copies of this block should be deleted in favour of this one.    */
.hi-date-picker .DateInput_input {
    background: #1e2537;
    color: #e8eaf0;
    border: 1px solid #2d3548;
    border-radius: 4px;
    padding: 7px 10px;
    font-size: 13px;
    width: 140px;
    box-sizing: border-box;
    font-family: inherit;
}

.hi-date-picker .DateInput_input__focused {
    border-color: #4a90d9;
}

.hi-date-picker .DateInput,
.hi-date-picker .SingleDatePickerInput {
    background: transparent;
    border: none;
}

body[data-theme="light"] .hi-date-picker .DateInput_input {
    background: #f7f9fc;
    color: #1a202c;
    border-color: #d1d9e0;
}

body[data-theme="light"] .hi-date-picker .DateInput_input__focused {
    border-color: #4a90d9;
}

/* BUG-414: calendar popup must clear sticky table headers/toolbars (max z-index 5).
   Applies globally — fleet-360, workshop-monitor, workshop-board, and any future page. */
.SingleDatePicker_picker,
.DateRangePicker_picker {
    z-index: 10;
}

/* Bootstrap dark overrides — dashboard / landing / unlock pages */
.form-control {
    background-color: #1e2537;
    border-color: #3a4258;
    color: #e8eaf0;
}
.form-control:focus {
    background-color: #1e2537;
    border-color: #4a9eff;
    color: #e8eaf0;
    box-shadow: 0 0 0 0.2rem rgba(74,158,255,0.25);
}
.form-control::placeholder { color: #6b7588; }

/* BUG-317: shared horizontal-scroll wrapper for wide data tables */
.tbl-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Shared narrow-page width tokens (FEAT-225) ─────────────────────────
   Mobile-first width progression used by HiLabour and fleet-check pages.
   Pages that want this progression can apply .hi-page-narrow or reference
   the vars directly in their own class.
   Candidates for future adoption: /fleet-check-supervisor, /pnl-report.
   ─────────────────────────────────────────────────────────────────────── */
:root {
  --hi-narrow-mobile:  480px;
  --hi-narrow-tablet:  720px;
  --hi-narrow-desktop: 860px;
}

.hi-page-narrow                              { max-width: var(--hi-narrow-mobile);  margin: 0 auto; }
@media (min-width: 768px)  { .hi-page-narrow { max-width: var(--hi-narrow-tablet);  } }
@media (min-width: 1024px) { .hi-page-narrow { max-width: var(--hi-narrow-desktop); } }
