:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #172033;
  --muted: #687386;
  --line: #e6e9ef;
  --brand: #d51f2a;
  --brand-dark: #a9111b;
  --brand-soft: #fff0f1;
  --sidebar: #1b0d10;
  --sidebar-hover: #351419;
  --danger: #c93636;
  --danger-soft: #fff0f0;
  --success: #18794e;
  --success-soft: #ebf8f1;
  --warning: #9a6500;
  --warning-soft: #fff7df;
  --purple: #6b4eff;
  --shadow: 0 10px 30px rgba(83, 18, 25, .08);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: white; padding: 18px 14px; height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; overflow-y: auto; z-index: 50; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 5px 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: white; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand); color: white; font-weight: 900; letter-spacing: -.03em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { color: #9da8ba; font-size: 11px; margin-top: 1px; }
.workspace-card { background: #1a2535; border: 1px solid #2a384c; border-radius: 12px; padding: 12px; margin: 4px 2px 14px; }
.workspace-card strong, .workspace-card small, .workspace-card span { display: block; }
.workspace-card strong { margin: 3px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-card small { color: #9da8ba; }
.workspace-label { color: #7890ff; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.admin-card { background: linear-gradient(135deg, #202d4e, #1a2535); }
.nav-list { display: flex; flex-direction: column; gap: 3px; }
.nav-heading { color: #7e8a9f; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; padding: 18px 12px 6px; }
.nav-link { color: #cbd3df; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 11px; border-radius: 9px; font-weight: 600; }
.nav-link:hover { color: white; background: var(--sidebar-hover); }
.nav-link.active { color: white; background: #27365a; box-shadow: inset 3px 0 0 #6f8cff; }
.nav-icon { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; color: #9aa8bb; }
.nav-link.active .nav-icon { color: #8ea5ff; }
.nav-more { margin-top: 3px; }
.nav-more > summary { list-style: none; cursor: pointer; user-select: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more-summary .nav-chevron { margin-left: auto; color: #8f9caf; transition: transform .16s ease; }
.nav-more[open] .nav-chevron { transform: rotate(180deg); }
.nav-more-items { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; padding-left: 14px; }
.nav-sub-link { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 14px; }
.nav-sub-link .nav-icon { width: 18px; height: 18px; flex-basis: 18px; }
.sidebar-footer { margin-top: auto; padding-top: 18px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 10px; color: white; }
.user-card:hover { background: var(--sidebar-hover); }
.user-card strong, .user-card small { display: block; max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { color: #98a2b3; margin-top: 2px; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: #dfe6ff; color: #2546b8; font-weight: 800; }
.logout-btn { width: 100%; border: 0; color: #aeb8c7; background: transparent; text-align: left; padding: 8px 10px; cursor: pointer; }
.logout-btn:hover { color: white; }
.main { min-width: 0; }
.topbar { height: 68px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 28px; position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); }
.topbar-title strong, .topbar-title small { display: block; }
.topbar-title small { color: var(--muted); margin-top: 2px; }
.global-search { height: 42px; flex: 1; max-width: 680px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.global-search span { color: var(--muted); font-size: 18px; }
.global-search input { border: 0; outline: 0; padding: 0; background: transparent; width: 100%; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.quick-add { background: var(--brand); color: white; padding: 10px 14px; border-radius: 9px; font-weight: 750; }
.quick-add:hover { background: var(--brand-dark); }
.topbar-user { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 650; }
.small-avatar { width: 32px; height: 32px; flex-basis: 32px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 22px; color: inherit; }
.menu-btn, .sidebar-close { display: none; }
.content { padding: 28px; max-width: 1560px; margin: 0 auto; }
.admin-workspace-banner { margin: -6px 0 20px; display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #202d4e; color: white; border-radius: 11px; padding: 11px 14px; }
.page-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.page-header h1 { margin: 0; font-size: 29px; letter-spacing: -.03em; }
.page-header p, .page-header .muted { margin-top: 6px; }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.card-head h2, .card h2, .card h3 { margin: 0; }
.card h2 { font-size: 18px; }
.card h3 { font-size: 15px; }
.card-subtitle { color: var(--muted); margin: 4px 0 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-label { color: var(--muted); font-weight: 650; }
.stat-value { font-size: 29px; line-height: 1; font-weight: 850; letter-spacing: -.04em; margin: 9px 0 5px; }
.stat-note { font-size: 12px; color: var(--muted); }
.stat-icon { position: absolute; right: 15px; top: 15px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.ui-icon { width: 19px; height: 19px; display: block; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon .ui-icon { width: 18px; height: 18px; }
.quick-actions { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.quick-action { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 13px; padding: 14px; display: flex; align-items: center; gap: 11px; color: var(--text); box-shadow: 0 3px 12px rgba(20,31,56,.04); }
.quick-action:hover { border-color: #b7c5ff; transform: translateY(-1px); }
.quick-action-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); }
.quick-action-icon .ui-icon { width: 20px; height: 20px; }
.quick-action-copy { min-width: 0; display: block; }
.quick-action-copy strong, .quick-action-copy small { display: block; }
.quick-action-copy strong { color: var(--text); font-weight: 800; line-height: 1.25; }
.quick-action-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 3px; }
.dashboard-shortcuts .quick-action:first-child { border-color: #efc2c6; background: #fffafb; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); background: #fafbfc; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
.row-title { color: var(--text); font-weight: 750; }
.amount { text-align: right; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: #3152bf; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: #eef0f4; color: #596274; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; font-weight: 750; color: var(--text); background: white; }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { border-color: #d8dce5; color: #364153; }
.btn-secondary:hover { background: #f7f8fa; }
.btn-dark { background: white; color: #172033; min-height: 34px; }
.btn-danger { background: var(--danger-soft); border-color: #ffd0d0; color: var(--danger); }
.btn-success { background: var(--success-soft); border-color: #b8e7cf; color: var(--success); }
.btn-sm { min-height: 33px; padding: 6px 10px; font-size: 12px; }
form.inline { display: inline-flex; align-items: center; gap: 7px; }
.form-card { max-width: 920px; }
.form-section { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border: 0; margin-bottom: 0; }
.form-section-title { margin-bottom: 14px; }
.form-section-title h2 { margin: 0; font-size: 17px; }
.form-section-title p { margin: 4px 0 0; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 12px; font-weight: 750; margin-bottom: 6px; color: #3d4758; }
input, select, textarea { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #d6dae3; border-radius: 9px; background: white; color: var(--text); outline: 0; }
input:focus, select:focus, textarea:focus { border-color: #8ea5ff; box-shadow: 0 0 0 3px rgba(41,86,232,.10); }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"] { width: auto; min-height: auto; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.field-help { color: var(--muted); font-size: 11px; margin-top: 5px; }
.search-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.search-row input { min-width: 250px; flex: 1; }
.search-row select { width: auto; min-width: 170px; }
.tabs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 16px; }
.tab { color: var(--muted); padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-weight: 700; }
.tab:hover { background: white; }
.tab.active { color: var(--brand); background: var(--brand-soft); }
.empty-state { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty-state strong { color: var(--text); display: block; margin-bottom: 5px; }
.flash { display: flex; gap: 9px; align-items: center; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; background: var(--success-soft); color: #126441; border: 1px solid #b8e7cf; }
.flash > span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #cdf0dd; font-weight: 900; }
.flash.error { background: var(--danger-soft); color: #9f2d2d; border-color: #ffd0d0; }
.flash.error > span { background: #ffd7d7; }
.detail-list { display: grid; grid-template-columns: 180px 1fr; gap: 10px 14px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 600; }
.timeline { display: flex; flex-direction: column; }
.timeline-row { display: grid; grid-template-columns: 70px 10px 1fr auto; gap: 12px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.timeline-row:last-child { border: 0; }
.timeline-time { font-weight: 800; }
.timeline-line { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 5px; box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline-main strong, .timeline-main small { display: block; }
.timeline-main small { color: var(--muted); margin-top: 3px; }
.workflow-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.workflow-column { background: #f4f6fa; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 170px; }
.workflow-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; font-weight: 800; font-size: 12px; }
.count-pill { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: white; color: var(--muted); }
.job-card { display: block; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 8px; color: var(--text); box-shadow: 0 2px 7px rgba(20,31,56,.04); }
.job-card:hover { border-color: #aebeff; }
.job-card strong { display: block; }
.job-card small { display: block; color: var(--muted); margin-top: 3px; }
.job-card .job-total { margin-top: 9px; color: var(--text); font-weight: 800; }
.alert-list { display: flex; flex-direction: column; }
.alert-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border: 0; }
.service-card-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.service-card { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 17px; box-shadow: var(--shadow); color: var(--text); }
.service-card:hover { border-color: #b7c5ff; }
.service-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.service-card h3 { margin: 0; font-size: 16px; }
.service-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.service-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.service-metric { background: var(--panel-soft); border-radius: 9px; padding: 9px; }
.service-metric strong, .service-metric small { display: block; }
.service-metric small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.sticky-card { position: sticky; top: 88px; }
.accordion { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 9px; background: white; overflow: hidden; }
.accordion summary { cursor: pointer; list-style: none; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 750; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion-body { padding: 0 15px 15px; border-top: 1px solid var(--line); padding-top: 15px; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 520px) 1fr; background: white; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 42px; }
.login-card { width: 100%; max-width: 390px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 42px; }
.login-card h1 { font-size: 32px; letter-spacing: -.04em; margin: 0 0 8px; }
.login-card > p { margin: 0 0 25px; }
.login-visual { background: linear-gradient(145deg, #111a2e, #233e94); color: white; display: flex; align-items: center; justify-content: center; padding: 60px; }
.login-visual-content { max-width: 620px; }
.login-visual h2 { font-size: 42px; line-height: 1.12; letter-spacing: -.04em; margin: 0 0 18px; }
.login-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-top: 35px; }
.login-feature { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 15px; }
.public-page { max-width: 980px; margin: 30px auto; padding: 0 18px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.photo-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: white; }
.photo-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.photo-card .body { padding: 10px; }
.print-only { display: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.mobile-overlay { display: none; }
@media (max-width: 1200px) {
  .quick-actions { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .service-card-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split-layout { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
}
@media (max-width: 940px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .mobile-overlay { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(5,10,20,.5); }
  .menu-btn, .sidebar-close { display: inline-grid; place-items: center; }
  .topbar { padding: 0 18px; }
  .global-search { max-width: none; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .quick-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}
@media (max-width: 680px) {
  .content { padding: 18px 14px; }
  .topbar { height: 62px; gap: 10px; }
  .global-search { display: none; }
  .topbar-title small, .desktop-only { display: none; }
  .quick-add { padding: 9px 10px; font-size: 12px; }
  .page-header { flex-direction: column; }
  .page-header h1 { font-size: 25px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .form-grid, .form-grid.grid-3 { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .service-card-list { grid-template-columns: 1fr; }
  .search-row { align-items: stretch; }
  .search-row input, .search-row select { width: 100%; min-width: 0; }
  .detail-list { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 55px 8px 1fr; }
  .timeline-row > :last-child { grid-column: 3; }
  .admin-workspace-banner { align-items: flex-start; flex-direction: column; }
  .login-panel { padding: 25px; }
}
@media print {
  .sidebar, .topbar, .no-print, .flash { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .print-only { display: block; }
}
.status-steps { display: grid; grid-template-columns: repeat(6, minmax(120px,1fr)); gap: 7px; overflow-x: auto; margin-bottom: 18px; }
.status-step { min-width: 120px; position: relative; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); font-size: 11px; font-weight: 800; text-align: center; }
.status-step.done { background: var(--success-soft); color: var(--success); border-color: #b8e7cf; }
.status-step.current { background: var(--brand); color: white; border-color: var(--brand); }
.order-summary { background: #172033; color: white; border-radius: 13px; padding: 18px; }
.order-summary .summary-line { display:flex; justify-content:space-between; gap:12px; padding:7px 0; color:#c7cfdd; }
.order-summary .summary-total { display:flex; justify-content:space-between; gap:12px; padding-top:13px; margin-top:9px; border-top:1px solid #344056; font-size:20px; font-weight:850; color:white; }
.section-nav { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.section-nav a { color:var(--muted); background:white; border:1px solid var(--line); padding:7px 10px; border-radius:8px; font-weight:700; }
.order-meta-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.order-meta-item { background:var(--panel-soft); border-radius:10px; padding:11px; }
.order-meta-item small,.order-meta-item strong { display:block; }
.order-meta-item small { color:var(--muted); margin-bottom:4px; }
@media (max-width:900px){.order-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:600px){.order-meta-grid{grid-template-columns:1fr;}}

/* Simplified mechanic workspace */
.mechanic-body { margin: 0; min-height: 100vh; background: #f3f5f8; color: #172033; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.mechanic-topbar { min-height: 72px; padding: 0 28px; background: #172033; color: white; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mechanic-brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.mechanic-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: white; color: #172033; font-weight: 900; }
.mechanic-brand strong, .mechanic-brand small { display: block; }
.mechanic-brand small { opacity: .65; margin-top: 2px; font-size: 11px; }
.mechanic-user { display: flex; align-items: center; gap: 16px; font-weight: 700; }
.mechanic-logout { border: 1px solid rgba(255,255,255,.25); background: transparent; color: white; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 750; }
.mechanic-main { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 54px; }
.mechanic-flash { margin-bottom: 18px; padding: 14px 16px; border-radius: 12px; background: #dcf7e8; color: #16633d; font-weight: 750; }
.mechanic-flash.error { background: #ffe6e6; color: #9d2929; }
.mechanic-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.mechanic-heading h1 { margin: 3px 0 5px; font-size: clamp(28px, 5vw, 42px); letter-spacing: -.04em; }
.mechanic-heading p { margin: 0; color: #697386; }
.mechanic-date { color: #697386; font-size: 13px; font-weight: 800; }
.mechanic-count { min-width: 112px; background: white; border: 1px solid #e0e4eb; border-radius: 16px; padding: 16px; text-align: center; font-size: 30px; font-weight: 900; box-shadow: 0 6px 22px rgba(23,32,51,.06); }
.mechanic-count small { display: block; color: #697386; font-size: 11px; margin-top: 3px; }
.mechanic-job-list { display: flex; flex-direction: column; gap: 14px; }
.mechanic-job-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 21px; background: white; border: 1px solid #dfe4ec; border-radius: 17px; color: #172033; text-decoration: none; box-shadow: 0 5px 18px rgba(23,32,51,.05); }
.mechanic-job-card:hover { border-color: #8097ef; transform: translateY(-1px); }
.mechanic-job-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.mechanic-plate { display: inline-flex; align-items: center; justify-content: center; min-width: 112px; min-height: 48px; padding: 5px 13px; border: 3px solid #172033; border-radius: 8px; background: white; font-size: 20px; font-weight: 950; letter-spacing: .06em; white-space: nowrap; }
.mechanic-plate.large { font-size: 25px; min-width: 144px; min-height: 56px; }
.mechanic-job-card h2 { margin: 0 0 5px; font-size: 20px; }
.mechanic-job-card p { margin: 0; color: #697386; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mechanic-job-side { display: flex; min-width: 155px; flex-direction: column; align-items: flex-end; gap: 7px; }
.mechanic-job-side small { color: #697386; }
.mechanic-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; background: #eef1f5; font-size: 12px; font-weight: 850; }
.status-in_progress { background: #e4ebff; color: #294ca8; }
.status-waiting_parts { background: #fff2d3; color: #8b5a00; }
.status-diagnostics { background: #eee8ff; color: #5e3bad; }
.status-ready { background: #daf6e6; color: #14643d; }
.large-status { padding: 10px 15px; font-size: 14px; }
.mechanic-empty { padding: 70px 24px; background: white; border: 1px solid #dfe4ec; border-radius: 18px; text-align: center; }
.mechanic-empty > div { width: 60px; height: 60px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; background: #daf6e6; color: #14643d; font-size: 28px; }
.mechanic-empty h2 { margin: 0 0 7px; }
.mechanic-empty p { margin: 0; color: #697386; }
.mechanic-ready-section { margin-top: 30px; }
.mechanic-ready-section h2 { font-size: 17px; }
.mechanic-ready-row { display: flex; justify-content: space-between; gap: 15px; padding: 13px 15px; margin-top: 8px; background: rgba(255,255,255,.7); border-radius: 11px; color: #697386; }
.mechanic-back { display: inline-block; margin-bottom: 20px; color: #40547c; text-decoration: none; font-weight: 800; }
.mechanic-job-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.mechanic-job-header > div { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mechanic-job-header h1 { margin: 0; font-size: 28px; }
.mechanic-job-header p { width: 100%; margin: -8px 0 0 162px; color: #697386; }
.mechanic-simple-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 18px; }
.mechanic-panel { background: white; border: 1px solid #dfe4ec; border-radius: 18px; padding: 24px; box-shadow: 0 6px 22px rgba(23,32,51,.05); }
.mechanic-panel-label { margin-bottom: 14px; color: #697386; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.mechanic-problem { font-size: 22px; line-height: 1.45; font-weight: 750; }
.mechanic-deadline { margin-top: 24px; padding-top: 17px; border-top: 1px solid #e5e8ee; color: #697386; }
.mechanic-note-label { display: block; margin-bottom: 9px; font-size: 17px; font-weight: 850; }
.mechanic-note { width: 100%; min-height: 150px; resize: vertical; border: 2px solid #dce2eb; border-radius: 13px; padding: 14px; font: inherit; box-sizing: border-box; }
.mechanic-note:focus { outline: none; border-color: #4968d8; box-shadow: 0 0 0 4px rgba(73,104,216,.11); }
.mechanic-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 14px; }
.mechanic-action { min-height: 54px; border: 0; border-radius: 13px; padding: 13px 16px; cursor: pointer; font-size: 15px; font-weight: 900; }
.mechanic-action:disabled { opacity: .65; cursor: wait; }
.mechanic-action.secondary { background: #edf0f5; color: #27334b; }
.mechanic-action.start { background: #294ca8; color: white; }
.mechanic-action.parts { background: #f3c85a; color: #4b3600; }
.mechanic-action.ready { background: #198754; color: white; }
.mechanic-photo-panel { margin-top: 18px; padding: 18px 24px; }
.mechanic-photo-panel summary { cursor: pointer; font-weight: 850; }
.mechanic-photo-panel form { display: flex; align-items: center; gap: 12px; margin-top: 15px; }
.mechanic-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mechanic-photo-list a { padding: 8px 11px; border-radius: 9px; background: #edf0f5; color: #27334b; text-decoration: none; font-weight: 700; }
@media (max-width: 760px) {
  .mechanic-topbar { padding: 0 16px; }
  .mechanic-user > span { display: none; }
  .mechanic-main { width: min(100% - 24px, 1040px); padding-top: 22px; }
  .mechanic-heading { align-items: flex-start; }
  .mechanic-count { min-width: 86px; padding: 12px; }
  .mechanic-job-card { align-items: flex-start; flex-direction: column; }
  .mechanic-job-main { align-items: flex-start; flex-direction: column; }
  .mechanic-job-side { min-width: 0; width: 100%; align-items: flex-start; }
  .mechanic-simple-grid { grid-template-columns: 1fr; }
  .mechanic-job-header { align-items: flex-start; flex-direction: column; }
  .mechanic-job-header p { margin: 4px 0 0; }
  .mechanic-actions { grid-template-columns: 1fr; }
  .mechanic-action { min-height: 60px; }
  .mechanic-photo-panel form { align-items: stretch; flex-direction: column; }
}

/* V4 customer portal, TA reminders and platform billing */
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-row input { min-width: 0; }
.btn-disabled { background: #eef0f4; color: #8992a2; cursor: not-allowed; }
.danger-banner { background: #7e2828; }
.quick-action { position: relative; }
.quick-badge { margin-left: auto; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: #fff0cf; color: #835600; font-size: 11px; }
.public-message-card { text-align: center; max-width: 560px; }
.public-message-card .btn { margin-top: 10px; }
.small-logo { width: 34px; height: 34px; font-size: 12px; }

.client-portal-body { background: #f3f5f8; color: #172033; }
.client-portal-wrap { width: min(1040px, calc(100% - 28px)); margin: 0 auto; }
.client-portal-header { background: #172033; color: white; padding: 15px 0; }
.client-portal-head-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.client-portal-head-inner > div:first-child { display: flex; align-items: center; gap: 10px; }
.client-contact { display: flex; gap: 14px; flex-wrap: wrap; }
.client-contact a { color: white; opacity: .85; }
.client-welcome { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding: 38px 0 22px; }
.client-welcome h1 { margin: 3px 0 7px; font-size: clamp(28px, 5vw, 42px); }
.client-welcome p { margin: 0; color: #697386; }
.client-today { background: white; border: 1px solid #dfe4ec; padding: 12px 16px; border-radius: 12px; font-weight: 800; }
.client-section { margin-bottom: 24px; }
.client-section > h2 { font-size: 19px; margin: 0 0 12px; }
.client-order-list { display: grid; gap: 14px; }
.client-order-card { background: white; border: 1px solid #dfe4ec; border-radius: 18px; padding: 22px; box-shadow: 0 5px 18px rgba(23,32,51,.05); }
.client-order-card.is-active { border-left: 5px solid #2956e8; }
.client-order-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.client-order-top > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.client-order-top h3 { margin: 0; }
.client-order-top small { width: 100%; color: #697386; margin-left: 105px; }
.client-plate { display: inline-flex; align-items: center; justify-content: center; min-width: 94px; min-height: 42px; border: 3px solid #172033; border-radius: 7px; background: white; font-size: 17px; font-weight: 950; letter-spacing: .05em; }
.client-progress { display: grid; grid-template-columns: repeat(7, minmax(80px,1fr)); overflow-x: auto; gap: 4px; margin: 22px 0; }
.client-progress-step { min-width: 80px; text-align: center; color: #98a2b3; font-size: 10px; font-weight: 800; }
.client-progress-step span { display: block; height: 5px; border-radius: 999px; background: #e4e7ec; margin-bottom: 7px; }
.client-progress-step.done { color: #3152bf; }
.client-progress-step.done span { background: #5f7cf0; }
.client-order-info { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.client-order-info > div { background: #f8f9fb; border-radius: 11px; padding: 13px; }
.client-order-info strong { display: block; margin-bottom: 5px; }
.client-order-info p { margin: 0; color: #5f697a; line-height: 1.45; }
.client-success-note { display: inline-flex; padding: 9px 12px; border-radius: 9px; background: #ebf8f1; color: #18794e; font-weight: 800; }
.client-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.client-two-column .client-section { background: white; border: 1px solid #dfe4ec; border-radius: 16px; padding: 20px; }
.client-list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #e8ebf0; }
.client-list-row:last-child { border-bottom: 0; }
.client-list-row strong, .client-list-row small { display: block; }
.client-list-row small { margin-top: 4px; color: #697386; }
.client-invoice-amount { text-align: right; }
.client-invoice-amount .badge { margin-top: 5px; }
.client-empty { background: white; border: 1px solid #dfe4ec; border-radius: 18px; padding: 50px 22px; text-align: center; margin-bottom: 24px; }
.client-empty > div { width: 56px; height: 56px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: #daf6e6; color: #14643d; font-size: 25px; }
.client-footer { padding: 24px; text-align: center; color: #7c8697; font-size: 12px; }

.ta-card { padding: 0; overflow: hidden; }
.ta-card-top { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px; }
.ta-vehicle { display: flex; align-items: center; gap: 15px; }
.ta-vehicle h2, .ta-vehicle p { margin: 0; }
.ta-vehicle p { margin-top: 4px; color: #687386; }
.ta-due { min-width: 150px; text-align: right; }
.ta-due small, .ta-due strong, .ta-due span { display: block; }
.ta-due strong { font-size: 20px; margin: 3px 0; }
.ta-due span { color: #9a6500; font-weight: 750; }
.ta-due.overdue span { color: #c93636; }
.ta-message-box { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; background: #f7f9fc; border-top: 1px solid #e6e9ef; border-bottom: 1px solid #e6e9ef; }
.ta-message-box p { margin: 5px 0 0; line-height: 1.5; color: #596274; }
.ta-actions-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 22px; padding: 20px; }
.ta-actions-grid > form + form { border-left: 1px solid #e6e9ef; padding-left: 22px; }
.ta-dismiss-form { padding: 0 20px 16px; text-align: right; }
.link-button { border: 0; background: none; color: #7d8797; cursor: pointer; text-decoration: underline; }
.small-stat { font-size: 20px; }

/* Expanded mechanic screen */
.mechanic-primary-task { margin-bottom: 18px; }
.compact-note { min-height: 90px; }
.mechanic-input { width: 100%; min-height: 48px; border: 2px solid #dce2eb; border-radius: 12px; padding: 10px 13px; }
.mechanic-status-panel, .mechanic-billing-panel { margin-top: 18px; }
.expanded-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
.mechanic-action.diagnostic { background: #eee8ff; color: #5e3bad; }
.mechanic-action.approval { background: #fff0cf; color: #805300; }
.mechanic-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.mechanic-section-head h2 { margin: 0; }
.mechanic-total { text-align: right; }
.mechanic-total small, .mechanic-total strong { display: block; }
.mechanic-total small { color: #697386; }
.mechanic-total strong { font-size: 24px; }
.mechanic-items-list { border: 1px solid #e1e5ec; border-radius: 13px; overflow: hidden; }
.mechanic-item-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border-bottom: 1px solid #e6e9ef; }
.mechanic-item-row:last-child { border-bottom: 0; }
.mechanic-item-row small { display: block; margin-top: 4px; color: #697386; }
.mechanic-item-row > div:last-child { display: flex; align-items: center; gap: 8px; }
.mechanic-delete { width: 28px; height: 28px; border: 0; border-radius: 8px; background: #ffe7e7; color: #a82d2d; cursor: pointer; }
.mechanic-empty-small { padding: 18px; border-radius: 12px; background: #f7f8fa; color: #697386; }
.mechanic-details { margin-top: 14px; }
.mechanic-details summary { cursor: pointer; font-weight: 850; }
.mechanic-item-form { display: grid; grid-template-columns: 120px minmax(180px,1fr) 90px 130px 90px auto; gap: 8px; margin-top: 12px; }
.mechanic-item-form input, .mechanic-item-form select, .mechanic-invoice-form input { min-height: 48px; border: 1px solid #dce2eb; border-radius: 10px; padding: 9px 11px; min-width: 0; }
.mechanic-item-form .mechanic-action { min-height: 48px; }
.mechanic-invoice-box { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 17px; border-radius: 14px; background: #172033; color: white; }
.mechanic-invoice-box strong, .mechanic-invoice-box small { display: block; }
.mechanic-invoice-box small { margin-top: 4px; color: #b8c0ce; }
.mechanic-invoice-form { display: flex; align-items: center; gap: 8px; }
.mechanic-invoice-form label { font-size: 12px; white-space: nowrap; color: #cbd2de; }
.mechanic-invoice-form label input { width: 68px; min-height: 42px; margin-left: 4px; }
.mechanic-invoice-form > input { min-height: 42px; }
.invoice-action { display: inline-flex; align-items: center; justify-content: center; background: white; color: #172033; text-decoration: none; white-space: nowrap; }
.mechanic-invoice-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.mechanic-invoice-header h1 { margin: 2px 0; }
.mechanic-invoice-header p { margin: 0 0 18px; color: #697386; }
.mechanic-invoice-sheet { background: white; border: 1px solid #dfe4ec; border-radius: 18px; padding: 30px; }
.mechanic-invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mechanic-invoice-parties small, .mechanic-invoice-parties strong { display: block; }
.mechanic-invoice-parties strong { margin: 5px 0; font-size: 18px; }
.mechanic-invoice-parties p { color: #697386; line-height: 1.5; }
.mechanic-invoice-meta { display: flex; flex-wrap: wrap; gap: 18px; padding: 14px 0; margin: 14px 0; border-top: 1px solid #e6e9ef; border-bottom: 1px solid #e6e9ef; }
.mechanic-invoice-totals { margin-left: auto; width: min(330px,100%); padding-top: 18px; }
.mechanic-invoice-totals span { display: flex; justify-content: space-between; padding: 7px 0; }
.mechanic-invoice-totals .grand-total { border-top: 2px solid #172033; margin-top: 6px; padding-top: 12px; font-size: 19px; }

@media (max-width: 900px) {
  .client-order-info, .client-two-column, .ta-actions-grid { grid-template-columns: 1fr; }
  .ta-actions-grid > form + form { border-left: 0; border-top: 1px solid #e6e9ef; padding: 18px 0 0; }
  .mechanic-item-form { grid-template-columns: 1fr 1fr; }
  .mechanic-item-form input[name="description"] { grid-column: 1 / -1; }
  .mechanic-invoice-box, .mechanic-invoice-form { align-items: stretch; flex-direction: column; }
  .mechanic-invoice-form > * { width: 100%; }
}
@media (max-width: 650px) {
  .client-portal-head-inner, .client-welcome, .client-order-top, .ta-card-top, .ta-message-box { align-items: flex-start; flex-direction: column; }
  .client-contact { display: none; }
  .client-order-top small { margin-left: 0; }
  .ta-due { text-align: left; }
  .expanded-actions, .mechanic-invoice-parties { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr; }
}
@media print {
  .mechanic-topbar, .mechanic-back, .mechanic-invoice-header .mechanic-action { display: none !important; }
  .mechanic-main { width: 100%; padding: 0; }
  .mechanic-invoice-sheet { border: 0; box-shadow: none; }
}
.portal-inline-box { margin-top: 13px; padding: 12px; border-radius: 10px; background: #f7f9fc; border: 1px solid #e3e7ee; }
.mechanic-status-control { display: grid; grid-template-columns: auto minmax(220px,1fr) auto; gap: 10px; align-items: stretch; }
.mechanic-status-control select { min-height: 54px; border: 2px solid #dce2eb; border-radius: 13px; padding: 10px 13px; background: white; font-weight: 750; }
@media (max-width: 700px) { .mechanic-status-control { grid-template-columns: 1fr; } }

/* V4.1 — single-repair public progress page */
.progress-page-body{margin:0;background:#f3f5f8;color:#172033;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh}
.progress-page-shell{width:min(760px,calc(100% - 28px));margin:0 auto;padding:24px 0 40px}
.progress-service-header{display:flex;align-items:center;gap:12px;margin-bottom:18px;padding:4px 2px}
.progress-brand-mark{width:46px;height:46px;border-radius:14px;background:#172033;color:#fff;display:grid;place-items:center;font-weight:800;letter-spacing:.04em}
.progress-service-header strong{font-size:17px}.progress-service-contacts{display:flex;gap:12px;margin-top:3px;font-size:13px}.progress-service-contacts a{color:#5d6678;text-decoration:none}
.progress-hero-card,.progress-info-card,.progress-help-card{background:#fff;border:1px solid #e4e8ef;box-shadow:0 10px 34px rgba(24,35,55,.06)}
.progress-hero-card{border-radius:24px;padding:28px}.progress-kicker{font-size:12px;font-weight:800;letter-spacing:.14em;color:#667085;margin-bottom:18px}
.progress-vehicle-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.progress-plate{display:inline-block;padding:7px 12px;border:2px solid #172033;border-radius:8px;background:#fff;font-size:21px;font-weight:900;letter-spacing:.08em}.progress-vehicle-row h1{margin:12px 0 3px;font-size:28px}.progress-vehicle-row p{margin:0;color:#737d90}.progress-percent{font-size:34px;font-weight:900;color:#1864d9}
.progress-main-status{margin-top:26px;font-size:20px;font-weight:800}.progress-track{height:13px;border-radius:999px;background:#e8edf4;overflow:hidden;margin-top:10px}.progress-track span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#1864d9,#4f8df7);transition:width .3s ease}
.progress-timeline{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;margin-top:20px}.progress-timeline-step{text-align:center;color:#9aa3b2;position:relative}.progress-timeline-step span{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;margin:0 auto 7px;background:#edf0f4;color:#8b94a3;font-weight:800;font-size:13px}.progress-timeline-step small{font-size:11px;font-weight:700}.progress-timeline-step.is-done{color:#1864d9}.progress-timeline-step.is-done span{background:#e8f1ff;color:#1864d9}
.progress-info-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.progress-info-card{border-radius:18px;padding:20px;min-height:112px}.progress-info-label{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#7c8698;margin-bottom:9px}.progress-info-card p{margin:0;line-height:1.55;white-space:pre-wrap}.progress-message-card{grid-column:1/-1;border-left:4px solid #1864d9}.progress-important{font-weight:750}.progress-muted{color:#7c8698}
.progress-help-card{margin-top:14px;border-radius:18px;padding:20px;display:flex;align-items:center;justify-content:space-between;gap:20px}.progress-help-card p{margin:5px 0 0;color:#697386}.progress-call-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 18px;border-radius:12px;background:#172033;color:#fff;text-decoration:none;font-weight:800;white-space:nowrap}.progress-footer{text-align:center;color:#8a93a3;font-size:12px;line-height:1.6;padding:24px 10px 0}
@media(max-width:620px){.progress-page-shell{width:min(100% - 20px,760px);padding-top:14px}.progress-hero-card{padding:22px 18px;border-radius:20px}.progress-vehicle-row h1{font-size:23px}.progress-percent{font-size:27px}.progress-info-grid{grid-template-columns:1fr}.progress-message-card{grid-column:auto}.progress-timeline-step small{font-size:9px}.progress-timeline-step span{width:27px;height:27px}.progress-help-card{align-items:stretch;flex-direction:column}.progress-call-button{width:100%}.progress-service-contacts{flex-direction:column;gap:2px}}
.mechanic-link-row{display:flex;gap:10px;align-items:center}.mechanic-link-row .mechanic-input{flex:1}.mechanic-hint{display:block;margin-top:9px;color:#778195;line-height:1.4}
@media(max-width:620px){.mechanic-link-row{align-items:stretch;flex-direction:column}}


/* V5 red visual system, logos, calendar and safer status controls */
.brand-with-logo { width: 100%; }
.brand-logo-shell { width: 100%; min-height: 43px; display: flex; align-items: center; padding: 8px 10px; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(0,0,0,.16); overflow: hidden; }
.brand-logo { display: block; width: 100%; height: 27px; object-fit: contain; object-position: left center; }
.platform-wordmark-link { width: 100%; text-decoration: none; }
.platform-wordmark-shell { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(0,0,0,.16); overflow: hidden; }
.platform-wordmark { display: block; color: #0a2748; font-size: 24px; line-height: 1; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }

.mechanic-logo-shell { width: 150px; height: 43px; display: flex; align-items: center; padding: 7px 10px; background: #fff; border-radius: 11px; }
.mechanic-logo { width: 100%; height: 24px; object-fit: contain; }
.login-logo-shell { width: 220px; max-width: 100%; display: flex; align-items: center; }
.login-logo { width: 100%; height: auto; display: block; }
.login-brand { align-items: flex-start; flex-direction: column; gap: 8px; }
.workspace-label { color: #ff8c94; }
.nav-link.active { background: linear-gradient(90deg, #6e151e, #42131a); box-shadow: inset 3px 0 0 #ff616b; }
.nav-link.active .nav-icon { color: #ff8c94; }
.admin-card { background: linear-gradient(135deg, #4b151c, #251015); }
.avatar { background: #ffe0e3; color: #a9111b; }
.quick-action:hover, .service-card:hover, .job-card:hover { border-color: #ef9da4; }
input:focus, select:focus, textarea:focus { border-color: #e36670; box-shadow: 0 0 0 3px rgba(213,31,42,.11); }
.mechanic-body { background: radial-gradient(circle at top right, #fff0f1 0, #f5f6f8 38%, #f3f4f7 100%); }
.mechanic-topbar { background: linear-gradient(100deg, #1c0d10, #5d141d); box-shadow: 0 4px 18px rgba(67,12,19,.2); }
.mechanic-job-card:hover { border-color: #e27c85; box-shadow: 0 10px 25px rgba(104,19,28,.1); }
.mechanic-note:focus { border-color: #d51f2a; box-shadow: 0 0 0 4px rgba(213,31,42,.1); }
.mechanic-action.start { background: #d51f2a; }
.mechanic-action.start:hover { background: #a9111b; }
.mechanic-back { color: #a9111b; }
.mechanic-invoice-box { background: linear-gradient(110deg, #1b0d10, #5a141c); }
.status-in_progress { background: #ffe5e7; color: #a9111b; }
.status-diagnostics { background: #f7e8eb; color: #81202a; }
.client-order-card.is-active { border-left-color: #d51f2a; }
.client-portal-header { background: linear-gradient(100deg, #1b0d10, #5f151e); }
.progress-percent, .progress-timeline-step.is-done { color: #d51f2a; }
.progress-track span { background: linear-gradient(90deg, #a9111b, #ed4d58); }
.progress-timeline-step.is-done span { background: #ffe8ea; color: #d51f2a; }
.progress-message-card { border-left-color: #d51f2a; }

.btn-undo { background: #fff7e1; border-color: #f0cf75; color: #7a5000; }
.btn-undo:hover { background: #ffefbf; }
.status-undo-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 14px; padding: 12px 14px; border: 1px solid #f0cf75; border-radius: 13px; background: #fff9e8; color: #704c00; font-weight: 750; }
.undo-action { min-height: 42px; background: #fff; color: #704c00; border: 1px solid #e4c264; white-space: nowrap; }
.ready-row-actions { display: flex; align-items: center; gap: 10px; }
.mechanic-undo-small { border: 1px solid #e4c264; border-radius: 8px; background: #fff9e8; color: #704c00; padding: 6px 9px; cursor: pointer; font-weight: 800; }

.mechanic-total-grid { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mechanic-total-grid span { min-width: 112px; padding: 9px 12px; border-radius: 11px; background: #f6f7f9; text-align: right; }
.mechanic-total-grid small, .mechanic-total-grid strong { display: block; }
.mechanic-total-grid small { color: #697386; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.mechanic-total-grid strong { margin-top: 3px; font-size: 17px; }
.mechanic-total-grid .gross { color: #fff; background: #d51f2a; }
.mechanic-total-grid .gross small { color: #ffd8dc; }
.vat-calculator-form { grid-template-columns: 110px minmax(190px,1fr) 90px 130px 90px minmax(280px,1.2fr) auto; }
.vat-live-result { display: grid; grid-template-columns: repeat(3,minmax(86px,1fr)); gap: 6px; align-items: stretch; }
.vat-live-result span { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 6px 9px; border-radius: 10px; background: #f6f7f9; color: #687386; font-size: 10px; font-weight: 800; }
.vat-live-result strong { color: #172033; font-size: 13px; margin-top: 2px; }
.vat-live-result .vat-gross { background: #fff0f1; color: #a9111b; }
.vat-live-result .vat-gross strong { color: #a9111b; font-size: 15px; }
.full-width-vat { margin-top: 12px; max-width: 570px; }

.service-logo-preview { min-height: 160px; display: grid; place-items: center; margin-bottom: 16px; border: 1px dashed #d6dae3; border-radius: 14px; background: #fafbfc; overflow: hidden; }
.service-logo-preview.has-logo { background: #fff; border-style: solid; }
.service-logo-preview img { width: min(360px, 86%); max-height: 125px; object-fit: contain; }
.service-logo-placeholder { text-align: center; color: #8a93a3; }
.service-logo-placeholder strong, .service-logo-placeholder span { display: block; }
.service-logo-placeholder strong { color: #3c4657; font-size: 20px; margin-bottom: 5px; }
.invoice-service-logo { display: block; width: min(280px, 80%); max-height: 100px; object-fit: contain; object-position: left center; margin-bottom: 12px; }
.mechanic-invoice-logo { display: block; max-width: 240px; max-height: 90px; object-fit: contain; object-position: left center; margin: 8px 0 10px; }
.invoice-seller-heading h1 { margin-bottom: 8px; }

.calendar-card { overflow: hidden; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.calendar-toolbar h2 { font-size: 24px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 12px; margin-bottom: 13px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.appointment-dot { background: #d51f2a; }
.work-dot { background: #172033; }
.month-calendar { display: grid; grid-template-columns: repeat(7, minmax(120px,1fr)); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; background: var(--line); gap: 1px; }
.calendar-weekday { min-width: 120px; padding: 9px 10px; background: #f6f7f9; color: #697386; text-align: center; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.calendar-day { min-width: 120px; min-height: 142px; padding: 9px; background: #fff; }
.calendar-day.outside-month { background: #fafafa; color: #a8afbb; }
.calendar-day.today { box-shadow: inset 0 0 0 2px #d51f2a; }
.calendar-day-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; font-weight: 850; margin-bottom: 6px; }
.calendar-day.today .calendar-day-number { background: #d51f2a; color: #fff; }
.calendar-events { display: flex; flex-direction: column; gap: 4px; }
.calendar-event { display: block; padding: 5px 6px; border-radius: 7px; color: #172033; font-size: 10px; overflow: hidden; }
.calendar-event strong, .calendar-event span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-event span { opacity: .75; margin-top: 1px; }
.appointment-event { background: #ffe8ea; border-left: 3px solid #d51f2a; }
.work-event { background: #edf0f4; border-left: 3px solid #172033; }
.calendar-more { color: #697386; padding: 2px 4px; }
.waiting-appointment-label { display: inline-flex; margin-top: 7px; padding: 5px 8px; border-radius: 999px; background: #fff0f1; color: #a9111b; font-size: 11px; font-weight: 850; }
.appointment-actions { min-width: 240px; display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.appointment-actions form.inline { display: grid; grid-template-columns: 1fr auto; }
.appointment-workflow-column { background: #fff7f8; border-color: #f0c5ca; }
.appointment-job-card { border-left: 3px solid #d51f2a; }
.workflow-board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); }

.client-service-brand { display: flex; align-items: center; gap: 12px; }
.client-service-logo { width: 120px; height: 42px; object-fit: contain; object-position: left center; padding: 4px 8px; border-radius: 8px; background: #fff; }
.client-platform-logo { width: 145px; height: 34px; object-fit: contain; padding: 5px 8px; border-radius: 8px; background: #fff; }
.client-completed-invoice { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 14px; border: 1px solid #f0c5ca; border-radius: 13px; background: #fff7f8; }
.client-completed-invoice small, .client-completed-invoice strong { display: block; }
.client-completed-invoice small { color: #7b6470; margin-bottom: 3px; }
.progress-brand-mark { width: 150px; height: 46px; padding: 7px 10px; background: #fff; }
.progress-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.progress-service-logo { width: 150px; height: 52px; display: grid; place-items: center; padding: 6px 10px; background: #fff; border: 1px solid #e4e8ef; border-radius: 12px; }
.progress-service-logo img { width: 100%; height: 100%; object-fit: contain; }
.progress-invoice-card { margin-top: 14px; padding: 22px; border: 1px solid #efc8cc; border-radius: 20px; background: linear-gradient(135deg,#fff,#fff5f6); box-shadow: 0 10px 34px rgba(104,19,28,.07); }
.progress-invoice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.progress-invoice-head h2 { margin: 2px 0 3px; }
.progress-invoice-head p { margin: 0; color: #697386; }
.progress-invoice-total { text-align: right; }
.progress-invoice-total small, .progress-invoice-total strong { display: block; }
.progress-invoice-total small { color: #7c8698; }
.progress-invoice-total strong { margin-top: 4px; color: #a9111b; font-size: 28px; }
.progress-invoice-breakdown { display: flex; gap: 10px; margin-top: 16px; }
.progress-invoice-breakdown span { flex: 1; display: flex; justify-content: space-between; padding: 10px 12px; background: #fff; border: 1px solid #ece0e2; border-radius: 10px; }
.progress-invoice-lines { margin-top: 12px; }
.progress-invoice-lines summary { cursor: pointer; color: #a9111b; font-weight: 800; }
.progress-invoice-lines div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px solid #eee3e5; }
.progress-invoice-lines div:last-child { border-bottom: 0; }

@media (max-width: 1100px) {
  .vat-calculator-form { grid-template-columns: 1fr 1fr; }
  .vat-calculator-form input[name="description"], .vat-calculator-form .vat-live-result { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .mechanic-logo-shell { width: 118px; }
  .mechanic-brand > span:last-child small { max-width: 115px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .status-undo-banner, .calendar-toolbar, .client-completed-invoice, .progress-invoice-head { align-items: stretch; flex-direction: column; }
  .status-undo-banner .undo-action { width: 100%; }
  .mechanic-total-grid { justify-content: stretch; }
  .mechanic-total-grid span { flex: 1; min-width: 92px; text-align: left; }
  .appointment-actions { min-width: 0; width: 100%; grid-column: 3; }
  .progress-invoice-total { text-align: left; }
}
@media (max-width: 620px) {
  .vat-live-result { grid-template-columns: 1fr; }
  .client-service-brand strong { display: none; }
  .client-platform-logo, .client-service-logo { width: 125px; }
  .progress-invoice-breakdown { flex-direction: column; }
}
@media print {
  .invoice-document { border: 0; box-shadow: none; }
  .invoice-service-logo, .mechanic-invoice-logo { max-height: 75px; }
}
.login-visual { background: linear-gradient(145deg, #1b0d10, #781c27); }
.login-visual .eyebrow { color: #ffadb3 !important; }
.badge { color: #a9111b; }
.client-progress-step.done { color: #d51f2a; }
.client-progress-step.done span { background: #d51f2a; }
.admin-workspace-banner { background: linear-gradient(100deg, #2b1014, #691822); }

/* V5.1: inline customer/vehicle creation and safer button sizing. */
button, .btn, .quick-add, .quick-action {
  max-width: 100%;
}
.btn {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.25;
}
.card, .form-section, .form-grid > *, .page-header > *, .card-head > *, .actions > *, form.inline > * {
  min-width: 0;
}
form.inline {
  max-width: 100%;
  flex-wrap: wrap;
}
form.inline input, form.inline select, form.inline textarea {
  min-width: 0;
  max-width: 100%;
}
.actions {
  max-width: 100%;
}
.actions form {
  max-width: 100%;
}

.inline-add-button {
  margin-top: 13px;
}
.inline-create-panel {
  border: 1px solid #edc7cb;
  border-radius: 14px;
  background: #fffafb;
  overflow: hidden;
}
.inline-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 17px;
  border-bottom: 1px solid #f0dadd;
  background: linear-gradient(135deg, #fff2f3, #fff);
}
.inline-create-head > div,
.inline-subsection-title > div {
  min-width: 0;
}
.inline-create-head strong,
.inline-create-head span {
  display: block;
}
.inline-create-head strong {
  font-size: 16px;
}
.inline-create-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.inline-subsection {
  padding: 17px;
  border-bottom: 1px solid #f0dadd;
}
.inline-subsection:last-child {
  border-bottom: 0;
}
.inline-subsection-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.inline-subsection-title > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inline-subsection-title strong,
.inline-subsection-title small {
  display: block;
}
.inline-subsection-title small {
  margin-top: 2px;
  color: var(--muted);
}
.inline-step {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}
.segmented-control {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 100%;
}
.segmented-control .btn {
  border-color: #e0c8cb;
  background: #fff;
  color: #5c4448;
}
.segmented-control .btn.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.form-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .inline-create-head,
  .inline-subsection-title {
    align-items: stretch;
    flex-direction: column;
  }
  .inline-create-head > .btn,
  .segmented-control,
  .segmented-control .btn {
    width: 100%;
  }
  .segmented-control {
    justify-content: stretch;
  }
  .form-actions {
    width: 100%;
  }
  .form-actions > .btn,
  .form-actions > button,
  .form-actions > form {
    width: 100%;
  }
  .form-actions > form .btn,
  .form-actions > form button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .card {
    padding: 16px;
  }
  .inline-subsection,
  .inline-create-head {
    padding: 14px;
  }
  .actions > .btn,
  .actions > button {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* V5.2 — role-focused screens, profitability and fixed VAT */
.month-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  white-space: nowrap;
}
.readonly-setting {
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8f4f5;
}
.readonly-setting small { color: var(--muted); line-height: 1.25; }
.readonly-setting.compact { min-height: 42px; }
.owner-profit-card { margin-bottom: 18px; }
.owner-profit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.owner-profit-grid > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.owner-profit-grid small { display: block; color: var(--muted); margin-bottom: 5px; }
.owner-profit-grid strong { display: block; font-size: 1.25rem; overflow-wrap: anywhere; }
.owner-profit-grid .positive { border-color: #b9ddc8; background: #f1fbf5; }
.owner-profit-grid .negative { border-color: #efb8bd; background: #fff2f3; }
.profit-positive { border-color: #b9ddc8; }
.profit-negative { border-color: #efb8bd; }
.recall-note {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #efb8bd;
  border-radius: 10px;
  background: #fff2f3;
  color: #7a222a;
}
.mechanic-heading-actions,
.mechanic-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.mechanic-header-actions form { margin: 0; }
.danger-action { background: #9d2028 !important; color: #fff !important; }
.wide-action { width: 100%; margin-top: 12px; }
.mechanic-new-job-form { max-width: 100%; }
.mechanic-inline-panel { margin: 14px 0; }
.mechanic-segmented { margin: 12px 0; justify-content: flex-start; }
.mechanic-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.mechanic-form-grid .full { grid-column: 1 / -1; }
.mechanic-vat-fixed {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  font-weight: 800;
  white-space: nowrap;
}

/* Keep every action inside its card/frame. */
.btn,
.quick-add,
.mechanic-action,
.nav-link,
button,
a {
  max-width: 100%;
}
.btn,
.quick-add,
.mechanic-action,
button {
  overflow-wrap: anywhere;
  white-space: normal;
}
.actions,
.form-actions,
.topbar-actions,
.card-head,
.mechanic-invoice-box,
.mechanic-status-control {
  min-width: 0;
  flex-wrap: wrap;
}
.actions > *,
.form-actions > *,
.card-head > *,
.mechanic-invoice-box > * {
  min-width: 0;
}

@media (max-width: 900px) {
  .owner-profit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .mechanic-heading-actions { width: 100%; justify-content: stretch; }
  .mechanic-heading-actions > * { width: 100%; }
  .mechanic-form-grid { grid-template-columns: 1fr; }
  .mechanic-form-grid .full { grid-column: auto; }
  .owner-profit-grid { grid-template-columns: 1fr; }
  .month-pill { width: 100%; }
}

/* V5.4 — recurring subscription billing and repaired autoservice invoice layout */
.account-subscription-card {
  position: static;
  top: auto;
}

.subscription-info-card {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid #e7c7ca;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff, #fff4f5);
  box-shadow: var(--shadow);
}
.subscription-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.subscription-info-head h2 { margin: 3px 0 5px; }
.subscription-info-head p { margin: 0; color: var(--muted); }
.subscription-kicker {
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}
.subscription-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.subscription-info-grid > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #ece4e5;
  border-radius: 12px;
  background: #fff;
}
.subscription-info-grid > div.attention {
  border-color: #e7aeb3;
  background: #fff3f4;
}
.subscription-info-grid small,
.subscription-info-grid strong,
.subscription-info-grid span { display: block; }
.subscription-info-grid small { color: var(--muted); margin-bottom: 5px; }
.subscription-info-grid strong { font-size: 17px; overflow-wrap: anywhere; }
.subscription-info-grid span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.platform-invoice-page-head { align-items: center; }
.platform-invoice-sheet {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid #dfe3e8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(48, 20, 24, .08);
  overflow: hidden;
}
.platform-invoice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 2px solid #251316;
}
.platform-invoice-seller { min-width: 0; }
.platform-invoice-brand {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .14em;
}
.platform-invoice-seller h2 { margin: 0 0 10px; font-size: 25px; }
.platform-invoice-contact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #5f6878;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.platform-invoice-identity {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  text-align: right;
}
.platform-invoice-identity > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .15em;
}
.platform-invoice-identity > strong {
  max-width: 100%;
  color: var(--brand-dark);
  font-size: clamp(22px, 3vw, 32px);
  overflow-wrap: anywhere;
}
.platform-invoice-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 32px;
  padding: 26px 0;
}
.platform-invoice-party small,
.platform-invoice-party strong,
.platform-invoice-party span { display: block; }
.platform-invoice-party small {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}
.platform-invoice-party strong { margin-bottom: 7px; font-size: 19px; }
.platform-invoice-party span { color: #5f6878; line-height: 1.5; overflow-wrap: anywhere; }
.platform-invoice-dates {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}
.platform-invoice-dates dt { color: var(--muted); }
.platform-invoice-dates dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.platform-invoice-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e3e6eb;
  border-radius: 12px;
}
.platform-invoice-lines {
  width: 100%;
  min-width: 650px;
  margin: 0;
  border-collapse: collapse;
}
.platform-invoice-lines th,
.platform-invoice-lines td {
  padding: 13px 14px;
  border-bottom: 1px solid #e8eaee;
  text-align: left;
  vertical-align: top;
}
.platform-invoice-lines th {
  background: #f7f4f5;
  color: #4e596b;
  font-size: 11px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.platform-invoice-lines tbody tr:last-child td { border-bottom: 0; }
.platform-invoice-lines .amount { text-align: right; white-space: nowrap; }
.platform-invoice-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  gap: 32px;
  padding-top: 26px;
}
.platform-invoice-notes small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}
.platform-invoice-notes p { color: #596274; line-height: 1.55; }
.platform-payment-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 18px;
  padding: 13px;
  border-radius: 10px;
  background: #f7f4f5;
  color: #596274;
  line-height: 1.45;
}
.platform-invoice-totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 18px;
  margin: 0;
  align-content: start;
}
.platform-invoice-totals dt { color: var(--muted); }
.platform-invoice-totals dd { margin: 0; text-align: right; white-space: nowrap; }
.platform-invoice-totals .grand-total {
  margin-top: 7px;
  padding-top: 13px;
  border-top: 2px solid #251316;
  color: #251316;
  font-size: 18px;
  font-weight: 900;
}
.platform-invoice-actions { width: min(100%, 960px); margin: 18px auto 0; }

@media (max-width: 850px) {
  .subscription-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-invoice-header,
  .platform-invoice-meta-grid,
  .platform-invoice-footer { grid-template-columns: 1fr; }
  .platform-invoice-header { flex-direction: column; }
  .platform-invoice-identity { min-width: 0; align-items: flex-start; text-align: left; }
  .platform-invoice-meta-grid,
  .platform-invoice-footer { gap: 22px; }
}
@media (max-width: 560px) {
  .subscription-info-card { padding: 16px; }
  .subscription-info-head { flex-direction: column; }
  .subscription-info-grid { grid-template-columns: 1fr; }
  .platform-invoice-sheet { padding: 18px; border-radius: 12px; }
  .platform-invoice-dates { grid-template-columns: 1fr; gap: 3px; }
  .platform-invoice-dates dd { margin-bottom: 8px; text-align: left; }
  .platform-invoice-totals { grid-template-columns: minmax(0, 1fr) auto; }
}
@media print {
  .platform-invoice-sheet {
    width: 100%;
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  .platform-invoice-table-wrap { overflow: visible; }
  .platform-invoice-lines { min-width: 0; }
  .platform-invoice-actions { display: none !important; }
}

/* V5.5 strategy alignment: onboarding, activation, imports and retention reminders */
.filter-pills,
.reminder-page-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.reminder-page-switch { margin-bottom: 0; justify-content: flex-end; }
.onboarding-card { margin-bottom: 18px; overflow: hidden; }
.onboarding-progress {
  height: 9px;
  margin: 4px 0 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e5e7;
}
.onboarding-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #e73542);
}
.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.onboarding-steps.compact { grid-template-columns: 1fr; }
.onboarding-step {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eadde0;
  border-radius: 12px;
  background: #fffafa;
  color: var(--text);
  text-decoration: none;
}
.onboarding-step > span {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #f1e4e6;
  color: var(--primary);
  font-weight: 900;
}
.onboarding-step strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.onboarding-step.done { border-color: #cfe7d5; background: #f5fbf6; }
.onboarding-step.done > span { background: #dff2e4; color: #24713a; }
.onboarding-note { margin: 14px 0 0; }
.activation-admin-card { margin-bottom: 18px; }
.activation-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.activation-metrics > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #ece5e6;
  border-radius: 12px;
  background: #faf8f8;
}
.activation-metrics small { display: block; margin-bottom: 5px; color: var(--muted); }
.activation-metrics strong { overflow-wrap: anywhere; }
.import-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.import-callout > div { min-width: 0; }
.import-callout h2 { margin: 3px 0 6px; }
.import-callout p { margin: 0; }
.import-rules { margin-top: 18px; }
.import-rules code {
  display: inline-block;
  margin: 8px 6px 0 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f4eeee;
  color: #6f2028;
  overflow-wrap: anywhere;
}
.ta-due .badge { margin-top: 8px; }

@media (max-width: 980px) {
  .onboarding-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activation-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .onboarding-steps,
  .activation-metrics { grid-template-columns: 1fr; }
  .import-callout { align-items: stretch; flex-direction: column; }
  .import-callout .btn { width: 100%; }
  .reminder-page-switch { justify-content: stretch; }
  .reminder-page-switch .btn,
  .filter-pills .btn { flex: 1 1 150px; }
}

/* V5.8 — clearer mechanic invoice preparation and visible add-position action. */
.mechanic-add-item-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #dfe4ec;
  border-radius: 16px;
  background: #f8fafc;
}
.mechanic-add-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.mechanic-add-item-head h3 {
  margin: 0;
  font-size: 19px;
}
.mechanic-add-item-head p {
  margin: 6px 0 0;
  max-width: 690px;
  color: #697386;
  line-height: 1.5;
}
.mechanic-item-form.mechanic-item-form-v58 {
  display: grid;
  grid-template-columns: 150px minmax(260px, 1fr) 120px 160px;
  gap: 14px;
  align-items: end;
  margin-top: 0;
}
.mechanic-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}
.mechanic-field > span:first-child,
.mechanic-invoice-field > span:first-child {
  color: #4f5b70;
  font-size: 12px;
  font-weight: 850;
}
.mechanic-item-form-v58 .mechanic-field input,
.mechanic-item-form-v58 .mechanic-field select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: white;
  font: inherit;
}
.mechanic-price-input {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid #dce2eb;
  border-radius: 10px;
  background: white;
}
.mechanic-price-input input {
  min-height: 46px !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.mechanic-price-input > span:last-child {
  flex: 0 0 auto;
  padding: 0 12px;
  color: #697386;
  font-weight: 850;
}
.mechanic-vat-summary {
  display: grid;
  grid-column: 1 / 4;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e1e5ec;
  border-radius: 12px;
  background: white;
}
.mechanic-vat-summary > span {
  min-width: 0;
  padding: 3px 10px;
  border-right: 1px solid #e7eaf0;
}
.mechanic-vat-summary > span:last-child { border-right: 0; }
.mechanic-vat-summary small,
.mechanic-vat-summary strong { display: block; }
.mechanic-vat-summary small {
  margin-bottom: 4px;
  color: #697386;
  font-size: 11px;
  font-weight: 800;
}
.mechanic-vat-summary strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}
.mechanic-vat-summary .gross strong { color: #a9111b; }
.mechanic-add-item-button {
  grid-column: 4;
  min-width: 0;
  width: 100%;
  min-height: 66px !important;
  white-space: normal;
  line-height: 1.25;
}
.mechanic-add-item-button > span {
  margin-right: 5px;
  font-size: 18px;
}
.mechanic-invoice-box.mechanic-invoice-create-box {
  display: block;
  padding: 20px;
}
.mechanic-invoice-copy {
  margin-bottom: 16px;
}
.mechanic-invoice-copy strong { font-size: 18px; }
.mechanic-invoice-form.mechanic-invoice-form-v58 {
  display: grid;
  grid-template-columns: 190px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  width: 100%;
}
.mechanic-invoice-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: inherit;
}
.mechanic-invoice-field > span:first-child { color: #cbd2de; }
.mechanic-invoice-form-v58 input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: white;
  color: #172033;
  font: inherit;
}
.mechanic-due-input {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  border-radius: 10px;
  background: white;
}
.mechanic-due-input input {
  min-height: 48px !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.mechanic-due-input small {
  flex: 0 0 auto;
  padding: 0 12px;
  color: #697386 !important;
}
.mechanic-create-invoice-button {
  min-width: 165px;
  min-height: 48px !important;
}
.mechanic-create-invoice-button:disabled {
  background: #d7dce5;
  color: #6c7587;
}
.mechanic-invoice-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff0cf;
  color: #704b00;
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 900px) {
  .mechanic-item-form.mechanic-item-form-v58 {
    grid-template-columns: 1fr 1fr;
  }
  .mechanic-item-form-v58 .mechanic-field-description {
    grid-column: 1 / -1;
  }
  .mechanic-vat-summary,
  .mechanic-add-item-button {
    grid-column: 1 / -1;
  }
  .mechanic-add-item-button { min-height: 54px !important; }
  .mechanic-invoice-form.mechanic-invoice-form-v58 {
    grid-template-columns: 1fr 1fr;
  }
  .mechanic-invoice-notes { grid-column: 2; }
  .mechanic-create-invoice-button { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 600px) {
  .mechanic-add-item-card,
  .mechanic-invoice-box.mechanic-invoice-create-box { padding: 16px; }
  .mechanic-item-form.mechanic-item-form-v58,
  .mechanic-invoice-form.mechanic-invoice-form-v58 {
    grid-template-columns: 1fr;
  }
  .mechanic-item-form-v58 .mechanic-field-description,
  .mechanic-invoice-notes,
  .mechanic-create-invoice-button {
    grid-column: 1;
  }
  .mechanic-vat-summary {
    grid-column: 1;
    grid-template-columns: 1fr;
  }
  .mechanic-vat-summary > span {
    border-right: 0;
    border-bottom: 1px solid #e7eaf0;
    padding: 7px 4px;
  }
  .mechanic-vat-summary > span:last-child { border-bottom: 0; }
  .mechanic-add-item-button { grid-column: 1; }
}

/* Override legacy compact invoice input widths inside the V5.8 grid. */
.mechanic-invoice-form.mechanic-invoice-form-v58 label input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin-left: 0;
}
.mechanic-invoice-form.mechanic-invoice-form-v58 .mechanic-due-input input {
  flex: 1 1 auto;
  width: 1%;
}


/* V5.9 — client invoice downloads, password reset, and internal cost workflow. */
.progress-download-button, .client-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 14px;
  padding: 9px 14px;
  border: 1px solid #d51f2a;
  border-radius: 10px;
  background: #d51f2a;
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}
.client-download-link { min-height: 34px; margin-top: 7px; padding: 6px 10px; font-size: 12px; }
.client-invoice-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.temporary-password-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #efc56e; border-radius: 14px; background: #fff8e7; }
.temporary-password-banner strong, .temporary-password-banner span { display: block; }
.temporary-password-banner span { margin-top: 4px; color: #6b5a32; font-size: 13px; }
.temporary-password-copy { display: flex; align-items: center; gap: 9px; }
.temporary-password-copy code { padding: 9px 12px; border: 1px solid #e7cf95; border-radius: 9px; background: #fff; color: #172033; font-size: 15px; font-weight: 850; }
.password-reset-form { margin-top: 10px; }
.login-password-help { margin: 14px 0 0; color: #697386; font-size: 12px; line-height: 1.5; text-align: center; }
.inline-cost-form { display: grid; grid-template-columns: minmax(86px, 1fr) auto; gap: 6px; align-items: center; min-width: 170px; }
.inline-cost-form input { min-width: 0; padding: 8px 9px; }
.mechanic-field-cost small { color: #697386; font-size: 10px; line-height: 1.35; }
.mechanic-cost-missing { color: #9a6500; font-weight: 850; }
.mechanic-item-form.mechanic-item-form-v58 { grid-template-columns: 140px minmax(220px, 1fr) 105px 145px 165px; }
.mechanic-vat-summary { grid-column: 1 / 5; }
.mechanic-add-item-button { grid-column: 5; }
@media (max-width: 900px) {
  .mechanic-item-form.mechanic-item-form-v58 { grid-template-columns: 1fr 1fr; }
  .mechanic-item-form-v58 .mechanic-field-description, .mechanic-field-cost, .mechanic-vat-summary, .mechanic-add-item-button { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .temporary-password-banner, .client-completed-invoice { align-items: stretch; flex-direction: column; }
  .temporary-password-copy { align-items: stretch; flex-direction: column; }
  .client-invoice-actions { align-items: stretch; }
  .client-download-link { width: 100%; }
  .inline-cost-form { grid-template-columns: 1fr; min-width: 120px; }
}


/* V5.10 — self-service password reset. */
.login-secondary-actions { display: flex; justify-content: center; margin-top: 12px; }
.login-secondary-actions .btn { width: 100%; }
.password-reset-preview { margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft); }
.password-reset-preview p { margin: 7px 0 14px; }
.password-reset-preview .btn { width: 100%; }

/* V5.11 language selector */
.language-switcher{display:inline-flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--border,#dfe4ec);border-radius:10px;background:var(--surface,#fff);flex:0 0 auto}
.language-switcher a{display:flex;align-items:center;justify-content:center;min-width:31px;height:28px;padding:0 7px;border-radius:7px;color:#111827;text-decoration:none;font-size:12px;font-weight:700;line-height:1}
.language-switcher a:visited{color:#111827}
.language-switcher a:hover{background:#f1f3f6;color:#111827}
.language-switcher a.active,.language-switcher a.active:visited,.language-switcher a.active:hover{background:#a9111b;color:#fff}
.login-language-row,.public-language-row{display:flex;justify-content:flex-end;margin-bottom:12px}
.mechanic-user .language-switcher{margin-right:6px}
.client-portal-header>.public-language-row{padding-top:10px;padding-bottom:0}
@media(max-width:720px){.topbar-actions .language-switcher{order:-1}.language-switcher a{min-width:29px;padding:0 5px}.mechanic-user{gap:6px;flex-wrap:wrap;justify-content:flex-end}}


/* V5.19 wordmark branding */
.brand-with-wordmark{display:flex;align-items:center;}
.brand-wordmark-shell{display:flex;align-items:center;justify-content:flex-start;min-height:42px;}
.brand-wordmark{display:block;width:170px;max-width:100%;height:auto;max-height:42px;object-fit:contain;}
.mechanic-wordmark{display:block;width:156px;max-width:100%;height:auto;max-height:34px;object-fit:contain;}
@media (max-width: 768px){.brand-wordmark{width:150px;max-height:38px;}.mechanic-wordmark{width:142px;max-height:30px;}}

/* V5.20 per-service panel configuration */
.panel-config-intro{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.panel-config-note{display:flex;flex-direction:column;gap:5px;padding:14px;border:1px solid var(--border);border-radius:14px;background:var(--surface-soft,#f8fafc)}.panel-config-note span{color:var(--muted);font-size:.92rem}.panel-config-list{display:grid;gap:14px}.panel-config-item{margin:0}.panel-config-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.panel-config-title{display:flex;align-items:center;gap:12px;min-width:0}.panel-config-title div{display:flex;flex-direction:column;min-width:0}.panel-config-title small{color:var(--muted);overflow-wrap:anywhere}.panel-config-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:var(--accent-soft,#fff0f1);font-size:1.15rem}.panel-config-fields{align-items:end}.panel-role-access{min-width:0}.role-checks{display:flex;flex-wrap:wrap;gap:10px 16px;min-height:44px;align-items:center}.panel-save-bar{display:flex;justify-content:flex-end;gap:10px;margin-top:18px;padding:14px 0;background:var(--background,#fff)}
@media(max-width:760px){.panel-config-intro{grid-template-columns:1fr}.panel-config-head{align-items:flex-start;flex-direction:column}.panel-save-bar{position:static}.role-checks{flex-direction:column;align-items:flex-start}}

/* V6.1 universal CRM extensions */
.compact-metrics{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:18px}
.integration-status{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0}
.communication-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.communication-actions .btn{max-width:100%;white-space:normal}
.compact-card{padding:14px 18px}
.compact-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
.text-danger{color:#a9111b}
@media (max-width:1000px){.compact-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-actions{grid-template-columns:1fr}}
@media (max-width:620px){.compact-metrics{grid-template-columns:1fr}.communication-actions{align-items:stretch}.communication-actions .btn{width:100%}}

/* V6.2: company accent controls the service workspace sidebar. */
.nav-link.active {
  background: var(--sidebar-active, #27365a);
  box-shadow: inset 3px 0 0 var(--sidebar-accent, #6f8cff);
}
.nav-link.active .nav-icon,
.workspace-label {
  color: var(--sidebar-accent, #8ea5ff);
}
.workspace-card:not(.admin-card) {
  background: color-mix(in srgb, var(--sidebar) 82%, #fff 8%);
  border-color: color-mix(in srgb, var(--sidebar) 72%, #fff 18%);
}

/* V6.2: predictable invoice logo sizing for square, portrait and wide logos. */
.invoice-document-header { align-items: flex-start; }
.invoice-seller-brand,
.mechanic-invoice-seller-brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}
.invoice-logo-frame {
  width: 150px;
  height: 72px;
  flex: 0 0 150px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid #e1e5eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.invoice-logo-frame img,
.invoice-service-logo,
.mechanic-invoice-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}
.invoice-seller-copy { min-width: 0; }
.invoice-seller-copy h1 { margin: 0 0 8px; font-size: 23px; overflow-wrap: anywhere; }
.invoice-seller-copy > div { color: #5f6878; line-height: 1.45; overflow-wrap: anywhere; }
.invoice-identity { flex: 0 0 auto; text-align: right; }
.invoice-identity h2 { margin-top: 0; overflow-wrap: anywhere; }
.mechanic-invoice-logo-frame { width: 132px; height: 64px; flex-basis: 132px; }
.mechanic-invoice-seller-brand > div { min-width: 0; }
.mechanic-invoice-seller-brand p { margin-bottom: 0; }

/* V6.2: quarter-hour-only date/time controls. */
.quarter-time-source { display: none !important; }
.quarter-time-control {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 84px 84px;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.quarter-time-control.time-only { grid-template-columns: 84px 84px; }
.quarter-time-control input,
.quarter-time-control select { min-width: 0; }
.quarter-time-control select { text-align: center; }
@media (max-width: 620px) {
  .invoice-seller-brand,
  .mechanic-invoice-seller-brand { flex-direction: column; }
  .invoice-logo-frame { width: 140px; height: 68px; flex-basis: 68px; }
  .invoice-identity { text-align: left; }
  .quarter-time-control { grid-template-columns: minmax(0, 1fr) 76px 76px; }
}
@media print {
  .invoice-logo-frame { border-color: #dfe3e8; }
}
