:root {
    --yuasa-red: #ed1c24;
    --yuasa-red-dark: #d71920;
    --yuasa-red-soft: #fff0f1;
    --ink-950: #0f1720;
    --ink-900: #111827;
    --ink-800: #1f2937;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --line: #dce4ed;
    --line-strong: #cbd5e1;
    --surface: #ffffff;
    --surface-subtle: #f6f8fb;
    --surface-muted: #eef2f6;
    --green: #079669;
    --green-soft: #e8fbf4;
    --amber: #b45309;
    --amber-soft: #fff7e6;
    --blue: #2563eb;
    --sidebar-width: 258px;
    --topbar-height: 72px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow-card: 0 12px 32px rgba(15, 23, 32, 0.07);
    --shadow-float: 0 18px 50px rgba(15, 23, 32, 0.16);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink-900);
    background: var(--surface-subtle);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--surface-subtle);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 85% 8%, rgba(237, 28, 36, 0.045), transparent 25rem),
        var(--surface-subtle);
    color: var(--ink-900);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
}

svg {
    display: block;
}

.yuasa-shell {
    min-height: 100vh;
}

.yuasa-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow-y: auto;
    color: #d7e0ea;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 18rem),
        var(--ink-950);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-lockup {
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-mark {
    display: flex;
    flex-direction: column;
    gap: 2px;
    letter-spacing: 0.04em;
}

.brand-word {
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}

.brand-word::after {
    display: inline-block;
    width: 24px;
    height: 4px;
    margin-left: 8px;
    vertical-align: 5px;
    content: "";
    background: var(--yuasa-red);
    border-radius: 999px;
}

.brand-product {
    color: var(--ink-400);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.primary-navigation {
    flex: 1;
    padding: 26px 14px 18px;
}

.navigation-label {
    margin: 0 12px 10px;
    color: #627286;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.navigation-label-spaced {
    margin-top: 30px;
}

.nav-item {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 13px;
    margin-bottom: 4px;
    padding: 0 14px;
    color: #8fa0b3;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 650;
    transition: 160ms ease;
}

.nav-item svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.nav-item:hover,
.nav-item:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
    outline: none;
}

.nav-item.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(237, 28, 36, 0.18), rgba(255, 255, 255, 0.06));
    border-color: rgba(237, 28, 36, 0.24);
}

.nav-item.is-active svg,
.nav-item.is-active-secondary svg {
    color: #ff4850;
}

.nav-dot {
    width: 6px;
    height: 6px;
    margin-left: auto;
    background: var(--yuasa-red);
    border-radius: 999px;
    box-shadow: 0 0 0 5px rgba(237, 28, 36, 0.12);
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 14px;
    padding: 13px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.profile-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    background: var(--yuasa-red);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 850;
}

.profile-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.profile-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy span {
    color: #74869a;
    font-size: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border: 2px solid var(--ink-950);
    border-radius: 50%;
}

.yuasa-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.yuasa-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    height: var(--topbar-height);
    align-items: center;
    gap: 20px;
    padding: 0 clamp(20px, 3vw, 38px);
    background: rgba(255, 255, 255, 0.93);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(15, 23, 32, 0.025);
    backdrop-filter: blur(16px);
}

.global-search {
    display: flex;
    width: min(560px, 48vw);
    height: 44px;
    align-items: center;
    gap: 11px;
    padding: 0 13px;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: 160ms ease;
}

.global-search:focus-within {
    background: #fff;
    border-color: #a8b5c5;
    box-shadow: 0 0 0 4px rgba(15, 23, 32, 0.04);
}

.global-search svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--ink-400);
    stroke-linecap: round;
    stroke-width: 2;
}

.global-search input {
    width: 100%;
    min-width: 0;
    color: var(--ink-800);
    background: transparent;
    border: 0;
    outline: 0;
}

.global-search input::placeholder {
    color: var(--ink-400);
}

.global-search kbd {
    padding: 3px 7px;
    color: var(--ink-400);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 1px 0 var(--line);
    font-family: inherit;
    font-size: 10px;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.online-pill,
.language-pill {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.online-pill {
    gap: 7px;
    color: var(--green);
    background: var(--green-soft);
}

.online-pill span {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 999px;
}

.language-pill {
    color: var(--ink-600);
    background: #fff;
    border: 1px solid var(--line);
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    color: var(--ink-600);
    background: transparent;
    border: 0;
    border-radius: 11px;
}

.icon-button:hover,
.icon-button:focus-visible {
    color: var(--ink-950);
    background: var(--surface-muted);
    outline: none;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.primary-action,
.secondary-action,
.ghost-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 780;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-action {
    color: #fff;
    background: linear-gradient(180deg, #f2262e, var(--yuasa-red-dark));
    border: 1px solid #cb131a;
    box-shadow: 0 8px 18px rgba(237, 28, 36, 0.2);
}

.primary-action:hover,
.primary-action:focus-visible {
    color: #fff;
    background: var(--yuasa-red-dark);
    box-shadow: 0 10px 24px rgba(237, 28, 36, 0.28);
    outline: none;
    transform: translateY(-1px);
}

.primary-action:disabled {
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.5;
    transform: none;
}

.primary-action svg,
.secondary-action svg,
.ghost-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.secondary-action {
    color: var(--ink-700);
    background: #fff;
    border: 1px solid var(--line-strong);
    box-shadow: 0 2px 5px rgba(15, 23, 32, 0.04);
}

.secondary-action:hover,
.secondary-action:focus-visible {
    color: var(--ink-950);
    background: var(--surface-subtle);
    outline: none;
}

.ghost-action {
    color: var(--ink-600);
    background: transparent;
    border: 1px solid transparent;
}

.ghost-action:hover {
    color: var(--ink-950);
    background: var(--surface-muted);
}

.topbar-primary {
    min-height: 44px;
    padding-inline: 16px;
}

.mobile-menu-button,
.sidebar-close {
    display: none;
}

.yuasa-content {
    width: 100%;
    max-width: 1760px;
    margin: 0 auto;
    padding: clamp(24px, 3vw, 42px);
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.page-heading-copy {
    min-width: 0;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: var(--yuasa-red-dark);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow::before {
    width: 20px;
    height: 2px;
    content: "";
    background: var(--yuasa-red);
}

.page-heading h1 {
    margin: 0;
    color: var(--ink-950);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 850;
    letter-spacing: -0.045em;
    line-height: 1.06;
}

.page-heading p {
    margin: 8px 0 0;
    color: var(--ink-500);
    font-size: 14px;
    line-height: 1.55;
}

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

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    position: relative;
    min-height: 122px;
    overflow: hidden;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 18px rgba(15, 23, 32, 0.035);
}

.metric-card::after {
    position: absolute;
    top: -32px;
    right: -22px;
    width: 90px;
    height: 90px;
    content: "";
    background: radial-gradient(circle, rgba(237, 28, 36, 0.08), transparent 70%);
}

.metric-label {
    display: block;
    margin-bottom: 10px;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.metric-value {
    display: block;
    color: var(--ink-950);
    font-size: 28px;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.metric-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: var(--ink-400);
    font-size: 11px;
}

.metric-meta .positive {
    color: var(--green);
    font-weight: 750;
}

.surface-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.card-heading {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.card-heading h2,
.card-heading h3 {
    margin: 0;
    color: var(--ink-950);
    font-size: 15px;
    font-weight: 820;
}

.card-heading p {
    margin: 4px 0 0;
    color: var(--ink-400);
    font-size: 11px;
}

.field-group {
    display: grid;
    gap: 7px;
}

.field-group label,
.field-label {
    color: var(--ink-700);
    font-size: 11px;
    font-weight: 760;
}

.field-group input,
.field-group select,
.search-control {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    color: var(--ink-800);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    transition: 140ms ease;
}

.field-group input:focus,
.field-group select:focus,
.search-control:focus {
    border-color: #9aa8b9;
    box-shadow: 0 0 0 4px rgba(15, 23, 32, 0.04);
}

.field-group input::placeholder {
    color: var(--ink-400);
}

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

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

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.check-row input {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--yuasa-red);
}

.check-row strong {
    display: block;
    color: var(--ink-700);
    font-size: 12px;
}

.check-row span {
    display: block;
    margin-top: 2px;
    color: var(--ink-400);
    font-size: 10px;
    line-height: 1.45;
}

.badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    color: var(--ink-600);
    background: var(--surface-muted);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
}

.badge-red {
    color: var(--yuasa-red-dark);
    background: var(--yuasa-red-soft);
}

.badge-green {
    color: var(--green);
    background: var(--green-soft);
}

.badge-amber {
    color: var(--amber);
    background: var(--amber-soft);
}

.section-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    color: var(--ink-500);
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 11px;
    line-height: 1.5;
}

.section-note svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--yuasa-red);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.loading-skeleton {
    position: relative;
    overflow: hidden;
}

.loading-skeleton::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.72) 48%, transparent 70%);
    transform: translateX(-100%);
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

.empty-state {
    display: grid;
    min-height: 180px;
    place-items: center;
    padding: 28px;
    color: var(--ink-400);
    text-align: center;
}

.empty-state svg {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    fill: none;
    stroke: var(--ink-300, #b9c4d1);
    stroke-width: 1.5;
}

.map-workspace {
    display: grid;
    grid-template-columns: 314px minmax(0, 1fr);
    gap: 16px;
    scroll-margin-top: calc(var(--topbar-height) + 18px);
}

.map-filter-card {
    align-self: start;
}

.map-filter-form {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.map-filter-submit {
    width: 100%;
}

.map-legend {
    display: grid;
    gap: 10px;
    margin: 0 18px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.map-legend > div {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink-500);
    font-size: 11px;
}

.legend-dot,
.legend-ring {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border-radius: 999px;
}

.legend-dot {
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--line-strong);
}

.legend-dot-red {
    background: var(--yuasa-red);
}

.legend-dot-dark {
    background: var(--ink-950);
}

.legend-ring {
    background: #fff;
    border: 3px solid var(--yuasa-red);
}

.map-filter-card .section-note {
    margin: 0 18px 18px;
}

.map-panel {
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.map-panel-heading {
    position: relative;
    z-index: 3;
}

.map-heading-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.mini-live-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 999px;
}

.compact-action {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 11px;
}

.dealer-map {
    height: clamp(540px, 65vh, 780px);
    min-height: 520px;
    background: #e7ece7;
}

.map-loading {
    position: absolute;
    inset: 68px 0 30px;
    z-index: 500;
    display: none;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: var(--ink-600);
    background: rgba(246, 248, 251, 0.78);
    font-size: 12px;
    backdrop-filter: blur(4px);
}

.map-loading.is-visible {
    display: grid;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--line);
    border-top-color: var(--yuasa-red);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.map-status-strip {
    display: flex;
    min-height: 30px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 12px;
    color: var(--ink-400);
    background: #fff;
    border-top: 1px solid var(--line);
    font-size: 9px;
}

.leaflet-container {
    font-family: inherit;
}

.leaflet-control-zoom a {
    color: var(--ink-700) !important;
}

.leaflet-control-attribution {
    color: var(--ink-400);
    font-size: 8px !important;
}

.yuasa-leaflet-popup .leaflet-popup-content-wrapper {
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-float);
}

.yuasa-leaflet-popup .leaflet-popup-content {
    width: auto !important;
    margin: 0;
}

.yuasa-leaflet-popup .leaflet-popup-tip {
    box-shadow: none;
}

.dealer-popup {
    min-width: 250px;
}

.dealer-popup-head {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 15px 16px 11px;
}

.dealer-popup-kicker {
    color: var(--yuasa-red);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dealer-popup-head strong {
    color: var(--ink-950);
    font-size: 14px;
    line-height: 1.25;
}

.dealer-popup p {
    margin: 0;
    padding: 0 16px 13px;
    color: var(--ink-500);
    font-size: 11px;
    line-height: 1.45;
}

.dealer-popup-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface-subtle);
    border-top: 1px solid var(--line);
    font-size: 10px;
}

.dealer-popup-meta span {
    color: var(--ink-400);
}

.dealer-popup-meta strong {
    color: var(--ink-800);
}

.dealer-popup-action {
    width: 100%;
    min-height: 42px;
    color: #fff;
    background: var(--yuasa-red);
    border: 0;
    font-size: 11px;
    font-weight: 780;
}

.dealer-popup-action:hover {
    background: var(--yuasa-red-dark);
}

.tour-builder-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.tour-control-stack,
.tour-output-stack {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.tour-settings-card,
.dealer-picker-card {
    overflow: hidden;
}

.target-icon,
.summary-route-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--yuasa-red);
    background: var(--yuasa-red-soft);
    border-radius: 12px;
}

.target-icon svg,
.summary-route-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.tour-settings-form,
.dealer-picker-body {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.selected-counter {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    color: var(--yuasa-red-dark);
    background: var(--yuasa-red-soft);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 820;
}

.picker-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 2px;
    color: var(--ink-700);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.picker-section-head > span:last-child {
    color: var(--ink-400);
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

.text-button {
    min-height: 28px;
    padding: 0;
    color: var(--yuasa-red);
    background: transparent;
    border: 0;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
}

.dealer-result-list,
.selected-dealer-list {
    display: grid;
    gap: 7px;
    max-height: 250px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.selected-dealer-list {
    max-height: 220px;
}

.dealer-result-row,
.selected-dealer-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 11px;
}

.dealer-result-copy,
.selected-dealer-row > div {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}

.dealer-result-copy strong,
.selected-dealer-row strong {
    overflow: hidden;
    color: var(--ink-800);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dealer-result-copy span,
.selected-dealer-row span {
    overflow: hidden;
    color: var(--ink-400);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dealer-result-copy small {
    color: var(--ink-500);
    font-size: 9px;
}

.dealer-result-row > button,
.selected-dealer-row > button {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    background: var(--yuasa-red);
    border: 0;
    border-radius: 9px;
    font-size: 18px;
    font-weight: 600;
}

.dealer-result-row > button.is-selected {
    color: var(--green);
    background: var(--green-soft);
    cursor: default;
}

.selected-dealer-row > button {
    color: var(--ink-400);
    background: transparent;
}

.selected-dealer-row > button:hover {
    color: var(--yuasa-red);
    background: var(--yuasa-red-soft);
}

.selected-dealer-row > button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.selection-index {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff !important;
    background: var(--ink-950);
    border-radius: 8px;
    font-size: 10px !important;
    font-weight: 820;
}

.mini-empty-state,
.picker-loading {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px;
    color: var(--ink-400);
    background: var(--surface-subtle);
    border: 1px dashed var(--line-strong);
    border-radius: 11px;
    text-align: center;
    font-size: 10px;
}

.mini-empty-state.error {
    color: var(--yuasa-red);
    background: var(--yuasa-red-soft);
}

.picker-loading .spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.optimize-button {
    width: 100%;
}

.tour-map-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    min-height: 520px;
    overflow: hidden;
    background: #e9efeb;
}

.tour-map-wrap {
    position: relative;
    min-width: 0;
}

.tour-map {
    height: 100%;
    min-height: 520px;
    background: #e5ebe7;
}

.route-map-label {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 500;
    display: flex;
    min-width: 180px;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 32, 0.12);
    backdrop-filter: blur(12px);
}

.route-map-label span {
    color: var(--ink-400);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.route-map-label strong {
    color: var(--ink-950);
    font-size: 12px;
}

.route-provider-badge {
    position: absolute;
    right: 14px;
    bottom: 12px;
    z-index: 500;
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 0 10px;
    color: var(--ink-500);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.tour-summary-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 8%, rgba(237, 28, 36, 0.18), transparent 12rem),
        var(--ink-950);
}

.tour-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tour-summary-head > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tour-summary-head span {
    color: #7e8ea1;
    font-size: 10px;
    font-weight: 700;
}

.tour-summary-head strong {
    font-size: 24px;
    font-weight: 850;
    letter-spacing: -0.03em;
}

.summary-route-icon {
    color: #ff4b52;
    background: rgba(255, 255, 255, 0.08);
}

.tour-summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.tour-summary-metrics > div {
    display: flex;
    min-height: 90px;
    flex-direction: column;
    justify-content: flex-end;
    gap: 7px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 12px;
}

.tour-summary-metrics span {
    color: #74869b;
    font-size: 8px;
    font-weight: 700;
}

.tour-summary-metrics strong {
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
}

.tour-logic-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
}

.logic-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 780;
}

.logic-title svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #ff4b52;
    stroke-linecap: round;
    stroke-width: 2;
}

.tour-logic-card p {
    margin: 10px 0 0;
    color: #8191a4;
    font-size: 10px;
    line-height: 1.6;
}

.summary-action {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: auto;
    color: #fff;
    background: var(--yuasa-red);
    border: 0;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 780;
}

.summary-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.summary-action svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.tour-map-loading {
    inset: 0 330px 0 0;
}

.route-number-icon-wrap {
    background: transparent !important;
    border: 0 !important;
}

.route-number-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #fff;
    background: var(--yuasa-red);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 5px 14px rgba(215, 25, 32, 0.35);
    font-size: 11px;
    font-weight: 850;
}

.tour-stops-card {
    overflow: hidden;
}

.tour-stop-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.tour-stop-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.tour-stop-row:hover {
    border-color: #b8c4d2;
    box-shadow: 0 5px 16px rgba(15, 23, 32, 0.055);
}

.tour-stop-index {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    background: var(--ink-950);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 850;
}

.tour-stop-copy {
    min-width: 0;
    flex: 1;
}

.tour-stop-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tour-stop-title > strong {
    color: var(--ink-950);
    font-size: 13px;
}

.tour-stop-copy p {
    margin: 4px 0 0;
    color: var(--ink-400);
    font-size: 10px;
}

.tour-stop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    color: var(--ink-500);
    font-size: 9px;
}

.tour-stop-meta strong {
    color: var(--ink-800);
}

.tour-output-stack > .section-note code {
    padding: 1px 4px;
    color: var(--ink-700);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 9px;
}

.login-page {
    min-height: 100vh;
    background: #fff;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 0.95fr) minmax(480px, 1.05fr);
}

.login-brand-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(38px, 5vw, 72px);
    color: #fff;
    background:
        linear-gradient(145deg, transparent 62%, rgba(237, 28, 36, 0.16)),
        radial-gradient(circle at 90% 10%, rgba(237, 28, 36, 0.2), transparent 24rem),
        var(--ink-950);
}

.login-brand-panel::before,
.login-brand-panel::after {
    position: absolute;
    width: 420px;
    height: 90px;
    content: "";
    background: rgba(255, 255, 255, 0.025);
    transform: rotate(-34deg);
}

.login-brand-panel::before {
    right: -120px;
    bottom: 26%;
}

.login-brand-panel::after {
    right: -40px;
    bottom: 12%;
}

.login-brand,
.login-mobile-brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
}

.login-brand-copy {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.login-brand-copy .eyebrow {
    color: #ff4c53;
}

.login-brand-copy h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(42px, 5vw, 72px);
    font-weight: 850;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.login-brand-copy > p:last-child {
    max-width: 520px;
    margin: 22px 0 0;
    color: #8fa0b3;
    font-size: clamp(14px, 1.5vw, 18px);
    line-height: 1.65;
}

.login-feature-row {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.login-feature-row span {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 14px;
    color: #7f90a4;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 10px;
    font-weight: 700;
}

.login-feature-row strong {
    color: #fff;
    font-size: 11px;
}

.login-form-panel {
    display: grid;
    place-items: center;
    padding: 38px;
    background:
        radial-gradient(circle at 0 100%, rgba(237, 28, 36, 0.045), transparent 26rem),
        #fff;
}

.login-form-wrap {
    width: min(420px, 100%);
}

.login-mobile-brand {
    display: none;
    margin-bottom: 42px;
}

.login-mobile-brand .brand-word {
    color: var(--ink-950);
}

.login-form-wrap h2 {
    margin: 0;
    color: var(--ink-950);
    font-size: 38px;
    font-weight: 850;
    letter-spacing: -0.045em;
}

.login-intro {
    margin: 10px 0 32px;
    color: var(--ink-500);
    font-size: 13px;
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-form input {
    min-height: 50px;
    background: var(--surface-subtle);
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.field-label-row span {
    color: var(--ink-400);
    font-size: 9px;
}

.field-error {
    color: var(--yuasa-red-dark);
    font-size: 10px;
}

.login-error {
    padding: 12px 14px;
    color: var(--yuasa-red-dark);
    background: var(--yuasa-red-soft);
    border: 1px solid #ffcbd0;
    border-radius: 10px;
    font-size: 11px;
}

.login-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
}

.login-footnote {
    margin: 26px 0 0;
    color: var(--ink-400);
    font-size: 9px;
    text-align: center;
}

.app-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1000;
    max-width: min(420px, calc(100vw - 36px));
    padding: 13px 16px;
    color: #fff;
    background: var(--ink-950);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    box-shadow: var(--shadow-float);
    font-size: 12px;
    font-weight: 650;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: 180ms ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast[data-type="error"] {
    background: var(--yuasa-red-dark);
}

.mobile-bottom-nav,
.sidebar-scrim {
    display: none;
}

@media (max-width: 1120px) {
    :root {
        --sidebar-width: 232px;
    }

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

    .topbar-help,
    .online-pill {
        display: none;
    }

    .map-workspace {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .tour-builder-grid {
        grid-template-columns: 320px minmax(0, 1fr);
    }

    .tour-map-card {
        grid-template-columns: 1fr;
    }

    .tour-summary-panel {
        display: grid;
        grid-template-columns: 1fr 1.5fr;
        gap: 14px;
    }

    .tour-summary-metrics {
        grid-column: span 2;
    }

    .tour-logic-card {
        min-height: 100%;
    }

    .summary-action {
        margin-top: 0;
    }

    .tour-map-loading {
        inset: 0;
    }
}

@media (max-width: 820px) {
    :root {
        --topbar-height: 64px;
    }

    .yuasa-sidebar {
        width: min(310px, 88vw);
        box-shadow: var(--shadow-float);
        transform: translateX(-104%);
        transition: transform 200ms ease;
    }

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

    .sidebar-scrim {
        position: fixed;
        inset: 0;
        z-index: 45;
        width: 100%;
        padding: 0;
        background: rgba(7, 12, 18, 0.55);
        border: 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
        backdrop-filter: blur(3px);
    }

    .sidebar-is-open .sidebar-scrim {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-close,
    .mobile-menu-button {
        display: inline-grid;
    }

    .sidebar-close {
        color: #9aa9ba;
    }

    .yuasa-main {
        margin-left: 0;
    }

    .yuasa-topbar {
        gap: 10px;
        padding: 0 14px;
    }

    .global-search {
        width: auto;
        flex: 1;
    }

    .global-search kbd,
    .language-pill,
    .topbar-primary span {
        display: none;
    }

    .topbar-primary {
        width: 44px;
        padding: 0;
    }

    .yuasa-content {
        padding: 22px 16px 96px;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 42;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        min-height: 68px;
        padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--line);
        box-shadow: 0 -10px 30px rgba(15, 23, 32, 0.08);
        backdrop-filter: blur(16px);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        display: flex;
        min-height: 52px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--ink-400);
        background: transparent;
        border: 0;
        border-radius: 10px;
        font-size: 9px;
        font-weight: 720;
    }

    .mobile-bottom-nav svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.8;
    }

    .mobile-bottom-nav .is-active {
        color: var(--yuasa-red);
        background: var(--yuasa-red-soft);
    }

    .page-heading {
        flex-direction: column;
        margin-bottom: 20px;
    }

    .page-actions {
        width: 100%;
        justify-content: stretch;
    }

    .page-actions > * {
        flex: 1;
    }

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

    .map-filter-card {
        order: 2;
    }

    .map-panel {
        order: 1;
    }

    .dealer-map {
        height: 54vh;
        min-height: 430px;
    }

    .tour-builder-grid {
        grid-template-columns: 1fr;
    }

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

    .tour-map-card {
        min-height: auto;
    }

    .tour-map {
        min-height: 460px;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        min-height: 100vh;
        padding: 28px 20px;
    }

    .login-mobile-brand {
        display: flex;
    }
}

@media (max-width: 560px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .metric-card {
        min-height: 108px;
        padding: 16px;
    }

    .metric-label {
        font-size: 9px;
    }

    .metric-value {
        font-size: 23px;
    }

    .metric-meta {
        font-size: 9px;
    }

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

    .span-2 {
        grid-column: auto;
    }

    .map-heading-actions .badge {
        display: none;
    }

    .compact-action {
        width: 40px;
        padding: 0;
        font-size: 0;
    }

    .map-status-strip span:last-child {
        display: none;
    }

    .tour-control-stack {
        grid-template-columns: 1fr;
    }

    .tour-map {
        min-height: 390px;
    }

    .tour-summary-panel {
        display: flex;
    }

    .tour-summary-metrics {
        grid-column: auto;
    }

    .route-map-label {
        top: 12px;
        left: 12px;
        min-width: 150px;
        padding: 10px 12px;
    }

    .tour-stop-row {
        align-items: flex-start;
        padding: 12px;
    }

    .tour-stop-meta {
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Administration: customers and locations */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.badge-neutral {
    color: var(--ink-600);
    background: var(--surface-muted);
}

.admin-metric-grid {
    margin-bottom: 20px;
}

.admin-workspace {
    overflow: hidden;
}

.admin-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.admin-toolbar > div {
    flex: 0 0 auto;
}

.admin-toolbar h2 {
    margin: 0;
    color: var(--ink-950);
    font-size: 18px;
    font-weight: 830;
    letter-spacing: -0.025em;
}

.admin-toolbar p {
    margin: 5px 0 0;
    color: var(--ink-400);
    font-size: 11px;
}

.admin-filter-form {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(240px, 1.5fr) repeat(2, minmax(150px, 0.8fr)) auto auto;
    align-items: end;
    gap: 10px;
}

.admin-filter-form-compact {
    grid-template-columns: minmax(240px, 1.5fr) minmax(170px, 0.8fr) auto auto;
}

.admin-search-field {
    display: flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.admin-search-field:focus-within {
    background: #fff;
    border-color: #9aa8b9;
    box-shadow: 0 0 0 4px rgba(15, 23, 32, 0.04);
}

.admin-search-field svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--ink-400);
    stroke-linecap: round;
    stroke-width: 2;
}

.admin-search-field input {
    width: 100%;
    min-width: 0;
    color: var(--ink-800);
    background: transparent;
    border: 0;
    outline: 0;
}

.admin-search-field input::placeholder {
    color: var(--ink-400);
}

.admin-filter-field {
    display: grid;
    gap: 5px;
}

.admin-filter-field > span {
    color: var(--ink-500);
    font-size: 9px;
    font-weight: 760;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-filter-field select {
    min-width: 0;
    min-height: 44px;
    padding: 0 34px 0 11px;
    color: var(--ink-700);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
}

.admin-filter-field select:focus {
    border-color: #9aa8b9;
    box-shadow: 0 0 0 4px rgba(15, 23, 32, 0.04);
}

.admin-filter-submit {
    min-width: 82px;
}

.admin-reset-link {
    min-height: 44px;
    align-content: center;
    white-space: nowrap;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.admin-table th {
    padding: 13px 16px;
    color: var(--ink-500);
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--line);
    font-size: 9px;
    font-weight: 820;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table td {
    padding: 13px 16px;
    color: var(--ink-600);
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: background 120ms ease;
}

.admin-table tbody tr:hover {
    background: #fbfcfd;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-primary-cell {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.admin-primary-cell > span:last-child {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.admin-primary-cell strong,
.admin-cell-main {
    display: block;
    overflow: hidden;
    color: var(--ink-900);
    font-size: 12px;
    font-weight: 760;
    text-overflow: ellipsis;
}

.admin-primary-cell small,
.admin-cell-meta {
    display: block;
    overflow: hidden;
    max-width: 210px;
    color: var(--ink-400);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--yuasa-red-dark);
    background: var(--yuasa-red-soft);
    border: 1px solid #ffd7da;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 850;
}

.admin-number-column {
    font-variant-numeric: tabular-nums;
    text-align: right !important;
    white-space: nowrap;
}

.admin-number-column strong {
    color: var(--ink-800);
    font-size: 11px;
}

.admin-action-column {
    width: 92px;
    text-align: right !important;
}

.admin-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.admin-icon-action {
    display: inline-grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    color: var(--ink-500);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: 120ms ease;
}

.admin-icon-action:hover,
.admin-icon-action:focus-visible {
    color: var(--ink-950);
    background: var(--surface-muted);
    outline: none;
}

.admin-icon-action.is-danger:hover,
.admin-icon-action.is-danger:focus-visible {
    color: var(--yuasa-red-dark);
    background: var(--yuasa-red-soft);
    border-color: #ffcbd0;
}

.admin-icon-action svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.admin-empty-state {
    display: grid;
    min-height: 260px;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 30px;
    color: var(--ink-400);
    text-align: center;
}

.admin-empty-state svg {
    width: 34px;
    height: 34px;
    margin-bottom: 4px;
    fill: none;
    stroke: var(--ink-300, #b8c3cf);
    stroke-linecap: round;
    stroke-width: 1.6;
}

.admin-empty-state strong {
    color: var(--ink-700);
    font-size: 13px;
}

.admin-empty-state p {
    margin: 0;
    font-size: 11px;
}

.admin-pagination {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
}

.admin-page-numbers {
    display: flex;
    gap: 5px;
}

.admin-page-link {
    display: inline-grid;
    min-width: 38px;
    min-height: 38px;
    padding: 0 10px;
    place-items: center;
    color: var(--ink-600);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 740;
}

.admin-page-link:hover,
.admin-page-link:focus-visible {
    color: var(--ink-950);
    background: var(--surface-subtle);
    outline: none;
}

.admin-page-link.is-current {
    color: #fff;
    background: var(--ink-950);
    border-color: var(--ink-950);
}

.admin-page-link.is-disabled {
    cursor: default;
    opacity: 0.4;
}

.admin-page-summary {
    margin: 0 5px;
    color: var(--ink-400);
    font-size: 10px;
    white-space: nowrap;
}

.office-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
}

.office-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 7px 22px rgba(15, 23, 32, 0.035);
}

.office-card-accent {
    height: 4px;
    background: var(--office-color);
}

.office-card-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 11px;
    padding: 16px;
}

.office-card-header h3 {
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--ink-950);
    font-size: 15px;
    font-weight: 820;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.office-card-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--office-color);
    background: color-mix(in srgb, var(--office-color) 10%, white);
    border: 1px solid color-mix(in srgb, var(--office-color) 22%, white);
    border-radius: 11px;
}

.office-card-icon svg,
.office-card-address svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.office-card-address {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 16px;
    padding: 12px;
    color: var(--ink-400);
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.office-card-address > span {
    min-width: 0;
}

.office-card-address strong,
.office-card-address small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.office-card-address strong {
    color: var(--ink-700);
    font-size: 11px;
}

.office-card-address small {
    margin-top: 3px;
    font-size: 10px;
}

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

.office-card-details div {
    min-width: 0;
}

.office-card-details dt {
    margin-bottom: 4px;
    color: var(--ink-400);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.office-card-details dd {
    margin: 0;
    overflow: hidden;
    color: var(--ink-700);
    font-size: 10px;
    font-weight: 660;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.office-card-footer {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #fbfcfd;
    border-top: 1px solid var(--line);
}

.office-color-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-400);
    font-size: 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.office-color-label i {
    width: 9px;
    height: 9px;
    background: var(--office-color);
    border-radius: 50%;
}

.office-card-footer .text-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.office-card-footer .text-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.office-empty-state {
    grid-column: 1 / -1;
}

.admin-dialog {
    width: min(720px, calc(100vw - 32px));
    max-width: none;
    max-height: min(900px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    color: var(--ink-900);
    background: transparent;
    border: 0;
    border-radius: 18px;
    box-shadow: var(--shadow-float);
}

.admin-dialog-wide {
    width: min(860px, calc(100vw - 32px));
}

.admin-dialog::backdrop {
    background: rgba(7, 12, 18, 0.62);
    backdrop-filter: blur(4px);
}

.admin-dialog-panel {
    display: flex;
    max-height: min(900px, calc(100vh - 32px));
    flex-direction: column;
    background: #fff;
}

.admin-dialog-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    background:
        radial-gradient(circle at 92% -30%, rgba(237, 28, 36, 0.11), transparent 15rem),
        #fff;
    border-bottom: 1px solid var(--line);
}

.admin-dialog-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--yuasa-red-dark);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-dialog-eyebrow.danger {
    color: #b91c1c;
}

.admin-dialog-header h2 {
    margin: 0;
    color: var(--ink-950);
    font-size: 21px;
    font-weight: 850;
    letter-spacing: -0.035em;
}

.admin-dialog-header p {
    margin: 6px 0 0;
    color: var(--ink-400);
    font-size: 11px;
    line-height: 1.5;
}

.admin-dialog-close {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    color: var(--ink-500);
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 11px;
}

.admin-dialog-close:hover,
.admin-dialog-close:focus-visible {
    color: var(--ink-950);
    background: var(--surface-muted);
    outline: none;
}

.admin-dialog-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.admin-dialog-body {
    display: grid;
    flex: 1;
    gap: 14px;
    padding: 18px 22px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-form-section {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
}

.admin-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.admin-section-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--yuasa-red-dark);
    background: var(--yuasa-red-soft);
    border-radius: 9px;
}

.admin-section-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.admin-section-heading h3 {
    margin: 0;
    color: var(--ink-900);
    font-size: 13px;
    font-weight: 810;
}

.admin-section-heading p {
    margin: 3px 0 0;
    color: var(--ink-400);
    font-size: 10px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 12px;
}

.field-group > span:first-child {
    color: var(--ink-700);
    font-size: 10px;
    font-weight: 760;
}

.field-group > small {
    color: var(--ink-400);
    font-size: 9px;
}

.admin-advanced-section {
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 13px;
}

.admin-advanced-section summary {
    padding: 15px 16px;
    color: var(--ink-600);
    cursor: pointer;
    font-size: 11px;
    font-weight: 780;
}

.admin-advanced-section[open] summary {
    border-bottom: 1px solid var(--line);
}

.admin-advanced-section .admin-form-grid {
    padding: 16px;
}

.admin-dialog-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    background: #fbfcfd;
    border-top: 1px solid var(--line);
}

.danger-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: #fff;
    background: #b91c1c;
    border: 1px solid #991b1b;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 780;
}

.danger-action:hover,
.danger-action:focus-visible {
    background: #991b1b;
    outline: none;
}

.admin-form-errors {
    margin: 14px 22px 0;
    padding: 11px 14px;
    color: #991b1b;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    font-size: 10px;
}

.admin-form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.admin-confirm-dialog {
    width: min(500px, calc(100vw - 32px));
}

.admin-confirm-copy {
    padding: 24px 22px;
}

.admin-confirm-copy p {
    margin: 0;
    color: var(--ink-700);
    font-size: 13px;
    line-height: 1.55;
}

.admin-confirm-copy span {
    display: block;
    margin-top: 8px;
    color: var(--ink-400);
    font-size: 10px;
}

.admin-color-input {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.admin-color-input input {
    width: 34px;
    min-height: 30px;
    padding: 0;
    border: 0;
}

.admin-color-input span {
    color: var(--ink-500);
    font-size: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.admin-color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-left: 44px;
}

.admin-color-presets button {
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--preset-color);
    border: 3px solid #fff;
    border-radius: 10px;
    box-shadow: 0 0 0 1px var(--line);
}

.admin-color-presets button:hover,
.admin-color-presets button:focus-visible,
.admin-color-presets button.is-selected {
    outline: none;
    box-shadow: 0 0 0 2px var(--ink-950);
}

@media (max-width: 1360px) {
    .admin-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-filter-form {
        width: 100%;
    }

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

@media (max-width: 1120px) {
    .admin-filter-form,
    .admin-filter-form-compact {
        grid-template-columns: 1fr 1fr;
    }

    .admin-search-field {
        grid-column: span 2;
    }

    .admin-reset-link {
        text-align: center;
    }

    .office-card-grid {
        grid-template-columns: 1fr;
    }

    .admin-table-wrap {
        padding: 12px;
        overflow: visible;
        background: var(--surface-subtle);
    }

    .admin-table {
        display: block;
        min-width: 0;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody {
        display: grid;
        gap: 10px;
    }

    .admin-table tr {
        display: grid;
        padding: 14px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 13px;
        box-shadow: 0 5px 16px rgba(15, 23, 32, 0.035);
    }

    .admin-table td {
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid #edf1f5;
        text-align: left !important;
    }

    .admin-table td::before {
        color: var(--ink-400);
        content: attr(data-label);
        font-size: 8px;
        font-weight: 820;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .admin-table td:first-child {
        display: block;
        padding-top: 0;
    }

    .admin-table td:first-child::before,
    .admin-table .admin-action-column::before {
        display: none;
    }

    .admin-table .admin-action-column {
        display: block;
        width: auto;
        padding: 10px 0 0;
        border-bottom: 0;
    }

    .admin-primary-cell {
        min-width: 0;
    }

    .admin-cell-meta {
        max-width: 100%;
    }

    .admin-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .admin-toolbar {
        padding: 16px;
    }

    .admin-filter-form,
    .admin-filter-form-compact {
        grid-template-columns: 1fr;
    }

    .admin-search-field {
        grid-column: auto;
    }

    .admin-filter-submit {
        width: 100%;
    }

    .admin-page-summary {
        width: 100%;
        order: -1;
        text-align: center;
    }

    .admin-page-numbers {
        display: none;
    }

    .office-card-grid {
        padding: 12px;
    }

    .office-card-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .office-card-header .admin-row-actions {
        grid-column: span 2;
        justify-content: stretch;
    }

    .office-card-header .admin-icon-action {
        width: auto;
        flex: 1;
    }

    .office-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-dialog,
    .admin-dialog-wide,
    .admin-confirm-dialog {
        width: calc(100vw - 32px);
        max-height: calc(100dvh - 8px);
        margin: auto 16px 8px;
        border-radius: 18px;
    }

    .admin-dialog-panel {
        max-height: 92dvh;
    }

    .admin-dialog-header {
        padding: 17px 16px;
    }

    .admin-dialog-body {
        padding: 14px 16px 20px;
    }

    .admin-form-section {
        padding: 14px;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-grid .span-2 {
        grid-column: auto;
    }

    .admin-dialog-footer {
        padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    }

    .admin-dialog-footer > * {
        flex: 1;
    }

    .admin-color-presets {
        padding-left: 0;
    }
}
