:root {
    color-scheme: light;
    --bg: #f6f7f5;
    --surface: #ffffff;
    --surface-soft: #f0f3ef;
    --surface-strong: #e4e9e2;
    --text: #17211b;
    --muted: #66736a;
    --border: #dbe2dc;
    --primary: #16803c;
    --primary-strong: #0f6b31;
    --primary-soft: #dff5e7;
    --danger: #b42318;
    --warning: #b45309;
    --info: #1d4ed8;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101411;
    --surface: #171d19;
    --surface-soft: #202821;
    --surface-strong: #2c352d;
    --text: #e8eee9;
    --muted: #a6b2aa;
    --border: #334036;
    --primary: #38a85f;
    --primary-strong: #4fc978;
    --primary-soft: #173b25;
    --danger: #f87171;
    --warning: #f59e0b;
    --info: #60a5fa;
    --shadow: none;
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
}

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

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    color: var(--text);
    letter-spacing: 0;
}

h1 {
    margin: 0 0 18px;
    font-size: clamp(1.65rem, 1.35rem + 1vw, 2.25rem);
    line-height: 1.1;
}

h2 {
    margin: 26px 0 12px;
    font-size: 1.2rem;
}

h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

p {
    margin: 8px 0;
}

form {
    margin: 0;
}

label {
    display: block;
    margin: 14px 0 5px;
    color: var(--text);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    max-width: 560px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    padding: 9px 13px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--primary-strong);
    text-decoration: none;
}

.button.compact,
button.compact {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

button:disabled,
.button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.button.secondary,
button.secondary {
    background: var(--surface-strong);
    color: var(--text);
}

.tracking-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.button.whatsapp-button,
.whatsapp-button {
    min-height: 44px;
    padding: 11px 16px;
    background: #25d366;
    color: #062d18;
    font-weight: 800;
}

.button.whatsapp-button:hover,
.whatsapp-button:hover {
    background: #1ebe5d;
    color: #062d18;
}

.flash-cta {
    margin-top: 10px;
}

@media (max-width: 640px) {
    .tracking-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tracking-actions .button,
    .tracking-actions button {
        width: 100%;
    }
}

.button.danger,
button.danger {
    background: var(--danger);
    color: #ffffff;
}

.icon-button {
    min-width: 40px;
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.header-btn {
    position: relative;
    display: inline-flex;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 0;
    text-decoration: none;
    line-height: 1;
    box-shadow: none;
}

.header-btn:hover,
.header-btn:focus-visible {
    border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
    background: var(--primary-soft);
    color: var(--primary-strong);
    text-decoration: none;
}

.header-btn:active {
    background: var(--surface-strong);
}

.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--border);
    background: var(--surface);
    padding: 18px;
}

.brand-block {
    display: grid;
    gap: 3px;
    margin-bottom: 24px;
}

.brand,
.brand-block .brand {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
}

.brand-logo-link {
    display: inline-flex;
    width: 148px;
    max-width: 100%;
    align-items: center;
}

.brand-logo {
    display: block;
    width: 100%;
    height: auto;
}

.brand-logo-dark {
    display: none;
}

:root[data-theme="dark"] .brand-logo-light {
    display: none;
}

:root[data-theme="dark"] .brand-logo-dark {
    display: block;
}

.brand-fallback {
    display: none;
}

.brand-block span,
.topbar-title span {
    color: var(--muted);
    font-size: .87rem;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav a,
.sidebar-subnav-toggle,
.mechanic-nav a {
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
}

.sidebar-nav a,
.sidebar-subnav-toggle {
    padding: 10px 11px;
}

.sidebar-nav a.active,
.sidebar-nav a:hover,
.sidebar-subnav-toggle.active,
.sidebar-subnav-toggle:hover,
.mechanic-nav a.active,
.mechanic-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary-strong);
    text-decoration: none;
}

.sidebar-subnav {
    display: grid;
    gap: 4px;
}

.sidebar-subnav-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    font-size: .95rem;
    text-align: left;
}

.sidebar-subnav-toggle span:first-child::before {
    content: "🔧";
    margin-right: 8px;
}

.sidebar-subnav-chevron::before {
    content: "▸";
    display: inline-block;
    transition: transform .15s ease;
}

.sidebar-subnav.open .sidebar-subnav-chevron::before {
    transform: rotate(90deg);
}

.sidebar-subnav-items {
    display: grid;
    gap: 3px;
    border-left: 1px solid var(--border);
    margin-left: 12px;
    padding-left: 8px;
}

.sidebar-subnav-items a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-left: 13px;
    font-size: .88rem;
    font-weight: 650;
}

.sidebar-subnav-items a.active {
    border-left: 3px solid var(--primary);
    padding-left: 10px;
}

.compact-table th,
.compact-table td {
    padding: 7px;
}

.compact-table input,
.compact-table select {
    min-height: 36px;
    padding: 7px 9px;
}

.compact-table .button {
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
}

.app-frame {
    min-width: 0;
}

.topbar,
.mechanic-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    padding: 12px 22px;
}

.topbar-title {
    display: grid;
    gap: 1px;
    margin-right: auto;
}

.sidebar-toggle {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-button .notification-icon {
    width: 19px;
    height: 19px;
}

.notification-button .notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    display: inline-flex;
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 0;
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 0 0 2px var(--surface);
    padding: 0;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.notification-button .notification-badge[hidden] {
    display: none;
}

.locale-switcher {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
}

.locale-switcher button {
    min-height: 38px;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
}

.locale-switcher button.active {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.mechanic-header-actions .locale-switcher {
    flex: 0 0 auto;
}

.mechanic-header-actions .locale-switcher button {
    min-width: 38px;
    padding: 0 9px;
}

.content,
.mechanic-content {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.content-narrow {
    width: min(100%, 520px);
}

.mechanic-layout {
    background: var(--bg);
}

.mechanic-layout h1 {
    margin-bottom: 12px;
    font-size: 1.45rem;
}

.mechanic-layout h2 {
    margin: 18px 0 8px;
    font-size: 1rem;
}

.mechanic-topbar {
    display: grid;
    gap: 6px;
    padding: 8px 12px 6px;
}

.mechanic-topbar .brand {
    margin-right: 0;
}

.mechanic-topbar .brand-logo-link {
    width: auto;
    max-width: 92px;
}

.mechanic-topbar .brand-logo {
    width: auto;
    max-width: 92px;
    max-height: 28px;
    object-fit: contain;
}

.mechanic-header-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.mechanic-nav {
    display: flex;
    gap: 10px;
    width: 100%;
    overflow-x: auto;
    padding: 2px 0 1px;
    scrollbar-width: none;
}

.mechanic-nav-button {
    display: inline-flex;
    flex: 1 1 0;
    min-width: 148px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 12px 16px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.15;
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.mechanic-nav .mechanic-nav-button.active,
.mechanic-nav .mechanic-nav-button:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
}

.mechanic-content {
    width: min(100%, 920px);
    padding: 12px 12px 34px;
}

.mechanic-header-actions {
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.notification-icon,
.theme-symbol {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
}

.notification-icon::before {
    content: "";
    position: absolute;
    inset: 2px 4px 3px;
    border: 2px solid currentColor;
    border-radius: 8px 8px 5px 5px;
}

.notification-icon::after {
    content: "";
    position: absolute;
    left: 6px;
    bottom: 0;
    width: 4px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.theme-symbol::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 -6px 0 -3px currentColor, 0 6px 0 -3px currentColor, 6px 0 0 -3px currentColor, -6px 0 0 -3px currentColor;
}

:root[data-theme="dark"] .theme-symbol::before {
    inset: 2px;
    background: transparent;
    box-shadow: inset -5px -2px 0 0 currentColor;
}

.mechanic-menu {
    position: relative;
}

.mechanic-menu-button {
    font-weight: 900;
    line-height: 1;
}

.mechanic-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    min-width: 132px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
    padding: 5px;
}

.mechanic-menu-dropdown a,
.mechanic-menu-dropdown button {
    width: 100%;
    min-height: 34px;
    justify-content: flex-start;
    display: flex;
    align-items: center;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    padding: 7px 9px;
    text-decoration: none;
}

.mechanic-menu-dropdown a:hover,
.mechanic-menu-dropdown button:hover {
    background: var(--surface-soft);
}

.stack {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.job-page-header {
    display: grid;
    gap: 12px;
}

.job-title-row,
.job-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.job-title-row {
    flex-wrap: wrap;
}

.job-title-row h1 {
    margin: 0;
}

.job-actions-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}

.job-actions-row .button,
.job-actions-row button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.reception-form {
    display: grid;
    gap: 0;
}

.reception-mode-panel {
    display: grid;
    gap: 14px;
}

.reception-mode-toggle {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-width: 440px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.reception-mode-option {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.reception-mode-option.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.reception-mode-option input {
    width: auto;
}

.reception-section h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.reception-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px 14px;
    align-items: start;
}

.reception-form-grid label {
    margin-top: 0;
}

.reception-form-grid input,
.reception-form-grid select,
.reception-form-grid textarea,
.reception-mode-panel input,
.reception-mode-panel select {
    max-width: none;
}

.reception-form-grid textarea {
    min-height: 92px;
}

.reception-form-grid .span-2 {
    grid-column: span 2;
}

.reception-form-grid .span-3 {
    grid-column: 1 / -1;
}

.searchable-select,
.car-combobox {
    position: relative;
    max-width: 720px;
}

.searchable-select input[type="search"],
.car-combobox input {
    width: 100%;
    max-width: none;
}

.searchable-select-results,
.car-combobox-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 30;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .14);
    padding: 6px;
}

.searchable-select-option,
.car-combobox-option {
    display: block;
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    padding: 9px 10px;
    text-align: left;
    font-weight: 700;
}

.searchable-select-option:hover,
.searchable-select-option.active,
.car-combobox-option:hover,
.car-combobox-option.active {
    background: var(--surface-soft);
}

.searchable-select-empty,
.car-combobox-empty {
    padding: 10px;
    color: var(--muted);
    font-weight: 700;
}

.reception-actions {
    margin-bottom: 18px;
}

.panel,
.card,
.job-card,
.task-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 18px;
    margin-bottom: 18px;
}

.job-detail-sections {
    display: grid;
    gap: 28px;
    margin-top: 18px;
}

.job-detail-section {
    margin: 0;
}

.job-detail-section.panel {
    margin-bottom: 0;
}

.job-detail-section > h2:first-child {
    margin: 0 0 12px;
}

.job-detail-section > .stack:first-child {
    margin-bottom: 12px;
}

.job-detail-section > .stack:first-child > h2 {
    margin: 0;
}

.job-detail-two-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
}

.job-detail-two-column > .panel {
    min-width: 0;
    margin-bottom: 0;
}

.job-detail-two-column > .panel:only-child {
    grid-column: 1 / -1;
}

.job-detail-two-column > .panel > h2:first-child {
    margin: 0 0 12px;
}

.job-detail-two-column input,
.job-detail-two-column textarea {
    max-width: none;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.card {
    padding: 16px;
}

.card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 2rem;
    line-height: 1;
}

.card span,
.muted {
    color: var(--muted);
}

.dashboard-page h1 {
    margin-bottom: 14px;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 16px;
}

.subscription-card {
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 14px;
}

.subscription-card h2 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.subscription-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.subscription-card dl > div {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 24px;
}

.subscription-card dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.subscription-card dd {
    margin: 0;
    color: var(--text);
    font-weight: 800;
    text-align: right;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 10px;
}

.stat-card {
    min-height: 86px;
    padding: 13px;
}

.stat-card strong {
    font-size: 1.65rem;
}

.dashboard-actions {
    margin: 8px 0 16px;
}

.client-search-form input[type="search"] {
    min-width: 240px;
}

.mechanic-filter-wrap {
    max-width: 420px;
    margin-bottom: 12px;
}

.mechanic-filter-wrap input {
    max-width: none;
}

.mechanic-picker {
    display: grid;
    gap: 8px;
}

.mechanic-picker input,
.mechanic-picker select {
    max-width: none;
}

.mechanic-warning {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--border));
    border-radius: 6px;
    background: color-mix(in srgb, var(--warning) 12%, var(--surface));
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.mechanic-select {
    min-width: 210px;
    min-height: 44px;
    font-weight: 700;
}

.mechanic-select.has-selection {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
}

.estimate-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
    align-items: start;
    margin: 14px 0 18px;
}

.estimate-info-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 12px;
}

.estimate-info-card h2 {
    margin: 0 0 8px;
    font-size: .95rem;
    line-height: 1.2;
}

.info-list {
    display: grid;
    gap: 6px;
    margin: 0;
}

.info-list > div {
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.info-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.info-list dd {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.job-summary-panel {
    padding: 16px;
}

.job-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
    gap: 20px;
    align-items: start;
}

.job-summary-details:only-child {
    grid-column: 1 / -1;
}

.job-info-list {
    gap: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.job-info-list > .job-info-row {
    display: grid;
    grid-template-columns: minmax(118px, 34%) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 11px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.job-info-list > .job-info-row:last-child {
    border-bottom: 0;
}

.job-info-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.job-info-value {
    min-width: 0;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.job-info-value--description {
    line-height: 1.5;
}

.job-summary-update h2 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.job-update-form {
    display: grid;
    gap: 8px;
}

.job-update-form label {
    margin: 0;
}

.job-update-form select,
.job-update-form textarea,
.job-update-form .searchable-select,
.job-update-form .searchable-select input[type="search"],
.reception-form-grid .searchable-select {
    max-width: none;
}

.job-update-form textarea {
    min-height: 76px;
}

.job-update-form button {
    justify-self: start;
}

.job-note-form button[type="submit"] {
    margin-top: 10px;
}

.job-move-back-form {
    margin-top: 12px;
}

.attention {
    background: color-mix(in srgb, #fff7ed 72%, var(--surface));
    border-color: color-mix(in srgb, var(--warning) 38%, var(--border));
}

:root[data-theme="dark"] .attention {
    background: #281f12;
}

.completed-job-row {
    background: color-mix(in srgb, var(--primary-soft) 64%, var(--surface));
}

:root[data-theme="dark"] .completed-job-row {
    background: color-mix(in srgb, var(--primary-soft) 62%, var(--surface));
}

.completed-task-badge {
    gap: 4px;
}

.inline-check {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.inline-check input {
    width: auto;
    max-width: none;
}

.success,
.errors {
    border-radius: 6px;
    padding: 11px 12px;
    margin-bottom: 16px;
}

.success {
    border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border));
    background: var(--primary-soft);
    color: var(--text);
}

.compact-hint {
    display: inline-flex;
    width: auto;
    align-items: center;
    margin: 0 0 8px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 700;
}

.errors {
    border: 1px solid color-mix(in srgb, var(--danger) 50%, var(--border));
    background: color-mix(in srgb, var(--danger) 13%, var(--surface));
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.in_progress,
.badge.sent,
.badge.ordered {
    background: color-mix(in srgb, var(--info) 18%, var(--surface));
    color: var(--info);
}

.badge.need_parts,
.badge.blocked,
.badge.high,
.badge.requested,
.badge.medium {
    background: color-mix(in srgb, var(--warning) 18%, var(--surface));
    color: var(--warning);
}

.badge.completed,
.badge.received,
.badge.low,
.badge.approved,
.badge.active {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.badge.cancelled,
.badge.rejected,
.badge.inactive,
.badge.admin_only {
    background: color-mix(in srgb, var(--danger) 16%, var(--surface));
    color: var(--danger);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

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

th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.unread {
    background: var(--primary-soft);
    font-weight: 700;
}

.task-action-buttons,
.job-status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-status-button,
.job-status-button {
    min-width: 112px;
    border: 2px solid transparent;
    padding: 11px 14px;
    font-weight: 800;
}

.task-status-button.pending {
    background: var(--surface-strong);
    color: var(--text);
}

.task-status-button.start,
.job-status-button.in-progress {
    background: var(--info);
}

.task-status-button.blocked,
.task-status-button.need-parts {
    background: var(--warning);
}

.task-status-button.done,
.job-status-button.completed {
    background: var(--primary);
}

.task-status-button.active,
.job-status-button.active {
    border-color: var(--text);
    box-shadow: inset 0 0 0 2px var(--surface);
}

.task-status-message:empty {
    display: none;
}

.task-note-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgb(0 0 0 / 42%);
}

.task-note-dialog {
    width: min(100%, 460px);
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.task-note-dialog label {
    margin: 0;
}

.task-note-dialog span {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

.task-note-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
    flex-wrap: wrap;
}

.blocked-reason-picker {
    display: grid;
    gap: 10px;
}

.blocked-reason-options {
    display: grid;
    gap: 8px;
}

.blocked-reason-options .button {
    width: 100%;
    justify-content: flex-start;
}

.blocked-reason-options .button.active {
    border-color: var(--warning);
    background: color-mix(in srgb, var(--warning) 22%, var(--surface));
    color: var(--text);
}

.blocked-reason {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    padding: 5px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--warning) 18%, var(--surface));
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.blocked-reason span {
    display: inline-grid;
    width: 16px;
    height: 16px;
    place-items: center;
    border-radius: 999px;
    background: var(--warning);
    color: #111827;
    font-size: 11px;
}

.blocked-task-card,
.blocked-task-row {
    background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}

.job-card {
    padding: 16px;
    margin-bottom: 14px;
}

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

.job-card-title {
    display: grid;
    gap: 2px;
}

.job-card-title strong {
    font-size: 1.15rem;
}

.job-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 9px;
    margin: 12px 0;
}

.job-meta span {
    display: grid;
    color: var(--muted);
    font-size: .86rem;
}

.job-meta strong {
    color: var(--text);
    font-size: .98rem;
}

.task-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.task-card {
    padding: 12px;
}

.task-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.mechanic-layout .task-status-button,
.mechanic-layout .job-status-button {
    min-height: 54px;
    min-width: 132px;
    flex: 1 1 calc(50% - 8px);
    font-size: 1rem;
}

.mechanic-layout .task-action-buttons,
.mechanic-layout .job-status-actions {
    width: 100%;
}

.mechanic-group {
    margin-bottom: 28px;
}

.mechanic-layout .job-card {
    margin-bottom: 10px;
    padding: 12px;
}

.mechanic-layout .job-card-header {
    margin-bottom: 8px;
}

.mechanic-layout .task-list {
    gap: 8px;
    margin-top: 8px;
}

.mechanic-layout .task-card {
    padding: 10px;
}

.mechanic-layout .task-card-main {
    margin-bottom: 8px;
}

.pagination,
nav[role="navigation"] {
    margin-top: 18px;
}

[data-ajax-busy="true"] {
    opacity: .72;
}

@media (min-width: 1024px) {
    .job-detail-two-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        z-index: 50;
        inset: 0 auto 0 0;
        width: min(82vw, 280px);
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .content {
        padding: 20px 14px 36px;
    }

    .topbar,
    .mechanic-topbar {
        padding: 10px 12px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .mechanic-header-actions {
        width: auto;
        justify-content: flex-end;
    }

    .dashboard-summary {
        grid-template-columns: 1fr;
    }

    .subscription-card {
        max-width: none;
    }

    .dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .estimate-info-grid {
        grid-template-columns: 1fr;
    }

    .reception-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reception-form-grid .span-3 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .task-note-modal {
        align-items: flex-end;
    }

    body {
        font-size: 14px;
    }

    .job-detail-sections {
        gap: 24px;
    }

    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reception-mode-toggle,
    .reception-form-grid {
        grid-template-columns: 1fr;
    }

    .reception-form-grid .span-2,
    .reception-form-grid .span-3 {
        grid-column: 1 / -1;
    }

    .panel,
    .card,
    .job-card {
        padding: 14px;
    }

    .job-summary-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .job-info-list > .job-info-row {
        grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .stack > h1,
    .stack > h2 {
        width: 100%;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }

    th,
    td {
        min-width: 130px;
    }

    .mechanic-topbar {
        padding: 6px 8px 5px;
        gap: 4px;
    }

    .mechanic-topbar .brand {
        width: auto;
    }

    .mechanic-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 1px;
        gap: 6px;
    }

    .mechanic-nav-button {
        min-width: 116px;
        min-height: 48px;
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .mechanic-content {
        padding: 10px 8px 28px;
    }

    .mechanic-layout table {
        display: table;
        overflow: visible;
    }
}

@media (max-width: 520px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .dashboard-stat-grid {
        grid-template-columns: 1fr;
    }

    .subscription-card dl > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .subscription-card dd {
        text-align: left;
    }

    .info-list > div {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .client-search-form input[type="search"] {
        min-width: 0;
        max-width: none !important;
        width: 100%;
    }

    button,
    .button {
        width: auto;
    }

    .mechanic-layout .button,
    .mechanic-layout button[type="submit"],
    .mechanic-layout .task-status-button {
        width: 100%;
    }

    .mechanic-header-actions .locale-switcher button {
        width: auto;
    }

    .mechanic-layout .task-status-button {
        flex-basis: 100%;
    }
}
