/*
|--------------------------------------------------------------------------
| OPS TURNAROUND APP - MAIN STYLESHEET
|--------------------------------------------------------------------------
|
| This stylesheet is intentionally structured in clear blocks.
| If the UI evolves later, update the relevant section instead of stacking
| duplicate rules at the bottom.
|
| Main sections:
| 1. Design tokens
| 2. Base / reset
| 3. Generic layout blocks
| 4. Forms
| 5. Flight list
| 6. Dashboard
| 7. Timeline
| 8. Workspace
| 9. Flight log
| 10. Notes modal
| 11. Responsive rules
|
*/

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
    --bg: #111827;
    --panel: #1f2937;
    --panel-2: #111827;
    --text: #f9fafb;
    --muted: #9ca3af;
    --border: #374151;
    --accent: #d50032;
    --success: #15803d;
    --warning: #b45309;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    --font-sm: 13px;
    --font-md: 14px;
    --font-base: 15px;
    --font-lg: 18px;
    --font-xl: 24px;
}

/* ==========================================================================
   2. BASE / RESET
   ========================================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--text);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    margin: 0;
}

p,
li {
    line-height: 1.45;
}

.is-hidden {
    display: none;
}

/* ==========================================================================
   3. GENERIC LAYOUT BLOCKS
   ========================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 16px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: var(--font-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.button-link,
button {
    display: inline-block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: white;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}

.button-link:hover,
button:hover {
    opacity: 0.92;
    text-decoration: none;
}

.button-link--small,
button.button-link--small {
    padding: 8px 10px;
    font-size: var(--font-sm);
}

.button-link--warning {
    background: var(--warning);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-subtitle {
    color: var(--muted);
    font-size: var(--font-sm);
}

.panel-header--compact {
    min-height: 20px;
    margin-bottom: 10px;
}

.panel-header--right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* ==========================================================================
   4. FORMS
   ========================================================================== */

.form-card {
    margin-top: 20px;
}

.form-grid,
.times-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--font-md);
    font-weight: bold;
}

input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    color: var(--text);
    font-size: var(--font-base);
}

.form-actions,
.times-editor-actions {
    margin-top: 14px;
}

.error-card {
    border-color: var(--warning);
}

.success-card {
    border-color: var(--success);
}

/* ==========================================================================
   5. FLIGHT LIST
   ========================================================================== */

.flight-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.flight-list--minimal {
    gap: 6px;
}

.flight-link-row {
    display: block;
    color: inherit;
    text-decoration: none;
}

.flight-link-row:hover {
    text-decoration: none;
}

.flight-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel-2);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.flight-link-row:hover .flight-row,
.flight-link-row:focus .flight-row {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    background: #0d1a33;
}

.flight-row--minimal {
    align-items: center;
    padding: 10px 14px;
}

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

.flight-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.flight-title {
    font-size: 17px;
    font-weight: bold;
    line-height: 1.2;
}

.flight-date {
    color: var(--muted);
    font-size: var(--font-md);
    white-space: nowrap;
}

.flight-schedule-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: var(--font-md);
    line-height: 1.2;
}

.flight-schedule-label {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.flight-schedule-time {
    font-size: 14px;
    font-weight: bold;
    color: var(--text);
}

.flight-schedule-arrow {
    color: var(--muted);
    font-size: 14px;
}

.flight-actions {
    flex-shrink: 0;
}

/* ==========================================================================
   6. DASHBOARD
   ========================================================================== */

.dashboard-page {
    max-width: 1380px;
}

.dashboard-header {
    padding: 10px 12px;
}

.dashboard-header--compact {
    margin-top: 0;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 16px;
    margin-top: 4px;
    align-items: start;
}



/*
|--------------------------------------------------------------------------
| Global section ready pill
|--------------------------------------------------------------------------
|
| This pill shows the most advanced operational gate that is ready.
| It is independent from the currently selected workspace tab.
| It uses the same visual family and size as the flight pill.
|
*/

.section-ready-pill {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    min-width: 108px;
    padding: 10px 12px;
    border: 1px solid var(--success);
    border-radius: 12px;
    background: color-mix(in srgb, var(--success) 16%, var(--panel-2));
    color: var(--text);
    flex-shrink: 0;
    box-shadow: 0 0 10px color-mix(in srgb, var(--success) 18%, transparent);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.section-ready-pill.is-visible {
    display: inline-flex;
}

/*
|--------------------------------------------------------------------------
| Header row
|--------------------------------------------------------------------------
|
| Left side:
| - ETD countdown
| - editable time strip
|
| Right side:
| - flight context pill, also used as back navigation
|
*/

.dashboard-top-row--header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-top-row--header .ops-times-strip {
    flex: 1;
    min-width: 0;
}

/*
|--------------------------------------------------------------------------
| Flight context pill
|--------------------------------------------------------------------------
*/

.flight-pill-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 108px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-2);
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}

.flight-pill-link:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.flight-pill-line {
    display: block;
    line-height: 1.15;
}

.flight-pill-line--flight {
    font-size: 16px;
    font-weight: 700;
}

.flight-pill-line--route {
    font-size: 12px;
    color: var(--text);
}

.flight-pill-line--date {
    font-size: 12px;
    color: var(--muted);
}

/*
|--------------------------------------------------------------------------
| Top time strip
|--------------------------------------------------------------------------
*/

.ops-times-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.ops-time-pill {
    min-width: 106px;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-2);
    text-align: center;
    flex-shrink: 0;
    position: relative;
}

.ops-time-pill--editable {
    cursor: pointer;
}

.ops-time-pill--editable:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.ops-time-pill--countdown {
    cursor: default;
    min-width: 92px;
    flex-shrink: 0;
}

.ops-time-pill--countdown .ops-time-value {
    letter-spacing: 0.01em;
}

.ops-time-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ops-time-value {
    display: block;
    margin-top: 1px;
    font-size: 15px;
    font-weight: bold;
}

.ops-time-subvalue {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    min-height: 13px;
}

.ops-time-connector {
    width: 16px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
    align-self: center;
}

.ops-time-duration {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    color: var(--muted);
    flex-shrink: 0;
}

.ops-time-duration--separator {
    min-width: 48px;
}

.ops-time-duration-label {
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ops-time-duration-value {
    margin-top: 2px;
    font-size: 12px;
    font-weight: bold;
    color: var(--text);
}

/*
|--------------------------------------------------------------------------
| Inline time editors
|--------------------------------------------------------------------------
*/

.ops-time-editor {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 5px;
}

.ops-time-editor[hidden] {
    display: none !important;
}

.ops-time-editor input {
    text-align: center;
    padding: 6px 8px;
    font-size: 13px;
}

.ops-time-editor button {
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 6px;
}

/* ==========================================================================
   7. TIMELINE
   ========================================================================== */

/*
|--------------------------------------------------------------------------
| 7.1 Timeline panel
|--------------------------------------------------------------------------
*/

.timeline-panel {
    padding: 12px;
}

/*
|--------------------------------------------------------------------------
| 7.2 Timeline list
|--------------------------------------------------------------------------
|
| We no longer use a continuous vertical line.
| The timeline is now a compact operational list:
| - marker
| - target time + anchor
| - label
|
*/

.timeline-list {
    display: grid;
    gap: 0;
}

/*
|--------------------------------------------------------------------------
| 7.3 Base timeline item
|--------------------------------------------------------------------------
|
| Compact 3-column layout:
| 1. marker
| 2. target time / anchor
| 3. label / optional note button
|
| Items are clickable.
|
*/

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 12px 68px 1fr;
    gap: 8px;
    align-items: start;
    padding: 7px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item.is-loading {
    opacity: 0.6;
}

/*
|--------------------------------------------------------------------------
| Auto-hidden timeline items
|--------------------------------------------------------------------------
|
| Once crew_on_board time is reached, some early optional / once-per-day
| items are removed from the visible timeline.
|
*/
.timeline-item.is-auto-hidden {
    display: none;
}

/*
|--------------------------------------------------------------------------
| 7.4 Marker
|--------------------------------------------------------------------------
|
| Marker alone communicates state:
| - pending = muted
| - done = green
| - due = red pulse highlight
|
*/

.timeline-marker {
    width: 10px;
    height: 10px;
    margin-top: 3px;
    border-radius: 999px;
    border: 2px solid var(--muted);
    background: var(--bg);
    position: relative;
    z-index: 1;
}

.timeline-item--pending .timeline-marker {
    border-color: var(--muted);
    background: var(--bg);
}

.timeline-item--done .timeline-marker {
    border-color: var(--success);
    background: var(--success);
}

/*
|--------------------------------------------------------------------------
| 7.5 Time column
|--------------------------------------------------------------------------
*/

.timeline-item-time {
    text-align: left;
}

.timeline-target {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.1;
}

.timeline-anchor {
    color: var(--muted);
    font-size: 11px;
    margin-top: 1px;
}

/*
|--------------------------------------------------------------------------
| 7.6 Body column
|--------------------------------------------------------------------------
*/

.timeline-item-body {
    min-width: 0;
}

.timeline-item-topline {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.timeline-item-topline .timeline-label {
    flex: 1;
}

.timeline-label {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
    margin: 0;
}

/*
|--------------------------------------------------------------------------
| 7.7 Due pulse
|--------------------------------------------------------------------------
|
| A pending timeline item pulses once its target time is reached.
| We pulse the time and label, not the whole row.
|
*/

@keyframes timelinePulseRed {
    0% {
        color: inherit;
        text-shadow: none;
        filter: none;
    }

    50% {
        color: color-mix(in srgb, var(--accent) 88%, var(--text));
        text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 28%, transparent);
        filter: saturate(1.08);
    }

    100% {
        color: inherit;
        text-shadow: none;
        filter: none;
    }
}

.timeline-item.is-timeline-due .timeline-marker {
    border-color: color-mix(in srgb, var(--accent) 70%, var(--muted));
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 28%, transparent);
}

.timeline-item.is-timeline-due .timeline-target,
.timeline-item.is-timeline-due .timeline-label {
    animation: timelinePulseRed 1.9s ease-in-out infinite;
}

/*
|--------------------------------------------------------------------------
| 7.8 Done must always win
|--------------------------------------------------------------------------
*/

.timeline-item--done,
.timeline-item--done.is-timeline-due {
    animation: none;
}

.timeline-item--done .timeline-target,
.timeline-item--done .timeline-label,
.timeline-item--done.is-timeline-due .timeline-target,
.timeline-item--done.is-timeline-due .timeline-label {
    animation: none;
    text-shadow: none;
    filter: none;
}

/* ==========================================================================
   8. WORKSPACE
   ========================================================================== */

.workspace-panel {
    padding: 14px;
}

/*
|--------------------------------------------------------------------------
| Section tabs
|--------------------------------------------------------------------------
|
| Single-line, horizontally scrollable phase selector.
|
*/

.workspace-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

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

.workspace-tab {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
}

.workspace-tab.is-active {
    background: var(--accent);
    border-color: var(--accent);
}

.workspace-section {
    display: none;
}

.workspace-section.is-active {
    display: block;
}

/*
|--------------------------------------------------------------------------
| Workspace layout modes
|--------------------------------------------------------------------------
|
| Small sections:
| - one compact visual column
|
| Large sections:
| - two visual columns
| - filled top-to-bottom, then left-to-right
|
| This gives:
| 1 | 3
| 2 | 4
|
*/

.workspace-items {
    display: grid;
    gap: 6px;
}

.workspace-items--single {
    grid-template-columns: 1fr;
}

.workspace-items--single .workspace-item {
    width: 100%;
    max-width: none;
}

.workspace-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
}

.workspace-column {
    min-width: 0;
}

.workspace-items--column .workspace-item {
    width: 100%;
    max-width: none;
}

/*
|--------------------------------------------------------------------------
| Base workspace item
|--------------------------------------------------------------------------
*/

.workspace-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-2);
    cursor: pointer;
}

.workspace-item.is-loading {
    opacity: 0.6;
}

.workspace-item-main {
    flex: 1;
    min-width: 0;
}

/*
|--------------------------------------------------------------------------
| Right-side meta area in workspace item
|--------------------------------------------------------------------------
|
| We reserve two fixed slots on the right:
| 1. time badge
| 2. notes icon
|
| This keeps ETA-20 / ETD-20 aligned even when some items have notes
| and others do not.
|
*/

.workspace-item-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.workspace-item-label {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 1.3;
}

.workspace-item-meta {
    display: grid;
    grid-template-columns: 74px 24px;
    align-items: center;
    column-gap: 8px;
    flex-shrink: 0;
}

.workspace-item-badge-slot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
}

.workspace-item-notes-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 24px;
    min-height: 20px;
}

/*
|--------------------------------------------------------------------------
| Checkbox
|--------------------------------------------------------------------------
*/

.workspace-item-check {
    width: 16px;
    height: 16px;
    border: 2px solid var(--muted);
    border-radius: 4px;
    flex-shrink: 0;
}

/*
|--------------------------------------------------------------------------
| Pending / done
|--------------------------------------------------------------------------
*/

.workspace-item--pending .workspace-item-check {
    border-color: var(--muted);
    background: transparent;
}

.workspace-item--done {
    border-color: var(--success);
    box-shadow: none;
}

.workspace-item--done .workspace-item-check {
    border-color: var(--success);
    background: var(--success);
}

/*
|--------------------------------------------------------------------------
| Badge area
|--------------------------------------------------------------------------
|
| Only timed badge remains.
|
*/

.workspace-item-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.workspace-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.workspace-badge--timed {
    letter-spacing: 0.02em;
}

/*
|--------------------------------------------------------------------------
| Notes button
|--------------------------------------------------------------------------
|
| We draw the note icon with 3 clean horizontal lines in CSS.
| This avoids blurry text glyph rendering on iPad.
|
*/

.item-notes-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.item-notes-button:hover {
    background: rgba(255, 255, 255, 0.04);
}

.item-notes-glyph {
    position: relative;
    display: block;
    width: 12px;
    height: 10px;
}

.item-notes-glyph::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: var(--muted);
    box-shadow:
        0 4px 0 var(--muted),
        0 8px 0 var(--muted);
}

.item-notes-button:hover .item-notes-glyph::before {
    background: var(--text);
    box-shadow:
        0 4px 0 var(--text),
        0 8px 0 var(--text);
}

/*
|--------------------------------------------------------------------------
| Workspace attention pulse
|--------------------------------------------------------------------------
|
| Red pulsating state used for:
| - time window reached
| - timeline trigger completed
| - prerequisite flow item completed
|
| This keeps the visual language intentionally simple:
| - neutral
| - red pulsating
| - green done
|
*/

@keyframes workspacePulseRed {
    0% {
        border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
        box-shadow:
            0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent),
            0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
    }

    50% {
        border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
        box-shadow:
            0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent),
            0 0 16px color-mix(in srgb, var(--accent) 24%, transparent);
    }

    100% {
        border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
        box-shadow:
            0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent),
            0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
    }
}

.workspace-item.is-time-ready,
.workspace-item.is-timeline-trigger-ready,
.workspace-item.is-requirement-ready {
    animation: workspacePulseRed 1.9s ease-in-out infinite;
}

.workspace-item.is-time-ready .workspace-badge--timed {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    color: var(--text);
}

/*
|--------------------------------------------------------------------------
| Done must always win
|--------------------------------------------------------------------------
*/

.workspace-item--done,
.workspace-item--done.is-time-ready,
.workspace-item--done.is-timeline-trigger-ready,
.workspace-item--done.is-requirement-ready {
    border-color: var(--success);
    box-shadow: none;
    animation: none;
}

.workspace-item--done .workspace-badge--timed {
    display: none;
}

/* ==========================================================================
   9. FLIGHT LOG
   ========================================================================== */

.flight-log-panel {
    margin-top: 16px;
    padding: 10px 12px;
}

.flight-log-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.flight-log-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.flight-log-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
    opacity: 1;
}

.flight-log-toggle-title {
    font-size: 14px;
}

.flight-log-toggle-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    font-weight: bold;
}

.flight-log-toggle-icon {
    margin-left: auto;
    color: var(--muted);
    font-size: 14px;
}

.flight-log-content {
    margin-top: 12px;
}

.flight-log-empty {
    color: var(--muted);
    margin: 0;
}

.flight-log-list {
    display: grid;
    gap: 8px;
}

.flight-log-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.flight-log-item:last-child {
    border-bottom: none;
}

.flight-log-time {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.flight-log-main {
    font-size: 14px;
    line-height: 1.3;
}

.flight-log-note {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.3;
}

/* ==========================================================================
   10. NOTES MODAL
   ========================================================================== */

.notes-modal[hidden] {
    display: none !important;
}

.notes-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.notes-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.notes-modal-dialog {
    position: relative;
    width: min(680px, calc(100vw - 24px));
    max-height: min(80vh, 700px);
    overflow: auto;
    margin: 6vh auto 0 auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    z-index: 1;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.notes-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.notes-modal-header h2 {
    flex: 1;
    font-size: 18px;
}

.notes-modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
}

.notes-modal-close:hover {
    opacity: 1;
}

.notes-modal-content {
    white-space: pre-line;
    line-height: 1.5;
    font-size: 15px;
}

/* ==========================================================================
   11. LEGACY TABLE / GENERIC DETAIL BLOCKS
   ========================================================================== */

.table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

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

.data-table th {
    color: var(--muted);
    font-size: 14px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* ==========================================================================
   12. RESPONSIVE RULES
   ========================================================================== */

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .dashboard-top-row--header {
        flex-direction: column;
        align-items: stretch;
    }

    .flight-pill-link {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 820px) {
    .flight-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .flight-schedule-line {
        flex-wrap: wrap;
    }

    .form-grid,
    .times-editor-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .flight-row {
        flex-direction: column;
    }

    .flight-log-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .workspace-columns {
        grid-template-columns: 1fr;
    }

    .workspace-items--single .workspace-item,
    .workspace-items--column .workspace-item {
        max-width: none;
    }

    .workspace-item-topline {
        align-items: flex-start;
    }
}