@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
    --tt-navy: #111b24;
    --tt-navy-2: #425766;
    --tt-blue: #425766;
    --tt-cyan: #d5e518;
    --tt-green: #18a56b;
    --tt-amber: #f3a51f;
    --tt-red: #dc4f5d;
    --tt-bg: #f3f6fa;
    --tt-panel: #ffffff;
    --tt-text: #17233a;
    --tt-muted: #6d788c;
    --tt-border: #e4e9f1;
    --tt-shadow: 0 14px 35px rgba(20, 39, 70, 0.08);
    --tt-radius: 18px;
    --bs-primary: #425766;
    --bs-primary-rgb: 66, 87, 102;
    --bs-body-font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    --bs-body-color: var(--tt-text);
    --bs-body-bg: var(--tt-bg);
}

[data-bs-theme="dark"] {
    --tt-bg: #0c1422;
    --tt-panel: #111d2e;
    --tt-text: #e8edf6;
    --tt-muted: #9ba8ba;
    --tt-border: #25334a;
    --tt-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
    --bs-body-color: var(--tt-text);
    --bs-body-bg: var(--tt-bg);
    --bs-secondary-color: var(--tt-muted);
    --bs-border-color: var(--tt-border);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--tt-text);
    background: var(--tt-bg);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-lockup strong {
    font-family: "Manrope", "DM Sans", sans-serif;
}

a {
    color: var(--tt-blue);
}

.min-w-0 {
    min-width: 0;
}

.btn {
    border-radius: 11px;
    font-weight: 700;
    padding: 0.66rem 1rem;
}

.btn-sm {
    padding: 0.42rem 0.68rem;
    border-radius: 9px;
}

.btn-lg {
    border-radius: 13px;
    padding: 0.85rem 1.15rem;
}

.btn-primary {
    border-color: var(--tt-blue);
    background: var(--tt-blue);
    box-shadow: 0 7px 18px rgba(66, 87, 102, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: #324550;
    background: #324550;
}

.btn-light {
    border-color: var(--tt-border);
    color: var(--tt-text);
    background: var(--tt-panel);
}

[data-bs-theme="dark"] .btn-light {
    color: var(--tt-text);
    background: #18263a;
}

.btn-dark {
    background: var(--tt-navy);
}

.form-label {
    margin-bottom: 0.42rem;
    color: var(--tt-text);
    font-size: 0.82rem;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 44px;
    border-color: var(--tt-border);
    border-radius: 11px;
    color: var(--tt-text);
    background-color: var(--tt-panel);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(66, 87, 102, 0.65);
    box-shadow: 0 0 0 0.22rem rgba(66, 87, 102, 0.12);
}

.form-control::placeholder {
    color: #9aa4b5;
}

textarea.form-control {
    min-height: unset;
}

.alert {
    border: 0;
    border-radius: 13px;
}

.eyebrow {
    color: var(--tt-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.text-cyan {
    color: var(--tt-cyan) !important;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: inherit;
    text-decoration: none;
}

.brand-lockup:hover {
    color: inherit;
}

.brand-logo-link {
    line-height: 0;
}

.brand-logo-frame {
    display: inline-flex;
    padding: 0.48rem 0.62rem;
    border-radius: 0.7rem;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.13);
    align-items: center;
}

.brand-wordmark {
    display: block;
    width: 184px;
    max-width: 100%;
    height: auto;
}

.brand-lockup > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-lockup strong {
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.brand-lockup small {
    margin-top: 0.28rem;
    color: #8fa0b9;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #111b24;
    background: linear-gradient(135deg, var(--tt-cyan), #edf675);
    box-shadow: 0 10px 24px rgba(213, 229, 24, 0.24);
    place-items: center;
}

.brand-mark i {
    font-size: 1.25rem;
}

.offline-indicator {
    position: fixed;
    z-index: 2000;
    top: 0;
    right: 0;
    left: 0;
    display: none;
    padding: 0.65rem 1rem;
    color: #fff;
    background: #bd3645;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

body.is-offline .offline-indicator {
    display: block;
}

body.is-offline .admin-sidebar,
body.is-offline .admin-shell,
body.is-offline .driver-header {
    margin-top: 39px;
}

/* Authentication */

.auth-body {
    overflow-x: hidden;
    background: #eef3f8;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.16fr) minmax(410px, 0.84fr);
}

.auth-visual {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: clamp(2.5rem, 6vw, 6.5rem);
    color: #fff;
    background:
        radial-gradient(circle at 76% 18%, rgba(213, 229, 24, 0.16), transparent 28%),
        radial-gradient(circle at 13% 76%, rgba(66, 87, 102, 0.22), transparent 34%),
        linear-gradient(145deg, #111b24 0%, #1b2a35 58%, #293c49 100%);
    align-items: center;
}

.auth-visual::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.06;
    background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 48px 48px;
}

.auth-visual-content {
    position: relative;
    z-index: 2;
    width: min(650px, 100%);
}

.auth-visual h1 {
    margin: 0 0 1.4rem;
    font-size: clamp(3rem, 6vw, 5.8rem);
    font-weight: 800;
    letter-spacing: -0.065em;
    line-height: 0.99;
}

.auth-visual-content > p:not(.eyebrow) {
    max-width: 580px;
    color: #aebdd1;
    font-size: 1.15rem;
    line-height: 1.7;
}

.auth-stat-row {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}

.auth-stat-row div {
    display: flex;
    flex-direction: column;
}

.auth-stat-row strong {
    color: #fff;
    font-family: "Manrope", sans-serif;
    font-size: 1.4rem;
}

.auth-stat-row span {
    color: #8192aa;
    font-size: 0.75rem;
}

.route-decoration {
    position: absolute;
    right: 8%;
    bottom: 10%;
    width: 220px;
    height: 160px;
    opacity: 0.75;
    border-right: 2px dashed rgba(213, 229, 24, 0.42);
    border-bottom: 2px dashed rgba(213, 229, 24, 0.42);
    border-radius: 0 0 70px;
}

.route-decoration span {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 4px solid #1b2a35;
    border-radius: 50%;
    background: var(--tt-cyan);
    box-shadow: 0 0 0 5px rgba(213, 229, 24, 0.14);
}

.route-decoration span:first-child {
    top: -8px;
    right: -9px;
}

.route-decoration span:nth-child(2) {
    right: 70px;
    bottom: -9px;
}

.route-decoration span:last-child {
    bottom: -9px;
    left: -9px;
}

.auth-form-side {
    display: flex;
    padding: 2rem;
    background: #f5f8fb;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(430px, 100%);
}

.auth-card h2 {
    margin-bottom: 0.6rem;
    color: #17233a;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 1rem;
    color: #8390a4;
    transform: translateY(-50%);
}

.input-icon .form-control {
    padding-left: 2.8rem;
}

.portal-switch {
    padding-top: 1.25rem;
    border-top: 1px solid #dfe5ed;
    color: #738096;
    font-size: 0.9rem;
    text-align: center;
}

.portal-switch a {
    display: block;
    margin-top: 0.35rem;
    font-weight: 700;
    text-decoration: none;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--tt-navy);
    font-family: "Manrope", sans-serif;
    font-size: 1.15rem;
}

.mobile-brand .brand-wordmark {
    width: 230px;
}

.auth-brand .brand-wordmark {
    width: 270px;
}

/* Admin shell */

.admin-sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    bottom: 0;
    left: 0;
    width: 258px;
    flex-direction: column;
    padding: 1.5rem 1.15rem;
    color: #dce5f3;
    background:
        radial-gradient(circle at 20% 0, rgba(213, 229, 24, 0.09), transparent 28%),
        var(--tt-navy);
}

.admin-sidebar .brand-lockup {
    margin: 0 0.45rem 1.5rem;
}

.admin-sidebar .brand-wordmark {
    width: 184px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    min-height: 44px;
    padding: 0.72rem 0.9rem;
    border-radius: 11px;
    color: #91a0b5;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: 160ms ease;
    align-items: center;
    gap: 0.82rem;
}

.sidebar-nav a i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
}

.sidebar-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(110deg, rgba(66, 87, 102, 0.96), rgba(92, 112, 125, 0.92));
    box-shadow: 0 8px 20px rgba(16, 79, 185, 0.25);
}

.sidebar-footer {
    display: grid;
    gap: 0.9rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-chip,
.person-cell,
.vehicle-cell {
    display: flex;
    align-items: center;
    gap: 0.72rem;
}

.user-chip {
    padding: 0 0.35rem;
}

.user-chip .avatar,
.person-cell .avatar,
.driver-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 11px;
    color: #10233e;
    background: #d9eef4;
    font-size: 0.8rem;
    font-weight: 800;
    place-items: center;
}

.user-chip strong {
    color: #fff;
    font-size: 0.8rem;
}

.user-chip small {
    color: #72829a;
    font-size: 0.68rem;
}

.btn-sidebar {
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #9babc0;
    background: rgba(255, 255, 255, 0.04);
}

.btn-sidebar:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

.admin-shell {
    min-height: 100vh;
    margin-left: 258px;
}

.topbar {
    position: sticky;
    z-index: 1020;
    top: 0;
    display: flex;
    min-height: 82px;
    padding: 1rem clamp(1.25rem, 3vw, 2.5rem);
    border-bottom: 1px solid var(--tt-border);
    background: color-mix(in srgb, var(--tt-bg) 88%, transparent);
    backdrop-filter: blur(16px);
    align-items: center;
    justify-content: space-between;
}

.page-heading {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--tt-border);
    color: var(--tt-text);
    background: var(--tt-panel);
    place-items: center;
}

.live-pill {
    display: inline-flex;
    padding: 0.45rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--tt-green) 30%, var(--tt-border));
    border-radius: 100px;
    color: var(--tt-green);
    background: color-mix(in srgb, var(--tt-green) 8%, var(--tt-panel));
    font-size: 0.72rem;
    font-weight: 800;
    align-items: center;
    gap: 0.45rem;
}

.live-pill span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tt-green);
    box-shadow: 0 0 0 4px rgba(24, 165, 107, 0.12);
}

.admin-main {
    width: min(1680px, 100%);
    margin: 0 auto;
    padding: clamp(1.2rem, 2.8vw, 2.4rem);
}

.mobile-nav {
    color: #dce5f3;
    background: var(--tt-navy);
}

.mobile-nav .brand-lockup {
    color: #fff;
}

.mobile-nav .brand-wordmark {
    width: 184px;
}

.mobile-nav .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel {
    padding: clamp(1rem, 2vw, 1.4rem);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    background: var(--tt-panel);
    box-shadow: 0 2px 4px rgba(20, 39, 70, 0.02);
}

.section-heading {
    display: flex;
    margin-bottom: 1.2rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-heading .eyebrow {
    margin-bottom: 0.25rem;
}

.section-heading h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.section-heading > a {
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.count-chip {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    margin-left: 0.35rem;
    padding: 0 0.45rem;
    border-radius: 8px;
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.09);
    font-family: "DM Sans", sans-serif;
    font-size: 0.73rem;
    place-items: center;
}

/* Dashboard */

.dashboard-hero {
    position: relative;
    display: flex;
    overflow: hidden;
    min-height: 190px;
    padding: clamp(1.5rem, 4vw, 2.3rem);
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 86% 20%, rgba(213, 229, 24, 0.2), transparent 26%),
        linear-gradient(115deg, #111b24, #425766);
    box-shadow: 0 18px 45px rgba(11, 23, 42, 0.16);
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.dashboard-hero::after {
    position: absolute;
    top: -90px;
    right: -60px;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
    box-shadow: 0 0 0 48px rgba(255, 255, 255, 0.025), 0 0 0 96px rgba(255, 255, 255, 0.018);
}

.dashboard-hero > * {
    position: relative;
    z-index: 2;
}

.hero-kicker {
    display: inline-flex;
    margin-bottom: 0.9rem;
    color: #7be7e7;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-hero h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.65rem, 3.2vw, 2.65rem);
    font-weight: 800;
    letter-spacing: -0.055em;
}

.dashboard-hero p {
    max-width: 620px;
    margin: 0;
    color: #a8bad0;
}

.hero-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.75rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.metric-card {
    display: flex;
    min-height: 122px;
    padding: 1.2rem;
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    background: var(--tt-panel);
    box-shadow: 0 2px 4px rgba(20, 39, 70, 0.02);
    align-items: center;
    gap: 1rem;
}

.metric-icon {
    display: grid;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.1);
    font-size: 1.2rem;
    place-items: center;
}

.metric-icon.cyan {
    color: #0d9ba4;
    background: rgba(213, 229, 24, 0.12);
}

.metric-icon.amber {
    color: #d48300;
    background: rgba(243, 165, 31, 0.12);
}

.metric-icon.green {
    color: var(--tt-green);
    background: rgba(24, 165, 107, 0.1);
}

.metric-card p {
    margin: 0 0 0.2rem;
    color: var(--tt-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    font-family: "Manrope", sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.metric-card small {
    display: block;
    margin-top: 0.16rem;
    color: var(--tt-muted);
    font-size: 0.68rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
    gap: 1rem;
}

.dashboard-map,
.history-map {
    height: 360px;
    border-radius: 13px;
    background: #dfe7ee;
}

.chart-wrap {
    position: relative;
    height: 245px;
}

.chart-tabs {
    display: grid;
    margin-bottom: 0.8rem;
    padding: 0.25rem;
    border-radius: 10px;
    background: var(--tt-bg);
    grid-template-columns: repeat(3, 1fr);
}

.chart-tabs button {
    padding: 0.42rem 0.35rem;
    border: 0;
    border-radius: 8px;
    color: var(--tt-muted);
    background: transparent;
    font-size: 0.65rem;
    font-weight: 800;
}

.chart-tabs button.active {
    color: var(--tt-blue);
    background: var(--tt-panel);
    box-shadow: 0 3px 12px rgba(20, 39, 70, 0.08);
}

.chart-summary {
    display: flex;
    margin-top: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--tt-border);
    align-items: center;
    gap: 0.75rem;
}

.chart-summary > span {
    display: grid;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: var(--tt-green);
    background: rgba(24, 165, 107, 0.1);
    place-items: center;
}

.chart-summary p,
.activity-item p,
.person-cell p,
.vehicle-cell p {
    display: flex;
    margin: 0;
    flex-direction: column;
}

.chart-summary strong {
    font-size: 0.82rem;
}

.chart-summary small,
.activity-item small,
.person-cell small,
.vehicle-cell small {
    color: var(--tt-muted);
    font-size: 0.69rem;
}

.compact-table {
    margin-bottom: 0;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--tt-text);
    --bs-table-border-color: var(--tt-border);
    margin-bottom: 0;
    white-space: nowrap;
}

.table thead th {
    padding: 0.72rem 0.75rem;
    border-bottom-width: 1px;
    color: var(--tt-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.table tbody td {
    padding: 0.8rem 0.75rem;
    font-size: 0.8rem;
    vertical-align: middle;
}

.status-badge {
    display: inline-flex;
    padding: 0.32rem 0.55rem;
    border-radius: 100px;
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: capitalize;
}

.status-badge.success {
    color: #0d8755;
    background: rgba(24, 165, 107, 0.12);
}

.status-badge.primary {
    color: #1e5bd1;
    background: rgba(66, 87, 102, 0.11);
}

.status-badge.warning {
    color: #b16a00;
    background: rgba(243, 165, 31, 0.14);
}

.status-badge.secondary {
    color: #6f7888;
    background: rgba(109, 120, 140, 0.12);
}

.status-badge.info {
    color: #0c8a93;
    background: rgba(213, 229, 24, 0.12);
}

.activity-list {
    display: grid;
    gap: 0.85rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.activity-item > span {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.09);
    place-items: center;
}

.activity-item strong {
    font-size: 0.78rem;
    font-weight: 700;
}

.alert-panel {
    padding: 1rem 1.2rem;
    border: 1px solid rgba(220, 79, 93, 0.2);
    border-radius: var(--tt-radius);
    background: color-mix(in srgb, var(--tt-red) 4%, var(--tt-panel));
}

.alert-panel .section-heading {
    margin-bottom: 0.65rem;
}

.alert-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.alert-list > div {
    display: flex;
    padding: 0.75rem;
    border: 1px solid rgba(220, 79, 93, 0.12);
    border-radius: 12px;
    background: var(--tt-panel);
    align-items: center;
    gap: 0.65rem;
}

.alert-icon {
    display: grid;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: var(--tt-red);
    background: rgba(220, 79, 93, 0.1);
    place-items: center;
}

.alert-list p {
    display: flex;
    min-width: 0;
    margin: 0;
    flex-direction: column;
}

.alert-list p strong {
    font-size: 0.75rem;
    text-transform: capitalize;
}

.alert-list p span {
    overflow: hidden;
    color: var(--tt-muted);
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-list a {
    margin-left: auto;
    font-size: 0.69rem;
    font-weight: 800;
    text-decoration: none;
}

/* Forms, resources and tables */

.content-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.form-panel {
    position: sticky;
    top: 102px;
}

.filter-bar {
    display: flex;
    margin-bottom: 1rem;
    align-items: center;
    gap: 0.55rem;
}

.filter-bar .search-control {
    min-width: 220px;
    flex: 1;
}

.filter-bar .form-select,
.filter-bar > .form-control {
    width: auto;
    min-width: 140px;
}

.filter-bar.wide .search-control {
    min-width: 250px;
}

.search-control,
.map-filter {
    position: relative;
}

.search-control > i,
.map-filter > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 0.85rem;
    color: var(--tt-muted);
    transform: translateY(-50%);
}

.search-control .form-control,
.map-filter .form-control {
    padding-left: 2.35rem;
}

.table-panel {
    min-width: 0;
}

.table-actions {
    white-space: nowrap;
}

.vehicle-cell > span {
    display: grid;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.09);
    place-items: center;
}

.vehicle-icon-preview {
    color: var(--vehicle-icon-color, var(--tt-blue)) !important;
    background: color-mix(in srgb, var(--vehicle-icon-color, var(--tt-blue)) 10%, transparent) !important;
}

.vehicle-icon-preview img {
    border-radius: 6px;
    object-fit: contain;
}

.person-cell strong,
.vehicle-cell strong {
    font-size: 0.79rem;
}

.mono-chip {
    display: inline-flex;
    padding: 0.28rem 0.48rem;
    border: 1px solid var(--tt-border);
    border-radius: 7px;
    color: var(--tt-muted);
    background: color-mix(in srgb, var(--tt-bg) 70%, var(--tt-panel));
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.67rem;
}

.address-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-cell {
    padding: 2.5rem !important;
    color: var(--tt-muted) !important;
    text-align: center;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-span-2 {
    grid-column: span 2;
}

.form-span-2 {
    grid-column: span 2;
}

.grid-span-4 {
    grid-column: span 4;
}

.form-actions {
    display: flex;
    gap: 0.6rem;
}

.route-cell {
    display: flex;
    max-width: 250px;
    flex-direction: column;
}

.route-cell span {
    overflow: hidden;
    max-width: 240px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-cell i {
    margin: 0.08rem 0;
    color: var(--tt-cyan);
    font-size: 0.68rem;
}

.assignment-grid {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.info-note,
.permission-note {
    display: flex;
    padding: 0.85rem;
    border-radius: 12px;
    color: var(--tt-muted);
    background: rgba(66, 87, 102, 0.06);
    gap: 0.7rem;
}

.info-note i,
.permission-note i {
    color: var(--tt-blue);
}

.info-note p,
.permission-note p {
    display: flex;
    margin: 0;
    font-size: 0.74rem;
    flex-direction: column;
}

.info-note strong,
.permission-note strong {
    color: var(--tt-text);
}

.info-note span,
.permission-note span {
    margin-top: 0.15rem;
}

.assignment-list {
    display: grid;
    gap: 0.9rem;
}

.assignment-card {
    padding: 1rem;
    border: 1px solid var(--tt-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--tt-bg) 45%, var(--tt-panel));
}

.assignment-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.assignment-card h4 {
    margin: 0.45rem 0 0;
    font-size: 1rem;
    font-weight: 800;
}

.assignment-route,
.driver-route-visual {
    display: grid;
    margin: 1rem 0;
    grid-template-columns: 14px 1fr;
    column-gap: 0.7rem;
}

.assignment-route p,
.driver-route-visual p {
    display: flex;
    margin: 0;
    font-size: 0.76rem;
    flex-direction: column;
}

.assignment-route p small,
.driver-route-visual p small {
    margin-bottom: 0.12rem;
    color: var(--tt-muted);
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.route-dot {
    width: 11px;
    height: 11px;
    margin-top: 0.25rem;
    border: 3px solid var(--tt-panel);
    border-radius: 50%;
    background: var(--tt-blue);
    box-shadow: 0 0 0 2px var(--tt-blue);
}

.route-dot.destination {
    background: var(--tt-cyan);
    box-shadow: 0 0 0 2px var(--tt-cyan);
}

.route-line {
    width: 2px;
    height: 24px;
    margin: 0.15rem 0 0.15rem 5px;
    background: repeating-linear-gradient(to bottom, var(--tt-border) 0 4px, transparent 4px 7px);
}

.assignment-meta {
    display: grid;
    padding: 0.85rem 0;
    border-top: 1px solid var(--tt-border);
    border-bottom: 1px solid var(--tt-border);
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
}

.assignment-meta > span {
    display: grid;
    grid-template-columns: 28px 1fr;
    column-gap: 0.5rem;
}

.assignment-meta i {
    grid-row: span 2;
    color: var(--tt-muted);
}

.assignment-meta strong {
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assignment-meta small {
    color: var(--tt-muted);
    font-size: 0.63rem;
}

.assignment-actions {
    display: flex;
    margin-top: 0.8rem;
    gap: 0.45rem;
}

.assignment-actions form {
    margin-left: auto;
}

.empty-state-lg {
    display: flex;
    min-height: 310px;
    color: var(--tt-muted);
    text-align: center;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-lg > i {
    margin-bottom: 0.75rem;
    color: var(--tt-blue);
    font-size: 2.5rem;
}

.empty-state-lg h3,
.empty-state-lg h4 {
    color: var(--tt-text);
    font-size: 1.15rem;
}

.empty-state-lg p {
    max-width: 410px;
    font-size: 0.85rem;
}

/* Maps */

.map-workspace {
    display: grid;
    overflow: hidden;
    min-height: calc(100vh - 130px);
    border: 1px solid var(--tt-border);
    border-radius: 20px;
    background: var(--tt-panel);
    grid-template-columns: 330px minmax(0, 1fr);
}

.map-sidebar-panel {
    position: relative;
    z-index: 500;
    display: flex;
    min-height: 0;
    padding: 1.2rem;
    border-right: 1px solid var(--tt-border);
    background: var(--tt-panel);
    flex-direction: column;
}

.vehicle-list {
    display: grid;
    overflow-y: auto;
    max-height: calc(100vh - 330px);
    margin-top: 0.8rem;
    gap: 0.4rem;
}

.vehicle-list-item {
    display: grid;
    width: 100%;
    padding: 0.8rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--tt-text);
    background: transparent;
    text-align: left;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 0.6rem;
}

.vehicle-list-item:hover,
.vehicle-list-item.active {
    border-color: var(--tt-border);
    background: color-mix(in srgb, var(--tt-bg) 65%, var(--tt-panel));
}

.vehicle-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.vehicle-status.online {
    background: var(--tt-green);
    box-shadow: 0 0 0 4px rgba(24, 165, 107, 0.1);
}

.vehicle-status.offline {
    background: var(--tt-red);
}

.vehicle-list-item > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.vehicle-list-item strong {
    font-size: 0.76rem;
}

.vehicle-list-item small {
    overflow: hidden;
    color: var(--tt-muted);
    font-size: 0.65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-speed {
    color: var(--tt-muted);
    font-size: 0.67rem;
    font-weight: 700;
}

.map-legend {
    display: flex;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--tt-border);
    color: var(--tt-muted);
    font-size: 0.67rem;
    gap: 1rem;
}

.legend-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.3rem;
    border-radius: 50%;
}

.legend-dot.online {
    background: var(--tt-green);
}

.legend-dot.offline {
    background: var(--tt-red);
}

.live-map-canvas {
    z-index: 1;
    min-height: calc(100vh - 130px);
    background: #dfe7ee;
}

.truck-map-marker {
    display: grid;
    width: 38px !important;
    height: 38px !important;
    border: 3px solid #fff;
    border-radius: 13px 13px 13px 3px;
    color: #fff;
    background: var(--marker-color, var(--tt-blue));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--marker-color, var(--tt-blue)) 42%, transparent);
    transform: rotate(-45deg);
    place-items: center;
}

.truck-map-marker i,
.truck-map-marker img {
    width: 22px;
    height: 22px;
    transform: rotate(calc(45deg + var(--marker-heading, 0deg)));
}

.truck-map-marker img {
    border-radius: 5px;
    object-fit: contain;
}

.truck-map-marker.offline {
    background: #788398;
    box-shadow: 0 8px 20px rgba(71, 82, 103, 0.3);
}

.customer-map-marker {
    display: grid;
    width: 30px !important;
    height: 30px !important;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 3px;
    color: #07333a;
    background: var(--tt-cyan);
    box-shadow: 0 7px 18px rgba(213, 229, 24, 0.32);
    transform: rotate(-45deg);
    place-items: center;
}

.customer-map-marker i {
    transform: rotate(45deg);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    color: var(--tt-text);
    background: var(--tt-panel);
}

.map-popup h4 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
}

.map-popup p {
    margin: 0.15rem 0;
    color: var(--tt-muted);
    font-size: 0.72rem;
}

.map-popup strong {
    color: var(--tt-text);
}

.history-selector {
    display: flex;
    align-items: flex-end;
    gap: 0.8rem;
}

.history-selector > div {
    max-width: 650px;
    flex: 1;
}

.route-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.route-summary > div {
    display: flex;
    min-height: 115px;
    padding: 1.1rem;
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    background: var(--tt-panel);
    flex-direction: column;
    justify-content: center;
}

.route-summary strong {
    font-family: "Manrope", sans-serif;
    font-size: 1.15rem;
}

.route-summary small {
    margin-top: 0.25rem;
    color: var(--tt-muted);
    font-size: 0.68rem;
}

.route-map-panel .section-heading h3 {
    max-width: 850px;
    overflow: hidden;
    font-family: "DM Sans", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-start-marker,
.route-end-marker {
    display: grid;
    width: 28px !important;
    height: 28px !important;
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: var(--tt-blue);
    box-shadow: 0 5px 14px rgba(20, 39, 70, 0.25);
    place-items: center;
}

.route-end-marker {
    background: var(--tt-cyan);
}

.admin-proof-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.85fr 1fr;
    gap: 1rem;
}

.admin-proof-grid h4 {
    margin-bottom: 0.65rem;
    font-size: 0.8rem;
}

.admin-proof-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.admin-proof-gallery img {
    width: 100%;
    height: 110px;
    border-radius: 10px;
    object-fit: cover;
}

.admin-signature {
    width: 100%;
    max-height: 160px;
    border: 1px solid var(--tt-border);
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}

.completion-notes {
    margin-bottom: 0.5rem;
    color: var(--tt-muted);
    font-size: 0.78rem;
    line-height: 1.55;
}

/* Reports and settings */

.report-filter {
    display: grid;
    grid-template-columns: 180px 180px minmax(180px, 260px) auto 1fr;
    align-items: end;
    gap: 0.7rem;
}

.export-menu {
    justify-self: end;
}

.report-metrics .metric-card {
    min-height: 110px;
}

.progress-label {
    color: var(--tt-green);
    font-weight: 800;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
    align-items: start;
}

.settings-form {
    display: grid;
    max-width: 820px;
    gap: 1rem;
}

.custom-field-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.custom-fields-group {
    display: grid;
    padding-top: 0.9rem;
    border-top: 1px solid var(--tt-border);
    gap: 0.9rem;
}

.custom-fields-heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.custom-fields-heading > span {
    display: grid;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.1);
    place-items: center;
}

.custom-fields-heading > div {
    display: flex;
    flex-direction: column;
}

.custom-fields-heading small {
    color: var(--tt-muted);
    font-size: 0.68rem;
}

.location-policy-card {
    display: flex;
    padding: 1rem;
    border: 1px solid rgba(24, 165, 107, 0.18);
    border-radius: 13px;
    background: rgba(24, 165, 107, 0.07);
    align-items: flex-start;
    gap: 0.8rem;
}

.location-policy-card > span,
.platform-icon {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: var(--tt-green);
    background: rgba(24, 165, 107, 0.12);
    place-items: center;
}

.location-policy-card p {
    margin: 0.2rem 0 0;
    color: var(--tt-muted);
    font-size: 0.75rem;
}

.device-cell {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.device-cell > div {
    display: flex;
    min-width: 240px;
    flex-direction: column;
}

.device-cell small {
    color: var(--tt-muted);
    font-size: 0.67rem;
}

.settings-aside {
    display: grid;
    gap: 1rem;
}

.settings-aside .panel {
    padding: 1.5rem;
}

.settings-icon {
    display: grid;
    width: 46px;
    height: 46px;
    margin-bottom: 1rem;
    border-radius: 13px;
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.1);
    font-size: 1.15rem;
    place-items: center;
}

.settings-icon.cyan {
    color: #0d9ba4;
    background: rgba(213, 229, 24, 0.11);
}

.settings-aside h4 {
    font-size: 0.95rem;
}

.settings-aside p {
    margin: 0;
    color: var(--tt-muted);
    font-size: 0.78rem;
    line-height: 1.55;
}

/* Driver mobile */

.driver-body {
    padding-bottom: 92px;
    background:
        radial-gradient(circle at 100% 0, rgba(213, 229, 24, 0.06), transparent 24%),
        var(--tt-bg);
}

.driver-header {
    position: sticky;
    z-index: 1030;
    top: 0;
    display: flex;
    height: 72px;
    padding: 0.75rem max(1rem, env(safe-area-inset-left));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    background: var(--tt-navy);
    align-items: center;
    justify-content: space-between;
}

.driver-header .brand-mark {
    width: 38px;
    height: 38px;
}

.driver-header .brand-logo-frame {
    padding: 0.34rem 0.46rem;
    border-radius: 0.5rem;
}

.driver-header .brand-wordmark {
    width: 154px;
}

.driver-avatar {
    color: #0d2037;
    background: var(--tt-cyan);
}

.driver-main {
    width: min(700px, 100%);
    margin: 0 auto;
    padding: 1.2rem 1rem 2rem;
}

.driver-title-row {
    display: flex;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: space-between;
}

.driver-page-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.driver-bottom-nav {
    position: fixed;
    z-index: 1040;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    padding: 0.55rem max(0.65rem, env(safe-area-inset-right)) max(0.55rem, env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-left));
    border-top: 1px solid var(--tt-border);
    background: color-mix(in srgb, var(--tt-panel) 94%, transparent);
    box-shadow: 0 -12px 35px rgba(20, 39, 70, 0.09);
    backdrop-filter: blur(16px);
    grid-template-columns: repeat(4, 1fr);
}

.driver-bottom-nav a {
    display: flex;
    min-height: 54px;
    border-radius: 12px;
    color: var(--tt-muted);
    font-size: 0.66rem;
    font-weight: 700;
    text-decoration: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.driver-bottom-nav a i {
    font-size: 1.15rem;
}

.driver-bottom-nav a.active {
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.07);
}

.driver-status-card {
    overflow: hidden;
    padding: 1.25rem;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0, rgba(213, 229, 24, 0.18), transparent 34%),
        linear-gradient(145deg, #111b24, #425766);
    box-shadow: 0 18px 42px rgba(11, 23, 42, 0.18);
}

.driver-status-card.tracking {
    background:
        radial-gradient(circle at 100% 0, rgba(213, 229, 24, 0.22), transparent 38%),
        linear-gradient(145deg, #0a1c2b, #0c4d54);
}

.driver-status-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.driver-status-icon {
    display: grid;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #092137;
    background: var(--tt-cyan);
    font-size: 1.2rem;
    place-items: center;
}

.driver-status-top > div {
    min-width: 0;
    flex: 1;
}

.driver-status-top p {
    margin: 0;
    color: #8fb2c7;
    font-size: 0.68rem;
    font-weight: 700;
}

.driver-status-top h2 {
    margin: 0.12rem 0 0;
    font-size: 1.12rem;
}

.driver-customer {
    display: flex;
    margin: 1.1rem 0 0.8rem;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.055);
    gap: 0.75rem;
}

.driver-customer > span {
    display: grid;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--tt-cyan);
    background: rgba(213, 229, 24, 0.1);
    place-items: center;
}

.driver-customer p {
    display: flex;
    margin: 0;
    flex-direction: column;
}

.driver-customer small {
    color: #7e9bb1;
    font-size: 0.6rem;
    text-transform: uppercase;
}

.driver-customer strong {
    font-size: 0.85rem;
}

.driver-customer p span {
    color: #91a6b9;
    font-size: 0.7rem;
}

.driver-status-card .driver-route-visual {
    margin: 1rem 0;
}

.driver-status-card .route-dot {
    border-color: #173c59;
}

.driver-status-card .driver-route-visual p {
    color: #dce7ef;
}

.driver-status-card .driver-route-visual p small {
    color: #7893a8;
}

.driver-status-card .route-line {
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 0 4px, transparent 4px 7px);
}

.driver-primary-actions {
    display: grid;
    margin-top: 1rem;
    grid-template-columns: 1.25fr 1fr;
    gap: 0.6rem;
}

.driver-info-grid {
    display: grid;
    margin: 1rem 0;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
}

.driver-info-grid article {
    display: flex;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid var(--tt-border);
    border-radius: 14px;
    background: var(--tt-panel);
    flex-direction: column;
}

.driver-info-grid article > span {
    display: grid;
    width: 32px;
    height: 32px;
    margin-bottom: 0.6rem;
    border-radius: 9px;
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.08);
    place-items: center;
}

.driver-info-grid p {
    display: flex;
    min-width: 0;
    margin: 0;
    flex-direction: column;
}

.driver-info-grid small {
    overflow: hidden;
    color: var(--tt-muted);
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-info-grid strong {
    overflow: hidden;
    margin: 0.1rem 0;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-note-card,
.proof-intro {
    display: flex;
    padding: 1rem;
    border: 1px solid var(--tt-border);
    border-radius: 15px;
    background: var(--tt-panel);
    gap: 0.8rem;
}

.driver-note-card > span,
.proof-intro > span {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #0b8991;
    background: rgba(213, 229, 24, 0.1);
    place-items: center;
}

.driver-note-card h3 {
    margin: 0 0 0.25rem;
    font-size: 0.85rem;
}

.driver-note-card p {
    margin: 0;
    color: var(--tt-muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.driver-empty {
    display: flex;
    min-height: 420px;
    padding: 2rem;
    border: 1px solid var(--tt-border);
    border-radius: 20px;
    background: var(--tt-panel);
    text-align: center;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.driver-empty > span {
    display: grid;
    width: 76px;
    height: 76px;
    margin-bottom: 1.2rem;
    border-radius: 24px;
    color: var(--tt-green);
    background: rgba(24, 165, 107, 0.1);
    font-size: 2rem;
    place-items: center;
}

.driver-empty h2 {
    font-size: 1.35rem;
}

.driver-empty p {
    max-width: 430px;
    color: var(--tt-muted);
    font-size: 0.85rem;
}

.driver-detail-card,
.driver-route-card,
.tracking-control-card,
.proof-card {
    padding: 1rem;
    border: 1px solid var(--tt-border);
    border-radius: 18px;
    background: var(--tt-panel);
}

.driver-detail-header {
    display: flex;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--tt-border);
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.driver-detail-header h2 {
    margin: 0.6rem 0 0.2rem;
    font-size: 1.1rem;
}

.driver-detail-header p {
    margin: 0;
    color: var(--tt-muted);
    font-size: 0.72rem;
}

.detail-list {
    display: grid;
    padding-top: 0.5rem;
}

.detail-list > div {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--tt-border);
    gap: 0.75rem;
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list > div > span {
    display: grid;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--tt-blue);
    background: rgba(66, 87, 102, 0.08);
    place-items: center;
}

.detail-list p {
    display: flex;
    margin: 0;
    font-size: 0.78rem;
    flex-direction: column;
}

.detail-list small,
.detail-list p span {
    color: var(--tt-muted);
    font-size: 0.65rem;
}

.driver-route-card h3 {
    margin: 0;
    font-size: 0.95rem;
}

.tracking-control-card {
    overflow: hidden;
    padding: 0;
}

.tracking-header {
    display: flex;
    padding: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.tracking-header h2 {
    margin: 0.38rem 0 0.1rem;
    font-size: 1.1rem;
}

.tracking-header p {
    margin: 0;
    color: var(--tt-muted);
    font-size: 0.7rem;
}

.tracking-pulse {
    display: inline-flex;
    color: var(--tt-muted);
    font-size: 0.68rem;
    font-weight: 800;
    align-items: center;
    gap: 0.4rem;
}

.tracking-pulse i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b95a5;
}

.tracking-pulse.active {
    color: var(--tt-green);
}

.tracking-pulse.active i {
    background: var(--tt-green);
    box-shadow: 0 0 0 5px rgba(24, 165, 107, 0.12);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    50% { box-shadow: 0 0 0 9px rgba(24, 165, 107, 0); }
}

.gps-accuracy {
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    color: var(--tt-muted);
    background: var(--tt-bg);
    font-size: 0.63rem;
    font-weight: 700;
}

.driver-map {
    height: 330px;
    background: #dfe7ee;
}

.driver-location-marker {
    display: grid;
    width: 30px !important;
    height: 30px !important;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--tt-blue);
    box-shadow: 0 0 0 7px rgba(66, 87, 102, 0.17), 0 5px 18px rgba(66, 87, 102, 0.35);
    place-items: center;
}

.tracking-readouts {
    display: grid;
    padding: 1rem;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.tracking-readouts > div {
    display: flex;
    padding: 0.7rem;
    border-radius: 12px;
    background: var(--tt-bg);
    text-align: center;
    flex-direction: column;
}

.tracking-readouts small {
    color: var(--tt-muted);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tracking-readouts strong {
    margin: 0.2rem 0 0;
    font-family: "Manrope", sans-serif;
    font-size: 1.1rem;
}

.tracking-readouts span {
    color: var(--tt-muted);
    font-size: 0.58rem;
}

.tracking-actions {
    display: grid;
    padding: 0 1rem 1rem;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.tracking-actions > button:first-child,
.tracking-actions > button:nth-child(2) {
    grid-column: span 2;
}

.tracking-message {
    min-height: 0;
    padding: 0 1rem 1rem;
    color: var(--tt-muted);
    font-size: 0.72rem;
    text-align: center;
}

.permission-note {
    margin-top: 0.8rem;
    background: var(--tt-panel);
}

.proof-intro {
    margin-bottom: 0.8rem;
}

.proof-intro h2 {
    margin: 0.15rem 0 0.3rem;
    font-size: 1.05rem;
}

.proof-intro p:last-child {
    margin: 0;
    color: var(--tt-muted);
    font-size: 0.72rem;
}

.proof-form {
    display: grid;
    gap: 0.8rem;
}

.proof-step {
    display: flex;
    margin-bottom: 0.9rem;
    align-items: flex-start;
    gap: 0.65rem;
}

.proof-step > span {
    display: grid;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #fff;
    background: var(--tt-blue);
    font-size: 0.75rem;
    font-weight: 800;
    place-items: center;
}

.proof-step h3 {
    margin: 0;
    font-size: 0.9rem;
}

.proof-step p {
    margin: 0.2rem 0 0;
    color: var(--tt-muted);
    font-size: 0.68rem;
}

.upload-zone {
    display: flex;
    min-height: 150px;
    padding: 1.2rem;
    border: 2px dashed var(--tt-border);
    border-radius: 14px;
    color: var(--tt-text);
    background: var(--tt-bg);
    text-align: center;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: var(--tt-blue);
}

.upload-zone i {
    margin-bottom: 0.5rem;
    color: var(--tt-blue);
    font-size: 1.55rem;
}

.upload-zone strong {
    font-size: 0.8rem;
}

.upload-zone span,
.file-selection {
    color: var(--tt-muted);
    font-size: 0.64rem;
}

.upload-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.file-selection {
    margin-top: 0.45rem;
    text-align: center;
}

.proof-gallery {
    display: grid;
    margin-bottom: 0.8rem;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.proof-gallery img {
    width: 100%;
    height: 90px;
    border-radius: 10px;
    object-fit: cover;
}

.signature-wrap {
    position: relative;
    overflow: hidden;
    height: 180px;
    border: 2px dashed var(--tt-border);
    border-radius: 14px;
    background: #fff;
    touch-action: none;
}

#signatureCanvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    color: #b3bcc9;
    font-family: cursive;
    font-size: 1.25rem;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.existing-signature {
    width: 100%;
    max-height: 140px;
    margin-bottom: 0.7rem;
    border: 1px solid var(--tt-border);
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}

.completion-button {
    min-height: 58px;
}

.profile-hero {
    display: flex;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--tt-border);
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    display: grid;
    width: 68px;
    height: 68px;
    border-radius: 21px;
    color: #0b2036;
    background: linear-gradient(135deg, var(--tt-cyan), #82eee8);
    font-family: "Manrope", sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    place-items: center;
}

.profile-hero h2 {
    margin: 0;
    font-size: 1.15rem;
}

.profile-hero p {
    margin: 0.15rem 0 0.35rem;
    color: var(--tt-muted);
    font-size: 0.7rem;
}

/* Responsive */

@media (max-width: 1199.98px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .alert-list {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-span-4 {
        grid-column: span 2;
    }

    .report-filter {
        grid-template-columns: repeat(3, 1fr);
    }

    .export-menu {
        justify-self: start;
    }
}

@media (max-width: 991.98px) {
    .auth-shell {
        display: block;
    }

    .auth-visual {
        display: none;
    }

    .auth-form-side {
        min-height: 100vh;
        padding: 1.25rem;
    }

    .admin-shell {
        margin-left: 0;
    }

    .content-grid,
    .assignment-grid,
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .form-panel {
        position: static;
    }

    .map-workspace {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .map-sidebar-panel {
        border-right: 0;
        border-bottom: 1px solid var(--tt-border);
    }

    .vehicle-list {
        display: flex;
        overflow-x: auto;
        max-height: none;
        padding-bottom: 0.4rem;
    }

    .vehicle-list-item {
        flex: 0 0 270px;
    }

    .map-legend {
        margin-top: 0.7rem;
    }

    .live-map-canvas {
        min-height: 580px;
    }
}

@media (max-width: 767.98px) {
    .topbar {
        min-height: 72px;
        padding: 0.8rem 1rem;
    }

    .topbar .eyebrow,
    .live-pill {
        display: none;
    }

    .page-heading {
        font-size: 1.2rem;
    }

    .admin-main {
        padding: 1rem;
    }

    .dashboard-hero {
        min-height: 240px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }

    .hero-actions {
        width: 100%;
    }

    .hero-actions .btn {
        flex: 1;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .alert-list {
        grid-template-columns: 1fr;
    }

    .filter-bar,
    .history-selector {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar .search-control,
    .filter-bar .form-select,
    .filter-bar > .form-control {
        width: 100%;
        min-width: 0;
    }

    .route-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-proof-grid {
        grid-template-columns: 1fr;
    }

    .report-filter {
        grid-template-columns: 1fr 1fr;
    }

    .report-filter > button {
        align-self: end;
    }

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-span-2 {
        grid-column: auto;
    }
}

@media (max-width: 575.98px) {
    .metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
    }

    .metric-card {
        min-height: 134px;
        padding: 0.85rem;
        align-items: flex-start;
        flex-direction: column;
        gap: 0.65rem;
    }

    .metric-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .metric-card strong {
        font-size: 1.4rem;
    }

    .dashboard-hero {
        padding: 1.3rem;
    }

    .dashboard-hero h2 {
        font-size: 1.8rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .panel {
        border-radius: 15px;
    }

    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .grid-span-2,
    .grid-span-4 {
        grid-column: span 1;
    }

    .assignment-meta {
        grid-template-columns: 1fr;
    }

    .assignment-actions {
        flex-wrap: wrap;
    }

    .assignment-actions form {
        margin-left: 0;
    }

    .live-map-canvas {
        min-height: 500px;
    }

    .route-summary {
        gap: 0.65rem;
    }

    .route-summary > div {
        min-height: 100px;
        padding: 0.8rem;
    }

    .route-summary strong {
        font-size: 0.9rem;
    }

    .report-filter {
        grid-template-columns: 1fr;
    }

    .driver-info-grid {
        gap: 0.5rem;
    }

    .driver-info-grid article {
        padding: 0.65rem;
    }

    .driver-primary-actions {
        grid-template-columns: 1fr;
    }

    .tracking-readouts {
        gap: 0.4rem;
    }

    .tracking-readouts > div {
        padding: 0.55rem 0.3rem;
    }

    .driver-map {
        height: 290px;
    }
}

@media print {
    .admin-sidebar,
    .topbar,
    .filter-bar,
    .report-filter,
    .btn,
    .offline-indicator {
        display: none !important;
    }

    .admin-shell {
        margin: 0;
    }

    .admin-main {
        padding: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
    }
}
