﻿:root {
  --radius: 1rem;
  --primary: #e30613;
  --primary-foreground: #fff5f6;
  --background: #eceff3;
  --foreground: #1d2229;
  --card: #ffffff;
  --card-foreground: #1d2229;
  --popover: #ffffff;
  --popover-foreground: #1d2229;
  --secondary: #f4f6f9;
  --secondary-foreground: #3b444f;
  --muted: #f4f6f9;
  --muted-foreground: #66707b;
  --accent: #e9edf2;
  --accent-foreground: #252b33;
  --destructive: #cf4b58;
  --destructive-foreground: #fff6f8;
  --border: #d4dae3;
  --input: #ffffff;
  --ring: #7e98b0;
  --sidebar: #f8f9fb;
  --sidebar-foreground: #3b444f;
  --sidebar-primary: #e30613;
  --sidebar-primary-foreground: #fff5f6;
  --sidebar-accent: rgba(88, 104, 124, .12);
  --sidebar-accent-foreground: #273240;
  --sidebar-border: #d4dae3;
  --sidebar-ring: #7e98b0;
  --chart-1: #e30613;
  --chart-2: #5f7084;
  --chart-3: #1fa06d;
  --chart-4: #ffaa14;
  --chart-5: #dc4152;
  --status-pending: #ffaa14;
  --status-adjustment: #2677ff;
  --status-completed: #1fa06d;
  --status-overdue: #dc4152;
  --status-neutral: #7f8995;
  --ease-out-smooth: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out-smooth: cubic-bezier(.77, 0, .175, 1);
  --success-text: #007d33;
  --success-bg: rgba(0, 125, 51, .12);
  --info-text: #2389e2;
  --warning-text: #f1840b;
  --danger-text: #e62b34;
  --sidebar-width: 256px;
}

html.dark {
  --primary: #de0013;
  --primary-foreground: #fff6f7;
  --background: #0f1824;
  --foreground: #eaf0f8;
  --card: #172434;
  --card-foreground: #eaf0f8;
  --popover: #152233;
  --popover-foreground: #eaf0f8;
  --secondary: #1d2d40;
  --secondary-foreground: #d4deea;
  --muted: #1a293a;
  --muted-foreground: #9eb0c4;
  --accent: #24374d;
  --accent-foreground: #f5f8fd;
  --destructive: #ff6b7c;
  --destructive-foreground: #fff7f8;
  --border: #2f435a;
  --input: #132235;
  --ring: #94b0cd;
  --sidebar: #132031;
  --sidebar-foreground: #c3d2e5;
  --sidebar-primary: #de0013;
  --sidebar-primary-foreground: #fff6f7;
  --sidebar-accent: rgba(148, 176, 205, .19);
  --sidebar-accent-foreground: #f6f9ff;
  --sidebar-border: #2b3e54;
  --sidebar-ring: #94b0cd;
  --chart-1: #de0013;
  --chart-2: #8eb2d9;
  --chart-3: #2bc18b;
  --chart-4: #ffd166;
  --chart-5: #f97386;
  --status-pending: #ffb547;
  --status-adjustment: #67a8ff;
  --status-completed: #31c591;
  --status-overdue: #ff6678;
  --status-neutral: #9caec2;
  --success-text: #31c591;
  --success-bg: rgba(49, 197, 145, .14);
  --info-text: #67a8ff;
  --warning-text: #ffb547;
  --danger-text: #ff6678;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--foreground);
  background:
    radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--card) 78%, transparent), transparent 44%),
    radial-gradient(circle at 88% 84%, color-mix(in srgb, var(--muted-foreground) 20%, transparent), transparent 46%),
    repeating-linear-gradient(135deg, rgba(31, 36, 44, .015) 0 2px, transparent 2px 10px),
    linear-gradient(140deg, #f9fafc, var(--background) 42%, #d9dde4);
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
  transition: background 180ms ease-out, color 180ms ease-out;
}
body[data-theme='dark'], html.dark body {
  background:
    radial-gradient(circle at 10% 8%, rgba(138, 170, 205, .2), transparent 42%),
    radial-gradient(circle at 86% 84%, rgba(255, 92, 106, .15), transparent 42%),
    repeating-linear-gradient(140deg, rgba(255, 255, 255, .02) 0 2px, transparent 2px 11px),
    linear-gradient(145deg, #0c141f 0%, var(--background) 46%, #111d2b 100%);
}
body.theme-instant-switch *, html.theme-instant-switch * { transition: none !important; animation: none !important; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4, button, input, select, textarea { letter-spacing: -.01em; }
button, a[href], select, input[type='checkbox'], input[type='radio'], [role='button'] { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }

/* Shell: sidebar + topbar */
.app-sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sidebar) 94%, #fff), color-mix(in srgb, var(--sidebar) 85%, #eceff3));
  border-right: 1px solid var(--sidebar-border);
  box-shadow: inset -1px 0 0 color-mix(in srgb, var(--sidebar-border) 84%, transparent);
  transition: width 300ms var(--ease-out-smooth), transform 220ms var(--ease-out-smooth);
}
html.dark .app-sidebar { background: linear-gradient(180deg, #162638, #101d2c); box-shadow: inset -1px 0 0 rgba(163, 186, 212, .2), 12px 0 24px rgba(2, 8, 18, .28); }
.sidebar-brand-strip { display: flex; height: 56px; align-items: center; flex: 0 0 56px; padding: 0 12px; background: #e10c15; border-bottom: 1px solid rgba(255, 255, 255, .22); }
.sidebar-brand { display: flex; min-width: 0; align-items: center; gap: 10px; color: #fff; }
.brand-logo { display: grid; width: 104px; height: 48px; flex: 0 0 104px; place-items: center start; border-right: 1px solid rgba(255, 255, 255, .4); }
.brand-logo img { width: 96px; max-height: 36px; object-fit: contain; }
.brand-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.brand-copy strong { overflow: hidden; font-size: 9.5px; font-weight: 700; text-overflow: ellipsis; text-transform: uppercase; }
.brand-copy small { overflow: hidden; margin-top: 3px; color: rgba(255, 255, 255, .85); font-size: 8.5px; font-weight: 500; text-overflow: ellipsis; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 16px 12px; }
.sidebar-section-label { margin: 0 12px 8px; color: color-mix(in srgb, var(--sidebar-foreground) 52%, transparent); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 4px; color: color-mix(in srgb, var(--sidebar-foreground) 70%, transparent); font-size: 14px; font-weight: 500; transition: background 150ms ease-out, color 150ms ease-out; }
.sidebar-nav-item + .sidebar-nav-item { margin-top: 4px; }
.sidebar-nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 1.8; }
.sidebar-nav-item:hover { color: var(--sidebar-foreground); background: color-mix(in srgb, var(--sidebar-accent) 60%, transparent); }
.sidebar-nav-item.active { color: var(--sidebar-accent-foreground); background: color-mix(in srgb, var(--sidebar-accent) 55%, transparent); font-weight: 600; }
.sidebar-nav-item.active::before { position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 0 999px 999px 0; background: var(--primary); content: ''; }
.sidebar-footer { padding: 12px; color: color-mix(in srgb, var(--sidebar-foreground) 45%, transparent); text-align: center; }
.sidebar-collapse-button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 12px; color: color-mix(in srgb, var(--sidebar-foreground) 55%, transparent); background: transparent; font-size: 12px; font-weight: 600; text-align: left; transition: background 150ms ease-out, color 150ms ease-out; }
.sidebar-collapse-button:hover { color: var(--sidebar-foreground); background: color-mix(in srgb, var(--sidebar-accent) 40%, transparent); }
.sidebar-collapse-button svg { width: 16px; height: 16px; transition: transform 300ms var(--ease-out-smooth); }
.sidebar-footer small { display: block; margin-top: 8px; font-size: 10px; font-weight: 600; letter-spacing: .04em; opacity: .7; }
.app-page { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left 300ms var(--ease-out-smooth); }
.app-shell.sidebar-collapsed { --sidebar-width: 68px; }
.app-shell.sidebar-collapsed .app-sidebar { width: 68px; }
.app-shell.sidebar-collapsed .brand-copy, .app-shell.sidebar-collapsed .sidebar-section-label, .app-shell.sidebar-collapsed .sidebar-nav-item span, .app-shell.sidebar-collapsed .sidebar-collapse-button span { display: none; }
.app-shell.sidebar-collapsed .sidebar-brand-strip { justify-content: center; padding-inline: 0; }
.app-shell.sidebar-collapsed .brand-logo { width: 48px; flex-basis: 48px; place-items: center; border-right: 0; }
.app-shell.sidebar-collapsed .brand-logo img { width: 42px; }
.app-shell.sidebar-collapsed .sidebar-nav { padding-inline: 8px; }
.app-shell.sidebar-collapsed .sidebar-nav-item { justify-content: center; padding: 10px; }
.app-shell.sidebar-collapsed .sidebar-collapse-button { justify-content: center; padding-inline: 8px; }
.app-shell.sidebar-collapsed .sidebar-collapse-button svg { transform: rotate(180deg); }
.app-shell.sidebar-collapsed .sidebar-footer { padding-inline: 8px; }
.app-shell.sidebar-collapsed .sidebar-footer small { font-size: 9px; }
.app-topbar { position: sticky; z-index: 30; top: 0; display: flex; height: 56px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 24px; backdrop-filter: blur(4px); background: linear-gradient(180deg, color-mix(in srgb, var(--card) 90%, #f4f6f9), color-mix(in srgb, var(--secondary) 72%, #fff)); border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent); box-shadow: 0 8px 18px rgba(20, 24, 30, .06); }
html.dark .app-topbar { background: linear-gradient(180deg, #1b2c3f, #162638); border-bottom-color: rgba(177, 198, 220, .22); box-shadow: 0 10px 24px rgba(3, 8, 16, .28); }
.topbar-left, .topbar-actions { display: flex; min-width: 0; align-items: center; gap: 8px; }
.topbar-title { overflow: hidden; margin: 0; color: var(--foreground); font-size: 18px; font-weight: 700; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.topbar-context { align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 999px; color: var(--muted-foreground); background: color-mix(in srgb, var(--muted) 20%, transparent); font-size: 10px; font-weight: 500; }
.topbar-context svg { width: 13px; height: 13px; }
.icon-button { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted-foreground); background: transparent; transition: color 150ms ease-out, background 150ms ease-out; }
.icon-button:hover { color: var(--accent-foreground); background: var(--accent); }
.icon-button svg { width: 16px; height: 16px; stroke-width: 1.9; }
.avatar-button { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: #de0013; box-shadow: 0 2px 8px rgba(222, 0, 19, .18); font-size: 10px; font-weight: 800; letter-spacing: .04em; transition: background 150ms ease-out; }
.avatar-button:hover, .avatar-button[aria-expanded='true'] { background: #b80010; }
.mobile-menu-button, .mobile-sidebar-close { display: none; }
.user-menu { width: 320px; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 12px; background: var(--popover); box-shadow: 0 18px 38px rgba(15, 23, 42, .14); }
.user-menu-header { display: flex; align-items: center; gap: 12px; padding: 16px; background: color-mix(in srgb, var(--muted) 25%, transparent); }
.user-menu-avatar { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 2px solid rgba(222, 0, 19, .15); border-radius: 50%; color: #fff; background: #de0013; font-size: 12px; font-weight: 900; }
.user-menu-identity { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.user-menu-identity strong, .user-menu-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-identity strong { color: var(--popover-foreground); font-size: 14px; font-weight: 700; }
.user-menu-identity span { color: var(--muted-foreground); font-size: 12px; }
.user-menu-footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.user-menu-footer form { margin-left: auto; }
.profile-badge { padding: 4px 7px; border-radius: 6px; color: var(--secondary-foreground); background: var(--secondary); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.session-active { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-foreground); font-size: 11px; }
.session-active i { width: 6px; height: 6px; border-radius: 50%; background: #10b981; }
.logout-button { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border: 0; border-radius: 6px; color: #fff; background: #de0013; font-size: 11px; font-weight: 600; }
.logout-button:hover { background: #b80010; }
.logout-button svg { width: 14px; height: 14px; }
.app-content { padding: 15px; }
.app-content-inner { display: flex; min-height: calc(100vh - 86px); flex-direction: column; gap: 15px; animation: pageEnter 300ms var(--ease-out-smooth) both; }
@keyframes pageEnter { from { transform: translateY(8px); } to { transform: translateY(0); } }
.sidebar-backdrop { display: none; }

/* Shared surfaces, buttons, alerts */
.card, .form-section, .detail-card, .settings-add-card, .settings-list-card, .filter-card, .records-card { color: var(--card-foreground); background: linear-gradient(180deg, color-mix(in srgb, var(--card) 96%, #fff), color-mix(in srgb, var(--secondary) 84%, #f4f6f9)); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent) !important; border-radius: 16px !important; box-shadow: 0 18px 55px rgba(15, 23, 42, .08); }
html.dark .card, html.dark .form-section, html.dark .detail-card, html.dark .settings-add-card, html.dark .settings-list-card, html.dark .filter-card, html.dark .records-card { background: linear-gradient(180deg, rgba(29, 44, 63, .98), rgba(23, 37, 54, .98)); border-color: rgba(171, 196, 224, .23) !important; box-shadow: 0 16px 34px rgba(9, 16, 28, .3); }
.btn { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); transition: all 180ms ease-out; }
.btn svg { width: 16px; height: 16px; transition: transform 180ms ease-out; }
.icon-fallback { display: inline-flex; width: 1em; height: 1em; align-items: center; justify-content: center; font-family: 'Segoe UI Symbol', 'Segoe UI', sans-serif; font-size: 1em; font-style: normal; line-height: 1; }
.icon-fallback::before { content: none !important; }
.btn:hover svg { transform: translateY(-1px); }
.btn:focus-visible, .icon-button:focus-visible, .avatar-button:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent); }
.btn-primary, .btn-danger { color: var(--primary-foreground); background: linear-gradient(92deg, color-mix(in srgb, var(--primary) 86%, #7c0008), color-mix(in srgb, var(--primary) 94%, #ff6872)); border-color: color-mix(in srgb, var(--primary) 76%, transparent); box-shadow: 0 4px 11px color-mix(in srgb, var(--primary) 16%, transparent); }
.btn-primary:hover, .btn-danger:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }
.btn-success-action { color: #fff; background: linear-gradient(92deg, #00893e, #00a95c); border-color: #008339; box-shadow: 0 4px 11px rgba(0, 137, 62, .18); }
.btn-success-action:hover { color: #fff; background: linear-gradient(92deg, #007d33, #009c50); transform: translateY(-1px); }
.btn-light, .btn-outline-secondary { color: color-mix(in srgb, var(--foreground) 76%, #4d525a); background: color-mix(in srgb, var(--card) 92%, #f2f3f5); border: 1px solid color-mix(in srgb, var(--border) 82%, transparent); }
.btn-light:hover, .btn-outline-secondary:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--card)); border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
.btn-dark { color: var(--secondary-foreground); background: linear-gradient(92deg, color-mix(in srgb, var(--secondary) 78%, var(--card)), color-mix(in srgb, var(--secondary) 94%, #fff)); border-color: color-mix(in srgb, var(--border) 82%, transparent); }
.btn-dark:hover { color: var(--foreground); filter: brightness(1.04); transform: translateY(-1px); }
.app-alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; box-shadow: 0 8px 18px rgba(15, 23, 42, .06); }
.app-alert-success { color: var(--success-text); background: var(--success-bg); border-color: color-mix(in srgb, var(--success-text) 24%, transparent); }
.app-alert-danger { color: var(--danger-text); background: rgba(220, 65, 82, .12); border-color: rgba(220, 65, 82, .28); }
.app-alert-warning { color: var(--warning-text); background: rgba(223, 161, 26, .12); border-color: rgba(223, 161, 26, .28); }
.app-alert-info { color: var(--info-text); background: rgba(35, 137, 226, .12); border-color: rgba(35, 137, 226, .25); }
.app-alert svg { width: 16px; height: 16px; flex: 0 0 16px; }
.alert-close { width: 26px; height: 26px; margin-left: auto; }

/* Forms and text */
.page-heading { display: flex; min-height: 36px; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0; }
.page-heading h1 { margin: 0; font-size: 18px; font-weight: 700; }
.page-subtitle { margin: 0; color: var(--muted-foreground); font-size: 12px; }
.compact-heading { padding: 2px 2px 0; }
.eyebrow { margin-bottom: 4px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.required-mark { color: var(--danger-text); }
.form-section .card-body, .detail-card .card-body, .settings-add-card .card-body, .settings-list-card .card-body { padding: 24px; }
.form-section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.section-number { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 8px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--card)); font-size: 10px; font-weight: 800; }
.form-section-heading h2, .detail-title, .section-title { margin: 0; color: var(--foreground); font-size: 14px; font-weight: 700; line-height: 1.1; }
.form-section-heading p { margin: 4px 0 0; color: var(--muted-foreground); font-size: 12px; }
.form-label { display: block; margin-bottom: 6px; color: var(--muted-foreground); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.form-control, .form-select { width: 100%; height: 36px; min-height: 36px; padding: 8px 12px; color: var(--foreground); background: color-mix(in srgb, var(--card) 96%, #f4f5f7); border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 8px; box-shadow: none; font-size: 13px; transition: color, box-shadow, border-color 150ms ease-out; }
.date-empty-placeholder:not(:focus)::-webkit-datetime-edit { color: transparent; }
textarea.form-control { height: auto; min-height: 72px; }
html.dark .form-control, html.dark .form-select { color: #f3f7fc; background: color-mix(in srgb, var(--input) 92%, #0f1a29); border-color: rgba(176, 198, 221, .26); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); }
.form-control::placeholder { color: color-mix(in srgb, var(--muted-foreground) 80%, transparent); }
.form-control:focus, .form-select:focus { color: var(--foreground); border-color: color-mix(in srgb, var(--ring) 66%, #9ea6b0); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 20%, transparent); }
.autocomplete-container { position: relative; z-index: 20; }
.autocomplete-container.is-open { z-index: 120; }
.form-section:has(.autocomplete-container.is-open) { position: relative; z-index: 110; }
.autocomplete-menu { position: absolute; z-index: 90; top: calc(100% + 5px); right: 0; left: 0; display: none; max-height: 258px; overflow-y: auto; padding: 5px; border: 1px solid color-mix(in srgb, var(--border) 86%, transparent); border-radius: 10px; background: var(--popover); box-shadow: 0 14px 30px rgba(15, 23, 42, .18); }
.autocomplete-menu.show { display: block; animation: autocompleteEnter 120ms ease-out both; }
@keyframes autocompleteEnter { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.autocomplete-option { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; padding: 8px 10px; border: 0; border-radius: 7px; color: var(--popover-foreground); background: transparent; font-size: 12px; font-weight: 600; text-align: left; }
.autocomplete-option:hover, .autocomplete-option.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--popover)); }
.autocomplete-option i { color: var(--primary); opacity: 0; }
.autocomplete-option:hover i, .autocomplete-option.active i { opacity: 1; }
.employee-directory-menu { max-height: 292px; padding: 6px; }
.employee-directory-menu .autocomplete-option { min-height: 46px; padding: 7px 10px; }
.autocomplete-option-copy { display: grid; gap: 2px; min-width: 0; }
.autocomplete-option-copy strong { color: inherit; font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.autocomplete-option-copy small { overflow: hidden; color: var(--muted-foreground); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.employee-directory-menu .autocomplete-option:hover small, .employee-directory-menu .autocomplete-option.active small { color: color-mix(in srgb, var(--primary) 72%, var(--muted-foreground)); }
.autocomplete-empty, .autocomplete-more { padding: 9px 10px; color: var(--muted-foreground); font-size: 11px; }
.autocomplete-more { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); font-size: 10px; font-weight: 600; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--destructive); background-image: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--destructive) 20%, transparent); }
.invalid-feedback { margin-top: 5px; color: var(--destructive); font-size: 11px; font-weight: 500; }
.form-text { color: var(--muted-foreground); font-size: 11px; }
.input-group .form-control { position: relative; z-index: 1; }
.input-group-text { color: var(--muted-foreground); background: var(--muted); border-color: color-mix(in srgb, var(--border) 78%, transparent); font-size: 11px; }
.calculated-tag { padding: 3px 6px; border-radius: 999px; color: var(--success-text); background: var(--success-bg); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.calculated-field { color: var(--success-text); background: color-mix(in srgb, var(--success-bg) 50%, var(--card)); border-color: color-mix(in srgb, var(--success-text) 28%, var(--border)); font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 15px; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.trip-entry { position: relative; }
.trip-entry + .trip-entry { margin-top: 18px; padding-top: 18px; border-top: 1px dashed color-mix(in srgb, var(--border) 85%, transparent); }
.trip-entry-heading { display: flex; align-items: center; gap: 9px; margin: 0 2px 10px; color: var(--foreground); font-size: 14px; font-weight: 700; }
.trip-entry-heading .section-number { width: 28px; height: 28px; flex-basis: 28px; }
.trip-entry-heading [data-remove-trip] { margin-left: auto; }
.trip-add-action { display: flex; align-items: center; gap: 10px; margin: -4px 0 2px; color: var(--muted-foreground); font-size: 12px; }
.btn-outline-danger { color: var(--primary); background: transparent; border: 1px solid color-mix(in srgb, var(--primary) 52%, var(--border)); }
.btn-outline-danger:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.alert-link { color: var(--primary); font-weight: 700; }
.history-batch-preview { padding: 20px; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.history-batch-preview-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--primary) 4%, var(--card)); }
.history-batch-preview-header h3 { margin: 9px 0 4px; color: var(--foreground); font-size: 17px; font-weight: 800; }
.history-batch-preview-header p { max-width: 680px; margin: 0; color: var(--muted-foreground); font-size: 12px; line-height: 1.5; }
.batch-total { flex: 0 0 auto; padding: 7px 10px; border-radius: 8px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--card)); font-size: 11px; font-weight: 800; }
.history-batch-preview-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.history-batch-preview-item { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.history-batch-preview-item-title { display: flex; align-items: center; gap: 9px; }
.history-batch-preview-item-title .section-number { width: 28px; height: 28px; flex-basis: 28px; }
.history-batch-preview-item-title strong, .history-batch-preview-item-title small { display: block; }
.history-batch-preview-item-title strong { color: var(--foreground); font-size: 13px; }
.history-batch-preview-item-title small { margin-top: 2px; color: var(--muted-foreground); font-size: 11px; }
.history-batch-preview-route { display: flex; align-items: center; gap: 8px; min-height: 42px; margin: 14px 0; padding: 10px; border-radius: 8px; color: var(--foreground); background: var(--muted); font-size: 12px; }
.history-batch-preview-route strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-batch-preview-route i { color: var(--primary); flex: 0 0 auto; }
.history-batch-preview-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.history-batch-preview-meta span { color: var(--foreground); font-size: 12px; font-weight: 700; }
.history-batch-preview-meta small { display: block; margin-bottom: 3px; color: var(--muted-foreground); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.history-batch-preview-footer { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--muted-foreground); font-size: 11px; }
.history-monthly-header { padding-bottom: 14px; }
.monthly-select-all { margin: 0; }
.monthly-history-table { min-width: 980px; margin: 0 !important; color: var(--foreground); }
.monthly-history-table thead th { padding: 10px 16px; color: var(--muted-foreground); background: var(--muted); border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.monthly-history-table tbody td { padding: 13px 16px; border-color: color-mix(in srgb, var(--border) 80%, transparent); color: var(--foreground); font-size: 12px; vertical-align: middle; }
.monthly-history-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--muted) 16%, transparent); }
.monthly-history-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 30%, transparent); }
.month-name { display: block; color: var(--foreground); font-size: 13px; }
.month-key, .monthly-count-hint { display: block; margin-top: 3px; color: var(--muted-foreground); font-size: 10px; }
.monthly-divergence-count { display: inline-flex; align-items: center; gap: 3px; margin-top: 6px; padding: 3px 7px; border-radius: 5px; color: var(--danger-text); background: rgba(220, 65, 82, .10); font-size: 10px; font-weight: 700; line-height: 1.1; }
.monthly-divergence-count b { font-weight: 800; }
.monthly-divergence-count, .modal-divergence-count, .mobile-divergence-count { display: none !important; }
.monthly-info-grid { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 7px 14px; min-width: 330px; }
.monthly-info-grid span { min-width: 0; overflow: hidden; color: var(--foreground); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.monthly-info-grid small { display: block; margin-bottom: 2px; color: var(--muted-foreground); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.monthly-km { color: var(--primary); font-size: 13px; font-weight: 800; white-space: nowrap; }
.monthly-view-button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.monthly-history-list { display: grid; gap: 10px; padding: 12px; }
.monthly-history-card { padding: 14px; border: 1px solid color-mix(in srgb, var(--border) 82%, transparent); border-radius: 12px; background: var(--card); }
.monthly-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.monthly-card-heading strong, .monthly-card-heading small { display: block; }
.monthly-card-heading strong { color: var(--foreground); font-size: 14px; }
.monthly-card-heading small { margin-top: 3px; color: var(--muted-foreground); font-size: 10px; }
.monthly-card-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 13px 0; }
.monthly-card-meta span { min-width: 0; color: var(--foreground); font-size: 12px; font-weight: 700; }
.monthly-card-meta small { display: block; margin-bottom: 3px; color: var(--muted-foreground); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.monthly-details-modal { z-index: 1060 !important; }
.monthly-details-modal .modal-dialog { z-index: 1061; max-width: min(1180px, calc(100vw - 28px)); }
.monthly-modal-content { max-height: min(86vh, 850px); }
.monthly-details-modal .modal-header, .monthly-details-modal .modal-footer { border-color: color-mix(in srgb, var(--border) 78%, transparent); }
.monthly-details-modal .modal-header { padding: 18px 22px 14px; }
.monthly-details-modal .modal-title { margin: 2px 0 0; color: var(--foreground); font-size: 20px; font-weight: 800; }
.monthly-details-modal .modal-body { padding: 18px 22px; }
.monthly-modal-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 18px; margin-bottom: 15px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--border) 72%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--muted) 55%, var(--card)); }
.monthly-modal-summary > span { min-width: 88px; }
.monthly-modal-summary small { display: block; margin-bottom: 2px; color: var(--muted-foreground); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.monthly-modal-summary strong { color: var(--foreground); font-size: 13px; }
.modal-divergence-count strong, .mobile-divergence-count { color: var(--danger-text) !important; }
.month-select-control { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted-foreground); font-size: 11px; font-weight: 700; cursor: pointer; }
.monthly-details-table-wrap { border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 10px; overflow: auto; }
.monthly-details-table { min-width: 1080px; margin: 0 !important; }
.monthly-details-table th { padding: 9px 10px; color: var(--muted-foreground); background: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.monthly-details-table td { max-width: 190px; padding: 9px 10px; color: var(--foreground); border-color: color-mix(in srgb, var(--border) 76%, transparent); font-size: 11px; vertical-align: middle; }
.monthly-details-table td strong, .monthly-details-table td small { display: block; }
.monthly-details-table td strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monthly-details-table td small { margin-top: 3px; color: var(--muted-foreground); font-size: 10px; }
.monthly-details-table td small i { vertical-align: middle; }
.monthly-details-table th:nth-child(9), .monthly-details-table td:nth-child(9), .monthly-detail-card .continuity-badge { display: none; }
.monthly-details-table tbody tr.odometer-divergence-row td { background: rgba(220, 65, 82, .09); border-color: rgba(220, 65, 82, .28); }
.monthly-details-table tbody tr.odometer-divergence-row td:first-child { box-shadow: inset 4px 0 0 var(--danger-text); }
.monthly-detail-cards { display: grid; gap: 10px; }
.monthly-detail-card { padding: 13px; border: 1px solid color-mix(in srgb, var(--border) 82%, transparent); border-radius: 11px; background: var(--card); }
.monthly-detail-card.odometer-divergence-row { border-color: rgba(220, 65, 82, .42); background: rgba(220, 65, 82, .07); box-shadow: inset 4px 0 0 var(--danger-text); }
.monthly-detail-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.monthly-detail-card-head strong, .monthly-detail-card-head small { display: block; }
.monthly-detail-card-head strong { color: var(--foreground); font-size: 13px; }
.monthly-detail-card-head small { margin-top: 3px; color: var(--muted-foreground); font-size: 10px; }
.monthly-detail-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.monthly-detail-card-grid span { min-width: 0; color: var(--foreground); font-size: 11px; overflow-wrap: anywhere; }
.monthly-detail-card-grid small { display: block; margin-bottom: 3px; color: var(--muted-foreground); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.monthly-detail-card-grid b { display: block; margin-top: 3px; color: var(--primary); }
.monthly-detail-actions { display: flex; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent); }
html.dark .monthly-history-table { --bs-table-bg: transparent; --bs-table-color: var(--foreground); }
html.dark .monthly-history-table thead th, html.dark .monthly-details-table th { color: #a9c2df; background: #17283b; }
html.dark .monthly-history-table tbody td, html.dark .monthly-details-table td { color: #eaf0f8; border-color: rgba(171, 196, 224, .16); }
html.dark .monthly-history-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .035); }
html.dark .monthly-history-table tbody tr:hover { background: rgba(255, 255, 255, .07); }
html.dark .monthly-details-table tbody tr.odometer-divergence-row td { background: rgba(220, 65, 82, .18); border-color: rgba(255, 102, 120, .34); }
@media (min-width: 768px) {
  .monthly-details-modal .d-md-block { display: block !important; }
  .monthly-details-modal .d-md-none { display: none !important; }
}
@media (max-width: 767.98px) {
  .monthly-details-modal .d-md-block { display: none !important; }
  .monthly-details-modal .d-md-none { display: grid !important; }
}
.odometer-alert { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid rgba(220, 65, 82, .48); border-radius: 12px; color: #a7192d; background: linear-gradient(135deg, rgba(255, 226, 231, .96), rgba(255, 242, 244, .92)); box-shadow: 0 8px 20px rgba(180, 31, 55, .1); }
html.dark .odometer-alert { color: #ff8090; background: linear-gradient(135deg, rgba(111, 25, 40, .32), rgba(91, 22, 34, .22)); border-color: rgba(255, 102, 120, .42); }
.odometer-alert-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; color: #c3213b; background: rgba(220, 65, 82, .18); }
.odometer-alert-icon svg { width: 18px; height: 18px; }
.odometer-alert-content { min-width: 0; }
.odometer-alert h2 { margin: 1px 0 4px; color: inherit; font-size: 14px; font-weight: 800; }
.odometer-alert p { margin: 0 0 12px; color: inherit; font-size: 12px; line-height: 1.5; }
.odometer-alert-grid { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 8px; }
.odometer-alert-grid div { padding: 8px; border: 1px solid rgba(195, 33, 59, .18); border-radius: 8px; background: rgba(255, 255, 255, .36); }
html.dark .odometer-alert-grid div { border-color: rgba(255, 102, 120, .22); background: rgba(0, 0, 0, .12); }
.odometer-alert-grid span { display: block; margin-bottom: 3px; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .76; }
.odometer-alert-grid strong { display: block; color: inherit; font-size: 12px; font-variant-numeric: tabular-nums; }
.odometer-confirmation { display: flex; align-items: flex-start; gap: 7px; margin-top: 12px; color: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.odometer-confirmation input { width: 16px; height: 16px; margin-top: 1px; accent-color: #ae7300; }

/* Listing */
.screen-description { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.screen-description p { margin: 0; color: var(--muted-foreground); font-size: 12px; }
.kpi-row { display: flex; flex-wrap: wrap; gap: 10px; }
.kpi-chip { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 8px 12px; border: 2px solid var(--border); border-radius: 12px; color: var(--muted-foreground); background: var(--card); text-align: left; transition: all 200ms ease-out; }
.kpi-row .kpi-chip { width: min(100%, 280px); }
.kpi-chip:hover { border-color: var(--ring); box-shadow: 0 10px 24px rgba(15, 23, 42, .1); transform: translateY(-2px); }
.kpi-chip .kpi-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.kpi-chip strong { color: var(--primary); font-size: 16px; font-variant-numeric: tabular-nums; }
.kpi-chip.orange strong { color: #dfa11a; }
.filter-card .card-body { padding: 15px 16px 8px; }
.filter-card .section-title { font-size: 13px; }
.filter-card .section-hint { font-size: 11px; }
.filter-decoration { width: 18px; color: var(--muted-foreground); opacity: .55; }
.input-icon-wrap { position: relative; }
.input-icon-wrap > svg { position: absolute; z-index: 2; top: 50%; left: 12px; width: 16px; height: 16px; color: var(--muted-foreground); transform: translateY(-50%); }
.input-icon-wrap .form-control { padding-left: 40px; }
.filter-card .form-label { margin-bottom: 2px; font-size: 11px; }
.filter-card .form-control, .filter-card .form-select { height: 36px; min-height: 36px; font-size: 13px; }
.filter-action { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.filter-action:hover { color: #fff; background: var(--danger-text); border-color: var(--danger-text); box-shadow: 0 4px 11px rgba(230, 43, 52, .2); }
@media (min-width: 768px) {
  .filter-card .filter-form { display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 12px; row-gap: 10px; margin-inline: 0; }
  .filter-card .filter-form > .filter-field { width: auto; min-width: 150px; max-width: none; flex: 1 1 150px; padding-inline: 0; }
  .filter-card .filter-form > .filter-field:first-child { min-width: 260px; flex: 2 1 300px; }
  .filter-card .filter-form > .filter-form-actions { width: auto; max-width: none; flex: 0 0 auto; padding-inline: 0; white-space: nowrap; }
}
.records-card { min-height: 0; overflow: hidden; }
.records-card .card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px 8px; border: 0; background: transparent; }
.records-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.selected-record-count { min-width: 0; font-size: 10px; }
.table-caption { display: inline-flex; align-items: center; gap: 4px; color: var(--muted-foreground); font-size: 11px; }
.table-caption svg { width: 13px; height: 13px; }
.preview-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid rgba(174, 115, 0, .24); border-radius: 999px; color: #8a5700; background: rgba(255, 224, 138, .34); font-size: 10px; font-weight: 700; white-space: nowrap; }
.preview-record td { background: rgba(255, 248, 224, .7); }
html.dark .preview-record td { background: rgba(111, 78, 6, .18); }
.records-card .table-responsive { margin: 4px 16px 15px; border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--card) 92%, #fff); overflow: auto; }
html.dark .records-card .table-responsive { border-color: rgba(171, 196, 224, .2); background: color-mix(in srgb, var(--card) 93%, #111d2c); }
.records-table { min-width: 1320px; margin: 0 !important; color: var(--foreground); }
.records-table thead th { position: sticky; z-index: 1; top: 0; padding: 10px 16px; color: var(--muted-foreground); background: var(--muted); border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent); font-size: 10px; font-weight: 600; letter-spacing: .08em; line-height: 1.25; text-transform: uppercase; white-space: nowrap; }
html.dark .records-table { --bs-table-bg: transparent; --bs-table-color: var(--foreground); --bs-table-striped-bg: rgba(255, 255, 255, .035); --bs-table-hover-bg: rgba(255, 255, 255, .06); }
html.dark .records-table thead th { color: #a9c2df; background: #17283b; border-bottom-color: rgba(171, 196, 224, .24); }
.record-select-cell { width: 42px !important; padding-right: 4px !important; padding-left: 12px !important; text-align: center; }
.record-checkbox { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); vertical-align: middle; cursor: pointer; }
.records-table tbody tr { border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent); transition: background 150ms ease-out; }
.records-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--muted) 16%, transparent); }
.records-table tbody tr:hover { background: color-mix(in srgb, var(--muted) 30%, transparent); }
.records-table tbody td { max-width: 190px; padding: 6px 16px; overflow: hidden; color: var(--foreground); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
html.dark .records-table tbody tr,
html.dark .records-table tbody td { color: #eaf0f8; background-color: transparent !important; border-color: rgba(171, 196, 224, .16); }
html.dark .records-table tbody tr:nth-child(even) { background-color: rgba(255, 255, 255, .035) !important; }
html.dark .records-table tbody tr:hover,
html.dark .records-table tbody tr:hover td { background-color: rgba(255, 255, 255, .07) !important; }
.operation-chip { display: inline-flex; max-width: 170px; align-items: center; padding: 2px 8px; overflow: hidden; border-radius: 999px; color: var(--info-text); background: rgba(35, 137, 226, .12); font-size: 10px; font-weight: 600; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.continuity-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.continuity-badge svg { width: 12px; height: 12px; }
.continuity-badge.ok, .mobile-continuity.ok { color: var(--success-text); background: var(--success-bg); }
.continuity-badge.danger, .mobile-continuity.danger { color: var(--danger-text); background: rgba(220, 65, 82, .14); }
.mobile-continuity { display: inline-block; font-size: 10px; font-weight: 700; }
.action-group { display: inline-flex; align-items: center; gap: 4px; }
.btn-icon { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0; color: var(--muted-foreground); background: transparent; box-shadow: none; }
.btn-icon:hover { color: var(--info-text); background: transparent; }
.btn-icon.danger:hover { color: var(--danger-text); background: transparent; }
.btn-icon svg { width: 14px; height: 14px; }
.records-card .card-footer { display: flex; align-items: center; justify-content: flex-end; padding: 6px 16px; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent) !important; color: var(--muted-foreground); font-size: 11px; background: transparent; }
.pagination { margin: 0; }
.page-link { padding: 3px 8px; border: 0; border-radius: 6px !important; color: var(--muted-foreground); background: transparent; font-size: 11px; }
.page-link:hover { color: var(--primary); background: var(--accent); }
.page-item.active .page-link { color: #fff; background: var(--primary); }
.page-item.disabled .page-link { color: color-mix(in srgb, var(--muted-foreground) 45%, transparent); background: transparent; }
.empty-state { min-height: 240px; display: grid; place-items: center; align-content: center; padding: 24px; text-align: center; }
.empty-icon { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; margin-bottom: 8px; color: color-mix(in srgb, var(--muted-foreground) 40%, transparent); }
.empty-icon svg { width: 32px; height: 32px; }
.empty-state h3 { margin-bottom: 4px; color: var(--muted-foreground); font-size: 14px; font-weight: 600; }
.empty-state p { margin-bottom: 14px; color: var(--muted-foreground); font-size: 12px; }

/* KM Ocioso */
.idle-km-sync-status { margin-top: 5px !important; color: var(--muted-foreground); font-size: 11px; }
.idle-km-sync-status i { margin-right: 4px; color: var(--primary); }
.idle-km-mode-switch { display: inline-flex; align-items: center; margin: 0 0 14px; padding: 3px; border: 1px solid color-mix(in srgb, var(--border) 88%, transparent); border-radius: 9px; background: var(--muted); }
.idle-km-mode-switch a { min-width: 78px; padding: 7px 12px; border-radius: 6px; color: var(--muted-foreground); font-size: 12px; font-weight: 700; text-align: center; text-decoration: none; transition: background .16s ease, color .16s ease, box-shadow .16s ease; }
.idle-km-mode-switch a:hover { color: var(--foreground); }
.idle-km-mode-switch a.active { color: #fff; background: var(--primary); box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 32%, transparent); }
.idle-km-filter-form { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)) auto; align-items: end; gap: 12px; }
.idle-km-monthly-filter-form { grid-template-columns: repeat(4, minmax(160px, 1fr)) auto; }
.idle-km-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.idle-km-results-card { overflow: hidden; }
.idle-km-results-card .card-header { padding: 16px; border: 0; }
.idle-km-fleet-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 12px; margin: 0 16px 16px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.idle-km-fleet-total span { color: var(--muted-foreground); font-size: 12px; font-weight: 700; }
.idle-km-fleet-total strong { color: var(--primary); font-size: 16px; }
.idle-km-fleet-total small { color: var(--muted-foreground); font-size: 11px; }
.idle-km-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--muted-foreground); border-top: 1px solid color-mix(in srgb, var(--border) 76%, transparent); background: transparent; font-size: 11px; }
.idle-km-results-card .table-responsive { margin: 0 16px 16px; border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--card) 92%, #fff); overflow: auto; }
.idle-km-table { min-width: 720px; color: var(--foreground); }
.idle-km-table thead th { padding: 10px 16px; color: var(--muted-foreground); background: var(--muted); border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.idle-km-table td { padding: 12px 16px; border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent); font-size: 13px; }
html.dark .idle-km-results-card .table-responsive { border-color: rgba(171, 196, 224, .2); background: color-mix(in srgb, var(--card) 93%, #111d2c); }
html.dark .idle-km-table { --bs-table-bg: transparent; --bs-table-color: var(--foreground); }
html.dark .idle-km-table thead th { color: #a9c2df; background: #17283b; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.idle-km-mobile-list { padding: 0 14px 14px; }
.idle-km-mobile-card { padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent); }
.idle-km-mobile-card > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.idle-km-mobile-card strong { color: var(--foreground); font-size: 14px; }
.idle-km-mobile-card small { color: var(--muted-foreground); font-size: 11px; }
.idle-km-mobile-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.idle-km-mobile-card dt { margin: 0 0 3px; color: var(--muted-foreground); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.idle-km-mobile-card dd { margin: 0; color: var(--foreground); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
  .idle-km-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .idle-km-monthly-filter-form { grid-template-columns: 1fr; }
  .idle-km-vehicle-filter, .idle-km-filter-actions { grid-column: 1 / -1; }
  .idle-km-filter-actions { justify-content: flex-end; }
  .idle-km-fleet-total { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .idle-km-filter-form, .idle-km-monthly-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .idle-km-filter-actions { grid-column: 3; }
}
@media (max-width: 420px) {
  .idle-km-mobile-card dl { grid-template-columns: 1fr; gap: 10px; }
}
.users-empty-card { min-height: 300px; }
.users-card .card-header { padding: 15px 16px 8px; border: 0; }
.users-table-wrap { margin: 4px 16px 15px; border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 14px; overflow: auto; }
.users-table { min-width: 780px; }
.user-table-cell { display: flex; align-items: center; gap: 9px; }
.user-table-avatar { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--card)); font-size: 10px; font-weight: 800; }
.user-table-cell > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.user-table-cell strong { color: var(--foreground); font-size: 12px; font-weight: 600; }
.user-table-cell small { color: var(--muted-foreground); font-size: 10px; }
.user-form-card { max-width: 920px; margin-inline: auto; }
.user-form-card .card-body { padding: 24px; }
.user-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 24px; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.user-active-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 12px; font-weight: 600; cursor: pointer; }
.user-active-toggle input { width: 16px; height: 16px; accent-color: var(--primary); }
.mobile-record-list { padding: 4px 14px 12px; }
.mobile-record-card { padding: 12px 2px; border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent); }
.mobile-record-card:last-child { border-bottom: 0; }
.mobile-record-card h3 { margin: 3px 0 6px; font-size: 13px; font-weight: 700; }
.mobile-record-heading { min-width: 0; }
.record-select-control { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 5px; color: var(--muted-foreground); font-size: 10px; font-weight: 700; cursor: pointer; }
.record-date { color: var(--muted-foreground); font-size: 10px; font-weight: 600; }
.record-context { max-width: 280px; margin-top: 3px; overflow: hidden; color: var(--primary); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mobile-record-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.mobile-record-meta span { overflow: hidden; color: var(--foreground); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-record-meta small { display: block; margin-bottom: 2px; color: var(--muted-foreground); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.dropdown-menu { color: var(--popover-foreground); background: var(--popover); border-color: var(--border); }
.dropdown-item { color: var(--popover-foreground); font-size: 12px; }
.dropdown-item:hover { color: var(--accent-foreground); background: var(--accent); }

/* Detail and settings */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.detail-highlight { grid-column: span 2; }
.detail-card .eyebrow { margin-bottom: 5px; }
.detail-id { padding: 3px 7px; border-radius: 999px; color: var(--muted-foreground); background: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.data-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0 0; }
.data-list dt { margin-bottom: 3px; color: var(--muted-foreground); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.data-list dd { margin: 0; color: var(--foreground); font-size: 13px; font-weight: 600; }
.metric-large { color: var(--primary); font-size: 38px; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric-large small { font-size: 12px; letter-spacing: 0; }
.metric-breakdown { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; color: var(--muted-foreground); font-size: 11px; }
.metric-breakdown span { display: flex; flex-direction: column; gap: 2px; }
.metric-breakdown strong { color: var(--foreground); font-weight: 600; }
.metric-breakdown svg { width: 14px; height: 14px; }
.passenger-line { display: flex; align-items: center; gap: 7px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 12px; }
.passenger-line svg { width: 16px; height: 16px; color: var(--warning-text); }
.odometer-history-card { grid-column: span 2; }
.odometer-history-list { margin-top: 14px; }

/* Login */
.login-page { display: grid; min-height: 100vh; place-items: center; padding: clamp(14px, 3.2vw, 34px); }
.login-shell { display: grid; width: min(1080px, 100%); min-width: 0; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(16px, 2.6vw, 28px); align-items: stretch; }
.login-brand-panel, .login-card { min-width: 0; max-width: 100%; border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 20px; background: linear-gradient(170deg, #fff, #f5f6f8); box-shadow: 0 16px 34px rgba(20, 24, 30, .12), inset 0 1px 0 rgba(255, 255, 255, .66); }
html.dark .login-brand-panel, html.dark .login-card { background: linear-gradient(170deg, #181c22, #12161c); border-color: rgba(255, 255, 255, .14); box-shadow: 0 16px 34px rgba(0, 0, 0, .28); }
.login-brand-panel { display: flex; min-height: 366px; flex-direction: column; justify-content: center; padding: clamp(24px, 4vw, 46px); }
.login-brand-panel img { width: min(220px, 70%); height: auto; padding: 12px; border-radius: 10px; background: #e10c15; }
.login-brand-panel .eyebrow { margin-top: 30px; }
.login-brand-panel h1 { max-width: 520px; margin: 0 0 12px; color: var(--foreground); font-size: clamp(26px, 3.3vw, 40px); font-weight: 800; letter-spacing: -.04em; }
.login-brand-panel p { max-width: 480px; margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.62; }
.login-card { display: flex; min-height: 366px; flex-direction: column; justify-content: center; padding: clamp(24px, 3vw, 34px); }
.login-card form { width: 100%; }
.login-card .btn-primary { width: 100%; min-height: 42px; padding-inline: 16px; }
.login-tabs { display: flex; gap: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.login-tabs a { position: relative; padding: 0 0 10px; color: var(--muted-foreground); font-size: 12px; font-weight: 700; text-decoration: none; }
.login-tabs a.active { color: var(--primary); }
.login-tabs a.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; border-radius: 2px; background: var(--primary); content: ''; }
.login-card-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-card-heading .settings-icon { margin: 0; }
.login-card-heading h2 { margin: 0 0 3px; color: var(--foreground); font-size: 26px; font-weight: 800; }
.login-card-heading p { margin: 0; color: var(--muted-foreground); font-size: 12px; }
.login-error { display: flex; align-items: center; gap: 7px; margin-bottom: 16px; padding: 10px; border: 1px solid rgba(220, 65, 82, .28); border-radius: 8px; color: #982232; background: rgba(220, 65, 82, .12); font-size: 12px; }
.login-error svg { width: 15px; height: 15px; }
.login-footer { margin: 18px 0 0; color: var(--muted-foreground); font-size: 12px; text-align: center; }
.login-footer a { color: var(--primary); font-weight: 700; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }
.settings-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; min-height: 28px; }
.settings-heading .page-subtitle { max-width: 680px; text-align: right; }
.settings-layout { display: grid; grid-template-columns: minmax(270px, 310px) minmax(0, 1fr); align-items: start; gap: 15px; }
.settings-add-card { position: sticky; top: 70px; }
.settings-icon { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; margin-bottom: 12px; border-radius: 8px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--card)); }
.settings-icon svg { width: 18px; height: 18px; }
.settings-list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.settings-list-card { min-width: 0; overflow: hidden; }
.list-key { color: color-mix(in srgb, var(--muted-foreground) 55%, transparent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.option-list { margin: 0; padding: 0; list-style: none; }
.settings-list-card .option-list { max-height: 340px; padding-right: 6px; overflow-y: auto; }
.option-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); color: var(--foreground); font-size: 12px; }
.option-list li:first-child { padding-top: 0; border-top: 0; }
.list-empty { padding: 9px; border-radius: 8px; color: var(--muted-foreground); background: var(--muted); font-size: 11px; }

/* Modal */
.modal-backdrop,
.modal-backdrop.show { z-index: 1040 !important; opacity: 1; background: rgba(15, 19, 24, .52); backdrop-filter: none !important; }
.modal-clean { border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 8px; color: var(--card-foreground); background: linear-gradient(180deg, color-mix(in srgb, var(--card) 99%, #fff), color-mix(in srgb, var(--secondary) 56%, #fff)); box-shadow: 0 18px 38px rgba(20, 33, 52, .18); }
html.dark .modal-clean { background: linear-gradient(180deg, color-mix(in srgb, var(--card) 94%, #223447), color-mix(in srgb, var(--secondary) 84%, #1a2b3d)); border-color: rgba(171, 196, 224, .28); }
#deleteModal { z-index: 1070 !important; }
#deleteModal .modal-dialog { z-index: 1071; }
.modal-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; margin-bottom: 10px; border-radius: 50%; color: var(--danger-text); background: rgba(220, 65, 82, .12); }
.modal-icon svg { width: 18px; height: 18px; }
.modal-clean h2 { color: var(--foreground); font-size: 18px; font-weight: 600; }
.modal-clean p { color: var(--muted-foreground) !important; font-size: 13px; }
.btn-integracao-cancelar { color: #fff; background: linear-gradient(92deg, #d73337, #fc5855); border-color: #e64343; }
.btn-integracao-cancelar:hover { color: #fff; background: linear-gradient(92deg, #c21725, #e64343); transform: translateY(-1px); }

/* Bootstrap fallback utilities for offline/mobile previews */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-column { flex-direction: column !important; }
.flex-column-reverse { flex-direction: column-reverse !important; }
.flex-wrap { flex-wrap: wrap !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.w-100 { width: 100% !important; }
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }
.text-nowrap { white-space: nowrap !important; }
.text-danger { color: var(--danger-text) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-md-5 { padding: 3rem !important; }
.border-0 { border: 0 !important; }
.bg-transparent { background-color: transparent !important; }
.row { display: flex; flex-wrap: wrap; margin-inline: -.5rem; }
.row > * { flex-shrink: 0; width: 100%; max-width: 100%; padding-inline: .5rem; }
.row.g-3, .row.g-4 { row-gap: 1rem; }
.row.g-4 { row-gap: 1.5rem; }
.col-6 { width: 50%; }
.col-12 { width: 100%; }
.table { width: 100%; border-collapse: collapse; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; z-index: 1000; top: 100%; right: auto; left: 0; display: none; min-width: 10rem; margin: .125rem 0 0; padding: .5rem 0; border: 1px solid var(--border); border-radius: .375rem; background: var(--popover); box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15); }
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item { display: block; width: 100%; padding: .375rem 1rem; clear: both; border: 0; color: var(--popover-foreground); background: transparent; text-align: inherit; text-decoration: none; white-space: nowrap; }
.dropdown-item:hover { background: var(--accent); }
.modal { position: fixed; z-index: 1055; inset: 0; display: none; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal.show { display: block; }
.modal-dialog { position: relative; width: auto; max-width: 500px; margin: 1.75rem auto; pointer-events: none; }
.modal-content { position: relative; display: flex; width: 100%; flex-direction: column; pointer-events: auto; outline: 0; }
.modal-backdrop { position: fixed; z-index: 1050; inset: 0; background: #000; opacity: .5; }
.modal-open { overflow: hidden; }
@media (min-width: 576px) {
  .flex-sm-row { flex-direction: row !important; }
  .col-sm-6 { width: 50%; }
}
@media (min-width: 768px) {
  .d-md-inline-flex { display: inline-flex !important; }
  .flex-md-row { flex-direction: row !important; }
  .align-items-md-center { align-items: center !important; }
  .col-md-4 { width: 33.333333%; }
  .col-md-6 { width: 50%; }
}
@media (min-width: 992px) {
  .d-lg-block { display: block !important; }
  .d-lg-none { display: none !important; }
  .col-lg-2 { width: 16.666667%; }
  .col-lg-4 { width: 33.333333%; }
}
@media (max-width: 991.98px) {
  .d-lg-block { display: none !important; }
  .d-lg-none { display: block !important; }
}
@media (max-width: 575.98px) {
  .d-sm-none { display: none !important; }
}

/* Tooltips */
.app-tooltip { position: fixed; z-index: 110; max-width: min(420px, calc(100vw - 2rem)); padding: 6px 12px; border-radius: 6px; color: var(--background); background: var(--foreground); box-shadow: 0 8px 24px rgba(15, 23, 42, .14); font-size: 12px; pointer-events: none; opacity: 0; transform: translateY(3px); transition: opacity 120ms ease-out, transform 120ms ease-out; }
.app-tooltip.visible { opacity: 1; transform: translateY(0); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(156, 159, 161, .3) transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border-radius: 3px; background: rgba(156, 159, 161, .3); }
*::-webkit-scrollbar-thumb:hover { background: rgba(156, 159, 161, .5); }

@media (min-width: 1280px) { .kpi-row { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 768px) and (max-width: 1279.98px) { .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1199.98px) {
  html, body { width: 100%; max-width: 100%; min-width: 0; margin: 0; overflow-x: hidden; }
  .app-shell, .app-page, .app-topbar, .app-content { width: 100% !important; max-width: none; min-width: 0; margin-left: 0 !important; }
  .app-shell { display: block; margin: 0 !important; }
  .app-sidebar { width: 256px; transform: translateX(-100%); }
  .app-sidebar.mobile-open { transform: translateX(0); }
  .app-page { margin-left: 0; }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; display: block; visibility: hidden; background: rgba(0, 0, 0, .4); opacity: 0; backdrop-filter: blur(4px); transition: opacity 220ms ease-out, visibility 220ms ease-out; }
  .sidebar-backdrop.visible { visibility: visible; opacity: 1; }
  .mobile-menu-button, .mobile-sidebar-close { display: inline-flex; }
  .mobile-menu-button { margin-left: -4px; }
  .mobile-sidebar-close { margin-left: auto; color: rgba(255, 255, 255, .85); }
  .mobile-sidebar-close:hover { color: #fff; background: rgba(255, 255, 255, .14); }
  .sidebar-collapse-button { display: none; }
}
@media (max-width: 767.98px) {
  .login-page { overflow-x: hidden; }
  .login-shell { width: 100%; }
  .login-brand-panel, .login-card { width: 100%; }
  .app-topbar { padding: 0 12px; }
  .mobile-menu-button { margin-left: 0; }
  .topbar-title { font-size: 16px; }
  .app-content { padding: 15px 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-highlight { grid-column: auto; }
  .odometer-history-card { grid-column: auto; }
  .odometer-alert { padding: 12px; }
  .odometer-alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-batch-preview { padding: 12px; }
  .history-batch-preview-header { flex-direction: column; gap: 10px; padding: 14px; }
  .history-batch-preview-list { grid-template-columns: 1fr; }
  .history-batch-preview-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monthly-details-modal .modal-dialog { max-width: calc(100vw - 20px); margin: 10px auto; }
  .monthly-details-modal .modal-header, .monthly-details-modal .modal-body { padding: 15px; }
  .monthly-modal-summary { align-items: flex-start; }
  .month-select-control { width: 100%; margin-left: 0; }
  .trip-add-action { align-items: flex-start; flex-direction: column; }
  .trip-add-action .btn { width: 100%; }
  .settings-list-grid { grid-template-columns: 1fr; }
  .settings-add-card { position: static; }
  .settings-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .settings-heading .page-subtitle { text-align: left; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 260px; }
  .login-card { min-height: auto; }
  .data-list { grid-template-columns: 1fr; gap: 12px; }
  .form-section .card-body, .detail-card .card-body, .settings-add-card .card-body, .settings-list-card .card-body { padding: 16px; }
}
@media (max-width: 991.98px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-add-card { position: static; }
}
@media (max-width: 575.98px) {
  .screen-description { align-items: flex-start; flex-direction: column; }
  .filter-card .card-body { padding: 15px 14px 8px; }
  .records-card .card-header { align-items: flex-start; flex-direction: column; padding: 15px 14px 8px; }
  .records-header-actions { width: 100%; justify-content: space-between; }
  .records-card .table-responsive { display: none !important; }
  .mobile-record-list { padding: 6px 12px 14px; }
  .mobile-record-card { margin-bottom: 10px; padding: 14px; border: 1px solid color-mix(in srgb, var(--border) 82%, transparent); border-radius: 13px; background: color-mix(in srgb, var(--card) 88%, var(--muted)); box-shadow: 0 7px 18px rgba(15, 23, 42, .05); }
  .mobile-record-card:last-child { margin-bottom: 0; }
  .mobile-record-card h3 { margin: 4px 0 7px; font-size: 14px; }
  .mobile-record-card .record-context { max-width: calc(100vw - 150px); }
  .mobile-record-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 14px; }
  .mobile-record-meta span { min-width: 0; padding: 9px 0 2px; border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent); }
  .mobile-record-meta small { margin-bottom: 4px; font-size: 9px; }
  .monthly-card-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monthly-details-modal .modal-title { font-size: 17px; }
  .monthly-detail-card-grid { grid-template-columns: 1fr; gap: 8px; }
  .monthly-detail-card-grid span { padding-bottom: 7px; border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent); }
  .monthly-detail-card-grid span:last-child { padding-bottom: 0; border-bottom: 0; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .user-menu { width: min(320px, calc(100vw - 24px)); }
  .odometer-alert { flex-direction: column; }
  .odometer-alert-grid { grid-template-columns: 1fr 1fr; width: 100%; }
}

/* ConfiguraÃ§Ãµes: painel central de listas */
.settings-page {
  --settings-red: #dd0017;
  --settings-red-dark: #b80014;
  --settings-graphite: #252a32;
  --settings-bg: #f6f7f9;
  --settings-border: #e5e8ed;
  --settings-text: #1b2029;
  --settings-muted: #737c88;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  color: var(--settings-text);
}
.settings-page .card,
.settings-page .settings-category-panel,
.settings-page .settings-manager,
.settings-page .settings-modal {
  border: 1px solid var(--settings-border) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(26, 35, 49, .06);
}
.settings-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.settings-title-row h1 { margin: 0 0 5px; color: var(--settings-text); font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.settings-title-row p { margin: 0; color: var(--settings-muted); font-size: 13px; }
.settings-actions { display: flex; align-items: center; gap: 8px; }
.settings-page .btn-primary { color: #fff; background: var(--settings-red); border-color: var(--settings-red); box-shadow: 0 5px 12px rgba(221, 0, 23, .16); }
.settings-page .btn-primary:hover { background: var(--settings-red-dark); border-color: var(--settings-red-dark); filter: none; }
.settings-page .btn-outline-secondary { color: var(--settings-text); background: #fff; border-color: var(--settings-border); }
.settings-page .btn-outline-secondary:hover { color: var(--settings-red); background: #fff5f6; border-color: #f09ca6; }
.settings-page .btn-light { color: var(--settings-text); background: #fff; border-color: var(--settings-border); }
.settings-page .btn-light:hover { color: var(--settings-red); background: #fff5f6; border-color: #f09ca6; }
.settings-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.settings-kpi { display: flex; min-width: 0; align-items: center; gap: 10px; min-height: 68px; padding: 12px; border: 1px solid var(--settings-border); border-radius: 12px; background: #fff; box-shadow: 0 6px 18px rgba(26, 35, 49, .045); }
.settings-kpi-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 8px; color: var(--settings-red); background: #fff0f2; }
.settings-kpi-icon svg { width: 18px; height: 18px; }
.settings-kpi div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.settings-kpi span:not(.settings-kpi-icon) { overflow: hidden; color: var(--settings-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.settings-kpi strong { overflow: hidden; color: var(--settings-text); font-size: 17px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.settings-kpi-dark { color: #fff; background: var(--settings-red); border-color: var(--settings-red); }
.settings-kpi-dark .settings-kpi-icon { color: #fff; background: rgba(255, 255, 255, .12); }
.settings-kpi-dark span:not(.settings-kpi-icon), .settings-kpi-dark strong { color: #fff; }
.settings-workspace { display: grid; grid-template-columns: minmax(225px, 260px) minmax(0, 1fr); align-items: stretch; gap: 16px; }
.settings-category-panel { min-width: 0; padding: 18px 12px; }
.settings-panel-label { margin: 0 10px 10px; color: var(--settings-muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.settings-category-list { display: flex; flex-direction: column; gap: 3px; }
.settings-category-link { display: grid; grid-template-columns: 30px minmax(0, 1fr) 14px; align-items: center; gap: 9px; min-height: 52px; padding: 8px 10px; border-radius: 8px; color: var(--settings-text); transition: background 150ms ease-out, color 150ms ease-out; }
.settings-category-link:hover { color: var(--settings-text); background: var(--settings-bg); }
.settings-category-link.active { color: #fff; background: var(--settings-red); }
.settings-category-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: var(--settings-red); background: #fff0f2; }
.settings-category-link.active .settings-category-icon { color: #fff; background: rgba(255, 255, 255, .13); }
.settings-category-icon svg { width: 16px; height: 16px; }
.settings-category-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.settings-category-copy strong { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.settings-category-copy small { color: var(--settings-muted); font-size: 10px; }
.settings-category-link.active .settings-category-copy small { color: rgba(255, 255, 255, .68); }
.settings-category-arrow { color: var(--settings-muted); font-size: 12px; }
.settings-category-link.active .settings-category-arrow { color: rgba(255, 255, 255, .8); }
.settings-manager { align-self: stretch; width: 100%; min-width: 0; min-height: 0; overflow: hidden; }
.settings-manager-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 16px; }
.settings-manager-eyebrow { margin-bottom: 4px; color: var(--settings-red); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.settings-manager-header h2, .settings-modal h2 { margin: 0 0 4px; color: var(--settings-text); font-size: 20px; font-weight: 800; }
.settings-manager-header p { max-width: 620px; margin: 0; color: var(--settings-muted); font-size: 12px; line-height: 1.5; }
.settings-count { flex: 0 0 auto; padding: 6px 9px; border-radius: 7px; color: var(--settings-red); background: #fff0f2; font-size: 11px; white-space: nowrap; }
.settings-count strong { font-size: 14px; }
.settings-toolbar { display: flex; align-items: center; gap: 10px; padding: 0 24px 16px; }
.settings-search { position: relative; min-width: 0; flex: 1 1 auto; }
.settings-search > svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: var(--settings-muted); transform: translateY(-50%); }
.settings-search input { width: 100%; height: 38px; padding: 8px 12px 8px 38px; border: 1px solid var(--settings-border); border-radius: 8px; color: var(--settings-text); background: #fff; font-size: 12px; }
.settings-search input:focus { outline: 0; border-color: #9da6b2; box-shadow: 0 0 0 3px rgba(221, 0, 23, .08); }
.settings-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 24px; border-top: 1px solid var(--settings-border); border-bottom: 1px solid var(--settings-border); color: var(--settings-muted); background: var(--settings-bg); font-size: 11px; }
.settings-results-head a { color: var(--settings-red); font-weight: 700; }
.settings-table-wrap { width: 100%; overflow-x: auto; }
.settings-table { width: 100%; min-width: 500px; table-layout: fixed; border-collapse: collapse; }
.settings-table th:first-child, .settings-table td:first-child { width: 72px; }
.settings-table th:last-child, .settings-table td:last-child { width: 96px; }
.settings-table th { padding: 11px 24px; color: var(--settings-muted); background: #fff; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.settings-table td { padding: 13px 24px; border-top: 1px solid var(--settings-border); color: var(--settings-text); font-size: 12px; }
.settings-table tbody tr:hover { background: #fbfbfc; }
.settings-table td strong { font-weight: 700; }
.settings-option-registration { display: block; margin-top: 3px; color: var(--settings-muted); font-size: 10px; }
.settings-index { width: 72px; color: var(--settings-muted) !important; font-size: 11px !important; font-variant-numeric: tabular-nums; }
.settings-row-actions { display: inline-flex; align-items: center; gap: 4px; }
.settings-page .settings-row-actions .btn-icon { width: 30px; height: 30px; border: 1px solid transparent; border-radius: 7px; color: var(--settings-muted); }
.settings-page .settings-row-actions .btn-icon:hover { color: var(--settings-red); background: #fff0f2; }
.settings-page .settings-row-actions .btn-icon.danger:hover { color: #b80014; }
.settings-empty { display: grid; place-items: center; padding: 54px 24px; text-align: center; }
.settings-empty > span { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 10px; border-radius: 10px; color: var(--settings-muted); background: var(--settings-bg); }
.settings-empty > span svg { width: 20px; height: 20px; }
.settings-empty h3 { margin: 0 0 5px; color: var(--settings-text); font-size: 15px; }
.settings-empty p { margin: 0 0 16px; color: var(--settings-muted); font-size: 12px; }
.settings-manager-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px 16px; border-top: 1px solid var(--settings-border); color: var(--settings-muted); font-size: 11px; }
.settings-manager-footer nav { display: inline-flex; gap: 4px; }
.settings-manager-footer .btn-icon { border: 1px solid var(--settings-border); border-radius: 7px; color: var(--settings-muted); }
.settings-manager-footer .btn-icon:not(.disabled):hover { color: var(--settings-red); border-color: #f09ca6; background: #fff0f2; }
.settings-modal { overflow: hidden; }
#settingsOptionModal, #settingsDeleteModal { z-index: 1060 !important; opacity: 1 !important; background: rgba(15, 19, 24, .52) !important; }
#settingsOptionModal .modal-dialog, #settingsDeleteModal .modal-dialog { z-index: 1061; filter: none !important; opacity: 1 !important; }
#settingsOptionModal .modal-content, #settingsDeleteModal .modal-content,
#settingsOptionModal .settings-modal, #settingsDeleteModal .settings-modal,
#settingsOptionModal .modal-header, #settingsOptionModal .modal-body, #settingsOptionModal .modal-footer,
#settingsDeleteModal .modal-header, #settingsDeleteModal .modal-body, #settingsDeleteModal .modal-footer { filter: none !important; opacity: 1 !important; background: #fff !important; }
#settingsOptionModal .settings-modal, #settingsDeleteModal .settings-modal { transform: none; }
.settings-modal .modal-header, .settings-modal .modal-footer { border-color: var(--settings-border); }
.settings-modal .modal-header { padding: 18px 22px 14px; }
.settings-modal .modal-body { padding: 20px 22px; }
.settings-modal .modal-footer { padding: 12px 22px 18px; }
.settings-modal .form-label { color: var(--settings-muted); font-size: 10px; }
.settings-modal .form-control, .settings-modal .form-select { height: 40px; color: var(--settings-text); background: #fff; border-color: var(--settings-border); }
.settings-modal .btn-danger { color: #fff; background: var(--settings-red); border-color: var(--settings-red); }
html.dark .settings-page { color: var(--foreground); }
html.dark .settings-page .card,
html.dark .settings-page .settings-category-panel,
html.dark .settings-page .settings-manager,
html.dark .settings-page .settings-modal,
html.dark .settings-kpi,
html.dark .settings-table th,
html.dark .settings-search input,
html.dark .settings-modal .form-control,
html.dark .settings-modal .form-select { background: var(--card) !important; border-color: var(--border) !important; }
html.dark .settings-title-row h1, html.dark .settings-manager-header h2, html.dark .settings-modal h2, html.dark .settings-empty h3, html.dark .settings-table td, html.dark .settings-category-link { color: var(--foreground); }
html.dark .settings-results-head, html.dark .settings-table tbody tr:hover { background: var(--muted); }
html.dark .settings-table th { color: var(--muted-foreground); }
html.dark .settings-kpi-dark { background: var(--settings-red) !important; border-color: var(--settings-red) !important; }

/* Filtros: mantÃ©m leitura confortÃ¡vel em tablets e telas estreitas */
@media (min-width: 1200px) {
  .filter-card .filter-form { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(6, minmax(120px, 1fr)); align-items: end; column-gap: 12px; row-gap: 10px; margin-inline: 0; }
  .filter-card .filter-form > .filter-field { width: auto; min-width: 0; max-width: none; padding-inline: 0; }
  .filter-card .filter-form > .filter-field:first-child { grid-column: span 2; min-width: 0; flex: none; }
  .filter-card .filter-form > .filter-form-actions { grid-column: 1 / -1; width: auto; max-width: none; padding-inline: 0; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .filter-card .filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; column-gap: 12px; row-gap: 12px; margin-inline: 0; }
  .filter-card .filter-form > .filter-field { width: auto; min-width: 0; max-width: none; padding-inline: 0; }
  .filter-card .filter-form > .filter-field:first-child, .filter-card .filter-form > .filter-form-actions { grid-column: 1 / -1; }
  .filter-card .filter-form > .filter-form-actions { width: auto; max-width: none; padding-inline: 0; }
}
@media (max-width: 991.98px) {
  .settings-workspace { grid-template-columns: 1fr; }
  .settings-category-panel { position: static; padding: 14px 12px; }
  .settings-category-list { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
  .settings-category-link { min-width: 175px; }
}
@media (max-width: 767.98px) {
  .settings-title-row { align-items: flex-start; flex-direction: column; }
  .settings-title-row h1 { font-size: 24px; }
  .settings-actions { width: 100%; }
  .settings-actions .btn { flex: 1 1 0; }
  .settings-kpis { grid-template-columns: 1fr; gap: 10px; }
  .settings-manager-header { padding: 18px 16px 14px; }
  .settings-toolbar { align-items: stretch; flex-direction: column; padding-inline: 16px; }
  .settings-toolbar .btn { width: 100%; }
  .settings-results-head { padding-inline: 16px; }
  .settings-table th, .settings-table td { padding-inline: 16px; }
  .settings-manager-footer { padding-inline: 16px; }
}
@media (max-width: 575.98px) {
  .settings-page { gap: 14px; }
  .settings-title-row p { font-size: 12px; }
  .settings-category-link { min-width: 160px; }
  .settings-count { padding-inline: 7px; font-size: 10px; }
  .settings-manager-header { gap: 8px; }
  .settings-manager-header h2 { font-size: 18px; }
  .settings-manager-header p { font-size: 11px; }
  .settings-modal .modal-header, .settings-modal .modal-body, .settings-modal .modal-footer { padding-inline: 16px; }
}

/* Tablet e notebook estreito: o menu vira gaveta sem deixar faixa lateral exposta */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .app-shell.sidebar-collapsed { --sidebar-width: 256px; }
  .app-shell.sidebar-collapsed .app-sidebar { width: 256px; }
  .app-shell.sidebar-collapsed .brand-copy { display: flex; }
  .app-shell.sidebar-collapsed .sidebar-section-label { display: block; }
  .app-shell.sidebar-collapsed .sidebar-nav-item span,
  .app-shell.sidebar-collapsed .sidebar-collapse-button span { display: inline; }
  .app-shell.sidebar-collapsed .sidebar-brand-strip { justify-content: flex-start; padding-inline: 12px; }
  .app-shell.sidebar-collapsed .brand-logo { width: 104px; flex-basis: 104px; place-items: center start; border-right: 1px solid rgba(255, 255, 255, .4); }
  .app-shell.sidebar-collapsed .brand-logo img { width: 96px; }
  .app-shell.sidebar-collapsed .sidebar-nav { padding-inline: 12px; }
  .app-shell.sidebar-collapsed .sidebar-nav-item { justify-content: flex-start; padding: 10px 12px; }
  .app-shell.sidebar-collapsed .sidebar-collapse-button { justify-content: flex-start; padding-inline: 12px; }
  .app-shell.sidebar-collapsed .sidebar-collapse-button svg { transform: none; }
  .app-topbar { padding-inline: 16px; }
  .mobile-menu-button { display: inline-flex !important; width: 34px; min-width: 34px; margin-left: 0; flex: 0 0 34px; }
  .settings-page { gap: 16px; }
  .settings-title-row { gap: 12px; }
  .settings-title-row h1 { font-size: 26px; }
  .settings-manager-header, .settings-toolbar { padding-inline: 20px; }
  .settings-results-head, .settings-table th, .settings-table td, .settings-manager-footer { padding-inline: 20px; }
}

/* O item Filial e os demais itens nunca ultrapassam o cartÃ£o pai */
.settings-category-panel,
.settings-category-list { width: 100%; max-width: 100%; box-sizing: border-box; }
.settings-category-link { width: 100%; min-width: 0; box-sizing: border-box; }
.record-form #filial,
.filter-card #filial { width: 100%; min-width: 0; max-width: 100%; }
@media (max-width: 991.98px) {
  .settings-category-list { flex-wrap: nowrap; }
  .settings-category-link { width: 175px; min-width: 175px; flex: 0 0 175px; }
}
@media (max-width: 575.98px) {
  .settings-category-link { width: 160px; min-width: 160px; flex-basis: 160px; }
}

/* Tabela de listas compacta: a altura fica definida pelo conteÃºdo, nÃ£o pelo botÃ£o */
.settings-table thead tr { height: 38px; }
.settings-table tbody tr { height: 44px; }
.settings-table th { padding-block: 7px; line-height: 1.2; }
.settings-table td { height: 44px; padding-block: 5px; line-height: 1.25; }
.settings-page .settings-row-actions .btn-icon { min-height: 28px; height: 28px; }

/* Mobile: nenhum componente da tela de ConfiguraÃ§Ãµes cria rolagem horizontal */
@media (max-width: 767.98px) {
  .settings-category-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; overflow: visible; }
  .settings-category-link,
  .settings-category-link:first-child,
  .settings-category-link:last-child { width: auto; min-width: 0; flex: 1 1 calc(50% - 6px); }
  .settings-table-wrap { overflow: visible; }
  .settings-table { width: 100%; min-width: 0; table-layout: fixed; }
  .settings-table th, .settings-table td { padding-inline: 10px; }
  .settings-table th:first-child, .settings-table td:first-child { width: 42px; }
  .settings-table th:last-child, .settings-table td:last-child { width: 78px; }
  .settings-table td:nth-child(2) { overflow-wrap: anywhere; white-space: normal; }
  .settings-row-actions { gap: 0; }
}

/* Quando o menu lateral reduz a largura Ãºtil, reorganiza os filtros antes de comprimir os textos */
@media (min-width: 1200px) and (max-width: 1499.98px) {
  .filter-card .filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; column-gap: 12px; row-gap: 12px; }
  .filter-card .filter-form > .filter-field { width: auto; min-width: 0; max-width: none; padding-inline: 0; }
  .filter-card .filter-form > .filter-field:first-child,
  .filter-card .filter-form > .filter-form-actions { grid-column: 1 / -1; }
  .filter-card .filter-form > .filter-form-actions { width: auto; max-width: none; padding-inline: 0; }
}
@media (min-width: 1500px) {
  .filter-card .filter-form { grid-template-columns: minmax(280px, 2fr) repeat(5, minmax(145px, 1fr)); }
  .filter-card .filter-form > .filter-field { min-width: 0; }
}
@media (min-width: 768px) and (max-width: 1499.98px) {
  .filter-card .filter-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filter-card .filter-form > .filter-field:first-child { grid-column: 1 / span 2; }
  .filter-card .filter-form > .filter-field:nth-child(2) { grid-column: 3; }
  .filter-card .filter-form > .filter-field:nth-child(3) { grid-column: 4; }
  .filter-card .filter-form > .filter-field:nth-child(4) { grid-column: 1; }
  .filter-card .filter-form > .filter-field:nth-child(5) { grid-column: 2; }
  .filter-card .filter-form > .filter-field:nth-child(6) { grid-column: 3; }
  .filter-card .filter-form > .filter-field:nth-child(7) { grid-column: 4; grid-row: 2; }
  .filter-card .filter-form > .filter-field:nth-child(8) { grid-column: 1 / span 2; grid-row: 3; }
  .filter-card .filter-form > .filter-form-actions { grid-column: 3 / span 2; grid-row: 3; width: auto; max-width: none; padding-inline: 0; white-space: nowrap; }
}
@media (min-width: 1500px) {
  .filter-card .filter-form { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .filter-card .filter-form > .filter-field:first-child { grid-column: 1 / span 2; }
  .filter-card .filter-form > .filter-field:nth-child(2) { grid-column: 3; }
  .filter-card .filter-form > .filter-field:nth-child(3) { grid-column: 4; }
  .filter-card .filter-form > .filter-field:nth-child(4) { grid-column: 5; }
  .filter-card .filter-form > .filter-field:nth-child(5) { grid-column: 6; }
  .filter-card .filter-form > .filter-field:nth-child(6) { grid-column: 1 / span 2; grid-row: 2; }
  .filter-card .filter-form > .filter-field:nth-child(7) { grid-column: 3 / span 2; grid-row: 2; }
  .filter-card .filter-form > .filter-field:nth-child(8) { grid-column: 5 / span 2; grid-row: 2; }
  .filter-card .filter-form > .filter-form-actions { grid-column: 5 / span 2; grid-row: 3; width: auto; max-width: none; padding-inline: 0; white-space: nowrap; }
}
.filter-card .form-select, .filter-card .form-control { min-width: 0; }
