:root {
  --orange: #ef6b35;
  --orange-dark: #d65323;
  --orange-soft: #fff2eb;
  --ink: #172235;
  --muted: #69778c;
  --subtle: #95a0b1;
  --line: #dfe5ed;
  --line-strong: #ccd5e1;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --background: #f2f5f8;
  --success: #17865f;
  --success-soft: #eaf8f2;
  --danger: #c94157;
  --danger-soft: #fff0f3;
  --warning: #a8640a;
  --warning-soft: #fff6df;
  --shadow: 0 16px 45px rgba(29, 42, 62, .1);
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100dvh; overflow-x: hidden; background: var(--background); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(239, 107, 53, .25); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.login-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #fa8351, #df5929); box-shadow: 0 10px 24px rgba(225, 91, 43, .25); font-size: .75rem; font-weight: 850; letter-spacing: -.02em; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { color: #101a2b; font-size: .98rem; letter-spacing: -.02em; }
.login-brand small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.main-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link { display: flex; min-height: 41px; padding: 0 13px; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 11px; color: #657489; text-decoration: none; white-space: nowrap; font-size: .84rem; font-weight: 680; transition: .18s ease; }
.nav-link span { width: 22px; color: #8b98a9; text-align: center; font-size: 1.13rem; }
.nav-link:hover { color: var(--ink); background: var(--surface-soft); }
.nav-link.active { color: var(--orange-dark); border-color: #f4c8b6; background: linear-gradient(100deg, #fff0e9, #fff9f6); }
.nav-link.active span { color: var(--orange); }
.account-menu { position: relative; }
.account-menu summary { list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-panel { position: absolute; z-index: 1100; top: calc(100% + 12px); right: 0; display: grid; width: 245px; padding: 18px; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.account-panel > small { margin-top: -10px; color: var(--muted); }
.connection-summary { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.status-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 4px; border-radius: 50%; background: #b9c1cc; box-shadow: 0 0 0 4px rgba(185, 193, 204, .14); }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 4px rgba(23, 134, 95, .12); }
.status-dot.warning { background: #d59123; box-shadow: 0 0 0 4px rgba(213, 145, 35, .12); }
.text-button { width: max-content; padding: 0; border: 0; color: var(--orange-dark); background: none; cursor: pointer; font-size: .78rem; font-weight: 750; }

.app-shell { display: flex; min-height: 100dvh; flex-direction: column; }
.topbar { display: flex; min-height: 68px; padding: 10px clamp(18px, 2.5vw, 36px); flex-shrink: 0; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .95); }
.page-heading { min-width: 0; }
.eyebrow { margin: 0 0 5px; color: var(--orange-dark); font-size: .69rem; font-weight: 850; letter-spacing: .13em; }
.page-heading h1 { margin: 0; color: #101a2b; font-size: clamp(1.22rem, 2vw, 1.5rem); line-height: 1.15; letter-spacing: -.035em; }
.top-actions { display: flex; flex-shrink: 0; align-items: center; gap: 12px; }
.sync-copy { display: grid; min-width: 125px; gap: 2px; color: var(--muted); text-align: right; font-size: .72rem; }
.sync-copy strong { color: #3e4b60; font-size: .76rem; }
.button { display: inline-flex; min-height: 41px; padding: 0 16px; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 10px; color: #415066; background: #fff; cursor: pointer; font-size: .84rem; font-weight: 750; text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.button:hover { border-color: #b8c3d1; background: #fafbfd; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { border-color: var(--orange); color: #fff; background: linear-gradient(120deg, #f47743, #e25828); box-shadow: 0 9px 22px rgba(220, 82, 34, .23); }
.button.primary:hover { background: linear-gradient(120deg, #f57d49, #d94f20); }
.button.ghost { min-height: 36px; padding-inline: 12px; background: #fff; font-size: .78rem; }
.icon-button { display: grid; width: 37px; height: 37px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: #657489; background: #fff; cursor: pointer; font-size: 1.2rem; }
.main-content { flex: 1; min-height: 0; }
.sync-indicator { display: grid; width: 28px; height: 32px; flex: 0 0 28px; place-items: center; border-radius: 8px; text-decoration: none; }
.sync-indicator[hidden], .sync-error, .sync-indicator.error .spinner { display: none; }
.sync-indicator.error .sync-error { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: var(--danger); background: var(--danger-soft); font-weight: 850; }

/* Workspace hartă */
body[data-page="map"] .app-shell { height: 100dvh; }
body[data-page="map"] .main-content { display: flex; }
.map-workspace { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; background: #dce4ea; }
.orders-panel { position: absolute; z-index: 650; top: 0; bottom: 0; left: 0; display: flex; width: 350px; min-width: 0; min-height: 0; padding: 16px 14px 8px; flex-direction: column; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: #fff; box-shadow: 2px 0 8px rgba(25, 39, 59, .15); }
.panel-head, .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-head h2, .card h2, .page-intro h2 { margin: 0; color: #142036; font-size: 1.15rem; letter-spacing: -.025em; }
.panel-head h2 { font-size: 1.1rem; }
.panel-subtitle { margin: 5px 0 0; color: var(--muted); font-size: .74rem; }
.panel-subtitle strong { color: var(--ink); }
.panel-close { display: none; }
.search-row { display: flex; gap: 0; margin-top: 12px; }
input, select { min-width: 0; min-height: 41px; padding: 0 12px; border: 1px solid #d7dfe9; border-radius: 9px; color: var(--ink); background: #fbfcfe; font-size: .84rem; }
input::placeholder { color: #9aa5b4; }
input:focus, select:focus { border-color: #ec8a64; outline: 0; box-shadow: 0 0 0 3px rgba(239, 107, 53, .11); background: #fff; }
.search-row input { flex: 1; min-height: 38px; border-radius: 4px 0 0 4px; background: #fff; font-size: .78rem; }
.search-button { min-width: 38px; min-height: 38px; padding: 0; border-color: var(--orange); border-radius: 0 4px 4px 0; color: #fff; background: var(--orange); font-size: 1.15rem; }
.search-button:hover { border-color: var(--orange-dark); color: #fff; background: var(--orange-dark); }
.filters { margin-top: 10px; border: 1px solid var(--line); border-radius: 4px; background: #fafbfd; }
.filters summary { display: flex; min-height: 34px; padding: 0 10px; align-items: center; justify-content: space-between; color: #4f5e73; cursor: pointer; font-size: .76rem; font-weight: 650; }
.filters summary::marker { color: var(--orange); }
.filters[open] summary { border-bottom: 1px solid var(--line); }
.filter-grid { display: grid; padding: 12px; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: grid; gap: 6px; }
label > span { color: #56657a; font-size: .77rem; font-weight: 720; }
.filter-grid input, .filter-grid select { width: 100%; min-height: 37px; padding-inline: 9px; font-size: .76rem; }
.filter-grid .wide { grid-column: 1 / -1; }
.reset-filters { margin: 0 12px 12px auto; }
.orders-summary { display: flex; min-height: 36px; padding: 0 2px; align-items: center; gap: 5px; color: var(--muted); font-size: .72rem; }
.orders-summary strong { color: var(--ink); }
.warning-count { margin-left: auto; color: var(--warning); font-weight: 700; }
.orders-list { display: grid; min-height: 0; margin-inline: -14px; padding: 0 4px 8px 14px; align-content: start; gap: 0; flex: 1; overflow-y: auto; scrollbar-gutter: stable; }
.order-item { display: grid; width: 100%; padding: 8px 8px 8px 4px; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; border: 0; border-bottom: 1px solid #edf0f4; border-radius: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.order-item:hover { background: #f7f9fc; }
.order-item.selected { background: #fff2eb; box-shadow: inset 3px 0 var(--orange); }
.order-marker-preview { display: grid; grid-row: 1 / 3; width: 26px; height: 30px; place-items: center; overflow: hidden; }
.order-marker-preview img { display: block; max-width: 22px; max-height: 22px; object-fit: contain; }
.neutral-pin { display: grid; width: 18px; height: 22px; place-items: center; border: 2px solid #fff; border-radius: 50% 50% 50% 3px; color: #fff; background: #67768a; box-shadow: 0 2px 5px rgba(20, 33, 50, .25); transform: rotate(-45deg); }
.neutral-pin::after { content: "•"; transform: rotate(45deg); }
.order-copy { display: contents; }
.order-copy strong, .order-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-copy strong { grid-column: 2 / 4; color: #223049; font-size: .82rem; font-weight: 600; }
.order-copy span { grid-column: 2; grid-row: 2; color: var(--muted); font-size: .7rem; }
.order-meta { display: grid; grid-column: 3; grid-row: 2; justify-items: end; gap: 3px; color: #718096; font-size: .65rem; white-space: nowrap; }
.mini-warning { padding: 3px 6px; border-radius: 99px; color: var(--warning); background: var(--warning-soft); font-size: .65rem; font-weight: 800; }
.empty-state { display: grid; min-height: 170px; padding: 28px; place-items: center; align-content: center; gap: 12px; color: var(--muted); text-align: center; }
.empty-state strong { font-size: .88rem; }
.empty-state p { max-width: 360px; margin: 0; font-size: .78rem; line-height: 1.55; }
.spinner { width: 27px; height: 27px; border: 3px solid #e4e9f0; border-top-color: var(--orange); border-radius: 50%; animation: spin .75s linear infinite; }
.spinner.small { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.map-card { position: absolute; inset: 0; min-width: 0; min-height: 0; background: #dce4ea; }
.map { width: 100%; height: 100%; }
.leaflet-zoom-anim .leaflet-zoom-animated { transition-duration: .18s; }
.leaflet-control-attribution { font-size: .66rem !important; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 10px 30px rgba(23, 34, 53, .18); }
.leaflet-popup-content { margin: 14px 16px; }
.order-leaflet-popup .leaflet-popup-content-wrapper { border-radius: 4px; }
.order-leaflet-popup .leaflet-popup-content { margin: 12px; }
.order-leaflet-popup .leaflet-popup-scrolled { border: 0; padding-right: 6px; overscroll-behavior: contain; }
.order-popup { width: 100%; color: var(--ink); }
.order-dialog { width: min(344px, calc(100vw - 16px)); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; box-shadow: var(--shadow); overflow-y: auto; }
.order-dialog::backdrop { background: rgba(22, 32, 48, .35); }
.order-dialog-close { position: absolute; top: 5px; right: 5px; width: 27px; height: 27px; border: 0; }
.details-open .map-tools, .details-open .leaflet-control-zoom { visibility: hidden; }
.order-popup-title { margin: 0 22px 7px 0; color: #17243a; font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.order-popup-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.order-popup-status img { display: block; width: 20px; height: 20px; object-fit: contain; }
.order-popup-status .neutral-pin { flex: 0 0 auto; transform: rotate(-45deg) scale(.7); }
.order-popup-status strong { color: #526174; font-size: .76rem; }
.order-popup-fields { margin: 0; }
.order-popup-field { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; padding: 3px 0; border-bottom: 1px solid #edf0f4; font-size: 12px; line-height: 1.35; }
.order-popup-field:last-child { border-bottom: 0; }
.order-popup-field dt { color: #687485; font-weight: 400; overflow-wrap: anywhere; }
.order-popup-field dd { margin: 0; color: #253248; white-space: pre-wrap; overflow-wrap: anywhere; }
.order-contacts { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #dce5de; }
.order-contact { display: flex; align-items: center; gap: 8px; }
.order-popup .phone-link { font-size: 12px; color: #31546a; text-decoration: none; }
.order-popup .whatsapp-button { min-height: 32px; padding: 0 10px; border: 1px solid #b9dec9; border-radius: 6px; color: #146c3b; background: #edf8f1; font-size: 12px; text-decoration: none; }
.order-popup .whatsapp-button:hover { color: #fff; border-color: #168447; background: #168447; }
.order-popup .whatsapp-button:disabled { cursor: default; }
.order-popup .warning-box { margin-top: 8px; padding: 6px 8px; font-size: 11px; white-space: pre-wrap; }
.whatsapp-settings { margin-top: 18px; }
.message-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-form textarea { width: 100%; min-height: 115px; resize: vertical; padding: 10px 12px; border: 1px solid #d7dfe9; border-radius: 9px; color: var(--ink); background: #fbfcfe; font: inherit; font-size: .84rem; line-height: 1.5; }
.settings-form textarea:focus { outline: 2px solid #ec8a64; outline-offset: 1px; }
@media (max-width: 1200px) {
  .details-open .orders-panel { visibility: hidden; }
  .details-open #show-orders { display: inline-flex; }
}
@media (max-width: 600px) {
  .order-leaflet-popup .leaflet-popup-content { margin: 12px; }
  .order-popup-field { font-size: 11px; line-height: 1.25; }
  .message-fields { grid-template-columns: 1fr; }
}
.custom-map-icon { border: 0; background: transparent; }
.custom-map-icon img { display: block; filter: drop-shadow(0 3px 3px rgba(21, 31, 45, .3)); object-fit: contain; }
.map-neutral-pin { width: 20px; height: 25px; }
.map-tools { position: absolute; z-index: 500; top: 16px; right: 16px; display: flex; gap: 8px; }
.map-tool { min-height: 38px; padding-inline: 12px; box-shadow: 0 5px 18px rgba(28, 42, 61, .14); font-size: .75rem; }
#show-orders { display: none; }
.warning-box { padding: 11px 12px; border: 1px solid #edd8a8; border-radius: 10px; color: #7a5717; background: var(--warning-soft); font-size: .76rem; line-height: 1.5; }

/* Pagini secundare */
.content-page { max-width: 1220px; padding: 28px clamp(18px, 3vw, 42px) 60px; }
.page-intro { display: flex; margin-bottom: 20px; align-items: center; justify-content: space-between; gap: 18px; }
.page-intro p:not(.eyebrow), .card-copy { max-width: 680px; margin: 8px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.card, .table-card { border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 12px 35px rgba(31, 45, 63, .07); }
.table-card { overflow: hidden; }
.history-list { display: grid; }
.danger-outline { border-color: #efc1c9; color: var(--danger); background: #fff; }
.danger-outline:hover { border-color: #df8e9c; color: #a82d41; background: var(--danger-soft); }
.history-row { display: grid; padding: 17px 20px; grid-template-columns: 150px minmax(170px, 1.3fr) minmax(180px, 1fr) 90px; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-time strong, .history-main strong { display: block; color: #26354b; font-size: .82rem; }
.history-time span, .history-main span, .history-device { display: block; margin-top: 4px; color: var(--muted); font-size: .73rem; line-height: 1.4; }
.state-pill, .pill { display: inline-flex; width: max-content; padding: 5px 9px; align-items: center; border-radius: 99px; color: #56657a; background: #eef2f6; font-size: .68rem; font-weight: 800; }
.state-pill.succeeded { color: var(--success); background: var(--success-soft); }
.state-pill.failed { color: var(--danger); background: var(--danger-soft); }
.state-pill.leased, .state-pill.uploading, .state-pill.queued { color: var(--warning); background: var(--warning-soft); }
.attempt-details { grid-column: 1 / -1; padding: 10px 12px; border-radius: 9px; color: var(--muted); background: #f7f9fb; font-size: .72rem; line-height: 1.55; }
.attempt-details summary { cursor: pointer; font-weight: 750; }
.attempt-details ul { margin: 9px 0 0; padding-left: 18px; }

.settings-page { max-width: 1280px; }
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.settings-card, .enrollment-card, .devices-card { padding: 24px; }
.pill { color: var(--orange-dark); background: var(--orange-soft); }
.settings-form { display: grid; gap: 17px; margin-top: 22px; }
.settings-form input { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 14px; }
.input-suffix { display: flex; align-items: center; }
.input-suffix input { border-radius: 9px 0 0 9px; }
.input-suffix b { display: grid; min-height: 41px; padding: 0 12px; place-items: center; border: 1px solid #d7dfe9; border-left: 0; border-radius: 0 9px 9px 0; color: var(--muted); background: #f4f6f9; font-size: .72rem; }
.switch-label { display: grid; min-height: 41px; padding: 0 12px; grid-template-columns: 1fr auto; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; cursor: pointer; }
.switch-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-label i { position: relative; width: 36px; height: 20px; border-radius: 99px; background: #c8d0dc; transition: .16s ease; }
.switch-label i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(20, 31, 48, .22); transition: .16s ease; }
.switch-label input:checked + i { background: var(--orange); }
.switch-label input:checked + i::after { left: 19px; }
.form-actions { display: flex; min-height: 41px; align-items: center; justify-content: flex-end; gap: 12px; color: var(--success); font-size: .75rem; }
.enrollment-card h2 { margin-top: 0; }
.enrollment-card > p:not(.eyebrow) { color: var(--muted); font-size: .82rem; line-height: 1.65; }
.security-note { display: flex; margin-top: 20px; padding: 13px; align-items: flex-start; gap: 10px; border: 1px solid #efc6b5; border-radius: 11px; color: #7d4a34; background: #fff7f3; font-size: .75rem; line-height: 1.55; }
.security-note > span:first-child { color: var(--orange); font-size: 1.1rem; }
.devices-card { margin-top: 18px; }
.devices-list { display: grid; gap: 9px; margin-top: 18px; }
.device-row { display: grid; padding: 14px; grid-template-columns: minmax(190px, 1.15fr) minmax(160px, .8fr) minmax(210px, 1.1fr) auto; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.device-identity { display: flex; min-width: 0; align-items: center; gap: 10px; }
.device-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; color: var(--orange-dark); background: var(--orange-soft); font-weight: 850; }
.device-copy { min-width: 0; }
.device-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.device-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; }
.device-state { display: flex; flex-wrap: wrap; gap: 5px; }
.device-dates { color: var(--muted); font-size: .71rem; line-height: 1.5; }
.device-error { grid-column: 1 / -1; padding: 8px 10px; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-size: .72rem; }
.device-actions { display: flex; gap: 6px; }
.device-actions .button { min-height: 34px; padding: 0 10px; font-size: .7rem; }
.device-actions .danger { border-color: #efc1c9; color: var(--danger); background: #fff6f7; }
code { padding: 2px 5px; border-radius: 5px; color: #92502f; background: var(--orange-soft); font-size: .82em; }

/* Login */
.login-page { display: grid; min-height: 100dvh; padding: 38px 18px; place-items: center; background: radial-gradient(circle at 80% 0%, rgba(239, 107, 53, .11), transparent 29%), #f3f5f8; }
.login-shell { width: min(440px, 100%); }
.login-brand { width: max-content; margin: 0 auto 22px; }
.login-card { padding: 39px 34px 31px; border: 1px solid #d9e0e9; border-radius: 18px; background: #fff; box-shadow: 0 24px 55px rgba(28, 42, 62, .1); }
.login-card h1 { margin: 12px 0 8px; color: #101a2b; font-size: 1.8rem; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.login-card form { display: grid; gap: 16px; }
.login-card input { width: 100%; min-height: 46px; }
.login-submit { width: 100%; margin-top: 4px; }
.form-error { margin: 0 0 17px; padding: 11px 12px; border: 1px solid #efc3cb; border-radius: 9px; color: var(--danger); background: var(--danger-soft); font-size: .78rem; }
.login-footnote { color: var(--muted); text-align: center; font-size: .7rem; }

.toast-region { position: fixed; z-index: 2000; right: 18px; bottom: 18px; display: grid; width: min(360px, calc(100% - 36px)); gap: 8px; pointer-events: none; }
.toast { padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 11px; color: #344258; background: rgba(255, 255, 255, .98); box-shadow: var(--shadow); font-size: .78rem; line-height: 1.45; animation: toast-in .2s ease; }
.toast.error { border-color: #edbac3; color: var(--danger); }
.toast.success { border-color: #b8dece; color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.deleted-filters { display: flex; gap: 6px; padding: 6px; margin-bottom: 12px; border-radius: 16px; background: #e4efed; }
.deleted-filters button { flex: 1; min-height: 54px; padding: 10px 16px; border: 0; border-radius: 12px; color: #416574; background: transparent; font-weight: 750; cursor: pointer; }
.deleted-filters button[aria-pressed="true"] { color: #00778a; background: #fff; box-shadow: 0 2px 8px #244d4d0b; }
.deleted-list { display: grid; gap: 7px; }
.deleted-card { border: 1px solid var(--line-strong); border-left: 4px solid #91b4b7; border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 2px 5px #17223508; }
.deleted-summary { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 14px; align-items: center; gap: 12px; height: 64px; padding: 10px 12px; cursor: pointer; list-style: none; }
.deleted-summary::-webkit-details-marker { display: none; }
.deleted-summary::after { content: "+"; color: var(--muted); text-align: center; }
.deleted-card[open] > .deleted-summary::after { content: "−"; }
.deleted-icon { width: 26px; height: 30px; object-fit: contain; }
.deleted-info { display: grid; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.deleted-info strong { font-size: .86rem; }
.deleted-info > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.4; }
.deleted-card[open] .deleted-summary { height: auto; min-height: 64px; }
.deleted-card[open] .deleted-info > * { white-space: normal; }
.deleted-info span, .deleted-date, .deleted-details > p { color: var(--muted); font-size: .8rem; }
.deleted-date { display: grid; gap: 3px; text-align: right; font-size: .73rem; }
.deleted-details { margin: 0 18px; padding: 0 0 18px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.deleted-details .order-popup-field { grid-template-columns: minmax(90px, 160px) minmax(0, 1fr); }
.deleted-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; color: var(--muted); font-size: .78rem; }
.deleted-page-size { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.deleted-page-size select { width: auto; min-height: 36px; padding: 5px 24px 5px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); }
.deleted-page-nav, #deleted-pages { display: flex; align-items: center; gap: 4px; }
.deleted-page-nav { margin-left: auto; }
.deleted-page-nav .button { min-width: 34px; min-height: 36px; padding: 0 8px; border-color: transparent; background: transparent; }
.deleted-page-nav .button:hover { background: #e4efed; }
.deleted-page-nav .button[aria-current="page"] { background: #00778a; color: #fff; }
.page-gap { padding: 0 3px; }

@media (max-width: 1200px) {
  .topbar { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; justify-content: center; }
}

@media (max-width: 1050px) {
  .topbar { gap: 12px; padding-inline: 18px; }
  .nav-link { padding-inline: 9px; }
  .settings-grid { grid-template-columns: 1fr; }
  .device-row { grid-template-columns: minmax(190px, 1fr) minmax(150px, .75fr) auto; }
  .device-dates { grid-column: 1 / 3; }
}

@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .page-heading { flex: 1; }
  .main-nav { order: 3; width: 100%; justify-content: center; }
  .nav-link { min-height: 36px; flex: 1; justify-content: center; }
  .orders-panel { position: absolute; inset: 0 auto 0 0; width: min(390px, 92%); border-right: 0; transform: translateX(-105%); transition: transform .2s ease; }
  .orders-panel.open { transform: translateX(0); }
  .panel-close { display: grid; }
  #show-orders { display: inline-flex; }
  .history-row { grid-template-columns: 130px 1fr 85px; }
  .history-device { grid-column: 2; }
  .attempt-details { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .main-nav { gap: 3px; }
  .nav-link { gap: 0; padding-inline: 6px; font-size: .74rem; }
  .nav-link span { display: none; }
  .deleted-filters { gap: 3px; padding: 5px; }
  .deleted-filters button { min-height: 48px; padding: 8px 4px; font-size: .8rem; }
  .deleted-summary { grid-template-columns: 26px minmax(0, 1fr) 14px; gap: 4px 8px; padding: 8px 10px; height: 84px; }
  .deleted-date { grid-column: 2 / 4; grid-row: 2; display: flex; justify-content: space-between; gap: 8px; font-size: .67rem; }
  .deleted-summary::after { grid-column: 3; grid-row: 1; }
  .deleted-card[open] .deleted-summary { min-height: 84px; }
  .deleted-pagination { justify-content: space-between; gap: 8px; }
  .deleted-page-nav { width: 100%; justify-content: center; margin-left: 0; }
  .deleted-page-nav .button { min-width: 30px; padding-inline: 6px; }
  .deleted-details { margin-inline: 14px; }
  .topbar { padding: 10px 13px; }
  .page-heading .eyebrow { display: none; }
  .page-heading h1 { font-size: 1.05rem; }
  .sync-copy { display: none; }
  .top-actions { gap: 6px; }
  .sync-button { min-height: 39px; padding: 0 11px; font-size: .76rem; }
  .map-tools { top: 10px; right: 10px; left: 10px; justify-content: space-between; }
  .map-tool { min-height: 37px; padding: 0 10px; }
  .content-page { padding: 20px 13px 45px; }
  .page-intro { align-items: stretch; flex-direction: column; }
  .page-intro .button { width: 100%; }
  .settings-card, .enrollment-card, .devices-card { padding: 18px; }
  .form-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .history-row { padding: 14px; grid-template-columns: 1fr auto; gap: 10px; }
  .history-device { grid-column: 1; }
  .device-row { grid-template-columns: 1fr; }
  .device-dates, .device-error { grid-column: 1; }
  .device-actions .button { flex: 1; }
  .login-card { padding: 32px 23px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

[hidden] { display: none !important; }
#user-form, #password-form { max-width: 720px; }
#users-list .device-row { display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; overflow-wrap:anywhere; }
#user-form input[type="checkbox"] { width:auto; }

#user-form label > span { display:flex; align-items:center; gap:8px; }
#user-form label > span input { margin:0; }
