* {
    box-sizing: border-box;
}

/* =========================
   Document Workspace UI
   Shared style for quotation, government, and ambulance document screens.
   ========================= */
body.document-workspace {
    background: #f3f6fb;
    color: #0f172a;
}

.document-workspace .container {
    width: min(1440px, calc(100% - 32px));
}

.document-workspace .topbar {
    min-height: 64px;
    background: rgba(255, 255, 255, .92);
    border-bottom-color: rgba(203, 213, 225, .9);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.document-workspace .hero {
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(30, 64, 175, .92)),
        #0f172a;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}

.document-workspace .gov-hero,
.document-workspace .ambulance-hero {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .96), rgba(37, 99, 235, .92)),
        #0f766e;
}

.document-workspace .brand-badge {
    border-radius: 999px;
    font-weight: 900;
    letter-spacing: .02em;
}

.document-workspace .card,
.document-workspace .stat-card {
    border-radius: 14px;
    border-color: #dbe3ee;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.document-workspace .card-head {
    align-items: center;
}

.document-workspace .card-head h1,
.document-workspace .card-head h2 {
    letter-spacing: 0;
}

.document-workspace input,
.document-workspace select,
.document-workspace textarea {
    border-radius: 10px;
}

.document-workspace .btn {
    border-radius: 10px;
}

.document-workspace .table-wrap {
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    overflow: auto;
    background: #fff;
}

.document-workspace .table-wrap table {
    border-collapse: separate;
    border-spacing: 0;
}

.document-workspace .table-wrap th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 900;
}

.document-workspace .table-wrap td {
    border-bottom: 1px solid #eef2f7;
}

.document-workspace .table-wrap tbody tr:hover td {
    background: #f8fbff;
}

.document-summary-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 800;
}

.document-summary-strip .muted {
    color: #1d4ed8;
}

.document-search-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.document-search-tools .search-row {
    flex: 1 1 520px;
    margin: 0;
}

.document-workspace .status-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.document-workspace .status-select {
    min-width: 150px;
}

@media (max-width: 760px) {
    .document-workspace .container {
        width: calc(100% - 20px);
        margin-block: 18px;
    }

    .document-summary-strip,
    .document-search-tools {
        display: grid;
    }

    .document-search-tools .search-row {
        display: grid;
        grid-template-columns: 1fr;
    }
}

body {
    margin: 0;
    font-family: "Tahoma", "Sarabun", Arial, sans-serif;
    background: #f6f8fb;
    color: #0f172a;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .18), transparent 30%),
        linear-gradient(135deg, #eff6ff, #f8fafc);
}

.login-card {
    width: min(460px, 100%);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .10);
}

.login-card.wide {
    width: min(760px, 100%);
}

.register-hero-image {
    display: block;
    width: calc(100% + 64px);
    max-width: none;
    margin: -32px -32px 22px;
    height: auto;
    border-radius: 28px 28px 18px 18px;
    background: #0f172a;
}

.brand-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 12px;
}

h1, h2, h3, h4 {
    margin-top: 0;
}

h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

h2 {
    margin-bottom: 6px;
}

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

.muted {
    color: #475569;
}

.shortcut-link {
    color: #0f3f91;
    font-weight: 900;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.shortcut-link:hover,
.shortcut-link:focus {
    color: #0e7490;
}

form {
    margin-top: 0;
}

label {
    display: block;
    font-weight: 700;
    color: #334155;
    margin-bottom: 14px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
}

.checkbox-card input[type="checkbox"] {
    margin-top: 0;
}

.code-block {
    display: block;
    overflow-x: auto;
    white-space: pre;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.55;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 12px 0 0;
    background: linear-gradient(to top, #fff 80%, rgba(255, 255, 255, 0));
}

small {
    display: block;
    margin-top: 6px;
}

input, select, textarea {
    width: 100%;
    margin-top: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 13px 14px;
    outline: none;
    font-size: 15px;
    background: #fff;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px #dbeafe;
}

input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    border-radius: 14px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.btn.primary {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.btn.full {
    width: 100%;
}

.btn.small {
    padding: 8px 12px;
    font-size: 13px;
}

.alert {
    border-radius: 16px;
    padding: 12px 14px;
    margin: 16px 0;
    font-weight: 700;
}

.alert.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.setup-note {
    margin-top: 18px;
    color: #64748b;
    text-align: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

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

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 28px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar > div:first-child {
    min-width: 220px;
}

.topbar > div:first-child strong {
    display: block;
    line-height: 1.2;
}

.topbar > div:first-child .muted {
    font-size: 12px;
}

.nav-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-user > a:not(.btn) {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    color: #334155;
    font-weight: 800;
}

.nav-user > a:not(.btn):hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nav-user > a.active:not(.btn),
.nav-group-menu a.active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    font-weight: 800;
}

.dashboard-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px 0 12px;
    border: 1px solid rgba(37, 99, 235, .28);
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .22);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.dashboard-fab:hover {
    background: #1d4ed8;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(37, 99, 235, .32);
}

.dashboard-fab:focus-visible {
    outline: 3px solid rgba(147, 197, 253, .95);
    outline-offset: 3px;
}

.dashboard-fab-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex: 0 0 auto;
}

.nav-group {
    position: relative;
    display: inline-flex;
}

.nav-group-toggle {
    min-height: 40px;
    border: 1px solid transparent;
    background: #f8fafc;
    color: #1e293b;
    border-radius: 999px;
    padding: 0 14px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.nav-group-toggle::after {
    content: "▾";
    margin-left: 8px;
    font-size: 10px;
    color: #64748b;
}

.nav-group:hover .nav-group-toggle,
.nav-group:focus-within .nav-group-toggle {
    background: #eef6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    box-shadow: 0 0 0 4px rgba(219, 234, 254, .75);
}

.nav-group-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    padding: 10px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 20px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .14);
    z-index: 30;
}

.nav-group-menu::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid rgba(226, 232, 240, .95);
    border-top: 1px solid rgba(226, 232, 240, .95);
    transform: rotate(45deg);
}

.nav-group:hover .nav-group-menu,
.nav-group:focus-within .nav-group-menu {
    display: grid;
    gap: 6px;
}

.nav-group-menu a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 14px;
    color: #1e293b;
    font-weight: 800;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-group-menu a::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #93c5fd;
    margin-right: 10px;
    flex: 0 0 auto;
}

.nav-group-menu a:hover {
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateX(2px);
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto;
}

.hero {
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
    color: #fff;
    border-radius: 30px;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 20px 60px rgba(37, 99, 235, .20);
    margin-bottom: 22px;
}

.hero.mini {
    padding: 24px;
}

.hero p {
    color: #dbeafe;
    margin-bottom: 0;
}

.hero .brand-badge {
    background: rgba(255,255,255,.18);
    color: #fff;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 22px 0;
}

.stat-card, .card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 26px;
    padding: 22px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .05);
}

.stat-card span {
    color: #64748b;
    font-weight: 700;
}

.stat-card strong {
    display: block;
    font-size: 34px;
    margin-top: 8px;
}

.card {
    margin-bottom: 18px;
}

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

.card-head p {
    margin: 6px 0 0;
    color: #475569;
}

.page-subtitle {
    margin: 4px 0 0;
    color: #475569;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    background: transparent;
    border: 0;
    padding: 0;
}

.table-wrap {
    overflow-x: auto;
}

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

th {
    text-align: left;
    color: #64748b;
    background: #f8fafc;
    padding: 12px;
    white-space: nowrap;
}

td {
    padding: 13px 12px;
    border-top: 1px solid #e2e8f0;
    vertical-align: top;
}

.empty {
    text-align: center;
    color: #94a3b8;
    padding: 28px;
}

.pill {
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}

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

.form-panel {
    background: #f8fafc;
    border-radius: 24px;
    padding: 18px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    margin: 0 0 18px;
}

.company-preview,
.doc-company {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 16px;
    margin-bottom: 18px;
}

.logo-box {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    background: #fde047;
    color: #0f172a;
    font-weight: 900;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-box.small {
    width: 60px;
    height: 60px;
    font-size: 12px;
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.quote-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 20px;
    align-items: start;
}

.quote-main {
    min-width: 0;
}

.quote-side {
    min-width: 0;
}

.sticky-card {
    position: sticky;
    top: 88px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px;
}

.checkbox-row input,
.checkbox-mini input {
    width: auto;
    margin: 0;
}

.coverage-flags {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.flag {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    padding: 10px 12px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 13px;
}

.flag.ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.flag.off {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.disabled-box {
    opacity: .45;
}

.items-wrap {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.item-row {
    display: grid;
    grid-template-columns: auto 1fr 160px auto;
    gap: 10px;
    align-items: center;
}

.item-row input {
    margin-top: 0;
}

.doc-preview {
    font-size: 13px;
}

.doc-preview h3 {
    margin: 0 0 8px;
}

.doc-title {
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
}

.preview-price-box,
.price-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 12px;
}

.price-line,
.price-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
}

.muted-line {
    color: #64748b;
    font-size: 12px;
}

.price-total {
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 10px;
    color: #1d4ed8;
    font-size: 16px;
    font-weight: 900;
}

.provider-footer {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 18px;
    padding: 14px;
    margin-top: 16px;
}

.provider-footer p {
    margin: 6px 0;
}

.quote-container {
    width: min(980px, calc(100% - 32px));
}

.quote-paper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 26px;
    padding: 34px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .05);
}

.quote-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 18px;
}

.print-logo {
    width: 96px;
    height: 96px;
}

.quote-header h1 {
    font-size: 24px;
}

.quote-header p,
.quote-title-row p {
    margin: 4px 0;
    color: #475569;
}

.quote-title-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 24px 0;
}

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

.quote-section {
    margin: 22px 0;
}

.quote-section h3 {
    margin: 0 0 10px;
    background: #f1f5f9;
    border-left: 4px solid #2563eb;
    padding: 10px 12px;
    border-radius: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.info-grid div {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
}

.info-grid span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.coverage-table {
    border: 1px solid #e2e8f0;
}

.coverage-table td:first-child {
    width: 65%;
}

.coverage-table td:last-child {
    text-align: right;
    font-weight: 800;
}

.price-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.quote-footer {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 20px;
    margin-top: 34px;
    border-top: 1px solid #e2e8f0;
    padding-top: 22px;
}

.signature-box {
    text-align: center;
    align-self: end;
}

.signature-line {
    height: 54px;
    border-bottom: 1px solid #0f172a;
    margin-bottom: 8px;
}

@media (max-width: 980px) {
    .quote-layout {
        grid-template-columns: 1fr;
    }

    .sticky-card {
        position: static;
    }

    .coverage-flags,
    .price-options,
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .grid-2, .grid-3, .stats-grid, .search-row {
        grid-template-columns: 1fr;
    }

    .hero, .card-head, .quote-title-row, .quote-footer {
        align-items: flex-start;
        flex-direction: column;
        display: flex;
    }

    .topbar {
        padding: 10px 14px;
        align-items: flex-start;
        flex-direction: column;
    }

    .hide-mobile {
        display: none;
    }

    .item-row {
        grid-template-columns: auto 1fr;
    }
}

@media print {
    body {
        background: #fff;
    }

    .no-print,
    .topbar {
        display: none !important;
    }

    .container,
    .quote-container {
        width: 100%;
        margin: 0;
    }

    .quote-paper {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .quote-section {
        break-inside: avoid;
    }

    a {
        color: inherit;
    }
}


/* =========================
   Set 3 layout refinements
   ========================= */

.quotation-create-page .container {
    width: min(1260px, calc(100% - 36px));
}

.quotation-create-page .card {
    padding: 24px;
}

.quotation-create-page .card h2 {
    font-size: 24px;
    line-height: 1.25;
}

.quotation-create-page .card h3 {
    font-size: 18px;
    margin-top: 24px;
}

.price-input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.addon-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 16px;
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 16px;
    margin-bottom: 16px;
}

.switch-row {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    font-weight: 700;
}

.switch-row input,
.choice-card input,
.checkbox-mini input {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto;
}

.switch-row small,
.choice-card small {
    display: block;
    color: #64748b;
    font-weight: 400;
    margin-top: 4px;
    line-height: 1.35;
}

.compact-field {
    margin: 0;
}

.choice-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 16px;
    margin: 16px 0 22px;
}

.choice-title {
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 12px;
}

.price-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.choice-card {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px;
    margin: 0 !important;
    cursor: pointer;
    background: #f8fafc;
    transition: .15s ease;
}

.choice-card:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 4px #dbeafe;
}

.items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 12px;
}

.items-header h3 {
    margin: 0 0 4px;
}

.items-header p {
    margin: 0;
    color: #64748b;
}

.items-table {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.items-table-head,
.item-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 180px 70px;
    gap: 10px;
    align-items: center;
}

.items-table-head {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    padding: 0 4px;
}

.item-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 10px;
}

.item-row input {
    margin-top: 0 !important;
}

.checkbox-mini {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    height: 100%;
}

.logo-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 6px;
    color: #0f172a;
    text-align: center;
    line-height: 1.15;
}

.logo-box img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block;
    margin: auto;
    border-radius: 0;
}

.logo-box.small {
    width: 72px;
    height: 72px;
}

.print-logo {
    width: 110px;
    height: 110px;
    border-radius: 22px;
}

/* keep round logos round when file itself is circular; do not crop or stretch */
.company-preview .logo-box,
.doc-company .logo-box,
.quote-header .logo-box {
    overflow: visible;
}

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

.doc-company h3 {
    margin-top: 0;
}

.preview-price-box {
    border-color: #dbeafe;
    background: #f8fbff;
}

@media (max-width: 1100px) {
    .quote-layout {
        grid-template-columns: 1fr;
    }

    .quote-side {
        order: -1;
    }

    .sticky-card {
        position: static;
    }
}

@media (max-width: 800px) {
    .addon-card,
    .price-input-grid,
    .price-mode-grid,
    .items-table-head,
    .item-row {
        grid-template-columns: 1fr;
    }

    .items-table-head {
        display: none;
    }

    .checkbox-mini {
        justify-content: flex-start;
    }

    .items-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Set 7: quotation edit + reuse vehicle */
.reuse-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr);
    gap: 14px;
    align-items: end;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 22px;
    padding: 16px;
    margin-bottom: 18px;
}

.reuse-help {
    color: #1e40af;
    font-size: 13px;
    line-height: 1.45;
    padding-bottom: 14px;
}

.danger-pill {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.success-pill {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.warning-pill {
    background: #fef3c7 !important;
    color: #92400e !important;
}

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

.detail-grid {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px 14px;
}

.detail-grid b {
    color: #475569;
}

.timeline-item {
    border-bottom: 1px solid #e5edf6;
    padding: 10px 0;
}

.timeline-item:last-child {
    border-bottom: 0;
}

@media (max-width: 800px) {
    .reuse-panel {
        grid-template-columns: 1fr;
    }

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

    .reuse-help {
        padding-bottom: 0;
    }
}


/* Set 5 actions retained */
.inline-form {
    display: inline-flex;
    margin: 0;
}

.btn.danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.actions {
    align-items: center;
}


/* =========================
   Set 8: consistent controls + responsive polish
   ========================= */

/* ป้องกัน checkbox/radio ถูกบังคับ width:100% จาก input global */
input[type="checkbox"],
input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block;
    vertical-align: middle;
    accent-color: #2563eb;
    box-shadow: none !important;
}

/* input ปกติให้กว้างเต็ม แต่ไม่กระทบ checkbox/radio */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    max-width: 100%;
}

/* จัด checkbox/radio ให้อยู่บรรทัดเดียวกับข้อความเสมอ */
.checkbox-row,
.switch-row,
.choice-card,
.checkbox-mini {
    line-height: 1.35;
}

.checkbox-row {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.switch-row {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.choice-card {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.checkbox-mini {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* ปรับแถวรายการให้วางตรงกัน ไม่โดดไปมา */
.items-table-head,
.item-row {
    grid-template-columns: 64px minmax(180px, 1fr) minmax(120px, 180px) 76px !important;
}

.item-row .btn.small {
    width: 100%;
}

/* ฟอร์มเลือกข้อมูลรถเดิม */
.reuse-panel label {
    margin-bottom: 0;
}

.reuse-panel select {
    margin-top: 8px;
}

/* ปุ่มในตารางไม่เบียด */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.actions .btn,
.actions .inline-form {
    flex: 0 0 auto;
}

/* Responsive: Tablet */
@media (max-width: 1100px) {
    .container {
        width: min(100% - 24px, 100%);
    }

    .quote-layout,
    .gov-layout {
        grid-template-columns: 1fr !important;
    }

    .quote-side,
    .gov-side {
        order: -1;
    }

    .sticky-card {
        position: static !important;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 16px;
        gap: 10px;
    }

    .nav-user {
        width: 100%;
        gap: 8px;
        justify-content: flex-start;
    }

    .nav-group-menu {
        left: 0;
        right: auto;
    }

    .nav-group-menu::before {
        left: 26px;
        right: auto;
    }
}

/* Responsive: Mobile */
@media (max-width: 760px) {
    body {
        font-size: 14px;
    }

    .container {
        width: calc(100% - 16px);
        margin: 12px auto;
    }

    .hero {
        border-radius: 22px;
        padding: 18px;
    }

    .card,
    .quotation-create-page .card {
        border-radius: 20px;
        padding: 16px;
    }

    .grid-2,
    .grid-3,
    .price-input-grid,
    .price-mode-grid,
    .reuse-panel,
    .addon-card {
        grid-template-columns: 1fr !important;
    }

    .items-table-head {
        display: none !important;
    }

    .item-row {
        grid-template-columns: 28px 1fr !important;
        align-items: center;
    }

    .item-row input[name^="item_name"],
    .item-row input[name^="item_amount"],
    .item-row .btn.small {
        grid-column: 1 / -1;
    }

    .checkbox-mini {
        justify-content: flex-start !important;
    }

    .choice-card,
    .switch-row,
    .checkbox-row {
        align-items: start;
    }

    .btn {
        min-height: 42px;
    }

    .topbar > div:first-child {
        min-width: 0;
    }

    .nav-user > a:not(.btn),
    .nav-group,
    .nav-group-toggle {
        width: 100%;
    }

    .nav-group-toggle,
    .nav-user > a:not(.btn) {
        justify-content: space-between;
    }

    .nav-group-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 6px;
        box-shadow: none;
        border-radius: 16px;
    }

    .nav-group-menu::before {
        display: none;
    }

    .dashboard-fab {
        right: 14px;
        bottom: 14px;
        width: 46px;
        min-height: 46px;
        padding: 0;
        justify-content: center;
    }

    .dashboard-fab span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .actions .btn,
    .actions .inline-form,
    .actions .inline-form .btn {
        width: 100%;
    }

    .search-row {
        grid-template-columns: 1fr !important;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 720px;
    }
}


/* Set 11: user/team management */
.form-panel h3 {
    margin-top: 18px;
}

.form-panel h3:first-child {
    margin-top: 0;
}


/* Set 12: status controls */
.status-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    flex-wrap: nowrap;
}

.status-select {
    width: auto;
    min-width: 130px;
    margin-top: 0 !important;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.status-card {
    margin-bottom: 14px;
}

.wide-status-form {
    justify-content: flex-end;
}

.status-inline-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 16px;
}

@media (max-width: 760px) {
    .status-form,
    .wide-status-form,
    .status-inline-panel {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .status-select,
    .status-form .btn {
        width: 100%;
    }
}


/* Set 13: multi-company */
.company-select-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr);
    gap: 14px;
    align-items: end;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 22px;
    padding: 16px;
    margin-bottom: 18px;
}

.company-select-panel label {
    margin-bottom: 0;
}

.company-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.company-check-card {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 18px;
    padding: 14px;
    margin: 0 !important;
}

.company-check-card input[type="checkbox"] {
    margin-top: 2px !important;
}

.company-check-card small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 400;
    line-height: 1.35;
}

.permission-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.permission-card {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid #dbeafe;
    background: #f8fafc;
    border-radius: 16px;
    padding: 13px;
    margin: 0 !important;
}

.permission-card input[type="checkbox"] {
    margin-top: 2px !important;
}

.permission-card small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 400;
    line-height: 1.35;
}

.permission-card.is-disabled {
    opacity: .62;
}

.permission-user-list {
    display: grid;
    gap: 14px;
}

.permission-user-card {
    border: 1px solid #dbeafe;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
}

.permission-user-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.permission-user-head h3,
.permission-user-head p {
    margin: 0;
}

@media (max-width: 760px) {
    .company-select-panel,
    .company-check-grid,
    .permission-card-grid {
        grid-template-columns: 1fr !important;
    }

    .permission-user-head {
        display: grid;
        grid-template-columns: 1fr;
    }
}


/* Set 19: cleaner action layout */
.quotation-action-panel {
    margin-bottom: 14px;
}

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

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.form-final-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.form-final-actions h2 {
    margin: 0 0 4px;
}

.form-final-actions p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 760px) {
    .action-head,
    .form-final-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons {
        justify-content: stretch;
        width: 100%;
    }

    .action-buttons .btn,
    .action-buttons form,
    .action-buttons form .btn {
        width: 100%;
    }
}


/* =========================
   Dashboard Redesign
   ========================= */

/* --- Stat Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 20px 20px 0 0;
}

.stat-card.s-blue::before  { background: #2563eb; }
.stat-card.s-teal::before  { background: #0d9488; }
.stat-card.s-amber::before { background: #d97706; }
.stat-card.s-coral::before { background: #dc2626; }

/* fallback: ถ้าไม่ระบุ modifier ให้ใช้สีน้ำเงิน */
.stat-card:not(.s-blue):not(.s-teal):not(.s-amber):not(.s-coral)::before {
    background: #2563eb;
}

.stat-card .stat-icon {
    font-size: 22px;
    display: block;
    margin-bottom: 10px;
}

.stat-card > span:not(.stat-icon):not(.stat-sub) {
    color: #475569;
    font-weight: 700;
    font-size: 13px;
}

.stat-card strong {
    display: block;
    font-size: 32px;
    margin-top: 6px;
    line-height: 1.1;
    color: #0f172a;
}

.stat-card .stat-sub {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

/* --- Document type pills in table --- */
.pill.type-gov {
    background: #dcfce7;
    color: #166534;
}

.pill.type-gen {
    background: #dbeafe;
    color: #1e40af;
}

.pill.type-amb {
    background: #fef9c3;
    color: #854d0e;
}

/* --- Status pills --- */
.pill.s-sent    { background: #dcfce7; color: #166534; }
.pill.s-pending { background: #fef9c3; color: #854d0e; }
.pill.s-draft   { background: #f1f5f9; color: #475569; }
.pill.s-cancel  { background: #fee2e2; color: #991b1b; }

/* --- Card head tweak for dashboard --- */
.card-head {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
}

/* --- Table row hover --- */
tbody tr:hover td {
    background: #f8fafc;
}

/* --- Hero gradient update --- */
.hero {
    background: linear-gradient(135deg, #1e40af, #0ea5e9);
}

/* --- Topbar brand logo --- */
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topbar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    font-weight: 800;
    font-size: 13px;
    margin-right: 8px;
    flex-shrink: 0;
}

.topbar-logo.first-logo {
    width: 96px;
    height: 36px;
    padding: 3px 6px;
    background: #050505;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .16);
}

.topbar-logo.first-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.topbar .topbar-brand img {
    display: block !important;
    width: auto !important;
    max-width: 96px !important;
    height: auto !important;
    max-height: 36px !important;
    object-fit: contain !important;
}

.topbar .topbar-brand .topbar-logo.first-logo,
nav.topbar .topbar-logo.first-logo {
    width: 96px !important;
    height: 36px !important;
    max-width: 96px !important;
    max-height: 36px !important;
    min-width: 96px !important;
    min-height: 36px !important;
    overflow: hidden !important;
}

.topbar .topbar-brand .topbar-logo.first-logo img,
nav.topbar .topbar-logo.first-logo img {
    display: block !important;
    width: 96px !important;
    height: 36px !important;
    max-width: 96px !important;
    max-height: 36px !important;
    object-fit: contain !important;
}

.driver-app-download {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.driver-app-download strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
}

.driver-app-download p {
    margin: 4px 0 0;
    color: #475569;
    line-height: 1.5;
}

/* --- Responsive: stack stat cards on mobile --- */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================
   Visual polish pass 2026
   ========================= */
:root {
    --ui-ink: #0f172a;
    --ui-muted: #64748b;
    --ui-line: #dbe4ef;
    --ui-soft: #f8fbff;
    --ui-blue: #2563eb;
    --ui-cyan: #0891b2;
    --ui-teal: #0f766e;
    --ui-amber: #d97706;
    --ui-rose: #e11d48;
    --ui-green: #059669;
    --ui-violet: #7c3aed;
}

body:not(.print-page) {
    background:
        linear-gradient(180deg, #f3f8ff 0%, #f8fafc 42%, #f6f8fb 100%);
}

.topbar {
    border-bottom-color: rgba(191, 219, 254, .85);
}

.topbar-logo {
    background: linear-gradient(135deg, var(--ui-blue), var(--ui-teal));
    box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}

.topbar-logo.first-logo {
    background: #050505;
}

.nav-user > a:not(.btn),
.nav-group-toggle {
    border: 1px solid transparent;
}

.nav-user > a:not(.btn):hover,
.nav-group:hover .nav-group-toggle,
.nav-group:focus-within .nav-group-toggle {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.nav-group-menu {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.nav-group-menu a:nth-child(2n)::before {
    background: #2dd4bf;
}

.nav-group-menu a:nth-child(3n)::before {
    background: #f59e0b;
}

.hero {
    background:
        linear-gradient(135deg, #1d4ed8 0%, #0891b2 54%, #0f766e 100%);
    box-shadow: 0 22px 60px rgba(8, 145, 178, .22);
}

.hero .btn.primary {
    background: #fff;
    border-color: #fff;
    color: #1e40af;
}

.hero .btn:not(.primary) {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .35);
    color: #fff;
}

.card,
.stat-card,
.login-card {
    border-color: rgba(191, 219, 254, .72);
    box-shadow: 0 12px 34px rgba(15, 23, 42, .07);
}

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

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ui-blue), var(--ui-cyan), var(--ui-teal));
    opacity: .9;
}

.card-head {
    border-bottom-color: #eaf2ff;
}

.card-head h1,
.card-head h2 {
    color: #10233f;
}

.brand-badge {
    background: #e0f2fe;
    color: #0369a1;
}

.btn {
    border-color: #cbdff5;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .10);
}

.btn.primary {
    background: linear-gradient(135deg, var(--ui-blue), var(--ui-cyan));
    border-color: transparent;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .20);
}

.btn.danger {
    background: linear-gradient(135deg, #dc2626, var(--ui-rose));
    border-color: transparent;
}

input,
select,
textarea {
    border-color: #c9d8ea;
    background: #fbfdff;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .16);
    background: #fff;
}

.form-panel,
.reuse-panel,
.company-select-panel,
.addon-card,
.choice-panel,
.status-inline-panel {
    background: linear-gradient(180deg, #f8fbff, #ffffff);
    border: 1px solid #dbeafe;
}

.search-row {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    padding: 10px;
}

th {
    background: linear-gradient(180deg, #eef6ff, #eaf2ff);
    color: #31506f;
    border-bottom: 1px solid #cfe0f4;
}

td {
    border-top-color: #e8eef6;
}

tbody tr:hover td {
    background: #f3f9ff;
}

.pill {
    background: #e0f2fe;
    color: #075985;
}

.danger-pill {
    background: #ffe4e6 !important;
    color: #be123c !important;
}

.alert.success {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.alert.error {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}

.stat-card {
    min-height: 126px;
}

.stat-card strong {
    color: #10233f;
}

.stat-card.s-blue {
    background: linear-gradient(180deg, #ffffff, #eff6ff);
}

.stat-card.s-teal {
    background: linear-gradient(180deg, #ffffff, #ecfdf5);
}

.stat-card.s-amber {
    background: linear-gradient(180deg, #ffffff, #fffbeb);
}

.stat-card.s-coral {
    background: linear-gradient(180deg, #ffffff, #fff1f2);
}

.price-total {
    color: var(--ui-teal);
}

.provider-footer {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
    border-color: #bae6fd;
}

/* Nearby vehicles map */
.nearby-vehicles-page .nearby-shell {
    overflow: visible;
}

.nearby-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.nearby-search,
.nearby-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.nearby-search input {
    min-width: min(420px, 100%);
    flex: 1;
}

.nearby-place-choices {
    margin: -4px 0 16px;
    padding: 14px;
    border: 1px solid #d7e6f8;
    border-radius: 16px;
    background: #f8fbff;
}

.nearby-place-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.nearby-place-title strong,
.nearby-place-title span {
    display: block;
}

.nearby-place-title span {
    color: #64748b;
    font-size: 13px;
}

.nearby-place-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.nearby-place-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px;
    border: 1px solid #d7e6f8;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
}

.nearby-place-option:hover,
.nearby-place-option:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: none;
}

.nearby-place-option strong,
.nearby-place-option span,
.nearby-place-option small {
    display: block;
}

.nearby-place-option span {
    margin-top: 4px;
    color: #475569;
    line-height: 1.45;
}

.nearby-place-option small {
    margin-top: 6px;
    color: #64748b;
}

.nearby-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: stretch;
}

.nearby-map-panel,
.nearby-results-panel {
    border: 1px solid #d7e6f8;
    border-radius: 18px;
    background: #f8fbff;
    overflow: hidden;
}

.nearby-map {
    width: 100%;
    min-height: 620px;
    height: 62vh;
    background: #dbeafe;
}

.nearby-map-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    color: #475569;
    font-size: 13px;
    border-top: 1px solid #d7e6f8;
}

.nearby-results-panel {
    display: flex;
    flex-direction: column;
    min-height: 620px;
}

.nearby-results-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid #d7e6f8;
}

.nearby-results-head strong,
.nearby-results-head span {
    display: block;
}

.nearby-results-head span {
    color: #64748b;
    font-size: 13px;
    margin-top: 2px;
}

.nearby-results {
    display: grid;
    gap: 10px;
    padding: 12px;
    overflow: auto;
    max-height: calc(62vh + 44px);
}

.nearby-result-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border: 1px solid #d7e6f8;
    border-radius: 14px;
    background: #ffffff;
}

.nearby-result-card.is-ready {
    border-color: #93c5fd;
}

.nearby-result-card.is-not-ready {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.nearby-result-card.is-not-ready .nearby-result-rank {
    background: #64748b;
}

.nearby-result-rank {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.nearby-result-main {
    min-width: 0;
}

.nearby-result-main strong,
.nearby-result-main span {
    display: block;
}

.nearby-result-main span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.nearby-result-actions {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

@media (max-width: 980px) {
    .nearby-toolbar,
    .nearby-layout {
        grid-template-columns: 1fr;
    }

    .nearby-results-panel {
        min-height: 0;
    }

    .nearby-results {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .nearby-map {
        min-height: 420px;
        height: 58vh;
    }

    .nearby-map-footer {
        flex-direction: column;
    }

    .nearby-search .btn,
    .nearby-filters .btn,
    .nearby-filters select {
        flex: 1 1 140px;
    }
}

.logo-box {
    border-color: #cfe0f4;
    background: #f8fbff;
}

.choice-card:hover,
.company-check-card:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.choice-card:has(input:checked) {
    border-color: #0891b2;
    background: #ecfeff;
    box-shadow: 0 0 0 4px rgba(103, 232, 249, .22);
}

@media print {
    .card::before,
    .btn:hover {
        box-shadow: none !important;
        transform: none !important;
    }
}

/* Final UI and print guards */
.nav-group-toggle::after {
    content: "\25BE";
}

@media print {
    body {
        background: #fff !important;
    }

    .card,
    .stat-card,
    .login-card,
    .quote-paper {
        box-shadow: none !important;
    }

    th {
        background: #f1f5f9 !important;
        color: #0f172a !important;
    }

    .btn {
        box-shadow: none !important;
        transform: none !important;
    }
}

/* Mobile QA guards: keep shared layouts usable on narrow screens. */
@media (max-width: 760px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

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

    img,
    video,
    canvas,
    svg {
        max-width: 100%;
        height: auto;
    }

    .container,
    .quote-container,
    .login-container {
        width: calc(100% - 16px) !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .card,
    .login-card,
    .stat-card,
    .quote-paper {
        max-width: 100%;
    }

    .card {
        overflow-x: auto;
    }

    .table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table,
    .card > table {
        min-width: 680px;
    }

    .actions,
    .action-buttons,
    .hero-actions,
    .card-head,
    .items-header,
    .form-final-actions,
    .search-row {
        min-width: 0;
    }

    .actions,
    .action-buttons,
    .hero-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .actions .btn,
    .action-buttons .btn,
    .hero-actions .btn,
    .inline-form,
    .inline-form .btn {
        min-width: 0;
    }

    .btn,
    button,
    input,
    select,
    textarea {
        max-width: 100%;
    }

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

    .nav-user {
        width: 100%;
        align-items: stretch;
    }

    .nav-user > a:not(.btn),
    .nav-group,
    .nav-group-toggle,
    .nav-user > .btn {
        width: 100%;
    }

    .nav-group-menu {
        position: static;
        width: 100%;
        max-width: 100%;
        margin-top: 6px;
    }

    .topbar {
        overflow: visible;
    }
}

@media (max-width: 420px) {
    .container,
    .quote-container,
    .login-container {
        width: calc(100% - 10px) !important;
    }

    .card,
    .login-card {
        padding: 14px;
    }

    .register-hero-image {
        width: calc(100% + 28px);
        margin: -14px -14px 16px;
        border-radius: 18px 18px 14px 14px;
    }

    .btn {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* RouteFlow EMS: dark mode follows device preference for night operations. */
@media (prefers-color-scheme: dark) {
    body:not(.print-page) {
        background: #07111f;
        color: #e5eefb;
    }

    .topbar,
    .card,
    .stat-card,
    .form-panel,
    .nearby-map-panel,
    .nearby-results-panel,
    .nearby-result-card,
    .nearby-place-choices,
    .nearby-place-option,
    .mobile-driver-panel,
    .legacy-access-panel,
    .system-access-panel,
    .permission-card,
    .permission-user-card,
    .search-row,
    .nav-group-menu {
        background: #0f1b2d;
        border-color: #1f3553;
        color: #e5eefb;
    }

    .card-head h1,
    .card-head h2,
    .stat-card strong,
    h1,
    h2,
    h3,
    label {
        color: #f8fbff;
    }

    .muted,
    .card-head p,
    .permission-card small,
    .stat-card span,
    .stat-card .stat-sub,
    .nearby-map-footer,
    .nearby-result-main span,
    .nearby-results-head span,
    .nearby-place-title span,
    .nearby-place-option span,
    .nearby-place-option small {
        color: #9fb4cf;
    }

    input,
    select,
    textarea {
        background: #0b1626;
        color: #f8fbff;
        border-color: #284464;
    }

    th {
        background: #13243a;
        color: #dbeafe;
        border-bottom-color: #284464;
    }

    td {
        border-top-color: #1f3553;
    }

    tbody tr:hover td {
        background: #102033;
    }

    .btn {
        background: #13243a;
        border-color: #284464;
        color: #f8fbff;
    }

    .auth-page .login-card,
    .auth-page .driver-app-download {
        background: #ffffff;
        border-color: #cbd5e1;
        color: #0f172a;
    }

    .auth-page .login-card h1,
    .auth-page .login-card h2,
    .auth-page .login-card h3,
    .auth-page .login-card h4,
    .auth-page .login-card label,
    .auth-page .login-card strong,
    .auth-page .driver-app-download h1,
    .auth-page .driver-app-download h2,
    .auth-page .driver-app-download h3,
    .auth-page .driver-app-download h4,
    .auth-page .driver-app-download strong {
        color: #0f172a;
    }

    .auth-page .login-card .muted,
    .auth-page .login-card p,
    .auth-page .login-card small,
    .auth-page .driver-app-download p,
    .auth-page .driver-app-download small {
        color: #475569;
    }

    .auth-page .login-card input,
    .auth-page .login-card select,
    .auth-page .login-card textarea {
        background: #ffffff;
        color: #0f172a;
        border-color: #94a3b8;
    }

    .auth-page .login-card input::placeholder,
    .auth-page .login-card textarea::placeholder {
        color: #64748b;
        opacity: 1;
    }
}

/* RouteFlow EMS: driver/mobile operation */
.mobile-driver-panel,
.legacy-access-panel,
.system-access-panel {
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
    border-radius: 20px;
    padding: 16px;
    margin: 18px 0;
}

.ems-only-toggle {
    margin-bottom: 14px;
}

.driver-page .container {
    max-width: 860px;
}

.driver-page .driver-primary-actions .btn,
.driver-page .driver-trip-actions .btn {
    min-height: 54px;
    font-size: 16px;
}

.driver-page .driver-primary-actions #sosButton {
    min-width: 96px;
}

.driver-page .stat-card strong {
    font-size: 24px;
    overflow-wrap: anywhere;
}

.driver-location-card {
    padding: 18px 22px;
}

.driver-location-card .card-head {
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.driver-location-card .card-head h2 {
    font-size: 22px;
}

.driver-location-card .card-head p {
    font-size: 13px;
    line-height: 1.35;
}

.driver-location-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.driver-location-grid label {
    margin-bottom: 0;
    font-size: 13px;
}

.driver-location-grid input {
    margin-top: 5px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.driver-location-card #mapLinkWrap {
    margin: 8px 0 0;
    font-size: 13px;
}

.driver-floating-status {
    position: fixed;
    right: 14px;
    bottom: 96px;
    z-index: 45;
    display: grid;
    gap: 2px;
    min-width: 180px;
    max-width: min(320px, calc(100vw - 28px));
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
    backdrop-filter: blur(12px);
}

.driver-floating-status span {
    color: #64748b;
    font-size: 12px;
}

.driver-floating-status strong {
    color: #0f172a;
    font-size: 15px;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.evidence-card {
    border: 1px solid #dbeafe;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fbff;
}

.evidence-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #e2e8f0;
}

.evidence-meta {
    display: grid;
    gap: 4px;
    padding: 10px 12px 12px;
    font-size: 13px;
    color: #475569;
}

.evidence-meta strong {
    color: #0f172a;
    font-size: 14px;
}

.trip-live-vehicle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.trip-live-vehicle .stat-card {
    min-height: 118px;
}

.dispatch-popup {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 90;
    width: min(380px, calc(100vw - 36px));
    padding: 16px;
    border: 1px solid #bfdbfe;
    border-left: 5px solid #2563eb;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .22);
}

.dispatch-popup strong {
    display: block;
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 17px;
}

.dispatch-popup p {
    margin: 0 0 12px;
    color: #475569;
    line-height: 1.5;
}

.trip-zone-list {
    display: grid;
    gap: 18px;
}

.trip-zone {
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 14px;
    background: #f8fbff;
}

.trip-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.trip-list-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #ffffff;
}

.trip-list-card p {
    margin: 0;
    color: #334155;
    line-height: 1.45;
}

.trip-list-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.btn,
button,
input,
select,
textarea {
    font-family: inherit;
}

.btn,
button,
input,
select,
textarea {
    min-height: 44px;
}

@media (max-width: 760px) {
    body {
        font-size: 16px;
    }

    .container {
        width: 100%;
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 86px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        padding: 8px 10px;
        min-height: 58px;
    }

    .topbar-brand strong {
        font-size: 14px;
    }

    .topbar-logo.first-logo {
        width: 78px;
        height: 30px;
        margin-right: 4px;
    }

    .nav-user {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(84px, 1fr);
        gap: 6px;
        overflow-x: auto;
        padding: 8px;
        background: rgba(255, 255, 255, .96);
        border-top: 1px solid #dbeafe;
        box-shadow: 0 -14px 34px rgba(15, 23, 42, .14);
        backdrop-filter: blur(12px);
    }

    .nav-user > a,
    .nav-group-toggle,
    .nav-user .btn {
        width: 100%;
        min-height: 46px;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        border-radius: 14px;
        font-size: 13px;
        padding: 10px 12px;
    }

    .nav-name {
        display: none;
    }

    .nav-group {
        position: relative;
    }

    .nav-group-menu {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 66px;
        max-height: 55vh;
        overflow-y: auto;
        border-radius: 18px;
    }

    .hero,
    .card,
    .form-panel {
        border-radius: 18px;
        padding: 14px;
        margin-left: 0;
        margin-right: 0;
    }

    .register-hero-image {
        width: calc(100% + 28px);
        margin: -14px -14px 16px;
        border-radius: 18px 18px 14px 14px;
    }

    .hero {
        display: grid;
        gap: 12px;
    }

    h1 {
        font-size: 24px;
        line-height: 1.2;
    }

    h2 {
        font-size: 21px;
    }

    h3 {
        font-size: 18px;
    }

    .page-subtitle,
    .card-head p,
    .muted {
        font-size: 13px;
        line-height: 1.45;
    }

    .stats-grid,
    .grid-2,
    .trip-live-vehicle,
    .driver-location-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        min-height: auto;
        padding: 14px;
    }

    .stat-card strong {
        font-size: 24px;
        overflow-wrap: anywhere;
    }

    .hero-actions,
    .form-actions,
    .search-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
    }

    .btn,
    button,
    input,
    select,
    textarea {
        width: 100%;
        font-size: 16px;
    }

    .table-wrap {
        overflow-x: visible;
    }

    table.mobile-table,
    .table-wrap table {
        border-collapse: separate;
        border-spacing: 0 10px;
    }

    .table-wrap thead {
        display: none;
    }

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

    .table-wrap tr {
        border: 1px solid #dbeafe;
        border-radius: 16px;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    }

    .table-wrap td {
        border-top: 0;
        padding: 9px 12px;
    }

    .table-wrap td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
    }

    .dispatch-popup {
        left: 10px;
        right: 10px;
        bottom: 78px;
        width: auto;
    }

    .trip-zone {
        padding: 12px;
    }

    .trip-card-grid {
        grid-template-columns: 1fr;
    }

    .trip-list-head {
        display: grid;
    }

    #emsMap,
    #vehicleTrackMap,
    .pick-map {
        min-height: 360px !important;
        border-radius: 16px;
    }
}

.map-pick-panel {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    padding: 14px;
    margin: 14px 0;
}

.map-search-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    margin-bottom: 12px;
}

.pick-map {
    min-height: 420px;
    border: 1px solid #cbdff5;
    border-radius: 16px;
    overflow: hidden;
    background: #e2e8f0;
}

.hospital-map-form .leaflet-container {
    font-family: inherit;
}

@media (max-width: 760px) {
    .driver-page {
        padding-bottom: 96px;
    }

    .driver-page .topbar .nav-user > a:not([href$="driver/index.php"]):not([href$="dashboard.php"]),
    .driver-page .topbar .nav-user > span {
        display: none;
    }

    .driver-page .driver-hero {
        margin-left: -8px;
        margin-right: -8px;
        border-radius: 0 0 24px 24px;
    }

    .driver-page .driver-primary-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        display: grid;
        grid-template-columns: 1fr 1fr 86px;
        gap: 8px;
        padding: 10px;
        background: rgba(255, 255, 255, .96);
        border-top: 1px solid #dbeafe;
        box-shadow: 0 -14px 34px rgba(15, 23, 42, .14);
        backdrop-filter: blur(12px);
    }

    .driver-floating-status {
        left: 10px;
        right: 10px;
        bottom: 84px;
        max-width: none;
    }

    .driver-page .driver-primary-actions .btn {
        width: 100%;
        min-height: 58px;
        border-radius: 16px;
        white-space: normal;
        line-height: 1.15;
    }

    .driver-page .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .driver-page .stat-card {
        min-height: auto;
        padding: 16px;
    }

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

    .driver-page .driver-trip-actions .btn {
        width: 100%;
        min-height: 56px;
    }

    .driver-location-card {
        padding: 14px;
    }

    .driver-location-card .card-head {
        margin-bottom: 8px;
    }

    .driver-location-card .card-head h2 {
        font-size: 18px;
    }

    .driver-location-card .card-head p {
        display: none;
    }

    .driver-location-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .driver-location-grid label:last-child {
        grid-column: span 2;
    }

    .driver-location-grid input {
        min-height: 36px;
        padding: 7px 9px;
    }

    .mobile-driver-panel,
    .legacy-access-panel,
    .system-access-panel {
        padding: 14px;
        border-radius: 18px;
    }

    .map-search-row {
        grid-template-columns: 1fr !important;
    }

    .pick-map {
        min-height: 360px;
    }
}

/* Admin mobile comfort pass: remove accidental sideways scrolling and make dense admin tables thumb-friendly. */
@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .topbar-brand {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .topbar-brand strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-user {
        grid-auto-columns: minmax(76px, 1fr);
        scroll-snap-type: x proximity;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .nav-user > a,
    .nav-group,
    .nav-group-toggle,
    .nav-user .btn {
        min-width: 0;
        scroll-snap-align: start;
    }

    .nav-user > a,
    .nav-group-toggle,
    .nav-user .btn {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-group-menu {
        left: 8px;
        right: 8px;
        bottom: calc(66px + env(safe-area-inset-bottom));
        width: auto;
        max-width: none;
    }

    .container {
        max-width: 100%;
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .card,
    .hero,
    .form-panel,
    .trip-zone,
    .trip-list-card,
    .stat-card {
        min-width: 0;
    }

    .grid-2,
    .grid-3,
    .stats-grid,
    .info-grid,
    .price-options,
    .trip-live-vehicle,
    .driver-location-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .grid-2 > *,
    .grid-3 > *,
    .stats-grid > *,
    .info-grid > *,
    .price-options > *,
    .trip-live-vehicle > *,
    .driver-location-grid > * {
        min-width: 0;
    }

    .code-block,
    pre {
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        white-space: pre;
    }

    .card-head {
        width: 100%;
        min-width: 0;
    }

    .table-wrap {
        width: 100%;
        overflow-x: visible !important;
    }

    .table-wrap table,
    .card > table {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: separate;
        border-spacing: 0 10px;
    }

    .table-wrap thead {
        display: none;
    }

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

    .table-wrap tr {
        border: 1px solid #dbeafe;
        border-radius: 16px;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    }

    .table-wrap td {
        display: grid;
        grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        border-top: 0;
        padding: 10px 12px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .table-wrap td::before {
        content: attr(data-label);
        display: block;
        min-width: 0;
        margin: 0;
        color: #64748b;
        font-size: 12px;
        font-weight: 800;
        line-height: 1.35;
    }

    .table-wrap td.empty {
        display: block;
        text-align: center;
    }

    .table-wrap td.empty::before,
    .table-wrap td[colspan]::before {
        content: none;
    }

    .table-wrap td.actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-wrap td.actions::before {
        width: 100%;
        flex: 0 0 100%;
    }

    .actions .btn,
    .actions .inline-form,
    .actions .inline-form .btn,
    .form-actions .btn,
    .form-actions .inline-form,
    .form-actions .inline-form .btn {
        width: 100%;
    }

    .search-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
    }

    .search-row > *,
    .form-actions > *,
    .hero-actions > * {
        min-width: 0;
    }
}

@supports not (overflow-x: clip) {
    @media (max-width: 760px) {
        html,
        body {
            overflow-x: hidden;
        }
    }
}

@media (prefers-color-scheme: dark) and (max-width: 760px) {
    .table-wrap tr {
        background: #0f1b2d;
        border-color: #1f3553;
        box-shadow: none;
    }

    .table-wrap td::before {
        color: #9fb4cf;
    }
}

/* pae_insure */
:root{--primary:#125b53;--primary-dark:#0c443e}body{font-family:"Leelawadee UI",Tahoma,sans-serif}.pae-nav{background:#fff;border-bottom:1px solid #dce6e3;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px 4%;flex-wrap:wrap}.pae-brand{color:#173e38;text-decoration:none;font-size:23px;font-weight:800;display:grid;grid-template-columns:44px auto;column-gap:12px;line-height:1.2}.pae-brand>span{grid-row:span 2;background:#145c52;color:#fff;border-radius:12px;display:grid;place-items:center;font-size:18px}.pae-brand small{font-size:11px;font-weight:400;margin-top:5px}.pae-links,.pae-account{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.pae-links>a{padding:10px 14px;text-decoration:none;color:#385750;border-radius:8px}.pae-links>a.active,.pae-links>a:hover{background:#e9f2ef;color:#0c5548}.pae-account{font-size:13px}.pae-account form{margin:0}.pae-hero{display:flex;justify-content:space-between;align-items:center;background:#123e38;color:white;padding:44px;border-radius:20px;margin-bottom:24px;gap:24px}.pae-hero h1{font-size:32px;color:white;margin:14px 0}.pae-hero p{color:#cfdfd9;margin-bottom:26px}.pae-eyebrow{letter-spacing:2px;font-size:11px;color:#a8d8bd}.pae-hero .btn{margin:4px}.pae-hero .btn.primary{background:#d6f19a;color:#173e38;border-color:#d6f19a}.pae-total{min-width:180px;text-align:center;display:grid;gap:6px}.pae-total strong{font-size:72px;font-weight:500}.pae-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:24px}.pae-stats .card{display:grid;gap:14px;text-decoration:none;color:#36514a;margin:0}.pae-stats strong{font-size:34px;color:#123e38}.pae-stats small{color:#63796f}.pae-empty{text-align:center;padding:50px 20px}.pae-auth{background:linear-gradient(135deg,#123e38,#407c68)}.pae-auth .login-card{border-radius:22px}.pae-auth h1{font-size:30px}.pae-links a:focus-visible,.btn:focus-visible{outline:3px solid #82ae43;outline-offset:3px}@media(max-width:760px){.pae-nav{padding:16px;gap:15px}.pae-links{order:3;flex-basis:100%;gap:4px}.pae-links>a{padding:8px;font-size:13px}.pae-account>span{display:none}.pae-hero{padding:25px}.pae-hero h1{font-size:25px}.pae-total{display:none}.pae-stats{grid-template-columns:repeat(2,1fr);gap:12px}}@media print{.pae-nav{display:none}}
