/*
 * App V2 — Clean, minimal, FreightSoft-inspired
 * Same class names as app.css — drop-in replacement.
 * Tighter spacing, no emoji reliance, monochrome + blue accent.
 */

html, body { font-family: var(--font-family); background: var(--bg); color: var(--text); }
body { line-height: 1.55; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; }
p { color: var(--text-soft); }
a { transition: color 0.15s; }
strong { color: var(--text); }
.muted { color: var(--text-faint); }

/* ── Forms — tighter, cleaner ── */
input, select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); color: var(--text); outline: none; transition: 0.15s; font-size: 0.88rem;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1); }
label { display: inline-block; margin-bottom: 6px; font-weight: 600; font-size: 0.84rem; color: var(--text-soft); }

.stack { display: grid; gap: 4px; min-width: 0; max-width: 100%; overflow-x: hidden; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-group { display: grid; gap: 6px; position: relative; }
.form-row { display: flex; align-items: center; gap: 12px; }
.form-row--between { justify-content: space-between; }

/* ── Buttons — clean, no hover lift ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 0 16px; border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.88rem; transition: 0.15s; border: 1px solid transparent; cursor: pointer;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--primary { background: var(--primary); color: var(--text-inverse); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn--danger:hover {
    background: var(--danger-hover);
    color: var(--danger-text-hover);
    border-color: var(--danger-text-hover);
}
.btn--secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--secondary:hover { background: var(--surface-soft); }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--border);border-color: var(--primary);font-weight: 900; }
.btn--ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 0.82rem; }

/* ── Status badges — dot + text, no background fill ── */
.badge, .status {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 24px; padding: 2px 10px; border-radius: var(--radius-pill);
    font-size: 0.78rem; font-weight: 600;
}
.status--pending { background: var(--warning-soft); color: var(--warning); }
.status--transit { background: var(--primary-soft); color: var(--primary); }
.status--delayed { background: var(--danger-soft); color: var(--danger); }
.status--delivered { background: var(--success-soft); color: var(--success); }
.status--available { background: var(--success-soft); color: var(--success); }
.status--trip { background: var(--primary-soft); color: var(--primary); }

.form-message { padding: 10px 12px; border-radius: var(--radius-md); font-size: 0.88rem; }
.form-message--error { background: var(--danger-soft); color: var(--danger); }
.form-message--success { background: var(--success-soft); color: var(--success); }

/* ── Auth — same layout, cleaner colors ── */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-brand, .auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.auth-brand__inner { max-width: 520px; }
.auth-brand__tag { display: inline-flex; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 0.84rem; margin-bottom: 20px; }
.auth-brand h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 10px; }
.auth-brand > .auth-brand__inner > p { font-size: 1rem; color: var(--text-soft); margin-bottom: 28px; line-height: 1.6; }
.auth-features { display: grid; gap: 12px; }
.auth-feature { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.auth-feature__icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.auth-feature strong { display: block; font-size: 0.88rem; margin-bottom: 2px; }
.auth-feature p { font-size: 0.82rem; color: var(--text-faint); margin: 0; }
.auth-panel { background: var(--surface-soft); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 32px 28px; }
.auth-logo { font-size: 1.8rem; margin-bottom: 10px; }
.auth-card h2 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-card__header { margin-bottom: 24px; }
.auth-card__header p { font-size: 0.88rem; color: var(--text-faint); }
.auth-form { display: grid; gap: 16px; }
.auth-card__footer { margin-top: 18px; text-align: center; font-size: 0.85rem; color: var(--text-faint); }
.auth-card__footer a { color: var(--primary); font-weight: 600; }
.auth-card__footer a:hover { text-decoration: underline; }

/* ── App Shell — sidebar + topbar ── */
.app-shell { min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh; overflow-y: auto; z-index: 20; }
.sidebar__brand h1 { color: var(--sidebar-active); font-size: 1.15rem; }
.sidebar__brand p { font-size: 0.82rem; color: var(--sidebar-text); }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { min-height: 36px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.86rem; color: var(--sidebar-text); transition: 0.12s; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: var(--sidebar-active); }
.nav-link--active { background: rgba(255,255,255,0.1); color: var(--sidebar-active); font-weight: 600; }
.nav-group { margin-top: 6px; }
.nav-group__label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(156,163,175,0.5); padding: 6px 12px 2px; font-weight: 700; }

.app-main { min-width: 0; max-width: 100%; overflow-x: hidden; margin-left: var(--sidebar-width); }
.topbar { min-height: var(--topbar-height); background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 10; }
.topbar__left { display: flex; align-items: center; gap: 12px; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 1.25rem; font-weight: 700; }
.page-content { padding: 20px 24px; overflow-x: hidden; max-width: 100%; }

/* ── Search ── */
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; z-index: 35; margin-top: 4px; }
.search-results[hidden] { display: none; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; text-decoration: none; color: var(--text); font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface-soft); }
.search-item__type { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--text-faint); min-width: 56px; }
.search-empty { padding: 14px; text-align: center; color: var(--text-faint); font-size: 0.85rem; }

/* ── Stats grid — cleaner cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card, .panel, .detail-card, .state-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.stat-card { padding: 18px 20px; }
.stat-card__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); display: inline-block; margin-bottom: 6px; font-weight: 600; }
.stat-card h3 { font-size: 1.6rem; margin-bottom: 4px; }
.stat-card__value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-card--link { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: box-shadow 0.15s; }
.stat-card--link:hover { box-shadow: var(--shadow-md); }
.stat-card--warning { border-left: 3px solid var(--warning); }
.stat-card--danger { border-left: 3px solid var(--danger); }
.stat-card--success { border-left: 3px solid var(--success); }
.stat-card__icon { position: absolute; top: 16px; right: 16px; font-size: 1.4rem; opacity: 0.5; }

.content-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }

/* ── Panels ── */
.panel__header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel__body { padding: 14px 18px; overflow-x: auto; }
.panel__body .btn { margin-top: 6px; }

/* ── Tables — clean, tight ── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { text-align: left; padding: 10px 16px; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); background: var(--surface-soft); border-bottom: 1px solid var(--border); font-weight: 600; }
.data-table tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text-soft); font-size: 0.88rem; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table thead th[data-pg-sort]:hover { background: var(--surface-muted); color: var(--text); cursor: pointer; }

.detail-card { padding: 18px; }
.detail-card h4 { margin-bottom: 10px; font-size: 0.92rem; }
.state-card { padding: 24px 18px; text-align: center; }
.state-card h3 { margin-bottom: 6px; }
.state-card p { max-width: 46ch; margin: 0 auto; }

/* ── Toolbar ── */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.toolbar__left, .toolbar__right { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mobile-menu-btn { display: none; }
.drawer-backdrop { display: none; }

/* ── Modals ── */
.modal-root, .toast-root { position: fixed; z-index: 999; }
.modal-root { inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; background: var(--overlay); }
.modal-root.is-open { display: flex; }
.modal { width: 100%; max-width: 500px; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.modal__header, .modal__body, .modal__footer { padding: 16px 18px; }
.modal__header { border-bottom: 1px solid var(--border); }
.modal__footer { border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Toasts — same position, cleaner ── */
.toast-root { bottom: 20px; right: 20px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 400px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border); box-shadow: var(--shadow-md); animation: toast-slide-in 0.2s ease; display: flex; align-items: flex-start; gap: 8px; }
.toast__icon { font-size: 0.9rem; flex-shrink: 0; line-height: 1.4; }
.toast__msg { flex: 1; font-size: 0.84rem; line-height: 1.4; color: var(--text); }
.toast__close { background: none; border: none; color: var(--text-faint); font-size: 0.78rem; cursor: pointer; padding: 0; flex-shrink: 0; }
.toast__close:hover { color: var(--text); }
.toast--clickable { cursor: pointer; transition: transform 0.1s; }
.toast--clickable:hover { transform: translateX(-3px); }
@keyframes toast-slide-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast--info { border-left-color: var(--primary); }
.toast--warning { border-left-color: var(--warning); }
.toast--lost { border-left-color: var(--danger); }
.toast--won { border-left-color: var(--success); }

/* ── Page header ── */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-header__left, .page-header__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-section-title { font-size: 1.1rem; }

/* ── Pagination — tighter ── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); gap: 10px; flex-wrap: wrap; }
.pagination__info { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 0.82rem; }
.pagination__controls { display: flex; align-items: center; gap: 3px; }
.pg-btn { min-width: 32px; min-height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-soft); font-weight: 600; font-size: 0.82rem; cursor: pointer; transition: 0.12s; }
.pg-btn:hover:not(:disabled):not(.pg-btn--active) { background: var(--surface-muted); }
.pg-btn--active { background: var(--primary); border-color: var(--primary); color: var(--text-inverse); }
.pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pg-per-page { width: auto; min-width: 90px; padding: 5px 8px; font-size: 0.82rem; border-radius: var(--radius-sm); }

/* ── Filter bar ── */
.table-filter { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.table-filter input { padding: 8px 12px; font-size: 0.86rem; }

/* ── Tabs — clean underline style ── */
.dispatch-tabs { display: flex; gap: 0; margin-bottom: 14px; border-bottom: 2px solid var(--border); width: 100%; overflow-x: auto; }
.dispatch-tab { padding: 10px 18px; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; background: transparent; color: var(--text-faint); font-weight: 600; font-size: 0.86rem; cursor: pointer; transition: 0.12s; white-space: nowrap; }
.dispatch-tab:hover { color: var(--text); }
.dispatch-tab--active { color: var(--primary); border-bottom-color: var(--primary); }
.dispatch-tab--active:hover { color: var(--primary-hover); }

/* ── Notifications ── */
.notification-bell { position: relative; }
.notification-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: white; font-size: 0.68rem; display: inline-flex; align-items: center; justify-content: center; }
.notification-panel { position: absolute; top: calc(var(--topbar-height) + 4px); right: 24px; width: 320px; max-height: 400px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: none; z-index: 30; }
.notification-panel.is-open { display: block; }
.notification-panel__header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notification-list { display: grid; }
.notification-item { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.notification-item p { margin-top: 3px; }
.notification-empty { padding: 16px 14px; color: var(--text-faint); }
.notification-item--link { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: background 0.12s; }
.notification-item--link:hover { background: var(--surface-soft); }
.notification-row--unread { background: var(--primary-soft); }

/* ── Profile ── */
.profile-btn { font-size: 1rem; position: relative; }
.profile-panel { position: absolute; top: calc(var(--topbar-height) + 4px); right: 24px; width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: none; z-index: 31; padding: 14px; }
.profile-panel.is-open { display: block; }
.profile-panel__name { font-weight: 700; font-size: 0.9rem; }
.profile-panel__role { font-size: 0.78rem; margin-bottom: 10px; text-transform: capitalize; }
.profile-panel__logout { display: block; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--danger); font-weight: 600; font-size: 0.84rem; text-align: center; border: 1px solid var(--danger); transition: background 0.12s; }
.profile-panel__logout:hover { background: rgba(220,38,38,0.06); }
.sidebar-logout { display: none; }

/* ── Dispatch inline ── */
.dispatch-inline { display: flex; gap: 8px; align-items: center; }

/* ── Chat ── */
.chat-list { display: grid; gap: 8px; }
.chat-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-soft); }
.chat-item--mine { background: var(--primary-soft); }

/* ── Shimmer ── */
.shimmer-line { display: inline-block; height: 12px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-muted) 25%, var(--border) 50%, var(--surface-muted) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.shimmer-table tbody td { padding: 14px 16px; }

/* ── Page error ── */
.page-error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; text-align: center; padding: 36px 20px; }
.page-error-state__icon { font-size: 2.5rem; margin-bottom: 10px; }
.page-error-state__title { font-size: 1.15rem; color: var(--text); margin: 0 0 6px; }
.page-error-state__msg { color: var(--text-faint); margin: 0 0 20px; max-width: 380px; }
.page-error-state__actions { display: flex; gap: 8px; }

/* ── Progress ── */
.progress-block { display: grid; gap: 12px; }
.progress-bar { width: 100%; height: 8px; background: var(--surface-muted); border-radius: var(--radius-pill); overflow: hidden; }
.progress-bar__fill { height: 100%; background: var(--primary); border-radius: var(--radius-pill); transition: width 0.25s; }
.progress-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.progress-step { display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: 0.84rem; }
.progress-step__dot { width: 8px; height: 8px; border-radius: 999px; background: var(--border-strong); flex-shrink: 0; }
.progress-step--active { color: var(--text); font-weight: 600; }
.progress-step--active .progress-step__dot { background: var(--primary); }

/* ── Timeline ── */
.timeline { display: grid; gap: 10px; }
.timeline-item { position: relative; padding-left: 22px; }
.timeline-item__dot { position: absolute; left: 0; top: 4px; width: 8px; height: 8px; border-radius: 999px; background: var(--primary); }
.timeline-item__line { position: absolute; left: 3px; top: 14px; width: 2px; height: calc(100% + 6px); background: var(--border); }
.timeline-item__line--last { display: none; }

/* ── Charts ── */
.chart-card { display: grid; gap: 14px; }
.chart-card__bar { display: flex; width: 100%; height: 14px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-muted); }
.chart-segment--pending { background: var(--warning); }
.chart-segment--delayed { background: var(--danger); }
.chart-segment--delivered { background: var(--success); }
.chart-legend { display: grid; gap: 8px; }
.chart-legend__item { display: flex; align-items: center; gap: 8px; }
.chart-legend__dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.metric-progress { display: grid; gap: 6px; }
.metric-progress__head { display: flex; justify-content: space-between; gap: 10px; }
.donut-chart { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-chart__ring { border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.donut-chart__center { width: var(--hole); height: var(--hole); background: var(--surface); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.donut-chart__center strong { font-size: 1.3rem; line-height: 1; }
.donut-chart__center span { font-size: 0.68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: var(--bar-height, 150px); padding-top: 20px; }
.bar-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-chart__bar { width: 100%; max-width: 44px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: height 0.3s; min-height: 3px; }
.bar-chart__value { font-weight: 700; font-size: 0.82rem; }
.bar-chart__label { font-size: 0.72rem; color: var(--text-faint); text-align: center; }
.kpi-mini { display: flex; flex-direction: column; gap: 3px; }
.kpi-mini__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 600; }
.kpi-mini__value { font-size: 1.2rem; }
.kpi-mini__sub { font-size: 0.78rem; color: var(--text-faint); }

/* ── Chips ── */
.chip-bar { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--primary-soft); color: var(--primary); border-radius: var(--radius-pill); font-size: 0.82rem; font-weight: 600; }
.chip__remove { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: none; background: rgba(26,86,219,0.12); color: var(--primary); border-radius: 50%; font-size: 0.82rem; cursor: pointer; padding: 0; }
.chip__remove:hover { background: var(--danger-soft); color: var(--danger); }

/* ── Speech-to-text ── */
.stt-mic { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 0.9rem; padding: 0; margin-left: 4px; vertical-align: middle; transition: 0.12s; flex-shrink: 0; }
.stt-mic:hover { background: var(--primary-soft); border-color: var(--primary); }
#stt-overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(17,24,39,0.5); backdrop-filter: blur(3px); }
#stt-overlay.stt-open { display: flex; }
.stt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 28px 36px; text-align: center; min-width: 280px; max-width: 400px; }
.stt-pulse { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; background: var(--danger); animation: stt-pulse-anim 1.2s ease-in-out infinite; }
@keyframes stt-pulse-anim { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.6; } }
.stt-status { font-weight: 600; color: var(--text); margin-bottom: 6px; }
.stt-transcript { color: var(--text-soft); font-size: 0.9rem; min-height: 20px; margin-bottom: 14px; max-height: 100px; overflow-y: auto; }
.form-group .stt-mic { position: absolute; right: 4px; bottom: 6px; }
.form-group input, .form-group textarea { padding-right: 40px; }
.dispatch-inline .stt-mic { position: static; }

/* ── Currency input ── */
.currency-input { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.currency-input select { width: auto; min-width: 68px; border: none; border-right: 1px solid var(--border); border-radius: 0; padding: 10px 8px; font-weight: 700; background: var(--surface-soft); color: var(--text); }
.currency-input input { border: none; border-radius: 0; flex: 1; min-width: 0; }
.currency-input select:focus, .currency-input input:focus { box-shadow: none; }
.currency-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }

/* ── Shipment progress stepper ── */
.sp-progress { display: grid; gap: 14px; }
.sp-track { width: 100%; height: 5px; background: var(--surface-muted); border-radius: var(--radius-pill); overflow: hidden; }
.sp-track__fill { height: 100%; border-radius: var(--radius-pill); transition: width 0.4s; }
.sp-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
    align-items: start;
}
.sp-step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sp-dot { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; transition: 0.2s; font-size: 1rem; }
.sp-dot__icon { position: relative; z-index: 2; }
.sp-dot__pulse { position: absolute; inset: -3px; border-radius: 50%; z-index: 1; animation: sp-pulse 1.5s ease-in-out infinite; }
@keyframes sp-pulse { 0%, 100% { transform: scale(1); opacity: 0.4; } 50% { transform: scale(1.3); opacity: 0; } }
.sp-label { font-size: 0.76rem; font-weight: 600; color: var(--text-faint); }
.sp-step--done .sp-dot { background: var(--success-soft); }
.sp-step--done .sp-label { color: var(--success); }
.sp-step--active .sp-dot { background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(26,86,219,0.12); }
.sp-step--active .sp-dot__pulse { background: var(--primary); }
.sp-step--active .sp-label { color: var(--primary); }
.sp-step--delayed .sp-dot { background: var(--danger-soft); box-shadow: 0 0 0 2px rgba(220,38,38,0.12); }
.sp-step--delayed .sp-dot__pulse { background: var(--danger); }
.sp-step--delayed .sp-label { color: var(--danger); }
.sp-step--future .sp-dot { background: var(--surface-muted); border: 2px solid var(--border); }
.sp-step--future .sp-label { color: var(--text-faint); }
.sp-step:hover .sp-dot { transform: scale(1.08); }
.sp-delay-badge { display: flex; justify-content: center; }
.sp-delay-badge span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-pill); font-weight: 700; font-size: 0.82rem; }

/* ── Timeline v2 ── */
.tl { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 32px 1fr; gap: 10px; position: relative; min-height: 48px; }
.tl-line { position: absolute; left: 15px; top: 32px; width: 2px; bottom: 0; }
.tl-item--last .tl-line { display: none; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; flex-shrink: 0; z-index: 2; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.tl-item:hover .tl-dot { transform: scale(1.1); }
.tl-item--last .tl-dot { box-shadow: 0 0 0 2px rgba(26,86,219,0.1); }
.tl-content { padding: 4px 0 14px; display: flex; flex-direction: column; gap: 2px; }
.tl-content strong { font-size: 0.86rem; }
.tl-time { font-size: 0.74rem; color: var(--text-faint); }

/* ── Shipment detail ── */
.sd-progress-panel { border-top: 2px solid var(--primary); }
.sd-summary-wrap { position: relative; }
.sd-scroll-btn { display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); font-size: 1rem; cursor: pointer; z-index: 2; color: var(--text); padding: 0; }
.sd-scroll-btn:hover { background: var(--surface-soft); }
.sd-scroll-left { left: -4px; }
.sd-scroll-right { right: -4px; }
.sd-summary { display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-top: 6px; scrollbar-width: thin; }
.sd-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); flex: 1 0 150px; min-width: 150px; padding: 14px; text-align: center; transition: box-shadow 0.12s; }
.sd-card:hover { box-shadow: var(--shadow-md); }
.sd-card__icon { font-size: 1.3rem; margin-bottom: 6px; }
.sd-card h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 3px; }
.sd-card p { font-weight: 600; color: var(--text); margin: 0; font-size: 0.9rem; }
.sd-card .muted { font-size: 0.78rem; display: block; margin-top: 2px; }
.sd-delay-card { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; background: var(--danger-soft); border: 1px solid rgba(220,38,38,0.12); border-radius: var(--radius-md); }
.sd-delay-card__icon { font-size: 1.2rem; flex-shrink: 0; }
.sd-delay-card p { margin: 0 0 2px; color: var(--text); font-size: 0.86rem; }
.sd-pod-card { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 12px 14px; background: var(--success-soft); border: 1px solid rgba(5,150,105,0.12); border-radius: var(--radius-md); }
.sd-pod-card__icon { font-size: 1.2rem; flex-shrink: 0; }
.sd-pod-card p { margin: 0 0 2px; color: var(--text); font-size: 0.86rem; }
.sd-tab-content { animation: sd-fade-in 0.15s ease; }
@keyframes sd-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Ratings ── */
.star { font-size: 1.2rem; color: var(--border-strong); }
.star--filled { color: #f59e0b; }
.star-btn { font-size: 1.6rem; background: none; border: none; cursor: pointer; color: var(--border-strong); padding: 2px 3px; transition: 0.1s; }
.star-btn:hover { transform: scale(1.15); }
.star-btn.star-btn--active { color: #f59e0b; }
.rating-stars-input { display: flex; gap: 3px; }
.rating-display { display: flex; flex-direction: column; gap: 3px; }
.rating-display__comment { font-style: italic; color: var(--text-soft); font-size: 0.86rem; }
.rating-summary { display: flex; align-items: center; gap: 12px; }
.rating-summary__score { font-size: 2rem; font-weight: 700; color: #f59e0b; line-height: 1; }
.rating-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 8px; }
.rating-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.rating-card__comment { font-style: italic; color: var(--text-soft); font-size: 0.84rem; margin: 3px 0; }

/* ── Share ── */
.share-wrap { position: relative; display: inline-block; }
.share-dropdown { position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); min-width: 150px; z-index: 20; overflow: hidden; }
.share-option { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 0.86rem; color: var(--text); text-decoration: none; border: none; background: none; width: 100%; cursor: pointer; transition: background 0.1s; }
.share-option:hover { background: var(--surface-soft); }
.share-option + .share-option { border-top: 1px solid var(--border); }

/* ── AI Insight ── */
.insight-panel { border-left: 2px solid var(--primary); background: var(--surface); }
.insight-panel .panel__header { border-bottom-color: var(--border); }
.insight-panel .panel__header h3 { color: var(--primary); }
.insight-body { min-height: 50px; }
.insight-result p { margin-bottom: 6px; line-height: 1.6; color: var(--text); }
.insight-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.insight-list li { padding: 8px 12px; background: var(--surface-soft); border: 1px solid var(--border); border-left: 2px solid var(--primary); border-radius: var(--radius-sm); line-height: 1.5; color: var(--text); }
.insight-loading { padding: 6px 0; }
.insight-cards { display: grid; gap: 10px; }
.insight-card { padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); }
.insight-card:hover { box-shadow: var(--shadow-sm); }
.insight-card__header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.insight-card__icon { font-size: 0.9rem; flex-shrink: 0; }
.insight-card__num { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700; flex-shrink: 0; background: var(--surface-muted); color: var(--text-faint); }
.insight-card__title { font-size: 0.86rem; color: var(--text); }
.insight-card__body { font-size: 0.84rem; line-height: 1.6; color: var(--text-soft); margin: 0; }
.insight-card__body strong { color: var(--text); }
.insight-card--danger { border-left: 2px solid var(--danger); }
.insight-card--danger .insight-card__num { background: var(--danger-soft); color: var(--danger); }
.insight-card--warning { border-left: 2px solid var(--warning); }
.insight-card--warning .insight-card__num { background: var(--warning-soft); color: var(--warning); }
.insight-card--success { border-left: 2px solid var(--success); }
.insight-card--success .insight-card__num { background: var(--success-soft); color: var(--success); }
.insight-card--info { border-left: 2px solid var(--primary); }
.insight-card--info .insight-card__num { background: var(--primary-soft); color: var(--primary); }
.insight-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; font-size: 0.72rem; color: var(--text-faint); }
.insight-meta span { padding: 2px 6px; background: var(--surface-muted); border-radius: var(--radius-sm); }
.insight-card__actions { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.ia-btn { padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.74rem; font-weight: 600; cursor: pointer; transition: 0.1s; color: var(--text-soft); }
.ia-btn:hover:not(:disabled) { background: var(--surface-muted); }
.ia-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ia-btn--selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.ia-done { font-size: 0.78rem; font-weight: 600; color: var(--text-faint); padding: 4px 0; }
.insight-collapse-btn { width: 24px; height: 24px; border: 1px solid rgba(26,86,219,0.15); border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-size: 0.65rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.insight-collapse-btn:hover { background: var(--primary); color: var(--text-inverse); }
.insight-listen-btn--playing { color: var(--danger); border-color: var(--danger); animation: tts-pulse 1.5s ease-in-out infinite; }
@keyframes tts-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.prompt-preview { font-size: 0.76rem; color: var(--text-faint); background: var(--surface-muted); padding: 3px 6px; border-radius: var(--radius-sm); display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── CRM tabs ── */
.crm-tab--new-pulse { animation: crm-new-pulse 1.5s ease-in-out infinite; color: var(--primary); font-weight: 700; }
@keyframes crm-new-pulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 2px 0 var(--primary); } }
.crm-tab--won { color: var(--success); font-weight: 600; }
.crm-tab--lost { color: var(--danger); font-weight: 600; }
.crm-tab--lost.dispatch-tab--active { color: var(--danger); border-bottom-color: var(--danger); background: transparent; }
.crm-tab--won.dispatch-tab--active { color: var(--success); border-bottom-color: var(--success); background: transparent; }

/* ── Dispatch badge ── */
.dispatch-nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: white; font-size: 0.68rem; font-weight: 700; margin-left: 3px; }
.driver-preview { padding: 6px 10px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); line-height: 1.5; font-size: 0.84rem; }
.driver-preview--busy { border-left: 2px solid var(--warning); }
.driver-preview--free { border-left: 2px solid var(--success); }

/* ── ETA modal ── */
.eta-modal { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center; background: var(--overlay); padding: 16px; }
.eta-modal__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 22px; width: 100%; max-width: 340px; }
.eta-modal__card h3 { margin-bottom: 14px; }

/* ── Quick actions ── */
.quick-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.quick-actions .btn--sm { font-size: 0.72rem; padding: 0 7px; min-height: 26px; }

/* ── Reports ── */
.report-table-wrap { max-height: 480px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.report-table-wrap .data-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; box-shadow: 0 1px 0 var(--border); }
.report-table-wrap .data-table { min-width: 800px; }
.rpt-type-btn.rpt-selected { background: var(--primary); color: var(--text-inverse); border-color: var(--primary); }
.rpt-type-btn:not(.rpt-selected) { background: var(--surface); color: var(--text-soft); }
.period-btn.period-selected { background: var(--primary); color: var(--text-inverse); border-color: var(--primary); }

/* ── Bottom nav (mobile only) ── */
.bottom-nav { display: none; }

/* ── Driver card view ── */
.ds-tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.ds-tabs::-webkit-scrollbar { display: none; }
.ds-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); cursor: pointer; flex: 1; min-width: 65px; transition: 0.12s; font-family: inherit; }
.ds-tab--active { border-color: var(--primary); background: var(--primary-soft); }
.ds-tab__icon { font-size: 1.2rem; }
.ds-tab__label { font-size: 0.68rem; font-weight: 600; color: var(--text-faint); }
.ds-tab--active .ds-tab__label { color: var(--primary); }
.ds-tab__count { background: var(--primary); color: #fff; font-size: 0.62rem; font-weight: 700; padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center; }
.ds-search { margin-bottom: 10px; }
.ds-search input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 0.92rem; background: var(--surface); }
.ds-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 8px; color: var(--text); cursor: pointer; }
.ds-card:active { box-shadow: var(--shadow-md); }
.ds-card__body { padding: 14px; }
.ds-card__header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.ds-card__id { font-weight: 700; font-size: 0.86rem; color: var(--primary); }
.ds-card__badge { font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.ds-card__badge--danger { background: var(--danger-soft); color: var(--danger); }
.ds-card__badge--gps { background: rgba(5,150,105,0.08); color: #059669; }
.ds-card__route { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.ds-card__meta { display: flex; gap: 14px; font-size: 0.82rem; color: var(--text-faint); margin-bottom: 3px; }
.ds-card__actions { padding: 0 14px 14px; }
.ds-action { display: block; width: 100%; padding: 12px; border: none; border-radius: var(--radius-md); font-size: 0.92rem; font-weight: 700; font-family: inherit; cursor: pointer; text-align: center; }
.ds-action--primary { background: var(--primary); color: #fff; }
.ds-action--primary:active { background: var(--primary-hover); }
.ds-action--gps { background: var(--success); color: #fff; }
.ds-action--gps:active { background: #047857; }
.ds-action--stop { background: var(--surface-muted); color: var(--danger); border: 1px solid var(--danger); }
.ds-empty { text-align: center; padding: 40px 18px; color: var(--text-faint); }
.ds-empty__icon { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.ds-empty p { font-size: 0.92rem; }

/* ── Action banner ── */
.action-banner { background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--danger); border-radius: var(--radius-md); overflow: hidden; }
.action-banner__header { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: rgba(220,38,38,0.03); font-size: 0.84rem; }
.action-banner__items, .action-banner__more { display: grid; gap: 0; }
.action-row { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-top: 1px solid var(--border); font-size: 0.82rem; }
.action-row__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.action-row__label { flex: 1; }
.action-row__btn { flex-shrink: 0; font-size: 0.74rem; white-space: nowrap; }

/* ── Alert items ── */
.alert-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); text-decoration: none; color: var(--text); transition: background 0.12s; font-size: 0.86rem; }
.alert-item:hover { background: var(--surface-soft); }
.alert-item--danger { border-left: 2px solid var(--danger); }
.alert-item--warning { border-left: 2px solid var(--warning); }
.alert-item--success { border-left: 2px solid var(--success); }
.alert-dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }

/* ── Tracking ── */
.tracking-live-map { height: 360px; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 18px; background: var(--surface-muted); overflow: hidden; position: relative; z-index: 1; }
@keyframes tracking-pulse-anim { 0% { opacity: 0.6; transform: scale(1); } 100% { opacity: 0; transform: scale(2.5); } }
.tracking-pulse { animation: tracking-pulse-anim 2s ease-out infinite; }
.tracking-row:hover { background: var(--surface-soft); }

/* ── Hidden ── */
[hidden] { display: none !important; }

/* ── Print ── */
@media print { .sidebar, .topbar, .notification-panel, .profile-panel, .stt-mic, #stt-overlay, .dispatch-tabs, .btn, .insight-panel, .share-wrap { display: none !important; } .main-content { margin-left: 0 !important; padding: 0 !important; } body { background: white !important; } }


/* ══════════════════════════════════════════════════════════════
   TOP NAVIGATION LAYOUT (layout-topnav.js)
   Only active when .app-shell--topnav is present.
   ══════════════════════════════════════════════════════════════ */

.app-shell--topnav .sidebar { display: none; }
.app-shell--topnav .app-main { margin-left: 0; }

.topnav {
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 20px; position: sticky; top: 0; z-index: 20;
}

.topnav__left { display: flex; align-items: center; gap: 6px; }
.topnav__right { display: flex; align-items: center; gap: 8px; }

.topnav__brand {
    font-weight: 800; font-size: 1.05rem; color: var(--primary);
    text-decoration: none; margin-right: 16px; white-space: nowrap;
}

.topnav__links { display: flex; align-items: center; gap: 2px; }

.topnav__link {
    padding: 6px 14px; border: none; background: none; color: var(--text-faint);
    font-weight: 600; font-size: 0.84rem; cursor: pointer; text-decoration: none;
    border-radius: var(--radius-sm); transition: 0.12s; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px; font-family: inherit;
}
.topnav__link:hover { color: var(--text); background: var(--surface-soft); }
.topnav__link--active { color: var(--primary); }

.topnav__arrow { font-size: 0.7rem; opacity: 0.6; }

/* ── Dropdown menus ── */
.topnav__dropdown { position: relative; }

.topnav__dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; margin-top: 4px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); min-width: 180px; z-index: 40; overflow: hidden;
}

.topnav__dropdown:hover .topnav__dropdown-menu,
.topnav__dropdown:focus-within .topnav__dropdown-menu { display: block; }

.topnav__dropdown-item {
    display: block; padding: 8px 16px; color: var(--text-soft); text-decoration: none;
    font-size: 0.84rem; font-weight: 500; transition: background 0.1s;
}
.topnav__dropdown-item:hover { background: var(--surface-soft); color: var(--text); }
.topnav__dropdown-item--active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.topnav__dropdown-item + .topnav__dropdown-item { border-top: 1px solid var(--border); }

/* ── Page content without sidebar margin ── */
.page-content--topnav { margin-left: 0; padding: 20px 24px; max-width: 1400px; margin: 0 auto; }

/* ── Topnav search is smaller ── */
.topnav .search-wrap { max-width: 240px; }
.topnav .search-wrap input { padding: 7px 10px; font-size: 0.84rem; }

/* ── Notification/profile panels position from topnav ── */
.topnav .notification-panel { top: 56px; }
.topnav .profile-panel { top: 56px; }

/* ── Hamburger hidden on desktop ── */
.topnav__hamburger { display: none; }

/* ── Mobile: hide topnav links, show hamburger ── */
@media (max-width: 900px) {
    .topnav__links { display: none; }
    .topnav__hamburger { display: inline-flex; }
    .topnav .search-wrap { max-width: none; flex: 1; }
    .topnav { padding: 0 12px; height: 48px; }
    .topnav__brand { font-size: 0.95rem; margin-right: 8px; }
    .page-content--topnav { padding: 14px 12px; padding-bottom: 68px; }

    /* Show sidebar on mobile when toggled */
    .app-shell--topnav .sidebar { display: flex; }
}
/* NEW: tax preview should not disturb form-grid alignment */
.tax-preview-row {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: -8px;
    margin-bottom: 4px;
}

.tax-preview-inline {
    display: none;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    font-size: 0.78rem;
    color: var(--text-soft);
}

.tax-preview-inline__title,
.tax-preview-inline__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.tax-preview-inline__title {
    margin-bottom: 6px;
    font-weight: 800;
    color: var(--text);
}

.tax-preview-inline__rows {
    display: grid;
    gap: 4px;
}

.tax-preview-inline__row strong {
    color: var(--text);
    white-space: nowrap;
}

.tax-preview-inline__total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    font-weight: 800;
}

.tax-preview-inline__action {
    margin-top: 8px;
}

.tax-preview-inline__action .btn {
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.76rem;
}

.tax-preview-inline__hint {
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-faint);
}

@media (max-width: 640px) {
    .tax-preview-inline__title,
    .tax-preview-inline__row {
        align-items: flex-start;
    }
}

.assistant-prefilled {
    border-color: #2563eb !important;
    background: rgba(37, 99, 235, 0.06);
}

.assistant-missing {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.08);
    animation: pulseMissing 1.6s infinite;
}

@keyframes pulseMissing {
    0% {
        box-shadow: 0 0 0 0 rgba(245,158,11,.35);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245,158,11,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245,158,11,0);
    }
}
.compliance-ticker {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;

  padding: 10px 16px;
  margin: 8px 0;
  border-left: 3px solid var(--primary);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.85rem;
}

.compliance-ticker__label {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.compliance-ticker__viewport {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  height: 1.4em;
  overflow: hidden;
}

.compliance-ticker__track {
  position: absolute;
  left: 0;
  top: 0;

  white-space: nowrap;
  color: var(--text-soft);

  max-width: none;
  width: max-content;

  animation: complianceTickerMove 28s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes complianceTickerMove {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }

  12% {
    transform: translateX(0);
    opacity: 1;
  }

  78% {
    transform: translateX(0);
    opacity: 1;
  }

  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}
[data-sd-panel="timeline"] {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* ============================================================
   3) CSS
   Add this at the bottom of your CSS file
   ============================================================ */
/* ─────────────────────────────────────────────
   Shipment Timeline — polished operational view
   ───────────────────────────────────────────── */

.shipment-timeline {
  display: grid;
  gap: 0;
  padding: 8px 0 2px;
}

.shipment-timeline__item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  position: relative;
}

.shipment-timeline__rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.shipment-timeline__dot {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  z-index: 2;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.shipment-timeline__dot--latest {
  animation: shipment-timeline-pulse 1.8s ease-in-out infinite;
}

@keyframes shipment-timeline-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 86, 219, 0.22);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(26, 86, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 86, 219, 0);
  }
}

.shipment-timeline__line {
  position: absolute;
  top: 32px;
  bottom: -10px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--border-strong, var(--border)),
    var(--border)
  );
}

.shipment-timeline__card {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.shipment-timeline__card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.shipment-timeline__card--latest {
  background:
    linear-gradient(90deg, rgba(26, 86, 219, 0.045), transparent 55%),
    var(--surface);
}

.shipment-timeline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.shipment-timeline__badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.shipment-timeline__head time {
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 600;
}

.shipment-timeline__card p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
}

/* Category colors */

.shipment-timeline__dot--automation,
.shipment-timeline__card--automation {
  border-color: rgba(26, 86, 219, 0.25);
}

.shipment-timeline__dot--automation {
  background: var(--primary-soft);
  color: var(--primary);
}

.shipment-timeline__card--automation {
  border-left-color: var(--primary);
}

.shipment-timeline__dot--quote,
.shipment-timeline__card--quote {
  border-color: rgba(22, 163, 74, 0.25);
}

.shipment-timeline__dot--quote {
  background: var(--success-soft);
  color: var(--success);
}

.shipment-timeline__card--quote {
  border-left-color: var(--success);
}

.shipment-timeline__dot--customs,
.shipment-timeline__card--customs {
  border-color: rgba(180, 130, 0, 0.28);
}

.shipment-timeline__dot--customs {
  background: var(--warning-soft);
  color: var(--warning);
}

.shipment-timeline__card--customs {
  border-left-color: var(--warning);
}

.shipment-timeline__dot--eta,
.shipment-timeline__card--eta {
  border-color: rgba(26, 86, 219, 0.22);
}

.shipment-timeline__dot--eta {
  background: var(--primary-soft);
  color: var(--primary);
}

.shipment-timeline__card--eta {
  border-left-color: var(--primary);
}

.shipment-timeline__dot--assignment,
.shipment-timeline__card--assignment {
  border-color: rgba(107, 114, 128, 0.26);
}

.shipment-timeline__dot--assignment {
  background: var(--surface-soft);
  color: var(--text-soft);
}

.shipment-timeline__card--assignment {
  border-left-color: var(--text-faint);
}

.shipment-timeline__dot--payment,
.shipment-timeline__card--payment {
  border-color: rgba(180, 130, 0, 0.28);
}

.shipment-timeline__dot--payment {
  background: var(--warning-soft);
  color: var(--warning);
}

.shipment-timeline__card--payment {
  border-left-color: var(--warning);
}

.shipment-timeline__dot--delivery,
.shipment-timeline__card--delivery {
  border-color: rgba(22, 163, 74, 0.25);
}

.shipment-timeline__dot--delivery {
  background: var(--success-soft);
  color: var(--success);
}

.shipment-timeline__card--delivery {
  border-left-color: var(--success);
}

.shipment-timeline__dot--warning,
.shipment-timeline__card--warning {
  border-color: rgba(220, 38, 38, 0.25);
}

.shipment-timeline__dot--warning {
  background: var(--danger-soft);
  color: var(--danger);
}

.shipment-timeline__card--warning {
  border-left-color: var(--danger);
}

.shipment-timeline__dot--status,
.shipment-timeline__card--status {
  border-color: rgba(26, 86, 219, 0.22);
}

.shipment-timeline__dot--status {
  background: var(--primary-soft);
  color: var(--primary);
}

.shipment-timeline__card--status {
  border-left-color: var(--primary);
}

.shipment-timeline__dot--default {
  background: var(--surface-soft);
  color: var(--text-soft);
}

.shipment-timeline__card--default {
  border-left-color: var(--border-strong, var(--border));
}

.shipment-timeline-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  display: grid;
  gap: 4px;
  text-align: center;
}

/* Mobile tightening */
@media (max-width: 640px) {
  .shipment-timeline__item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
  }

  .shipment-timeline__dot {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }

  .shipment-timeline__line {
    top: 28px;
  }

  .shipment-timeline__card {
    padding: 11px 12px;
  }

  .shipment-timeline__head {
    align-items: flex-start;
  }

  .shipment-timeline__head time {
    width: 100%;
  }
}
/* Stronger timeline progress feel */
.shipment-timeline__item--completed .shipment-timeline__dot {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.32);
}

.shipment-timeline__dot--completed {
  font-size: 0.82rem;
  font-weight: 900;
}

.shipment-timeline__line--completed {
  background: linear-gradient(
    to bottom,
    var(--success),
    rgba(22, 163, 74, 0.35)
  );
  opacity: 0.85;
}

.shipment-timeline__line--start {
  background: linear-gradient(
    to bottom,
    rgba(22, 163, 74, 0.55),
    var(--success)
  );
}

.shipment-timeline__item--active .shipment-timeline__dot {
  transform: scale(1.04);
}

.shipment-timeline__item--active .shipment-timeline__card {
  border-left-width: 5px;
  box-shadow:
    var(--shadow-md),
    0 0 0 3px rgba(26, 86, 219, 0.04);
}

.shipment-timeline__card--completed {
  opacity: 0.94;
}

.shipment-timeline__card--completed .shipment-timeline__badge {
  background: var(--success-soft);
  color: var(--success);
}

.shipment-timeline__current-pill {
  display: inline-flex;
  margin-top: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.shipment-timeline__dot--latest {
  animation: shipment-timeline-active-pulse 1.8s ease-in-out infinite;
}

@keyframes shipment-timeline-active-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 86, 219, 0.28);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(26, 86, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 86, 219, 0);
  }
}
/**/
/* NEW: global system update footer notice */
.system-update-footer-notice {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9999;
  width: min(460px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-left: 4px solid var(--primary);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  animation: system-update-slide-in 0.22s ease-out;
}

.system-update-footer-notice__icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1rem;
}

.system-update-footer-notice__content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.system-update-footer-notice__content strong {
  font-size: 0.88rem;
  color: var(--text);
}

.system-update-footer-notice__content span {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-soft);
}

.system-update-footer-notice__actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.system-update-footer-notice--warning {
  border-left-color: var(--warning);
}

.system-update-footer-notice--warning .system-update-footer-notice__icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.system-update-footer-notice--success {
  border-left-color: var(--success);
}

.system-update-footer-notice--success .system-update-footer-notice__icon {
  background: var(--success-soft);
  color: var(--success);
}

@keyframes system-update-slide-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .system-update-footer-notice {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .system-update-footer-notice__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* NEW: polished register account type selector */
.register-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.register-role-card {
  position: relative;
  display: block;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 13px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  opacity: 0.72;
}

.register-role-card:hover {
  opacity: 1;
  transform: translateY(-1px);
  border-color: var(--primary);
}

.register-role-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.register-role-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 24px;
}

.register-role-card__icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
}

.register-role-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.register-role-card--active {
  opacity: 1;
  border: 2px solid var(--primary);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.13), rgba(37, 99, 235, 0.04)),
    var(--surface);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

.register-role-card--active .register-role-card__icon {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.register-role-card--active strong {
  color: var(--primary);
}

.register-role-card--active::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

@media (max-width: 560px) {
  .register-role-grid {
    grid-template-columns: 1fr;
  }
}



/* Profile dropdown */
.profile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 18px;
  width: 300px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
  z-index: 80;
}

.profile-panel:not(.is-open) {
  display: none;
}

.profile-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--surface-soft), var(--surface));
  border: 1px solid var(--border);
}

.profile-card__avatar,
.profile-summary-avatar {
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

.profile-card__avatar {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.profile-card__body {
  min-width: 0;
}

.profile-card__name {
  font-weight: 850;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card__role {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: capitalize;
}

.profile-card__badge {
  margin-top: 8px;
}

.profile-panel__menu {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.profile-panel__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.profile-panel__item:hover {
  background: var(--surface-soft);
}

.profile-panel__item--danger {
  color: var(--danger);
}

.profile-panel__item--danger:hover {
  background: var(--danger-soft);
}

/* Profile page */
.profile-shell {
  display: grid;
  gap: 18px;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  width: fit-content;
  margin-bottom: 20px;
}

.profile-tab {
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.88rem;
}

.profile-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.profile-tab--active {
  color: var(--primary);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.profile-page-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-summary-card,
.profile-form-card,
.profile-danger-card,
.profile-info-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.profile-summary-card {
  text-align: center;
  position: sticky;
  top: 18px;
}

.profile-summary-avatar {
  width: 82px;
  height: 82px;
  margin: 0 auto 14px;
  font-size: 1.8rem;
}

.profile-summary-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.profile-summary-meta {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.profile-summary-actions {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.profile-form-card h3,
.profile-danger-card h3,
.profile-info-card h3 {
  margin-top: 0;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-form-grid .form-group--full {
  grid-column: 1 / -1;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 620px);
  gap: 18px;
}

.profile-danger-card {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  background: linear-gradient(180deg, var(--surface), var(--danger-soft));
}

.profile-danger-warning {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.88rem;
  line-height: 1.5;
}

.profile-danger-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .profile-page-grid {
    grid-template-columns: 1fr;
  }

  .profile-summary-card {
    position: static;
  }

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

  .profile-tabs {
    width: 100%;
  }

  .profile-tab {
    flex: 1;
    text-align: center;
  }
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.profile-settings-main {
  display: grid;
  gap: 16px;
}

.profile-info-card,
.profile-danger-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.profile-info-card h3,
.profile-danger-card h3 {
  margin: 0 0 8px;
}

.profile-info-card p,
.profile-danger-card p {
  margin-bottom: 0;
  line-height: 1.55;
}

.profile-danger-card {
  border-color: rgba(220, 38, 38, 0.28);
  background: linear-gradient(180deg, var(--surface), rgba(220, 38, 38, 0.045));
}

.profile-danger-warning {
  padding: 12px;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.86rem;
  line-height: 1.5;
}

.profile-danger-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .profile-settings-grid {
    grid-template-columns: 1fr;
  }
}