:root {
    --bg: #f3f7f5;
    --surface: #ffffff;
    --line: #e3ebe7;
    --ink: #172d2c;
    --muted: #71827e;
    --muted-2: #9baaa5;
    --navy: #102d2c;
    --blue: #0d8178;
    --blue-dark: #076d66;
    --green: #168366;
    --orange: #dc963d;
    --red: #ca665b;
    --shadow: 0 10px 30px rgba(23, 53, 48, .055), 0 2px 5px rgba(23, 53, 48, .025);
}

html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font-size: 14px; }
.sidebar { background: linear-gradient(165deg, #102d2c 0%, #123936 58%, #102b2b 100%); border-right: 1px solid #234846; box-shadow: 8px 0 32px rgba(20, 49, 46, .08); padding: 25px 16px 14px; }
.brand { margin-bottom: 30px; }
.brand-mark { background: #d9f5e9; color: #087b6c; box-shadow: 0 5px 16px rgba(5, 24, 25, .16); }
.brand-name { color: #f4fbf8; }
.brand-name > span { color: #79dfbb; }
.brand-name small { color: #8ca9a2; }
.company-switcher { background: rgba(255,255,255,.065); border-color: rgba(208,237,226,.11); }
.company-avatar { background: #d6f2e6; color: #0a7467; }
.company-copy b, .profile-copy b { color: #eef8f4; }
.company-copy small, .profile-copy small { color: #9ab4ad; }
.chevron { color: #9ab4ad; }
.nav-label { color: #7f9a94; }
.nav-item { color: #bacbc6; min-height: 40px; }
.nav-item:hover { background: rgba(228,248,239,.09); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(57,171,139,.25), rgba(57,171,139,.11)); box-shadow: inset 3px 0 #75dfb7; color: #e9fff5; }
.nav-icon, .nav-item.active .nav-icon { color: #99c8b8; }
.live-dot { background: #69e0ad; border-color: #214c43; box-shadow: 0 0 0 3px rgba(105,224,173,.1); }
.nav-count { background: #254945; color: #bed5ce; }
.help-card { background: rgba(255,255,255,.065); border-color: rgba(208,237,226,.1); }
.help-icon { background: #285850; color: #8be0bd; }
.help-card b { color: #e8f4ef; }
.help-card small { color: #99b2aa; }
.profile-button { border-color: rgba(208,237,226,.14); }
.profile-avatar { background: #f3d9bf; color: #895a32; }
.logout-button { color: #aac0ba; }
.logout-button:hover { color: #fff; }
.main-area { background: var(--bg); }
.topbar { background: rgba(255,255,255,.94); border-bottom-color: #e1eae6; box-shadow: 0 3px 18px rgba(30,62,55,.025); height: 68px; }
.breadcrumbs b { color: #314c47; }
.global-search { background: #f4f8f6; border-color: #e6eeea; }
.global-search:focus-within { background: #fff; border-color: #8fcdb5; box-shadow: 0 0 0 3px rgba(77,174,135,.1); }
.global-search input { font-size: 11px; }
.topbar-divider { background: #e0e9e5; }
.date-button { color: #60746e; font-size: 11px; }
.content-wrap { padding-top: 31px; }
.eyebrow { color: #718c82; font-size: 10px; letter-spacing: 1.35px; }
.eyebrow-line { background: #35a780; height: 3px; width: 16px; }
h1 { color: #173633; font-size: 27px; letter-spacing: -.9px; }
.page-heading p { color: #748680; font-size: 12px; }
.button { border-radius: 9px; font-size: 11px; height: 38px; padding: 0 15px; }
.button-primary { background: #0c8277; box-shadow: 0 5px 13px rgba(12,130,119,.18); }
.button-primary:hover { background: #096f66; box-shadow: 0 7px 17px rgba(12,130,119,.24); }
.button-quiet { border-color: #dce7e2; color: #526b64; }
.button-quiet:hover { background: #f4faf7; border-color: #b8d6c9; }
.metric-grid { gap: 16px; margin-bottom: 20px; }
.metric-card { border: 1px solid #e3ebe7; border-radius: 14px; box-shadow: var(--shadow); min-height: 132px; padding: 18px 18px 15px; position: relative; transition: box-shadow .18s ease, transform .18s ease; }
.metric-card::before { background: #0d8178; border-radius: 14px 14px 0 0; content: ""; height: 3px; inset: 0 14px auto; position: absolute; }
.metric-card:nth-child(2)::before { background: #e3a44c; }
.metric-card:nth-child(3)::before { background: #35a77d; }
.metric-card:nth-child(4)::before { background: #7a83c7; }
.metric-card:hover { box-shadow: 0 15px 34px rgba(23,53,48,.09); transform: translateY(-2px); }
.metric-label { color: #687e77; font-size: 11px; }
.metric-icon { border-radius: 9px; height: 32px; width: 32px; }
.icon-blue { background: #e2f3ee; color: #0c8177; }
.icon-orange { background: #fff3df; color: #bd7e2d; }
.icon-green { background: #e1f3e9; color: #218460; }
.icon-violet { background: #eeedfb; color: #6d70ad; }
.metric-value { color: #193a35; font-size: 25px; margin: 12px 0 9px; }
.metric-foot { color: #80918b; font-size: 10px; }
.trend { font-size: 10px; }
.dashboard-grid { gap: 17px; margin-bottom: 19px; }
.panel { border-color: #e2ebe6; border-radius: 14px; box-shadow: var(--shadow); }
.panel-heading { padding: 20px 21px 16px; }
.panel-heading h2 { color: #23433c; font-size: 14px; }
.panel-heading p { color: #83938d; font-size: 10px; }
.count-badge { background: #e6f4ee; color: #267c61; }
.text-link { color: #087d72; font-size: 10px; }
.text-link:hover { color: #075e56; }
.data-table thead th { background: #f4f8f6; color: #70867e; font-size: 9px; letter-spacing: .075em; }
.data-table td { color: #5c7069; font-size: 10px; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #f7fbf9; }
.table-id { color: #294a42; font-size: 10px; }
.table-sub, .route-cell { color: #83958e; font-size: 9px; }
.route-dot { background: #51b28d; box-shadow: 0 0 0 3px #e5f5ed; }
.route-sep { color: #9eb0aa; }
.status-badge { border-radius: 999px; font-size: 9px; padding: 5px 9px; }
.status-running, .status-started, .status-in-transit { background: #e2f3ef; color: #08776e; }
.status-scheduled, .status-pending, .status-assigned, .status-partial, .status-partially-delivered, .status-on-hold { background: #fff3df; color: #a96c22; }
.status-completed, .status-delivered, .status-paid, .status-active, .status-available, .status-approved { background: #e1f4e9; color: #167451; }
.status-delayed, .status-overdue, .status-damaged, .status-rejected, .status-failed { background: #fff0ec; color: #b85549; }
.status-paused, .status-cancelled, .status-inactive, .status-maintenance, .status-on-leave, .status-in-progress { background: #edf1ef; color: #687b74; }
.dashboard-inline-stats { border-color: #e6eeea; color: #7c8e87; font-size: 10px; gap: 22px; padding: 14px 21px; }
.dashboard-inline-stats b { color: #34574c; font-size: 11px; }
.activity-panel { padding-bottom: 4px; }
.activity-content p b { color: #405d52; }
.activity-time, .activity-content small { color: #92a19a; }
.activity-finance { border-color: #e5eeea; }
.activity-finance small { color: #84958e; font-size: 9px; }
.activity-finance b { color: #1c6857; font-size: 15px; }
.page-footer { color: #91a19a; font-size: 9px; }
.footer-status { background: #39aa7d; box-shadow: 0 0 0 3px #e1f4e9; }
.resource-panel { overflow: hidden; }
.module-toolbar { background: #fafcfb; border-bottom-color: #e7efeb; padding: 13px 17px; }
.module-search { background: #fff; border-color: #e2ebe6; border-radius: 8px; height: 36px; }
.module-search:focus-within { border-color: #9acbb8; box-shadow: 0 0 0 3px rgba(57,170,125,.1); }
.module-search input, .filter-select { color: #425f55; font-size: 10px; }
.filter-select { border-color: #e2ebe6; border-radius: 8px; height: 36px; }
.module-count { color: #7c9088; font-size: 10px; }
.form-panel { border-radius: 15px; }
.resource-form-grid { gap: 16px 15px; padding: 0 25px 22px; }
.form-intro { border-color: #e7efeb; margin: 0 25px 20px; padding: 22px 0 16px; }
.form-intro h2 { color: #23463d; font-size: 15px; }
.form-intro p { color: #7d9188; font-size: 10px; }
.form-step { color: #16856c; font-size: 9px; }
.form-field label { color: #526b61; font-size: 10px; }
.form-field input, .form-field select, .form-field textarea { background: #fbfdfc; border-color: #dfe9e4; border-radius: 8px; color: #304e44; font-size: 11px; min-height: 39px; }
.form-field textarea { min-height: 95px; padding: 11px 12px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #67b99a; box-shadow: 0 0 0 3px rgba(57,170,125,.12); }
.form-footer { border-color: #e7efeb; margin: 0 25px; padding: 17px 0 21px; }
.flash-success { background: #e9f7f0; border-color: #cdebdc; color: #267654; }
.flash-error { background: #fff1ec; border-color: #f1d4c9; color: #a65145; }
.pagination-nav { gap: 12px; }
.page-link { color: #087d72; font-size: 9px; }
.page-count { font-size: 9px; }

/* GPS control center */
.tracking-heading { align-items: center; }
.tracking-refresh { align-items: center; background: #e7f5ed; border: 1px solid #d5eddf; border-radius: 12px; color: #267a5a; display: flex; gap: 11px; padding: 10px 14px; }
.refresh-orbit { align-items: center; animation: refresh-turn 7s linear infinite; background: #d3efdf; border-radius: 10px; color: #168360; display: flex; font-size: 21px; height: 38px; justify-content: center; width: 38px; }
.tracking-refresh b, .tracking-refresh small { display: block; }
.tracking-refresh b { color: #276b53; font-size: 10px; }
.tracking-refresh small { color: #6f9783; font-size: 9px; margin-top: 3px; }
.gps-summary-grid { display: grid; gap: 13px; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 17px; }
.gps-summary-card { align-items: center; background: #fff; border: 1px solid #e1ebe6; border-radius: 13px; box-shadow: var(--shadow); display: grid; gap: 0 12px; grid-template-columns: 42px minmax(0,1fr); min-height: 100px; padding: 15px 16px; position: relative; }
.gps-summary-icon { align-items: center; border-radius: 12px; display: flex; font-size: 18px; grid-row: span 2; height: 42px; justify-content: center; width: 42px; }
.icon-teal { background: #e2f3ef; color: #087b70; }
.icon-mint { background: #e1f4e8; color: #19815e; }
.icon-amber { background: #fff2dd; color: #b77a2e; }
.icon-navy { background: #e9eff3; color: #39566a; }
.gps-summary-card small { color: #7a8e85; display: block; font-size: 9px; margin-bottom: 5px; }
.gps-summary-card strong { color: #21483e; display: block; font: 700 21px/1.1 "Manrope",sans-serif; }
.gps-summary-caption { color: #94a39c; font-size: 8px; grid-column: 2; margin-top: 6px; }
.gps-last-report strong { font-size: 14px; }
.tracking-panel-live { border-radius: 15px; }
.tracking-panel-heading { padding: 19px 21px 15px; }
.tracking-panel-heading .panel-title-row { gap: 10px; }
.live-pill { align-items: center; background: #e3f5eb; border: 1px solid #d1eddf; border-radius: 99px; color: #2a805e; display: inline-flex; font-size: 8px; font-weight: 800; gap: 6px; letter-spacing: .06em; padding: 5px 8px; }
.live-pill i { animation: signal-pulse 1.8s ease-out infinite; background: #36a879; border-radius: 50%; height: 6px; width: 6px; }
.gps-vehicle-cell { align-items: center; display: flex; gap: 10px; }
.gps-vehicle-cell > span:last-child { display: grid; gap: 4px; }
.gps-vehicle-cell b { color: #2e4e44; font-size: 10px; }
.gps-vehicle-cell small { color: #91a099; font-size: 8px; }
.gps-truck-icon { align-items: center; background: #e8f4ef; border-radius: 9px; color: #14816f; display: flex; font-size: 15px; height: 34px; justify-content: center; width: 34px; }
.coordinate-link { align-items: center; color: #087b70; display: inline-flex; font-size: 10px; gap: 5px; }
.coordinate-link:hover { color: #07584f; }
.location-pin { color: #d58d35; font-size: 15px; }
.speed-reading { background: #f1f7f4; border-radius: 7px; color: #48665b; display: inline-block; font-size: 9px; padding: 5px 7px; }
.connection-badge { align-items: center; border-radius: 99px; display: inline-flex; font-size: 9px; font-weight: 700; gap: 6px; padding: 6px 9px; white-space: nowrap; }
.connection-badge i { border-radius: 50%; height: 6px; width: 6px; }
.connection-badge.is-online { background: #e5f5eb; color: #24754f; }
.connection-badge.is-online i { background: #36a879; box-shadow: 0 0 0 3px #d3efdf; }
.connection-badge.is-waiting { background: #f2f4f2; color: #71827b; }
.connection-badge.is-waiting i { background: #a9b4ae; }
.table-bottom { border-top-color: #e8efec; color: #87978f; font-size: 9px; }
.gps-how-panel { margin-top: 17px; overflow: hidden; padding: 22px; }
.gps-how-header { align-items: flex-start; display: flex; justify-content: space-between; }
.gps-how-header h2 { color: #20433a; font: 700 16px "Manrope",sans-serif; letter-spacing: -.35px; margin: 7px 0 6px; }
.gps-how-header p { color: #7b8f86; font-size: 10px; line-height: 1.6; margin: 0; max-width: 600px; }
.gps-lock { align-items: center; background: #f0f7f3; border: 1px solid #e1eee7; border-radius: 9px; color: #267855; display: inline-flex; font-size: 11px; gap: 7px; padding: 8px 10px; white-space: nowrap; }
.gps-lock b { font-size: 9px; }
.gps-flow { align-items: center; display: grid; gap: 11px; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; margin: 22px 0 18px; }
.gps-flow-step { background: #f8fbf9; border: 1px solid #e5eee9; border-radius: 11px; display: grid; gap: 8px; grid-template-columns: 34px minmax(0,1fr); min-height: 84px; padding: 12px; position: relative; }
.gps-flow-number { color: #9aafa6; font: 700 8px "DM Sans",sans-serif; position: absolute; right: 10px; top: 8px; }
.gps-flow-icon { align-items: center; background: #e6f4ed; border-radius: 9px; color: #178066; display: flex; font-size: 17px; grid-row: span 2; height: 34px; justify-content: center; width: 34px; }
.gps-flow-step:nth-of-type(2) .gps-flow-icon { background: #fff1dc; color: #b8792c; }
.gps-flow-step:nth-of-type(3) .gps-flow-icon { background: #e9eef4; color: #4d687e; }
.gps-flow-step div { align-self: center; display: grid; gap: 5px; }
.gps-flow-step b { color: #34574b; font-size: 9px; }
.gps-flow-step small { color: #879991; font-size: 8px; line-height: 1.4; }
.gps-flow-arrow { color: #86ac99; font-size: 17px; }
.gps-api-strip { align-items: center; background: linear-gradient(100deg, #eff8f2, #f5f8f5); border: 1px solid #e0eee5; border-radius: 10px; display: flex; gap: 12px; justify-content: space-between; padding: 12px 14px; }
.gps-api-strip > div { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.api-method { background: #d8f0e2; border-radius: 5px; color: #207854; font-size: 8px; font-weight: 800; letter-spacing: .04em; padding: 5px 7px; }
.gps-api-strip code { background: #fff; border: 1px solid #e3ece6; border-radius: 5px; color: #3b6554; font-size: 9px; padding: 5px 7px; }
.gps-api-strip small, .gps-refresh-note { color: #71877d; font-size: 8px; }
.gps-api-strip small b { color: #3b6654; }
.gps-refresh-note { white-space: nowrap; }

.report-filters, .summary-card, .report-card { border-color: #e2ebe6; border-radius: 12px; box-shadow: var(--shadow); }
.report-filters { padding: 16px; }
.report-filters input { border-color: #dfe9e4; border-radius: 8px; height: 37px; }
.form-errors { border-radius: 10px; font-size: 11px; }
.field-error { font-size: 10px; }
.field-help { font-size: 10px; }
.row-edit, .mini-action, .row-delete { font-size: 9px; }
.mini-action { color: #117a5d; }
.row-delete { color: #b7574e; }
.page-footer { padding-top: 19px; }

.auth-page { background: radial-gradient(ellipse at 18% 15%, rgba(93,205,157,.26), transparent 34%), radial-gradient(ellipse at 88% 84%, rgba(222,162,80,.16), transparent 30%), linear-gradient(135deg,#102d2c,#174541 65%,#102e31); overflow: hidden; position: relative; }
.auth-page::before { background-image: radial-gradient(rgba(228,249,239,.17) .8px, transparent .8px); background-size: 22px 22px; content: ""; inset: 0; opacity: .17; pointer-events: none; position: fixed; }
.auth-card { border: 1px solid rgba(255,255,255,.72); border-radius: 19px; box-shadow: 0 30px 80px rgba(4,25,24,.28); max-width: 440px; padding: 36px; position: relative; }
.auth-brand { margin-bottom: 30px; }
.auth-brand .brand-name { color: #193d36; }
.auth-brand .brand-name > span { color: #0c8d75; }
.auth-brand .brand-name small { color: #789187; }
.auth-kicker { color: #208468; font-size: 9px; letter-spacing: 1.4px; }
.auth-card h1 { color: #1c3b34; font-size: 25px; }
.auth-subtitle { color: #7d9087; font-size: 11px; }
.auth-form { gap: 9px; }
.auth-form > label:not(.remember-row) { color: #506b60; font-size: 10px; }
.auth-form > input { border-color: #dfe9e3; border-radius: 8px; height: 42px; }
.auth-form > input:focus { border-color: #6fbea0; box-shadow: 0 0 0 3px #e8f6ee; }
.auth-submit { height: 42px; margin-top: 5px; }
.auth-foot { border-color: #e8efeb; color: #879890; font-size: 9px; }

@keyframes signal-pulse { 0% { box-shadow: 0 0 0 0 rgba(54,168,121,.35); } 70%,100% { box-shadow: 0 0 0 5px rgba(54,168,121,0); } }
@keyframes refresh-turn { to { transform: rotate(360deg); } }

@media (max-width: 1150px) {
    .gps-summary-grid { gap: 10px; }
    .gps-summary-card { gap: 0 9px; padding: 13px 12px; }
    .gps-flow { gap: 7px; }
    .gps-flow-step { padding: 10px; }
}
@media (max-width: 900px) {
    .sidebar { background: linear-gradient(165deg, #102d2c 0%, #123936 58%, #102b2b 100%); }
    .gps-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .gps-flow { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .gps-flow-arrow { display: none; }
}
@media (max-width: 680px) {
    .topbar { height: 60px; }
    .content-wrap { padding: 24px 15px 14px; }
    .page-heading h1 { font-size: 24px; }
    .metric-card { min-height: 118px; padding: 15px 13px 11px; }
    .dashboard-inline-stats { font-size: 9px; gap: 11px; padding: 13px 14px; }
    .activity-panel { display: block; }
    .tracking-heading { align-items: flex-start; }
    .tracking-refresh { align-self: stretch; }
    .gps-summary-grid { gap: 9px; }
    .gps-summary-card { grid-template-columns: 34px minmax(0,1fr); min-height: 92px; padding: 12px 10px; }
    .gps-summary-icon { border-radius: 9px; height: 32px; width: 32px; font-size: 15px; }
    .gps-summary-card strong { font-size: 18px; }
    .gps-last-report strong { font-size: 12px; }
    .gps-summary-card small { font-size: 8px; }
    .gps-summary-caption { font-size: 7px; }
    .tracking-panel-heading { align-items: flex-start; gap: 8px; }
    .tracking-panel-heading .panel-title-row { align-items: flex-start; flex-direction: column; gap: 7px; }
    .tracking-panel-heading .module-count { white-space: nowrap; }
    .gps-how-panel { padding: 17px 14px; }
    .gps-how-header { gap: 12px; flex-direction: column; }
    .gps-lock { align-self: flex-start; }
    .gps-flow { align-items: stretch; grid-template-columns: 1fr; margin: 18px 0 14px; }
    .gps-flow-step { min-height: 70px; }
    .gps-flow-arrow { justify-self: center; line-height: 12px; transform: rotate(90deg); }
    .gps-flow-arrow { display: block; }
    .gps-api-strip { align-items: flex-start; flex-direction: column; }
    .gps-refresh-note { white-space: normal; }
    .report-filters { border-radius: 11px; }
    .auth-card { padding: 29px 23px; }
}

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