/* ==========================================================================
   Teltonika End Point — shared EMD design system
   Aligned with LicenseServer.Web (DM Sans, Syncfusion Material3, accent #5C54D6)
   ========================================================================== */

:root {
  /* Backgrounds */
  --bg-body: #fafafa;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-sidebar-hover: #f5f5f7;
  --bg-sidebar-active: #e8e8ec;

  /* Accent */
  --accent: #5C54D6;
  --accent-hover: #4a43b8;
  --accent-light: #8B83F0;
  --accent-subtle: rgba(92, 84, 214, 0.06);
  --accent-muted: rgba(92, 84, 214, 0.12);

  /* Status */
  --green: #2d9d6a;
  --green-bg: #eef8f3;
  --green-border: #b4e4cd;
  --green-text: #1a7a4f;
  --amber: #d4940a;
  --amber-bg: #fdf6e8;
  --amber-border: #f0d680;
  --amber-text: #936500;
  --red: #c7453b;
  --red-bg: #fdf0ef;
  --red-border: #f0b8b4;
  --red-text: #a3342b;
  --blue: #4478cc;
  --blue-bg: #eef3fc;

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;

  /* Borders */
  --border: #E8E8E8;
  --border-light: #F0F0F0;

  /* Radii */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  /* Layout */
  --sidebar-width: 260px;
  --appbar-height: 56px;

  --transition: 0.15s ease;
}

* { box-sizing: border-box; }

html { font-size: 14px; }

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.6;
  margin: 0;
}

h1, h2, h3, h4 { line-height: 1.3; font-weight: 600; color: var(--text-primary); margin: 0 0 8px; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.subtitle { color: var(--text-secondary); font-size: 0.875rem; margin: 0 0 20px; }
.muted { color: var(--text-tertiary); font-size: 0.8125rem; }

/* ===================== Layout shell ===================== */

.app-layout { display: flex; min-height: 100vh; }

#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.sidebar-brand-img {
  height: 34px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-brand-text { font-weight: 700; font-size: 0.9375rem; color: var(--text-primary); }
.sidebar-brand-text small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--text-tertiary); }

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 16px 20px 6px;
}

.sidebar-nav { list-style: none; padding: 0 8px; margin: 0; }
.sidebar-nav .nav-item { list-style: none; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 450;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}
.sidebar-nav .nav-link:hover { background: var(--bg-sidebar-hover); color: var(--text-primary); text-decoration: none; }
.sidebar-nav .nav-link.active { background: var(--bg-sidebar-active); color: var(--text-primary); font-weight: 600; }
.sidebar-nav .nav-link i { font-size: 1.1rem; width: 22px; text-align: center; color: var(--text-tertiary); }
.sidebar-nav .nav-link.active i { color: var(--accent); }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  height: var(--appbar-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.breadcrumb-nav { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; }
.breadcrumb-link { color: var(--text-secondary); }
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }
.app-bar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.app-bar-user .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
}
.breadcrumb-separator { color: var(--text-tertiary); }

.content-wrapper { padding: 24px 28px; width: 100%; flex: 1; }

/* Mobile header (hidden on desktop) */
.mobile-header { display: none; }
.sidebar-backdrop { display: none; }

/* ===================== Page header ===================== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header h1, .page-header h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-header-actions { display: flex; gap: 8px; }

/* ===================== Buttons ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: default; }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-surface-hover); color: var(--text-primary); border-color: var(--text-tertiary); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: none; padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: var(--red-text); border-color: var(--red-text); color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 0.8125rem; }
.btn-lg { padding: 10px 20px; font-size: 0.9375rem; }

/* ===================== Cards / panels ===================== */

.card, .table-card, .form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card { padding: 20px 24px; margin-bottom: 20px; }
.card > h2, .card > h3 { margin: 0 0 12px; }
.table-card { padding: 0; overflow: hidden; margin-bottom: 20px; }
.form-card { padding: 28px; margin-bottom: 20px; }

.card-hint { margin: 0 0 16px; font-size: 0.8125rem; color: var(--text-secondary); }

/* ===================== Filter bar ===================== */

.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .field { display: flex; flex-direction: column; min-width: 170px; }
.filter-bar .field.grow { flex: 1; }
.filter-bar .field label, .form-field .form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 5px;
  line-height: 1.4;
}
.filter-bar .field-actions { display: flex; align-items: flex-end; }

/* ===================== Forms ===================== */

.form-section { margin-bottom: 24px; }
.form-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field .form-label .required { color: var(--red); margin-left: 2px; }
.form-actions {
  display: flex;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  justify-content: flex-end;
  flex-direction: row-reverse;
}
.validation-message { font-size: 0.75rem; color: var(--red); margin-top: 4px; }

/* ===================== Stats grid (dashboards) ===================== */

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-sm); border-color: var(--accent-muted); }
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.amber { background: var(--amber-bg); color: var(--amber); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-icon.accent { background: var(--accent-subtle); color: var(--accent); }
.stat-label { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }

/* Home navigation cards */
.nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.nav-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 24px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.nav-card:hover { box-shadow: var(--shadow-sm); border-color: var(--accent-muted); }
.nav-card .nav-card-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  background: var(--accent-subtle); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: 14px;
}
.nav-card h2 { margin: 0 0 8px; font-size: 1.125rem; }
.nav-card p { margin: 0 0 18px; font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; flex: 1; }

/* ===================== Badges / pills ===================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.4;
}
.badge-count { background: var(--accent-muted); color: var(--accent); font-weight: 500; }
.badge-success, .badge-active { background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border); }
.badge-warning { background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-border); }
.badge-danger, .badge-error { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); }
.badge-info { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(68,120,204,0.2); }
.badge-neutral { background: var(--bg-surface-hover); color: var(--text-secondary); border: 1px solid var(--border); }

/* IMEI diagnostic status badges mapped onto the shared palette */
.badge-status.status-ok { background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border); }
.badge-status.status-pending { background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-border); }
.badge-status.status-nodata { background: var(--bg-surface-hover); color: var(--text-secondary); border: 1px solid var(--border); }

/* GPS no-fix + coordinate cells */
.badge-nofix { background: var(--bg-surface-hover); color: var(--text-secondary); border: 1px solid var(--border); padding: 2px 9px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-yes { background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border); padding: 2px 9px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-no { background: var(--bg-surface-hover); color: var(--text-secondary); border: 1px solid var(--border); padding: 2px 9px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; display: inline-block; }
.coord { font-family: var(--font-mono); font-size: 0.8125rem; }
/* Odometer value carried forward from an earlier reading (io_389 absent in this record) — muted + italic
   so a real CAN reading is visually distinguishable from an inherited one. */
.odo-carried { color: var(--text-secondary); font-style: italic; cursor: help; }
.odo-note { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.15; white-space: nowrap; }

/* IMEI registration textarea: room for several lines, monospace for easy scanning of digit strings. */
.imei-registration-input textarea { min-height: 160px; font-family: var(--font-mono); font-size: 0.85rem; }

/* ===================== States ===================== */

.loading-text { color: var(--text-secondary); font-size: 0.875rem; }
.error-text { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); font-size: 0.8125rem; padding: 10px 14px; border-radius: var(--radius); }

/* ===================== Syncfusion Grid overrides ===================== */

.e-grid {
  border: none !important;
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-family) !important;
}
.e-grid .e-gridheader { background: var(--bg-body) !important; border-bottom: 1px solid var(--border) !important; }
.e-grid .e-headercell {
  background: transparent !important;
  color: var(--text-tertiary) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 12px 16px !important;
}
.e-grid .e-headercell .e-headertext,
.e-grid .e-headercell .e-headercelldiv {
  text-overflow: clip !important;
  overflow: visible !important;
  white-space: nowrap !important;
}
.e-grid .e-rowcell {
  padding: 12px 16px !important;
  font-size: 0.875rem !important;
  color: var(--text-primary) !important;
  border-color: var(--border-light) !important;
  white-space: nowrap;
}
.e-grid .e-row:hover .e-rowcell { background: var(--bg-surface-hover) !important; }
.e-grid .e-row.e-altrow .e-rowcell { background: transparent !important; }
.e-grid .e-selectionbackground { background: var(--accent-subtle) !important; }
.e-grid .e-pager { background: var(--bg-surface) !important; border-top: 1px solid var(--border) !important; padding: 8px 16px !important; }
.e-grid .e-pager .e-numericitem.e-currentitem { background: var(--accent) !important; color: #fff !important; border-radius: var(--radius) !important; }

/* Clickable grid: signal that each data row can be selected to drill into it.
   Syncfusion sets the cursor on the cells, so we override .e-rowcell (with !important).
   The copy button inside a cell keeps its own pointer but must not read as "row-clickable". */
.e-grid.clickable-grid .e-row > .e-rowcell,
.e-grid.clickable-grid .e-row > .e-rowcell .imei-value { cursor: pointer !important; }
.e-grid.clickable-grid .e-row:hover > .e-rowcell { background: var(--accent-subtle) !important; }

/* Make the whole clickable-grid cell content stretch so the hand cursor covers the entire cell,
   not just the text glyphs. Inline style="cursor:pointer" on these spans is the source of truth. */
.clickable-grid .e-rowcell > span { display: block; width: 100%; }

/* IMEI cell: value + inline copy button (copy does NOT open the dialog). */
.imei-cell { display: inline-flex; align-items: center; gap: 8px; }
.imei-value { font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.01em; }
.imei-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); color: var(--text-tertiary);
  cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.imei-copy:hover { color: var(--accent); border-color: var(--accent-light); background: var(--accent-subtle); }
.imei-copy .bi-check2 { color: var(--green); }

/* ── Telemetry dialog ─────────────────────────────────────────────── */
.telemetry-dialog.e-dialog {
  /* Force the wide layout regardless of Syncfusion's inline Width attribute (which does not
     reliably honour min()/calc()). 1400px fits all ~1275px of columns without a horizontal
     scrollbar; max-width:97vw keeps it responsive on narrow screens. */
  width: 1400px !important;
  max-width: 97vw !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 1px 1px rgba(26, 26, 46, 0.04), 0 24px 60px rgba(26, 26, 46, 0.24) !important;
  border: 1px solid var(--border) !important; overflow: hidden;
}
.telemetry-dialog .e-dlg-header-content {
  padding: 0 !important; border-bottom: 1px solid var(--border) !important;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-body) 100%);
}
.telemetry-dialog .e-dlg-content { padding: 0 !important; background: var(--bg-body); }

.tdlg-header { display: flex; align-items: center; gap: 14px; padding: 18px 22px; padding-right: 64px; }
.tdlg-header-icon {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--radius-lg); flex-shrink: 0;
  background: linear-gradient(145deg, var(--accent-muted), var(--accent-subtle));
  color: var(--accent); font-size: 1.15rem;
  border: 1px solid var(--accent-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), var(--shadow-xs);
}
.tdlg-header-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tdlg-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); line-height: 1.15; letter-spacing: -0.01em; }
.tdlg-subtitle { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-secondary); flex-wrap: wrap; }
.tdlg-imei { font-family: var(--font-mono); color: var(--text-primary); font-weight: 500; letter-spacing: 0.01em; }
.tdlg-dot { color: var(--text-tertiary); font-size: 0.6rem; }
.tdlg-count { color: var(--accent); font-weight: 600; }
/* Anchor the close button to the dialog box itself (not the padded header) so it sits flush in the
   top-right corner. The dialog has overflow:hidden + rounded corners, so keep a small inset. */
.telemetry-dialog.e-dialog { position: relative; }
.telemetry-dialog .tdlg-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition); font-size: 0.9rem;
}
.telemetry-dialog .tdlg-close:hover { color: var(--red-text); border-color: var(--red-border); background: var(--red-bg); }

.tdlg-body { padding: 18px 22px 22px; }
.tdlg-body .table-card {
  margin-bottom: 0;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
/* Keep wide telemetry grids inside the dialog: horizontal scroll stays within the grid, never the page. */
.tdlg-body .table-card { max-width: 100%; overflow-x: auto; }

/* ── Telemetry dialog grid (scoped so only THIS grid is restyled) ──── */
.telemetry-dialog .e-grid { border-radius: var(--radius-lg) !important; }

/* Header row: quiet, uppercase, letter-spaced column labels on a soft surface. */
.telemetry-dialog .e-grid .e-gridheader {
  background: var(--bg-surface-hover) !important;
  border-bottom: 1px solid var(--border) !important;
}
.telemetry-dialog .e-grid .e-headercell {
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 10px 16px !important;
  border-color: var(--border-light) !important;
}

/* Data rows: comfortable rhythm, softened default text, tabular digits so numbers line up. */
.telemetry-dialog .e-grid .e-rowcell {
  padding: 12px 16px !important;
  font-size: 0.84rem !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-light) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  vertical-align: middle;
}

/* Subtle zebra striping on alternate rows. */
.telemetry-dialog .e-grid .e-row .e-rowcell { background: var(--bg-surface) !important; }
.telemetry-dialog .e-grid .e-altrow .e-rowcell { background: var(--bg-body) !important; }

/* Gentle accent hover across the whole row. */
.telemetry-dialog .e-grid .e-row:hover .e-rowcell,
.telemetry-dialog .e-grid .e-altrow:hover .e-rowcell { background: var(--accent-subtle) !important; }

/* Footer pagination integrated with the dialog surface. */
.telemetry-dialog .e-grid .e-pager {
  background: var(--bg-surface) !important;
  border-top: 1px solid var(--border) !important;
  padding: 8px 14px !important;
}
.telemetry-dialog .e-grid .e-pager .e-pagercontainer { border: none !important; background: transparent !important; }
.telemetry-dialog .e-grid .e-pager .e-numericitem {
  background: transparent !important; color: var(--text-secondary) !important;
  font-size: 0.8rem !important;
}
.telemetry-dialog .e-grid .e-pager .e-numericitem:hover {
  background: var(--accent-subtle) !important; color: var(--accent) !important; border-radius: var(--radius) !important;
}
.telemetry-dialog .e-grid .e-pager .e-numericitem.e-currentitem {
  background: var(--accent) !important; color: #fff !important; border-radius: var(--radius) !important; font-weight: 600 !important;
}
.telemetry-dialog .e-grid .e-pager .e-pagecountmsg { color: var(--text-tertiary) !important; font-size: 0.78rem !important; }

/* Coordinates: precise mono data, tight and dark. */
.telemetry-dialog .coord {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Status / GPS pills: small, rounded, micro-label uppercase, restrained. */
.telemetry-dialog .badge-nofix,
.telemetry-dialog .badge-yes,
.telemetry-dialog .badge-no {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.5;
}
/* "No GPS fix" is a normal state → muted amber, not alarming. */
.telemetry-dialog .badge-nofix {
  background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-border);
}
/* Transferred = Sì → subtle green. */
.telemetry-dialog .badge-yes {
  background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border);
}
/* Not transferred = No → neutral gray. */
.telemetry-dialog .badge-no {
  background: var(--bg-surface-hover); color: var(--text-secondary); border: 1px solid var(--border);
}

.tdlg-state { display: flex; align-items: center; gap: 10px; padding: 40px 8px; color: var(--text-secondary); font-size: 0.9rem; }
.tdlg-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 8px; color: var(--text-tertiary); }
.tdlg-empty .bi { font-size: 2rem; }
.tdlg-empty p { margin: 0; font-size: 0.9rem; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--accent-muted); border-top-color: var(--accent);
  animation: tdlg-spin 0.7s linear infinite;
}
@keyframes tdlg-spin { to { transform: rotate(360deg); } }

/* Syncfusion input focus in the shared accent */
.e-input-group:not(.e-disabled):not(.e-error).e-input-focus,
.e-input-group:not(.e-disabled):not(.e-error) .e-input:focus { border-color: var(--accent) !important; }

/* Syncfusion buttons pick up the shared radius/weight */
.e-btn { border-radius: var(--radius) !important; font-weight: 500 !important; font-family: var(--font-family) !important; }

/* ===================== Responsive ===================== */

@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding-top: var(--appbar-height); }
  .content-wrapper { padding: 16px; }
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--appbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    z-index: 150;
  }
  .mobile-header-brand { font-weight: 700; font-size: 0.9375rem; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 190; }
}

/* ===================== Standard (customer) view — no sidebar ===================== */
.standard-layout { min-height: 100vh; display: flex; flex-direction: column; }
.standard-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; height: var(--appbar-height);
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.standard-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.standard-brand:hover { text-decoration: none; }
.standard-brand-text { font-weight: 700; font-size: 0.9375rem; color: var(--text-primary); }
.standard-brand-text small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--text-tertiary); }
.standard-layout .content-wrapper { padding: 24px 28px; width: 100%; flex: 1; max-width: 1400px; margin: 0 auto; }
