/* ===== Custom Properties ===== */
:root {
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --brand-dark: #1e293b;
    --brand-dark-light: #334155;
    --brand-accent: #3b82f6;
    --brand-surface: #f8fafc;
    --brand-border: #e2e8f0;
    --brand-text: #1e293b;
    --brand-text-muted: #64748b;
    --brand-success: #10b981;
    --brand-danger: #ef4444;
    --brand-warning: #f59e0b;
    --brand-info: #06b6d4;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, .08);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: 0.2s ease;
}
main {
    padding-top: 5.2rem !important;
}
header {
    position: fixed;
  width: 100%;
  z-index: 9999;
}
/* ===== Base ===== */
html {
    position: relative;
    min-height: 100%;
    font-size: 19px;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    margin-bottom: 72px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--brand-text);
    background-color: var(--brand-surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; }

.text-muted { color: var(--brand-text-muted) !important; }

a { color: var(--brand-primary); transition: color var(--transition); }
a:hover { color: var(--brand-primary-hover); }

/* ===== Navbar ===== */
.nav-item {
    margin-top: auto;
    margin-bottom: auto;
}

/* ===== Cards ===== */
.card {
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition);
    overflow: hidden;
}

.card:hover { box-shadow: var(--card-shadow-hover); }

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--brand-border);
    padding: 1rem 1.25rem;
}

.card-header h5 {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--brand-text-muted);
}

.card-body { padding: 1.25rem; }

.card-footer {
    background-color: #fff;
    border-top: 1px solid var(--brand-border);
    padding: 0.75rem 1.25rem;
}

/* ===== Tables ===== */
.table {
    --bs-table-hover-bg: rgba(37, 99, 235, .04);
    font-size: 0.9rem;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-text-muted);
    border-bottom-width: 2px;
    border-bottom-color: var(--brand-border);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: var(--brand-border);
}

.table-light { --bs-table-bg: var(--brand-surface); }

/* ===== Buttons ===== */
.btn {
    text-decoration-line: none;
    margin: 0.5rem 0.2rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.btn:focus, .btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, .25);
}

.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    margin: 0.25rem 0.15rem;
}

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: var(--radius);
    border-color: var(--brand-border);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, .15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--brand-dark);
    margin-bottom: 0.35rem;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===== Badges ===== */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.65em;
    border-radius: 999px;
}

/* ===== Alerts ===== */
.alert {
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    border: none;
}

/* ===== Details/Summary ===== */
details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--brand-primary);
    font-size: 0.85rem;
}

details summary:hover { text-decoration: underline; }

details[open] summary { margin-bottom: 0.35rem; }

/* ===== Modals ===== */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
}

.modal-header {
    padding: 1.25rem 1.5rem 0.5rem;
}

.modal-body {
    padding: 0.5rem 1.5rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    font-size: 1.15rem;
}

/* ===== Copy Button ===== */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0 0.25rem;
    margin: 0;
    color: var(--brand-text-muted);
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s;
    vertical-align: middle;
    line-height: 1;
}

.copy-btn:hover,
.copy-btn:focus {
    opacity: 1;
    outline: none;
}

/* ===== Table Pagination ===== */
.table-pagination {
    padding: 0.75rem 0.5rem;
}

/* ===== Utility ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* ===== PWA install prompt ===== */
.install-app-prompt {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1055;
    width: min(22rem, calc(100vw - 2rem));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-lg);
}

.install-app-prompt .card-body {
    padding: 1rem;
}

/* ===== Responsive table ===== */
@media (max-width: 767.98px) {
    .table { font-size: 0.82rem; }
    .table thead th, .table tbody td { padding: 0.6rem 0.5rem; }
    .install-app-prompt {
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
    }
}

/* ===== Page Titles ===== */
h1.mb-4 {
    font-size: 1.85rem;
    position: relative;
    padding-bottom: 0.6rem;
}

h1.mb-4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 3px;
    background: var(--brand-primary);
    border-radius: 2px;
}

/* Color variants via parent context */
h1.text-danger::after { background: var(--brand-danger); }

/* ===== Card-header "Create New" buttons ===== */
.card-header .btn-primary.btn-sm,
.card-header .btn-outline-primary.btn-sm {
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

/* ===== Clickable table rows ===== */
.operator-row,
.truck-row,
.site-row,
.admin-truck-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.operator-row td:first-child,
.truck-row td:first-child,
.site-row td:first-child {
    font-weight: 600;
    color: var(--brand-dark);
}

/* ===== Definition lists (detail / delete pages) ===== */
dl dt {
    font-weight: 600;
    color: var(--brand-text-muted);
    font-size: 0.85rem;
}

dl dd {
    font-size: 0.95rem;
}

/* ===== Dashboard ===== */
.dashboard-card {
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}

.dashboard-card .card-body { padding: 1.5rem; }

.dashboard-card .card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
    font-weight: 600;
}

.dashboard-card .display-6 {
    font-size: 2.25rem;
    font-weight: 800;
}

.dashboard-card .card-footer a {
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0.85;
    text-decoration: none;
    transition: opacity 0.15s;
}

.dashboard-card .card-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

.lead {
    font-size: 1.05rem;
    color: var(--brand-text-muted);
}

.lead strong { color: var(--brand-dark); }

.user-truck-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.user-truck-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.member-profile-btn {
    border-radius: var(--radius);
    font-size: 0.82rem;
    padding: 0.45rem 0.6rem;
    transition: all 0.15s ease;
}

.member-profile-btn:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

/* ===== Swipeable announcements ===== */
.announcement-swipe-shell {
    background: rgba(239, 68, 68, 0.95);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.announcement-item {
    position: relative;
    background: #fff;
    touch-action: pan-y;
    will-change: transform;
    transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.announcement-item.is-dismissing {
    opacity: 0;
}

.announcement-item .announcement-dismiss-btn {
    position: relative;
    z-index: 1;
}

/* ===== Badge overrides ===== */
.badge.bg-primary  { background-color: var(--brand-primary) !important; }
.badge.bg-success  { background-color: var(--brand-success) !important; }
.badge.bg-warning  { background-color: var(--brand-warning) !important; color: #fff !important; }

/* ===== Alerts ===== */
.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left: 4px solid var(--brand-primary);
}

/* ===== Error page ===== */
h1.text-danger {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-danger) !important;
}

h2.text-danger {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--brand-text-muted) !important;
    margin-bottom: 2rem;
}

code {
    background: #fef2f2;
    color: var(--brand-danger);
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.job-summary {
    white-space: pre-line;
}

/* ===== Marketing / public pages ===== */
.marketing-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #fff;
    border-radius: 1.25rem;
    padding: clamp(2rem, 5vw, 4rem);
    box-shadow: 0 20px 45px rgba(15, 23, 42, .15);
}

.marketing-hero .lead,
.marketing-hero .text-muted {
    color: rgba(255, 255, 255, .78) !important;
}

.marketing-hero .badge {
    background: rgba(255, 255, 255, .16) !important;
    color: #fff !important;
}

.marketing-panel {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 1rem;
}

/* ===== Notification panel ===== */
.notif-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10500;
}

.notif-overlay.is-open {
    display: block;
}

.notif-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, .18);
    transform: translateX(110%);
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1);
    z-index: 10501;
}

.notif-overlay.is-open .notif-panel {
    transform: translateX(0);
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #1e293b;
    color: #fff;
    flex-shrink: 0;
}

.notif-panel-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.notif-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .8);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.notif-close-btn:hover {
    color: #fff;
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.notif-panel-body .announcement-swipe-shell {
    margin-bottom: 0.625rem;
    border-radius: var(--radius);
}

.notif-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.notif-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
}

.notif-card-body {
    font-size: 0.825rem;
    color: #475569;
    line-height: 1.5;
    white-space: pre-line;
}

.notif-card-meta {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: #94a3b8;
    text-align: center;
}

.notif-empty p {
    margin: 0;
    font-size: 0.875rem;
}

@media (max-width: 767.98px) {
    .notif-panel {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 82vh;
        max-height: 82vh;
        border-radius: 1rem 1rem 0 0;
        transform: translateY(110%);
    }

    .notif-overlay.is-open .notif-panel {
        transform: translateY(0);
    }
}


.marketing-card,
.pricing-card,
.contact-card,
.about-card {
    height: 100%;
}

.marketing-card .card-body,
.pricing-card .card-body,
.contact-card .card-body,
.about-card .card-body {
    padding: 1.5rem;
}

.feature-icon,
.contact-icon,
.about-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: var(--brand-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pricing-card {
    position: relative;
}

.pricing-card.featured {
    border: 2px solid var(--brand-primary);
    box-shadow: 0 18px 40px rgba(37, 99, 235, .12);
}

.pricing-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

.pricing-meta {
    font-size: 0.9rem;
    color: var(--brand-text-muted);
}

.soft-section {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 1.25rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--card-shadow);
}

.section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.stat-chip {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    color: #fff;
    font-size: 0.85rem;
}

.marketing-list li {
    margin-bottom: 0.75rem;
}

.marketing-list li:last-child {
    margin-bottom: 0;
}

.cta-strip {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid #dbeafe;
    border-radius: 1.25rem;
}