:root {
    --fleet-ink: #183245;
    --fleet-accent: #ff7a45;
    --fleet-accent-strong: #f05b2a;
    --fleet-secondary: #23c4a0;
    --fleet-sand: #f3f8fd;
    --fleet-surface: #ffffff;
    --fleet-line: #d8e3ec;
    --fleet-shadow: 0 22px 48px rgba(24, 50, 69, 0.1);
    --fleet-soft: #f7fbff;
    --fleet-navy: #17354b;
    --fleet-success: #1f8b64;
    --fleet-muted: #6b7b88;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container,
.container-fluid {
    width: 100%;
    margin-inline: auto;
    padding-inline: 0.75rem;
}

.container {
    max-width: 1200px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
    margin-top: calc(var(--bs-gutter-y, 0) * -1);
}

.row > * {
    width: 100%;
    max-width: 100%;
    padding-inline: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    margin-top: var(--bs-gutter-y, 0);
}

.g-2 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.col-12 {
    flex: 0 0 auto;
    width: 100%;
}

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 auto;
        width: 33.333333%;
    }

    .col-lg-5 {
        flex: 0 0 auto;
        width: 41.666667%;
    }

    .col-lg-7 {
        flex: 0 0 auto;
        width: 58.333333%;
    }

    .col-lg-8 {
        flex: 0 0 auto;
        width: 66.666667%;
    }
}

.d-grid {
    display: grid;
}

.d-flex {
    display: flex;
}

.d-inline-flex {
    display: inline-flex;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.small,
small {
    font-size: 0.875em;
}

.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--fleet-navy);
    line-height: 1.2;
}

.h3 {
    font-size: 1.75rem;
}

.h4 {
    font-size: 1.5rem;
}

.h5 {
    font-size: 1.25rem;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: end;
}

.text-secondary {
    color: var(--fleet-muted) !important;
}

.fw-semibold {
    font-weight: 600;
}

.align-middle {
    vertical-align: middle;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.me-auto {
    margin-inline-end: auto;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.h-100 {
    height: 100%;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(24, 50, 69, 0.08);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--fleet-navy);
}

.form-text {
    margin-top: 0.35rem;
    color: var(--fleet-muted);
    font-size: 0.875rem;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.form-check-label {
    color: var(--fleet-navy);
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 1rem;
}

.alert-success {
    background: rgba(31, 139, 100, 0.12);
    color: #166548;
}

.alert-danger {
    background: rgba(200, 68, 68, 0.12);
    color: #963636;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.text-bg-success {
    background: rgba(31, 139, 100, 0.14);
    color: #166548;
}

.text-bg-secondary {
    background: rgba(107, 123, 136, 0.14);
    color: #566572;
}

.text-bg-warning {
    background: rgba(240, 91, 42, 0.14);
    color: #a44722;
}

hr {
    border: 0;
    border-top: 1px solid rgba(24, 50, 69, 0.1);
    margin: 1.25rem 0;
}

body {
    background:
        radial-gradient(circle at top right, rgba(255, 122, 69, 0.17), transparent 24%),
        radial-gradient(circle at left top, rgba(35, 196, 160, 0.16), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%);
    color: #223545;
    min-height: 100vh;
    font-family: "Fira Sans", "Segoe UI", sans-serif;
    position: relative;
}

.fleet-nav {
    background: linear-gradient(135deg, #17354b 0%, #23607e 100%);
    box-shadow: 0 14px 34px rgba(24, 50, 69, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
}

.fleet-main {
    padding-inline: 1rem;
    position: relative;
    z-index: 1;
}

.fleet-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.fleet-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(60px);
    opacity: 0.45;
}

.fleet-glow-one {
    width: 380px;
    height: 380px;
    background: rgba(255, 122, 69, 0.18);
    top: -120px;
    right: -90px;
}

.fleet-glow-two {
    width: 260px;
    height: 260px;
    background: rgba(35, 196, 160, 0.14);
    left: -80px;
    top: 140px;
}

.fleet-body .panel-card,
.hero-panel,
.login-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(24, 50, 69, 0.08);
    border-radius: 24px;
}

.panel-card,
.hero-panel {
    padding: 1.5rem;
    box-shadow: var(--fleet-shadow);
}

.panel-card {
    position: relative;
    overflow: hidden;
}

.panel-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 38%);
    pointer-events: none;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem;
}

.hero-panel-dashboard {
    background:
        linear-gradient(135deg, rgba(255, 248, 244, 0.98) 0%, rgba(242, 251, 248, 0.98) 100%);
}

.hero-copy {
    min-width: 0;
}

.hero-title {
    font-size: clamp(1.8rem, 2vw + 1rem, 3rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--fleet-navy);
    max-width: 14ch;
}

.hero-text {
    max-width: 58ch;
}

.hero-action {
    white-space: nowrap;
}

.hero-actions,
.fleet-nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.hero-tag,
.subtle-badge,
.status-chip,
.zone-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.hero-tag,
.subtle-badge {
    background: rgba(23, 53, 75, 0.08);
    color: var(--fleet-navy);
    border: 1px solid rgba(23, 53, 75, 0.08);
}

.status-chip {
    background: rgba(255, 255, 255, 0.14);
    color: #f7fbff;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 0 0.2rem rgba(74, 222, 128, 0.16);
}

.zone-pill {
    background: rgba(35, 196, 160, 0.13);
    color: #13775f;
    padding: 0.32rem 0.65rem;
}

.map-shell {
    height: 560px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--fleet-line);
}

.map-panel,
.side-panel {
    height: 100%;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    color: var(--fleet-accent-strong);
    font-weight: 700;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-family: "Fira Code", "Cascadia Code", monospace;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.14);
    color: #fff8ef;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    font-family: "Fira Sans", "Segoe UI", sans-serif;
}

.brand-copy small {
    font-size: 0.72rem;
    opacity: 0.72;
    font-weight: 500;
}

.fleet-nav-links {
    gap: 0.2rem;
}

.fleet-nav-links .nav-link {
    border-radius: 999px;
    padding: 0.55rem 0.85rem !important;
    color: rgba(255, 247, 236, 0.85);
    border: 1px solid transparent;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.fleet-nav-links .nav-link:hover,
.fleet-nav-links .nav-link:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #fffefb;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.12);
}

.fleet-nav-links .nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 0.5rem 0.65rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.18);
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-shell {
    width: min(100%, 460px);
}

.login-card {
    padding: 2rem;
}

.code-box {
    font-family: "Cascadia Code", "Courier New", monospace;
}

.vehicle-chip {
    border: 1px solid var(--fleet-line);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 250, 255, 0.92) 100%);
    display: grid;
    gap: 0.9rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.vehicle-chip strong {
    display: block;
    color: var(--fleet-navy);
}

.vehicle-chip-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.vehicle-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.85rem;
}

.vehicle-chip-grid span {
    display: grid;
    gap: 0.12rem;
}

.vehicle-chip-grid label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fleet-muted);
}

.preview-thumb {
    width: 160px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--fleet-line);
    box-shadow: 0 12px 24px rgba(24, 50, 69, 0.12);
}

.geofence-raw {
    white-space: pre-wrap;
    font-family: "Cascadia Code", "Courier New", monospace;
    background: rgba(23, 53, 75, 0.05);
    border-radius: 12px;
    padding: 0.75rem;
}

.vehicle-chip-highlight {
    border-color: var(--fleet-accent);
    background: rgba(255, 122, 69, 0.12);
}

.action-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.action-row > * {
    flex: 0 0 auto;
}

.action-row-split > * {
    flex: 1 1 220px;
}

.compact-actions form,
.compact-actions a {
    margin: 0;
}

.action-cluster {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.action-cluster > * {
    flex: 0 0 auto;
}

.table-stack-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    position: relative;
    z-index: 1;
}

.panel-head-spaced {
    align-items: center;
}

.empty-copy {
    padding: 0.85rem 0.2rem;
}

.fleet-alert {
    border-radius: 18px;
    border: 0;
    box-shadow: 0 12px 28px rgba(24, 50, 69, 0.09);
}

.fleet-table th {
    white-space: nowrap;
    color: #6a7c8d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.fleet-table td,
.fleet-table th {
    vertical-align: middle;
}

.fleet-table tbody tr {
    transition: background-color 180ms ease, transform 180ms ease;
}

.fleet-table tbody tr:hover {
    background: rgba(35, 196, 160, 0.06);
}

.mobile-inline-form {
    display: inline-flex;
}

.btn {
    border-radius: 14px;
    min-height: 2.75rem;
    font-weight: 600;
    padding-inline: 1rem;
    border-width: 1px;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.navbar-toggler:focus-visible {
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--fleet-accent) 0%, var(--fleet-accent-strong) 100%);
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(255, 122, 69, 0.22);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: linear-gradient(135deg, #ff8657 0%, #ef6437 100%);
    box-shadow: 0 16px 30px rgba(255, 122, 69, 0.28);
}

.btn-outline-primary {
    color: var(--fleet-navy);
    border-color: rgba(23, 53, 75, 0.14);
    background: rgba(35, 196, 160, 0.08);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    color: var(--fleet-navy);
    border-color: rgba(35, 196, 160, 0.32);
    background: rgba(35, 196, 160, 0.16);
    box-shadow: 0 12px 24px rgba(35, 196, 160, 0.14);
}

.btn-outline-secondary {
    color: var(--fleet-navy);
    border-color: rgba(23, 53, 75, 0.14);
    background: rgba(23, 53, 75, 0.05);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    color: var(--fleet-navy);
    border-color: rgba(23, 53, 75, 0.24);
    background: rgba(23, 53, 75, 0.11);
    box-shadow: 0 12px 24px rgba(24, 50, 69, 0.12);
}

.btn-outline-danger {
    color: #b84040;
    border-color: rgba(184, 64, 64, 0.18);
    background: rgba(184, 64, 64, 0.06);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
    color: #a63232;
    border-color: rgba(184, 64, 64, 0.28);
    background: rgba(184, 64, 64, 0.12);
    box-shadow: 0 12px 24px rgba(184, 64, 64, 0.12);
}

.btn-dark {
    background: linear-gradient(135deg, #17354b 0%, #1f5b73 100%);
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(24, 50, 69, 0.22);
}

.btn-dark:hover,
.btn-dark:focus-visible {
    background: linear-gradient(135deg, #1a4059 0%, #246783 100%);
    box-shadow: 0 16px 30px rgba(24, 50, 69, 0.28);
}

.btn-sm {
    min-height: 2.35rem;
}

.form-control,
.form-select {
    min-height: 3rem;
    border-radius: 14px;
    border-color: rgba(24, 50, 69, 0.12);
    background: rgba(249, 252, 255, 0.96);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(35, 196, 160, 0.46);
    box-shadow: 0 0 0 0.22rem rgba(35, 196, 160, 0.14);
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.18rem;
}

@media (max-width: 991.98px) {
    .hero-panel {
        align-items: flex-start;
    }

    .map-shell {
        height: 420px;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.96rem;
    }

    .fleet-main {
        padding-inline: 0.75rem;
    }

    .panel-card,
    .hero-panel,
    .login-card {
        padding: 1rem;
        border-radius: 20px;
    }

    .hero-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-title {
        max-width: none;
        font-size: 1.9rem;
    }

    .action-row,
    .hero-actions,
    .fleet-nav-actions {
        width: 100%;
    }

    .action-row:not(.action-row-split) > *,
    .hero-actions > * {
        width: 100%;
    }

    .action-row.action-row-split {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .action-row.action-row-split > * {
        width: 100%;
        min-width: 0;
    }

    .action-row .btn,
    .action-cluster .btn,
    .mobile-inline-form .btn,
    .hero-actions .btn {
        width: 100%;
    }

    .hero-tags {
        gap: 0.45rem;
    }

    .map-shell {
        height: 320px;
        border-radius: 16px;
    }

    .login-body {
        padding: 1rem;
    }

    .table-responsive {
        overflow: visible;
    }

    .fleet-table thead {
        display: none;
    }

    .fleet-table,
    .fleet-table tbody,
    .fleet-table tr,
    .fleet-table td {
        display: block;
        width: 100%;
    }

    .fleet-table tr {
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid rgba(24, 50, 69, 0.08);
        border-radius: 18px;
        padding: 0.85rem;
        margin-bottom: 0.85rem;
        box-shadow: 0 10px 24px rgba(24, 50, 69, 0.06);
    }

    .fleet-table td {
        border: 0;
        padding: 0.38rem 0;
        text-align: left !important;
    }

    .fleet-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.18rem;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--fleet-muted);
    }

    .fleet-table-detail-row {
        margin-top: -0.45rem;
        padding-top: 0;
    }

    .fleet-table-detail-row td::before {
        margin-bottom: 0.45rem;
    }

    .geofence-raw {
        font-size: 0.82rem;
        overflow-x: auto;
    }

    .vehicle-chip {
        padding: 0.75rem 0.85rem;
    }

    .vehicle-chip-grid {
        grid-template-columns: 1fr;
    }

    .navbar .container-fluid {
        padding-inline: 0.75rem;
    }

    .navbar-collapse {
        margin-top: 0.9rem;
        padding: 0.95rem;
        border-radius: 20px;
        background: rgba(12, 33, 49, 0.72);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(14px);
    }

    .fleet-nav-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .fleet-nav-links .nav-link {
        min-height: 2.9rem;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-inline: 0.95rem !important;
    }

    .fleet-nav-actions {
        margin-top: 0.75rem;
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .status-chip {
        justify-content: center;
    }

    .btn {
        min-height: 3rem;
    }

    .btn-sm {
        min-height: 2.8rem;
    }

    .action-cluster {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .action-cluster > * {
        width: 100%;
        min-width: 0;
    }

    .table-stack-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .table-stack-actions .btn,
    .table-stack-actions .mobile-inline-form,
    .table-stack-actions .badge {
        width: 100%;
    }

    .table-stack-actions .badge {
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .fleet-nav-links,
    .action-row.action-row-split,
    .action-cluster {
        grid-template-columns: 1fr;
    }
}

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