:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --panel: rgba(255,255,255,0.96);
    --panel-2: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --danger: #dc2626;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.35), transparent 36rem),
        radial-gradient(circle at bottom right, rgba(14,165,233,0.25), transparent 34rem),
        linear-gradient(135deg, #020617 0%, #0f172a 46%, #111827 100%);
}

.app-shell {
    width: min(1180px, calc(100% - 28px));
    margin: 22px auto;
}

.container {
    background: var(--panel);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.app-header {
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(37,99,235,0.98), rgba(14,165,233,0.95));
    color: #fff;
}

.app-header h1 {
    margin: 0;
    font-size: clamp(1.55rem, 4vw, 2.25rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.app-header .subtitle {
    margin-top: 7px;
    opacity: 0.9;
    font-size: 0.96rem;
}

.content {
    padding: 26px 28px 32px;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 28px;
    background: rgba(248,250,252,0.9);
    border-bottom: 1px solid var(--border);
}

nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    color: #1f2937;
    background: #fff;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 4px 15px rgba(15,23,42,0.06);
}

nav a:hover {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

h2, h3 {
    letter-spacing: -0.03em;
}

h2 {
    margin: 0 0 18px;
    font-size: clamp(1.35rem, 4vw, 2rem);
}

h3 {
    margin-top: 28px;
    margin-bottom: 12px;
}

a {
    color: var(--primary);
    font-weight: 700;
}

.card,
form {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15,23,42,0.06);
    margin-bottom: 18px;
}

form[style*="display:inline"] {
    display: inline !important;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

label {
    display: block;
    font-weight: 800;
    color: #374151;
    margin: 4px 0 6px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 13px 14px;
    margin: 0 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
    outline: none;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}

button,
.button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 800;
    font-size: 0.96rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(37,99,235,0.28);
}

button:hover,
.button:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

button[name="delete"] {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 12px 24px rgba(239,68,68,0.22);
}

.error,
.success {
    border-radius: 16px;
    padding: 14px 16px;
    margin: 14px 0 18px;
    font-weight: 700;
}

.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #fecaca;
}

.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bbf7d0;
}

.small {
    color: var(--muted);
    font-size: 0.9em;
}

.danger {
    color: var(--danger);
}

ul {
    padding-left: 1.2rem;
}

li {
    margin: 7px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15,23,42,0.06);
}

th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

tr:last-child td {
    border-bottom: 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.stat-card {
    background: linear-gradient(180deg, #fff, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15,23,42,0.06);
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.06em;
}

.stat-label {
    color: var(--muted);
    font-weight: 700;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.84rem;
}

.badge-open {
    background: #fef3c7;
    color: #92400e;
}

.badge-closed {
    background: #dcfce7;
    color: #166534;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
}

.detail-label {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
}

.detail-value {
    margin-top: 4px;
    font-weight: 800;
}

/* Mobile table cards */
@media (max-width: 760px) {
    .app-shell {
        width: 100%;
        margin: 0;
    }

    .container {
        min-height: 100vh;
        border-radius: 0;
        border: 0;
    }

    .app-header {
        padding: 22px 18px;
    }

    .content {
        padding: 20px 16px 30px;
    }

    nav {
        padding: 12px 14px;
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    nav a {
        white-space: nowrap;
        min-height: 40px;
        font-size: 0.86rem;
    }

    .stat-grid,
    .detail-list {
        grid-template-columns: 1fr;
    }

    form,
    .card {
        padding: 16px;
        border-radius: 18px;
    }

    button,
    .button {
        width: 100%;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    table {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    tr:first-child {
        display: none;
    }

    tr {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 18px;
        margin-bottom: 14px;
        padding: 10px 12px;
        box-shadow: 0 10px 28px rgba(15,23,42,0.07);
    }

    td {
        border-bottom: 1px solid #eef2f7;
        padding: 11px 2px;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        word-break: break-word;
    }

    td:last-child {
        border-bottom: 0;
    }

    td::before {
        content: attr(data-label);
        min-width: 35%;
        color: var(--muted);
        font-weight: 900;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    td > form {
        width: 100%;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }
}


.location-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
}

.location-row input {
    margin-bottom: 16px;
}

.gps-button {
    min-height: 48px;
    white-space: nowrap;
    background: linear-gradient(135deg, #0f766e, #0891b2);
    box-shadow: 0 12px 24px rgba(8,145,178,0.24);
}

@media (max-width: 760px) {
    .location-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .gps-button {
        width: 100%;
        margin-top: -6px;
        margin-bottom: 16px;
    }
}


.timeline {
    position: relative;
    margin: 24px 0;
    padding-left: 34px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #2563eb, #0891b2, #22c55e);
}

.timeline-item {
    position: relative;
    margin-bottom: 18px;
}

.timeline-dot {
    position: absolute;
    left: -31px;
    top: 18px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #2563eb;
    border: 4px solid #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
}

.timeline-dot.stop {
    background: #0891b2;
    box-shadow: 0 0 0 3px rgba(8,145,178,0.18);
}

.timeline-dot.end {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}

.timeline-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.timeline-title {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.timeline-time {
    color: var(--muted);
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
}

.timeline-location {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.timeline-pill {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
    font-size: 0.86rem;
}

.danger-zone {
    margin-top: 26px;
    padding: 18px;
    border: 1px solid #fecaca;
    background: #fff7f7;
    border-radius: 20px;
}

.inline-delete-form {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 10px 0 0;
}

.inline-delete-form button {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 0.88rem;
}

@media (max-width: 760px) {
    .timeline {
        padding-left: 28px;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-dot {
        left: -26px;
    }

    .timeline-card-header {
        display: block;
    }

    .timeline-time {
        margin-top: 4px;
        white-space: normal;
    }
}


/* v7 graphic journey timeline */
.route-timeline {
    position: relative;
    margin: 28px 0;
    padding-left: 72px;
}

.route-timeline::before {
    content: "";
    position: absolute;
    left: 31px;
    top: 34px;
    bottom: 34px;
    width: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #22c55e 0%, #0891b2 52%, #2563eb 100%);
    box-shadow: 0 0 0 6px rgba(37,99,235,0.06);
}

.route-point {
    position: relative;
    margin-bottom: 22px;
}

.route-point:last-child {
    margin-bottom: 0;
}

.route-marker {
    position: absolute;
    left: -58px;
    top: 18px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #fff;
    border: 4px solid #2563eb;
    box-shadow: 0 10px 26px rgba(15,23,42,0.18);
    z-index: 2;
}

.route-marker.start {
    border-color: #22c55e;
}

.route-marker.stop {
    border-color: #0891b2;
}

.route-marker.end {
    border-color: #2563eb;
}

.route-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 14px 34px rgba(15,23,42,0.09);
}

.route-card-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.route-type {
    font-weight: 950;
    letter-spacing: -0.03em;
    font-size: 1.1rem;
}

.route-date-time {
    text-align: right;
    color: #475569;
    font-weight: 900;
    font-size: 0.92rem;
}

.route-date-time span {
    display: block;
}

.route-location {
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 12px;
}

.route-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.route-detail-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 11px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 900;
    font-size: 0.86rem;
}

.route-detail-pill.miles {
    background: #ecfeff;
    color: #155e75;
}

.route-detail-pill.note {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    width: 100%;
    justify-content: flex-start;
    line-height: 1.45;
}

.route-card-actions {
    margin-top: 12px;
}

.route-card-actions form {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.route-card-actions button {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 0.86rem;
}

@media (max-width: 760px) {
    .route-timeline {
        padding-left: 58px;
    }

    .route-timeline::before {
        left: 24px;
        width: 5px;
    }

    .route-marker {
        left: -51px;
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }

    .route-card {
        padding: 16px;
    }

    .route-card-top {
        display: block;
    }

    .route-date-time {
        text-align: left;
        margin-top: 4px;
    }

    .route-location {
        font-size: 1rem;
    }
}


/* v7.1 timeline event separation and compact delete button */
.route-point {
    padding-bottom: 18px;
}

.route-point:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(37,99,235,0.24), rgba(148,163,184,0.18), transparent);
}

.route-card {
    position: relative;
}

.route-card-top {
    padding-bottom: 10px;
    border-bottom: 1px dashed #cbd5e1;
}

.route-card-actions {
    position: absolute;
    right: 14px;
    bottom: 14px;
    margin-top: 0;
}

.route-card-actions form {
    display: inline;
}

.route-card-actions button {
    width: auto;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(239,68,68,0.16);
}

.route-card.has-actions {
    padding-bottom: 58px;
}

@media (max-width: 760px) {
    .route-card-actions {
        position: static;
        display: flex;
        justify-content: flex-end;
        margin-top: 12px;
    }

    .route-card-actions button {
        width: auto;
        min-height: 34px;
    }

    .route-card.has-actions {
        padding-bottom: 16px;
    }
}


/* v8 admin action buttons */
td[data-label="Actions"] form {
    margin: 4px 4px 4px 0;
}

td[data-label="Actions"] button {
    width: auto;
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    td[data-label="Actions"] {
        display: block;
    }

    td[data-label="Actions"]::before {
        display: block;
        margin-bottom: 8px;
    }

    td[data-label="Actions"] form {
        display: inline-block !important;
        margin: 4px 4px 4px 0;
    }

    td[data-label="Actions"] button {
        width: auto;
    }
}


/* v8.1 admin mobile button fix */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-actions form {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.admin-actions button {
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    white-space: nowrap;
}

@media (max-width: 760px) {
    td[data-label="Actions"] {
        display: block !important;
    }

    td[data-label="Actions"]::before {
        display: block;
        margin-bottom: 10px;
    }

    .admin-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
    }

    .admin-actions form {
        display: block !important;
        width: 100%;
    }

    .admin-actions button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        border-radius: 14px;
    }
}


/* v9 site icon/header */
.brand-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 12px 28px rgba(15,23,42,0.28);
    border: 2px solid rgba(255,255,255,0.72);
}

@media (max-width: 760px) {
    .brand-row {
        gap: 12px;
    }

    .brand-icon {
        width: 52px;
        height: 52px;
        border-radius: 15px;
    }
}


/* v9.1 clean smaller icon */
.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
}

@media (max-width: 760px) {
    .brand-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .brand-row {
        gap: 10px;
    }
}


/* v10 mobile-first dashboard */
.dashboard-hero {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 16px;
    margin: 18px 0 18px;
}

.hero-main-card {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    padding: 24px;
    border-radius: 26px;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.28), transparent 15rem),
        linear-gradient(135deg, #2563eb, #0891b2);
    box-shadow: 0 22px 45px rgba(37,99,235,0.28);
}

.hero-main-card::after {
    content: "↗";
    position: absolute;
    right: 24px;
    bottom: 14px;
    font-size: 5rem;
    font-weight: 900;
    opacity: 0.18;
}

.hero-label {
    font-weight: 900;
    opacity: 0.92;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.82rem;
}

.hero-number {
    margin-top: 14px;
    font-size: clamp(3rem, 10vw, 5.4rem);
    line-height: 0.9;
    font-weight: 950;
    letter-spacing: -0.08em;
}

.hero-subtitle {
    margin-top: 12px;
    font-weight: 800;
    opacity: 0.9;
}

.hero-side-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mini-stat-card {
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(15,23,42,0.08);
}

.mini-stat-number {
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    line-height: 1;
    font-weight: 950;
    color: var(--primary);
    letter-spacing: -0.06em;
}

.mini-stat-label {
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.9rem;
}

.dashboard-actions {
    margin-top: 18px;
}

.primary-action {
    font-size: 1.05rem;
    min-height: 54px;
}

.secondary-action {
    background: linear-gradient(135deg, #334155, #0f172a);
    box-shadow: 0 12px 24px rgba(15,23,42,0.18);
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.overview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(15,23,42,0.07);
    text-decoration: none;
    color: var(--text);
}

.overview-card:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.overview-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--primary-soft);
    font-size: 1.45rem;
}

.overview-number {
    font-size: 1.5rem;
    font-weight: 950;
    color: var(--primary);
    letter-spacing: -0.05em;
}

.overview-label {
    color: var(--muted);
    font-weight: 800;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-hero {
        gap: 12px;
        margin-top: 14px;
    }

    .hero-main-card {
        min-height: 180px;
        padding: 22px;
        border-radius: 24px;
    }

    .hero-side-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .mini-stat-card {
        padding: 15px;
        border-radius: 18px;
    }

    .mini-stat-number {
        font-size: 1.65rem;
    }

    .mini-stat-label {
        font-size: 0.82rem;
    }

    .dashboard-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .overview-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .overview-card {
        padding: 15px;
        border-radius: 18px;
    }

    .overview-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }
}


/* v10.1 dashboard tile fix */
.mobile-dashboard {
    display: block;
    width: 100%;
}

.dashboard-big-tile,
.dashboard-tile,
.overview-tile {
    box-sizing: border-box;
    border: 1px solid #e5e7eb !important;
    background: #ffffff !important;
    border-radius: 22px !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10) !important;
}

.dashboard-big-tile {
    position: relative;
    overflow: hidden;
    margin: 18px 0 14px;
    padding: 24px;
    color: #ffffff !important;
    background: linear-gradient(135deg, #2563eb, #0891b2) !important;
    min-height: 185px;
}

.dashboard-big-tile .tile-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 12px;
}

.tile-main-number {
    font-size: clamp(3rem, 14vw, 5.5rem);
    line-height: 0.9;
    font-weight: 950;
    letter-spacing: -0.08em;
}

.tile-label {
    font-weight: 900;
    color: inherit;
}

.tile-subtext {
    margin-top: 10px;
    font-weight: 800;
    opacity: 0.9;
}

.dashboard-tile-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin: 14px 0 18px !important;
}

.dashboard-tile {
    min-height: 132px;
    padding: 18px;
}

.dashboard-tile .tile-icon {
    font-size: 1.55rem;
    line-height: 1;
    margin-bottom: 10px;
}

.tile-number {
    display: block;
    font-size: clamp(1.65rem, 7vw, 2.5rem);
    line-height: 1;
    font-weight: 950;
    color: #2563eb;
    letter-spacing: -0.06em;
}

.dashboard-tile .tile-label {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.2;
}

.dashboard-action-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0 24px;
}

.dashboard-action {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 16px;
    border-radius: 16px;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.dashboard-action.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.dashboard-action.secondary {
    background: linear-gradient(135deg, #334155, #0f172a);
}

.dashboard-overview-list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.overview-tile {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 16px;
    color: #111827 !important;
    text-decoration: none;
}

.overview-tile-icon {
    display: flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: #dbeafe;
    font-size: 1.35rem;
}

.overview-tile strong {
    display: block;
    color: #2563eb;
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 950;
}

.overview-tile small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 800;
}

@media (max-width: 760px) {
    .dashboard-big-tile {
        margin-top: 14px;
        padding: 22px;
        min-height: 170px;
        border-radius: 24px !important;
    }

    .dashboard-tile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .dashboard-tile {
        min-height: 124px;
        padding: 15px;
        border-radius: 18px !important;
    }

    .dashboard-action-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .dashboard-overview-list {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .overview-tile {
        border-radius: 18px !important;
        padding: 15px;
    }
}


/* v11 Reports */
.report-filter {
    max-width: 360px;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 24px;
}

.report-summary-card {
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(15,23,42,0.08);
}

.report-summary-number {
    font-size: clamp(1.45rem, 4vw, 2.1rem);
    line-height: 1;
    font-weight: 950;
    color: var(--primary);
    letter-spacing: -0.05em;
}

.report-summary-label {
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.88rem;
}

.month-report-list {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.month-report-card {
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(15,23,42,0.07);
}

.month-report-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
}

.month-name {
    font-weight: 950;
    font-size: 1.05rem;
}

.month-sub {
    color: var(--muted);
    font-weight: 800;
    font-size: 0.86rem;
    margin-top: 3px;
}

.month-miles {
    font-weight: 950;
    color: var(--primary);
    white-space: nowrap;
}

.month-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.month-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #0891b2);
}

.report-table {
    margin-top: 20px;
}

@media (max-width: 760px) {
    .report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .report-summary-card {
        padding: 15px;
        border-radius: 18px;
    }

    .month-report-card {
        padding: 15px;
        border-radius: 18px;
    }

    .month-report-top {
        align-items: flex-start;
    }

    .month-miles {
        text-align: right;
    }
}


/* v12 site edit buttons */
.site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.site-actions form {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.small-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff !important;
    text-decoration: none;
    font-weight: 900;
    font-size: 0.82rem;
    box-shadow: 0 8px 18px rgba(37,99,235,0.18);
}

.site-actions button {
    width: auto;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    .site-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 10px;
    }

    .site-actions form {
        width: 100%;
    }

    .site-actions button,
    .site-actions .small-action-button {
        width: 100%;
        min-height: 44px;
        border-radius: 14px;
    }
}


/* v12.1 improved Sites action buttons */
.site-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.site-actions form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.site-action-btn,
.site-actions .small-action-button,
.site-actions button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
    width: auto;
}

.site-actions .small-action-button {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe;
    box-shadow: none;
}

.site-actions .small-action-button::before {
    content: "✏️";
}

.site-actions button[name="delete"] {
    background: #fff1f2 !important;
    color: #be123c !important;
    border: 1px solid #fecdd3;
    box-shadow: none;
}

.site-actions button[name="delete"]::before {
    content: "🗑️";
}

.site-actions .small-action-button:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb;
}

.site-actions button[name="delete"]:hover {
    background: #e11d48 !important;
    color: #ffffff !important;
    border-color: #e11d48;
}

@media (max-width: 760px) {
    .site-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .site-actions form {
        width: 100%;
    }

    .site-actions .small-action-button,
    .site-actions button {
        width: 100%;
        min-height: 44px;
        border-radius: 14px;
    }
}

@media (max-width: 420px) {
    .site-actions {
        grid-template-columns: 1fr;
    }
}


/* v13 import/export journeys */
.import-export-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0 24px;
}

.import-export-card {
    padding: 20px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(15,23,42,0.08);
}

.import-export-card h3 {
    margin-top: 0;
}

.import-export-card form {
    box-shadow: none;
    border: 0;
    padding: 0;
    margin-bottom: 0;
}

code {
    display: block;
    white-space: normal;
    word-break: break-word;
    padding: 14px;
    border-radius: 14px;
    background: #0f172a;
    color: #e2e8f0;
    font-weight: 700;
}

@media (max-width: 760px) {
    .import-export-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .import-export-card {
        padding: 16px;
        border-radius: 18px;
    }
}


/* v15 tools page */
.tools-grid{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:16px;
 margin-top:18px;
}
.tool-card{
 display:block;
 text-decoration:none;
 color:inherit;
 background:#fff;
 border:1px solid var(--border);
 border-radius:24px;
 padding:22px;
 box-shadow:0 12px 28px rgba(15,23,42,.08);
}
.tool-card:hover{
 transform:translateY(-2px);
}
.tool-icon{
 font-size:2rem;
 margin-bottom:10px;
}
.tool-title{
 font-size:1.1rem;
 font-weight:900;
 margin-bottom:6px;
}
.tool-text{
 color:#64748b;
 font-weight:700;
}
.admin-tool{
 border-color:#f5d0fe;
}
@media (max-width:760px){
 .tools-grid{
  grid-template-columns:1fr;
  gap:12px;
 }
 .tool-card{
  padding:18px;
  border-radius:18px;
 }
}
