/*
Ember Tide

Interface style:
- Midnight teal navigation
- Porcelain light canvas
- Graphite dark canvas
- Burnt-orange primary actions
- Teal route and information accents
*/

html[data-design-theme="ember-tide"] {
    color-scheme: light;

    --bg: #f7f8f5;
    --surface: #ffffff;
    --surface-subtle: #f5f7f5;
    --surface-strong: #edf1ef;
    --topbar: #ffffff;

    --ink: #172126;
    --ink-soft: #34454b;
    --muted: #738086;

    --line: #dce3e0;
    --line-strong: #bdc9c5;

    --primary: #f0542d;
    --primary-hover: #cf3f1d;
    --primary-soft: #fff0ea;
    --on-primary: #ffffff;

    --accent: #087e82;
    --accent-hover: #05696d;
    --accent-soft: #e4f5f3;

    --danger: #c63d2f;
    --warning: #bd7317;
    --success: #198760;

    --ember-tide-sidebar: #0b4a50;
    --ember-tide-sidebar-deep: #073a40;
    --ember-tide-sidebar-text: #f3f7f5;
    --ember-tide-sidebar-muted: #a8c3c3;

    --radius: 6px;
    --shadow:
        0 1px 2px rgb(17 35 38 / 5%),
        0 8px 24px rgb(17 35 38 / 4%);
}

/*
Dark mode uses the same Ember Tide identity.
The ordinary light/dark control changes data-theme.
*/

html[data-design-theme="ember-tide"][data-theme="dark"] {
    color-scheme: dark;

    --bg: #0b1114;
    --surface: #10191d;
    --surface-subtle: #0e171b;
    --surface-strong: #142126;
    --topbar: #0c1519;

    --ink: #f3f0e8;
    --ink-soft: #d5dddc;
    --muted: #9eacaf;

    --line: #26383d;
    --line-strong: #3a4e54;

    --primary: #f0542d;
    --primary-hover: #ff6743;
    --primary-soft: #402017;
    --on-primary: #ffffff;

    --accent: #28b8b0;
    --accent-hover: #56d2cb;
    --accent-soft: #103a3b;

    --danger: #ff7767;
    --warning: #dfa348;
    --success: #53c796;

    --ember-tide-sidebar: #07383e;
    --ember-tide-sidebar-deep: #052c31;
    --ember-tide-sidebar-text: #f4f4ee;
    --ember-tide-sidebar-muted: #9db6b7;

    --shadow: none;
}

/* Application shell */

html[data-design-theme="ember-tide"] body {
    color: var(--ink);
    background: var(--bg);
}

html[data-design-theme="ember-tide"] .main-column,
html[data-design-theme="ember-tide"] .main-content {
    background: var(--bg);
}

html[data-design-theme="ember-tide"] .sidebar {
    color: var(--ember-tide-sidebar-text);
    background:
        linear-gradient(
            180deg,
            var(--ember-tide-sidebar) 0%,
            var(--ember-tide-sidebar-deep) 100%
        );
    border-inline-end-color:
        color-mix(
            in srgb,
            var(--ember-tide-sidebar-text) 15%,
            transparent
        );
}

html[data-design-theme="ember-tide"] .brand-mark {
    color: var(--primary);
    border-color: var(--primary);
}

html[data-design-theme="ember-tide"] .brand-lockup strong {
    color: var(--ember-tide-sidebar-text);
}

html[data-design-theme="ember-tide"] .brand-lockup small,
html[data-design-theme="ember-tide"] .nav-label {
    color: var(--ember-tide-sidebar-muted);
}

html[data-design-theme="ember-tide"] .nav-link {
    color: var(--ember-tide-sidebar-text);
    border-inline-start: 3px solid transparent;
}

html[data-design-theme="ember-tide"] .nav-link:hover {
    color: #ffffff;
    background:
        color-mix(
            in srgb,
            var(--ember-tide-sidebar-text) 8%,
            transparent
        );
}

html[data-design-theme="ember-tide"] .nav-link.is-active {
    color: #ffffff;
    background:
        color-mix(
            in srgb,
            var(--ember-tide-sidebar-text) 12%,
            transparent
        );
    border-inline-start-color: var(--primary);
}

html[data-design-theme="ember-tide"] .nav-link.is-active svg {
    color: var(--primary);
}

html[data-design-theme="ember-tide"] .sidebar-footer {
    color: var(--ember-tide-sidebar-muted);
    border-top-color:
        color-mix(
            in srgb,
            var(--ember-tide-sidebar-text) 15%,
            transparent
        );
}

html[data-design-theme="ember-tide"] .environment-dot {
    background: #49d19d;
    box-shadow: 0 0 0 4px rgb(73 209 157 / 12%);
}

/* Top bar */

html[data-design-theme="ember-tide"] .topbar {
    color: var(--ink);
    background: var(--topbar);
    border-bottom-color: var(--line);
}

html[data-design-theme="ember-tide"] .global-search {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
    border-radius: var(--radius);
}

html[data-design-theme="ember-tide"] .global-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px
        color-mix(
            in srgb,
            var(--accent) 14%,
            transparent
        );
}

html[data-design-theme="ember-tide"] .global-search input {
    color: var(--ink);
    background: transparent;
}

html[data-design-theme="ember-tide"]
    .global-search
    input::placeholder {
    color: var(--muted);
}

html[data-design-theme="ember-tide"] .global-search kbd {
    color: var(--muted);
    background: var(--surface-subtle);
    border-color: var(--line);
}

/* Project header and navigation */

html[data-design-theme="ember-tide"] .project-overview {
    background: var(--bg);
    border-bottom-color: var(--line);
    box-shadow: none;
    clip-path: none;
}

html[data-design-theme="ember-tide"] .project-hero h1,
html[data-design-theme="ember-tide"] .detail-section h2 {
    color: var(--ink);
}

html[data-design-theme="ember-tide"] .back-link,
html[data-design-theme="ember-tide"] .section-kicker {
    color: var(--accent);
}

html[data-design-theme="ember-tide"] .detail-nav {
    background: var(--bg);
    border-color: var(--line);
}

html[data-design-theme="ember-tide"] .detail-nav a {
    color: var(--muted);
}

html[data-design-theme="ember-tide"] .detail-nav a:hover {
    color: var(--ink);
}

html[data-design-theme="ember-tide"] .detail-nav a.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Buttons */

html[data-design-theme="ember-tide"] .button--primary {
    color: var(--on-primary);
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius);
}

html[data-design-theme="ember-tide"] .button--primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

html[data-design-theme="ember-tide"] .button--secondary,
html[data-design-theme="ember-tide"] .button--ghost {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line-strong);
    border-radius: var(--radius);
}

html[data-design-theme="ember-tide"] .button--secondary:hover,
html[data-design-theme="ember-tide"] .button--ghost:hover {
    color: var(--accent-hover);
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* Transport page heading */

html[data-design-theme="ember-tide"] #transport {
    color: var(--ink);
    padding-top: 28px;
}

html[data-design-theme="ember-tide"]
    #transport
    .detail-section__heading {
    align-items: end;
    margin-bottom: 12px;
}

html[data-design-theme="ember-tide"]
    #transport
    .section-kicker {
    display: none;
}

html[data-design-theme="ember-tide"]
    #transport
    .detail-section__heading
    h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 500;
    letter-spacing: -0.025em;
}

html[data-design-theme="ember-tide"]
    #transport
    .detail-section__heading
    h2::after {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    content: "Record cargo, routes and transport costs.";
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
}

html[data-design-theme="ember-tide"]
    #transport
    .expense-total {
    display: grid;
    grid-template-columns: auto auto;
    gap: 2px 8px;
    align-items: baseline;
}

html[data-design-theme="ember-tide"]
    #transport
    .expense-total::before {
    grid-column: 1 / -1;
    color: var(--muted);
    content: "Recorded transport cost";
    font-size: 11px;
}

html[data-design-theme="ember-tide"]
    #transport
    .expense-total
    span {
    grid-column: 2;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

html[data-design-theme="ember-tide"]
    #transport
    .expense-total
    strong {
    grid-column: 1;
    color: var(--primary);
    font-size: 22px;
    font-weight: 650;
}

/* Add transport card */

html[data-design-theme="ember-tide"]
    #transport
    .transport-quick-form {
    display: grid;
    gap: 14px;
    margin: 0 0 10px;
    padding: 18px;
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-quick-form::before {
    display: block;
    color: var(--ink);
    content: "Add transport";
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
}

/*
Existing field order:
1 Cargo
2 Vehicle type
3 Cost
4 Date
5 Carrier
6 Action stack containing subject type and button
*/

html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 14px 18px;
    align-items: end;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields
    > :nth-child(1) {
    grid-column: 1 / 5;
    grid-row: 1;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields
    > :nth-child(2) {
    grid-column: 5 / 9;
    grid-row: 1;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields
    > :nth-child(5) {
    grid-column: 9 / 13;
    grid-row: 1;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields
    > :nth-child(3) {
    grid-column: 1 / 5;
    grid-row: 2;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields
    > :nth-child(4) {
    grid-column: 5 / 9;
    grid-row: 2;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-action-stack {
    grid-column: 9 / 13;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 14px;
    align-items: end;
    width: auto;
    min-width: 0;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-object-field {
    grid-column: 1;
    grid-row: 1;
    width: auto;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-object-field
    select {
    width: 100%;
    height: 42px;
    min-height: 42px;
    padding-block: 8px;
    font-size: 13px;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-submit-button {
    grid-column: 2;
    grid-row: 1;
    width: 170px;
    min-width: 170px;
    height: 42px;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields
    label,
html[data-design-theme="ember-tide"]
    #transport
    .transport-object-field
    label {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields
    input,
html[data-design-theme="ember-tide"]
    #transport
    .transport-main-fields
    select,
html[data-design-theme="ember-tide"]
    #transport
    .transport-route-fields
    input {
    min-height: 42px;
    color: var(--ink);
    background: var(--surface-subtle);
    border-color: var(--line);
    border-radius: 4px;
}

html[data-design-theme="ember-tide"]
    #transport
    input::placeholder {
    color: var(--muted);
}

html[data-design-theme="ember-tide"]
    #transport
    input:focus,
html[data-design-theme="ember-tide"]
    #transport
    select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px
        color-mix(
            in srgb,
            var(--accent) 14%,
            transparent
        );
    outline: 0;
}

/* Route */

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-section {
    margin-top: 0;
    padding-top: 12px;
    border-top-color: var(--line);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-toggle {
    color: var(--ink-soft);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-toggle__identity {
    color: var(--ink);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-toggle__identity
    svg {
    color: var(--accent);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-visual {
    min-height: 70px;
    margin-top: 4px;
    background: var(--surface-subtle);
    border-color: var(--line);
    border-radius: var(--radius);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-point__icon {
    color: var(--accent);
    background: var(--accent-soft);
    border-color:
        color-mix(
            in srgb,
            var(--accent) 35%,
            var(--line)
        );
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-track__line {
    background:
        color-mix(
            in srgb,
            var(--accent) 72%,
            var(--line)
        );
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-track__line::before,
html[data-design-theme="ember-tide"]
    #transport
    .transport-route-track__line::after {
    background: var(--accent);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-track__vehicle {
    color: var(--accent);
    background: var(--surface);
    border-color: var(--line);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-track__arrow {
    color: var(--accent);
    background: var(--surface-subtle);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-route-default {
    color: var(--muted);
    background: transparent;
}

/* Records heading */

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 8px 0 7px;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-heading
    h3 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-heading
    span {
    color: var(--muted);
    font-size: 12px;
}

/* Records table */

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table {
    overflow: hidden;
    background: var(--surface);
    border-color: var(--line);
    border-radius: var(--radius);
    box-shadow: none;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table
    table {
    width: 100%;
    margin: 0;
    background: transparent;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table
    thead {
    background: var(--surface-subtle);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table
    th {
    height: 34px;
    padding: 8px 12px;
    color:
        color-mix(
            in srgb,
            var(--accent) 66%,
            var(--muted)
        );
    border-bottom-color: var(--line);
    font-size: 11px;
    font-weight: 650;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table
    td {
    height: 40px;
    padding: 8px 12px;
    color: var(--ink-soft);
    border-bottom-color: var(--line);
    font-size: 13px;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table
    tbody
    tr:nth-child(even) {
    background:
        color-mix(
            in srgb,
            var(--surface-subtle) 55%,
            transparent
        );
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table
    tbody
    tr:hover {
    background: var(--accent-soft);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table
    td:nth-child(3) {
    color: var(--accent-hover);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-table
    td:nth-child(6) {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: end;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-total {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 10px;
    min-height: 42px;
    padding: 10px 14px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-total
    bdi {
    color: var(--primary);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

html[data-design-theme="ember-tide"]
    #transport
    .transport-records-total
    span {
    color: var(--muted);
    font-size: 12px;
}

/* Dark-mode table separation */

html[data-design-theme="ember-tide"][data-theme="dark"]
    #transport
    .transport-records-table
    tbody
    tr:nth-child(even) {
    background: #0c1519;
}

html[data-design-theme="ember-tide"][data-theme="dark"]
    #transport
    .transport-records-table
    tbody
    tr:hover {
    background: #103033;
}

/* Responsive layout */

@media (max-width: 1180px) {
    html[data-design-theme="ember-tide"]
        #transport
        .transport-main-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }

    html[data-design-theme="ember-tide"]
        #transport
        .transport-main-fields
        > :nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }

    html[data-design-theme="ember-tide"]
        #transport
        .transport-action-stack {
        grid-column: 1 / -1;
        grid-row: auto;
        grid-template-columns: minmax(0, 1fr) 170px;
    }
}

@media (max-width: 760px) {
    html[data-design-theme="ember-tide"]
        #transport
        .detail-section__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    html[data-design-theme="ember-tide"]
        #transport
        .transport-main-fields {
        grid-template-columns: 1fr;
    }

    html[data-design-theme="ember-tide"]
        #transport
        .transport-action-stack {
        grid-template-columns: 1fr;
    }

    html[data-design-theme="ember-tide"]
        #transport
        .transport-object-field,
    html[data-design-theme="ember-tide"]
        #transport
        .transport-submit-button {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        min-width: 0;
    }

    html[data-design-theme="ember-tide"]
        #transport
        .transport-route-visual {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    html[data-design-theme="ember-tide"]
        #transport
        .transport-route-track {
        width: 100%;
        min-width: 0;
    }

    html[data-design-theme="ember-tide"]
        #transport
        .transport-route-point--destination {
        justify-content: flex-start;
    }
}