/*
 * ParcelFly admin form UI: sectioned forms, sticky charge summary and the
 * Global Delivery Estimator. Colours come from the admin theme tokens, so the
 * blue default, the red & white theme and dark mode all apply automatically.
 */
.pf-ui {
    --pf-accent: var(--clr-primary-2, #0d6efd);
    --pf-accent-strong: color-mix(in srgb, var(--pf-accent) 78%, #000);
    --pf-accent-soft: color-mix(in srgb, var(--pf-accent) 10%, transparent);
    --pf-accent-ring: color-mix(in srgb, var(--pf-accent) 22%, transparent);
    --pf-surface: var(--clr-white, #ffffff);
    --pf-subtle: color-mix(in srgb, var(--clr-heading, #444050) 4%, var(--pf-surface));
    --pf-line: var(--clr-border, #dee5f0);
    --pf-text: var(--clr-heading, #444050);
    --pf-muted: var(--clr-body, #798494);
    --pf-radius: 16px;
    --pf-radius-sm: 10px;
    --pf-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
    color: var(--pf-text);
}

/* ---------- page heading ---------- */
.pf-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pf-hero__title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pf-hero__icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #fff;
    font-size: 20px;
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-strong));
    box-shadow: 0 8px 20px var(--pf-accent-ring);
}

.pf-hero h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pf-text);
}

.pf-hero p {
    margin: 2px 0 0;
    color: var(--pf-muted);
    font-size: 14px;
}

.pf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pf-accent);
    background: var(--pf-accent-soft);
}

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

@media (min-width: 1200px) {
    .pf-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 24px;
    }
}

.pf-stack {
    display: grid;
    gap: 20px;
    min-width: 0;
}

/* ---------- section cards ---------- */
.pf-card {
    background: var(--pf-surface);
    border: 1px solid var(--pf-line);
    border-radius: var(--pf-radius);
    box-shadow: var(--pf-shadow);
    padding: 22px 24px 24px;
}

.pf-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--pf-line);
}

.pf-step {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--pf-accent);
    background: var(--pf-accent-soft);
    font-size: 17px;
}

.pf-card__head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--pf-text);
}

.pf-card__head p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--pf-muted);
}

.pf-card__head .pf-card__badge {
    margin-left: auto;
}

/* ---------- fields ---------- */
.pf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

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

.pf-span-2 {
    grid-column: 1 / -1;
}

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

@media (max-width: 767.98px) {
    .pf-card {
        padding: 18px 16px 20px;
    }

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

    .pf-col-2 {
        grid-column: auto;
    }
}

.pf-field {
    min-width: 0;
}

.pf-field > label,
.pf-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pf-text);
}

.pf-field .pf-req {
    color: #e5484d;
    margin-left: 2px;
}

.pf-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--pf-muted);
}

.pf-ui .errorTextBox:not(.d-none) {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

.pf-ui .form-control,
.pf-ui .select2-container--default .select2-selection--single,
.pf-ui .select2-container--default .select2-selection--multiple {
    min-height: 46px;
    border: 1px solid var(--pf-line) !important;
    border-radius: var(--pf-radius-sm) !important;
    background-color: var(--pf-subtle) !important;
    color: var(--pf-text);
    font-size: 14px;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.pf-ui .form-control {
    padding: 10px 14px;
}

.pf-ui textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.pf-ui .form-control:focus,
.pf-ui .select2-container--focus .select2-selection,
.pf-ui .select2-container--open .select2-selection {
    border-color: var(--pf-accent) !important;
    background-color: var(--pf-surface) !important;
    box-shadow: 0 0 0 4px var(--pf-accent-ring) !important;
    outline: none;
}

.pf-ui .form-control[readonly] {
    opacity: 0.75;
    cursor: not-allowed;
}

.pf-ui .select2-container {
    width: 100% !important;
}

.pf-ui .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    padding-left: 14px;
    color: var(--pf-text);
}

.pf-ui .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
    right: 8px;
}

.pf-ui .select2-container--default .select2-selection--multiple .select2-selection__choice {
    border: 0;
    border-radius: 8px;
    color: var(--pf-accent);
    background: var(--pf-accent-soft);
    font-weight: 600;
}

/* input with a leading icon */
.pf-icon-input {
    position: relative;
}

.pf-icon-input > i {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--pf-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 3;
}

.pf-icon-input > .form-control {
    padding-left: 40px;
}

/* input with a trailing unit */
.pf-affix {
    position: relative;
}

.pf-affix > .form-control {
    padding-right: 64px;
}

.pf-affix > span {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pf-muted);
    background: var(--pf-surface);
    border: 1px solid var(--pf-line);
    pointer-events: none;
}

/* coupon input + apply */
.pf-inline {
    display: flex;
    gap: 10px;
}

.pf-inline > .form-control {
    flex: 1 1 auto;
}

/* ---------- option tiles (checkbox) ---------- */
.pf-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.pf-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--pf-line);
    border-radius: 12px;
    background: var(--pf-subtle);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.pf-option:hover {
    border-color: color-mix(in srgb, var(--pf-accent) 45%, var(--pf-line));
}

.pf-option input[type="checkbox"],
.pf-option input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 20px;
    width: 20px !important;
    height: 20px !important;
    min-height: 0 !important;
    margin: 1px 0 0 !important;
    padding: 0 !important;
    border: 2px solid color-mix(in srgb, var(--pf-muted) 55%, transparent) !important;
    border-radius: 6px !important;
    background: #fff no-repeat center / 12px 12px !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pf-option input[type="radio"] {
    border-radius: 50% !important;
}

.pf-option input:checked {
    border-color: var(--pf-accent) !important;
    background-color: var(--pf-accent) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.pf-option input:focus-visible {
    outline: 2px solid var(--pf-accent);
    outline-offset: 2px;
}

.pf-option > span {
    flex: 1 1 auto;
    min-width: 0;
}

.pf-option strong {
    display: block;
    font-size: 14px;
    color: var(--pf-text);
}

.pf-option small {
    display: block;
    margin-top: 2px;
    line-height: 1.45;
    font-size: 12px;
    color: var(--pf-muted);
}

.pf-option:has(input:checked) {
    border-color: var(--pf-accent);
    background: var(--pf-accent-soft);
    box-shadow: 0 0 0 3px var(--pf-accent-ring);
}

/* ---------- segmented radio ---------- */
.pf-segment {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    border-radius: 12px;
    border: 1px solid var(--pf-line);
    background: var(--pf-subtle);
}

.pf-segment input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pf-segment label {
    margin: 0;
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pf-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pf-segment input:checked + label {
    color: #fff;
    background: var(--pf-accent);
    box-shadow: 0 4px 12px var(--pf-accent-ring);
}

.pf-segment input:focus-visible + label {
    outline: 2px solid var(--pf-accent);
    outline-offset: 2px;
}

/* ---------- buttons ---------- */
.pf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pf-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.pf-btn--primary {
    color: #fff !important;
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-strong));
    box-shadow: 0 8px 20px var(--pf-accent-ring);
}

.pf-btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px var(--pf-accent-ring);
}

.pf-btn--ghost {
    color: var(--pf-text) !important;
    background: var(--pf-surface);
    border-color: var(--pf-line);
}

.pf-btn--ghost:hover {
    border-color: var(--pf-accent);
    color: var(--pf-accent) !important;
}

.pf-btn--soft {
    color: var(--pf-accent) !important;
    background: var(--pf-accent-soft);
    border-color: transparent;
}

.pf-btn--block {
    width: 100%;
}

/* ---------- charge summary ---------- */
.pf-summary {
    overflow: hidden;
    padding: 0;
}

@media (min-width: 1200px) {
    .pf-summary {
        position: sticky;
        top: 90px;
    }
}

.pf-summary__hero {
    position: relative;
    padding: 22px 24px;
    color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
        linear-gradient(135deg, var(--pf-accent), var(--pf-accent-strong));
}

.pf-summary__hero .pf-summary__label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}

.pf-summary__hero strong {
    display: block;
    margin-top: 6px;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    word-break: break-word;
}

.pf-summary__hero small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.85;
}

.pf-summary__body {
    padding: 8px 24px 4px;
}

.pf-summary__group {
    margin: 14px 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pf-muted);
}

.pf-summary__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pf-summary__list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    font-size: 14px;
    color: var(--pf-muted);
    border-bottom: 1px dashed var(--pf-line);
}

.pf-summary__list li:last-child {
    border-bottom: 0;
}

.pf-summary__list li > span:last-child {
    font-weight: 700;
    color: var(--pf-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pf-summary__list li.is-total {
    margin-top: 6px;
    padding: 14px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--pf-accent-soft);
    color: var(--pf-text);
    font-weight: 700;
}

.pf-summary__list li.is-total > span:last-child {
    color: var(--pf-accent);
    font-size: 17px;
}

.pf-summary__foot {
    display: grid;
    gap: 10px;
    padding: 16px 24px 24px;
}

.pf-summary__note {
    display: flex;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    color: var(--pf-muted);
}

/* Mobile: keep the save action reachable without scrolling back up. */
@media (max-width: 1199.98px) {
    .pf-summary__foot {
        position: sticky;
        bottom: 0;
        background: var(--pf-surface);
        border-top: 1px solid var(--pf-line);
        z-index: 5;
    }
}

/* ---------- Global Delivery Estimator modal ---------- */
.afc-modal .modal-content {
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    background: var(--clr-white, #fff);
    box-shadow: 0 30px 80px rgba(16, 24, 40, 0.25);
}

.afc-modal .modal-header {
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--clr-border, #dee5f0);
}

.afc-modal .modal-header .close {
    margin: 0 0 0 auto;
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    opacity: 1;
    color: var(--clr-body, #798494);
    background: color-mix(in srgb, var(--clr-heading, #444050) 6%, transparent);
    text-shadow: none;
    font-size: 22px;
    line-height: 38px;
}

.afc-modal .modal-header .close:hover {
    color: var(--clr-heading, #444050);
}

.afc-modal .modal-body {
    padding: 24px;
}

.afc-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.afc-title h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--clr-heading, #444050);
}

.afc-title p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--clr-body, #798494);
}

.afc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

@media (min-width: 992px) {
    .afc-layout {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: 24px;
    }
}

.afc-results {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.afc-empty {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    gap: 10px;
    text-align: center;
    padding: 36px 20px;
    border: 1px dashed var(--pf-line);
    border-radius: var(--pf-radius);
    background: var(--pf-subtle);
    color: var(--pf-muted);
    font-size: 14px;
}

.afc-empty i {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 24px;
    color: var(--pf-accent);
    background: var(--pf-accent-soft);
}

.afc-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    color: #b42318;
    background: #fef3f2;
    border: 1px solid #fecdca;
}

.afc-breakdown .pf-summary__hero strong {
    font-size: 28px;
}

.afc-breakdown .pf-summary__hero .afc-alt {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

.afc-breakdown .pf-summary__list li > span:last-child small {
    display: block;
    font-weight: 500;
    font-size: 11px;
    color: var(--pf-muted);
    text-align: right;
}

/* ---------- delivery plan cards (merchant panel + admin preview) ---------- */
.pp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 24px;
    align-items: stretch;
    padding-top: 14px;
}

.pp-card {
    --pp-accent: var(--pf-accent);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px 24px 24px;
    border: 1px solid var(--pf-line);
    border-radius: 20px;
    background: var(--pf-surface);
    box-shadow: var(--pf-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.1);
}

.pp-card.is-featured {
    border: 2px solid var(--pp-accent);
    box-shadow: 0 20px 44px color-mix(in srgb, var(--pp-accent) 18%, transparent);
}

.pp-card.is-current {
    border-color: color-mix(in srgb, #12b76a 60%, var(--pf-line));
}

.pp-ribbon {
    position: absolute;
    top: -13px;
    left: 24px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--pp-accent);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--pp-accent) 35%, transparent);
}

.pp-state {
    align-self: flex-start;
    margin-bottom: -6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #067647;
    background: #ecfdf3;
}

.pp-state.is-next {
    color: #b54708;
    background: #fffaeb;
}

.pp-head {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.pp-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    color: var(--pp-accent);
    background: color-mix(in srgb, var(--pp-accent) 12%, transparent);
    font-size: 22px;
}

.pp-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pp-name {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: var(--pf-text);
    overflow-wrap: anywhere;
}

.pp-tagline {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--pf-muted);
}

.pp-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.pp-price strong {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--pf-text);
    font-variant-numeric: tabular-nums;
}

.pp-price del {
    font-size: 15px;
    color: var(--pf-muted);
}

.pp-save {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #067647;
    background: #ecfdf3;
}

.pp-caption {
    margin-top: -12px;
    font-size: 13px;
    color: var(--pf-muted);
}

.pp-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--pf-muted);
}

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

.pp-stat {
    padding: 10px 8px;
    border-radius: 12px;
    text-align: center;
    background: color-mix(in srgb, var(--pp-accent) 7%, var(--pf-surface));
}

.pp-stat strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: var(--pf-text);
    word-break: break-word;
}

.pp-stat span {
    display: block;
    margin-top: 4px;
    line-height: 1.3;
    font-size: 11px;
    color: var(--pf-muted);
}

.pp-features {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 16px 0 0;
    list-style: none;
    border-top: 1px dashed var(--pf-line);
}

.pp-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--pf-text);
}

.pp-features li i {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    font-size: 11px;
    color: #fff;
    background: var(--pp-accent);
}

.pp-features li.is-excluded {
    color: var(--pf-muted);
}

.pp-features li.is-excluded span {
    text-decoration: line-through;
}

.pp-features li.is-excluded i {
    color: var(--pf-muted);
    background: color-mix(in srgb, var(--pf-muted) 18%, transparent);
}

.pp-foot {
    display: grid;
    gap: 8px;
    margin-top: auto;
}

.pp-cta {
    width: 100%;
    color: #fff !important;
    background: var(--pp-accent);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--pp-accent) 28%, transparent);
}

.pp-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--pp-accent) 85%, #000);
}

.pp-cta.is-muted {
    color: var(--pf-muted) !important;
    background: var(--pf-subtle);
    box-shadow: none;
    cursor: default;
}

.pp-cta.is-current {
    color: #067647 !important;
    background: #ecfdf3;
    box-shadow: none;
    cursor: default;
}

.pp-note {
    margin: 0;
    font-size: 12px;
    text-align: center;
    color: var(--pf-muted);
}

/* ---------- plan editor ---------- */
.pp-preview {
    position: sticky;
    top: 90px;
}

.pp-preview__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pf-muted);
}

.pp-preview__label::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 4px #ecfdf3;
}

.pf-feature-list {
    display: grid;
    gap: 10px;
}

.pf-feature-row {
    display: flex;
    gap: 8px;
}

.pf-feature-row .form-control {
    flex: 1 1 auto;
}

.pf-icon-btn {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--pf-line);
    border-radius: var(--pf-radius-sm);
    color: var(--pf-muted);
    background: var(--pf-surface);
    cursor: pointer;
}

.pf-icon-btn:hover {
    color: #d92d20;
    border-color: #fda29b;
}

.pf-color {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pf-color input[type="color"] {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    padding: 4px;
    border: 1px solid var(--pf-line);
    border-radius: var(--pf-radius-sm);
    background: var(--pf-surface);
    cursor: pointer;
}

.pf-swatches {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pf-swatch {
    width: 26px;
    height: 26px;
    border: 2px solid var(--pf-surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--pf-line);
    cursor: pointer;
}

.pf-swatch.is-reset {
    display: grid;
    place-items: center;
    font-size: 11px;
    color: var(--pf-muted);
    background: var(--pf-subtle);
}

.pf-toggles {
    display: grid;
    gap: 12px;
}

.pf-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--pf-line);
    border-radius: 12px;
    background: var(--pf-subtle);
}

.pf-toggle-row strong {
    display: block;
    font-size: 14px;
    color: var(--pf-text);
}

.pf-toggle-row small {
    display: block;
    font-size: 12px;
    color: var(--pf-muted);
}

.pf-uploader {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px dashed var(--pf-line);
    border-radius: 12px;
    background: var(--pf-subtle);
}

.pf-uploader img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--pf-surface);
}

.pf-uploader span {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: var(--pf-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- inline table row actions (replace the ⋮ dropdown) ---------- */
.pf-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
}

td:has(> .pf-row-actions) {
    text-align: right;
    white-space: nowrap;
}

.pf-row-action {
    --pf-row: var(--clr-primary-2, #0d6efd);
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--pf-row) 22%, transparent);
    border-radius: 9px;
    color: var(--pf-row) !important;
    background: color-mix(in srgb, var(--pf-row) 8%, transparent);
    font-size: 13px;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.pf-row-action:hover,
.pf-row-action:focus-visible {
    color: #fff !important;
    background: var(--pf-row);
    transform: translateY(-1px);
}

.pf-row-action.is-danger { --pf-row: #e5484d; }
.pf-row-action.is-success { --pf-row: #12b76a; }
.pf-row-action.is-warning { --pf-row: #f79009; }
.pf-row-action.is-neutral { --pf-row: #667085; }

.pf-row-action > form {
    display: contents;
}

.pf-row-action button {
    all: unset;
}

.afc-breakdown .pf-summary__list li {
    padding: 8px 0;
}

.afc-breakdown .pf-summary__list li > span:last-child small {
    line-height: 1.2;
    margin-top: 2px;
}

/* Items moved out of the old dropdown keep .dropdown-item; neutralise its menu styling. */
.pf-row-actions .pf-row-action.dropdown-item {
    width: 34px;
    min-width: 0;
    margin: 0;
    padding: 0;
    clear: none;
    white-space: nowrap;
}

.pf-row-actions .pf-row-action.is-text,
.pf-row-actions .pf-row-action.dropdown-item.is-text {
    width: auto;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
}

.pf-row-actions form {
    display: inline-flex;
    margin: 0;
}

.pf-actions-cell .mb-3:has(> .input-group-prepend) {
    margin-bottom: 0 !important;
}

.pf-actions-cell .input-group-prepend {
    display: block;
}

.pf-row-more {
    display: inline-flex;
}

.pf-row-more > a {
    padding: 0 !important;
}

/* ---------- website theme picker ---------- */
.wt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.wt-tile {
    position: relative;
    display: grid;
    align-content: start;
    gap: 12px;
    margin: 0;
    padding: 12px;
    border: 2px solid var(--pf-line);
    border-radius: 16px;
    background: var(--pf-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wt-tile input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wt-tile:has(input:checked) {
    border-color: var(--pf-accent);
    box-shadow: 0 0 0 4px var(--pf-accent-ring);
}

.wt-tile__body strong {
    display: block;
    font-size: 15px;
    color: var(--pf-text);
}

.wt-tile__body small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--pf-muted);
}

.wt-tile__check {
    position: absolute;
    top: 20px;
    right: 20px;
    display: none;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    background: var(--pf-accent);
}

.wt-tile:has(input:checked) .wt-tile__check {
    display: grid;
}

.wt-mock {
    display: grid;
    gap: 8px;
    height: 150px;
    padding: 10px;
    border-radius: 10px;
    overflow: hidden;
}

.wt-mock span {
    display: block;
}

.wt-mock__bar {
    height: 12px;
    border-radius: 3px;
}

.wt-mock__hero {
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 0 12px;
    border-radius: 4px;
}

.wt-mock__hero span {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.85);
}

.wt-mock__hero span:nth-child(1) { width: 60%; height: 9px; }
.wt-mock__hero span:nth-child(2) { width: 40%; }
.wt-mock__hero span:nth-child(3) { width: 24%; height: 10px; }

.wt-mock__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    height: 34px;
}

.wt-mock__cards span {
    border-radius: 3px;
}

.wt-mock--classic {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.wt-mock--classic .wt-mock__bar { background: #101828; }
.wt-mock--classic .wt-mock__hero { min-height: 60px; background: linear-gradient(120deg, #0f172a, #334155); }
.wt-mock--classic .wt-mock__cards span { background: #e5e7eb; }

.wt-mock--classic_two {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.wt-mock--classic_two .wt-mock__bar { background: #ffffff; box-shadow: inset 0 0 0 1px #e5e7eb; }
.wt-mock--classic_two .wt-mock__hero { min-height: 60px; background: linear-gradient(120deg, var(--pf-accent, #2563eb), #1e3a8a); }
.wt-mock--classic_two .wt-mock__cards span { background: #dbeafe; }

.wt-mock--nova {
    background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--pf-accent) 18%, #fff), #f8fafc 60%);
    border: 1px solid #e5e7eb;
}

.wt-mock--nova .wt-mock__bar { margin: 0 18%; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12); }
.wt-mock--nova .wt-mock__hero { min-height: 60px; justify-items: center; border-radius: 12px; background: transparent; }
.wt-mock--nova .wt-mock__hero span { background: #0f172a; opacity: 0.85; }
.wt-mock--nova .wt-mock__hero span:nth-child(3) { background: var(--pf-accent); border-radius: 999px; }
.wt-mock--nova .wt-mock__cards span { border-radius: 8px; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1); }

/* ---------- navbar theme menu ---------- */
.pf-theme-menu {
    --tm-accent: var(--clr-primary-2, #0d6efd);
    --tm-text: var(--clr-heading, #344054);
    --tm-muted: var(--clr-body, #798494);
    --tm-line: var(--clr-border, #e4e7ec);
    --tm-surface: var(--clr-white, #ffffff);
    width: 290px;
    padding: 8px !important;
    border: 1px solid var(--tm-line) !important;
    border-radius: 16px !important;
    background: var(--tm-surface) !important;
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.14) !important;
}

.pf-theme-menu__label {
    padding: 8px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tm-muted);
}

.pf-theme-menu__divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--tm-line);
}

.pf-theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--tm-text) !important;
    background: transparent !important;
    text-decoration: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pf-theme-option:hover,
.pf-theme-option:focus-visible {
    background: color-mix(in srgb, var(--tm-accent) 6%, transparent) !important;
    outline: none;
}

.pf-theme-option.is-active {
    border-color: color-mix(in srgb, var(--tm-accent) 30%, transparent);
    background: color-mix(in srgb, var(--tm-accent) 8%, transparent) !important;
}

.pf-theme-option__text {
    flex: 1 1 auto;
    min-width: 0;
}

.pf-theme-option__text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--tm-text);
}

.pf-theme-option__text small {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    color: var(--tm-muted);
}

.pf-theme-option__check {
    font-size: 16px;
    color: var(--tm-accent);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.pf-theme-option.is-active .pf-theme-option__check {
    opacity: 1;
    transform: none;
}

/* Tiny layout previews: sidebar + content block. */
.pf-theme-option__preview {
    flex: 0 0 auto;
    display: flex;
    gap: 3px;
    width: 46px;
    height: 34px;
    padding: 4px;
    border: 1px solid var(--tm-line);
    border-radius: 8px;
    background: #f5f7fb;
}

.pf-theme-option__preview span:first-child {
    width: 12px;
    border-radius: 3px;
    background: #ffffff;
    box-shadow: 0 0 0 1px #e4e7ec;
}

.pf-theme-option__preview span:last-child {
    flex: 1 1 auto;
    border-radius: 3px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--tm-accent) 25%, #fff) 0 30%, #ffffff 30%);
    box-shadow: 0 0 0 1px #e4e7ec;
}

.pf-theme-option__preview--style_two span:first-child {
    background: linear-gradient(180deg, #1d2b4f, #0b1220);
    box-shadow: none;
}

.pf-theme-option__preview--style_two {
    background: linear-gradient(135deg, #eaf2ff, #f5f7fb);
}

.pf-theme-option__dot {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #dc1f26 0 50%, #ffffff 50%);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.12);
}

.pf-mini-switch {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 20px;
    border-radius: 20px;
    background: var(--tm-line);
    transition: background-color 0.2s ease;
}

.pf-mini-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.pf-mini-switch.is-on {
    background: var(--tm-accent);
}

.pf-mini-switch.is-on::after {
    transform: translateX(16px);
}

body.dark-mode .pf-theme-option__preview {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

/* ---------- dashboard header + metric cards (both admin styles) ---------- */
.pf-dash-head {
    --dh-accent: var(--clr-primary-2, #0d6efd);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: hidden;
    padding: 26px 28px;
    border: 1px solid var(--clr-border, #e4e7ec);
    border-radius: 18px;
    background:
        radial-gradient(60% 140% at 100% 0%, color-mix(in srgb, var(--dh-accent) 16%, transparent), transparent 60%),
        linear-gradient(120deg, color-mix(in srgb, var(--dh-accent) 7%, var(--clr-white, #fff)), var(--clr-white, #fff) 60%);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
}

.pf-dash-head__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dh-accent);
    background: color-mix(in srgb, var(--dh-accent) 10%, transparent);
}

.pf-dash-head__eyebrow i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pf-dash-head h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--clr-heading, #101828);
}

.pf-dash-head p {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--clr-body, #667085);
}

.pf-dash-head__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.pf-dash-head__live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--clr-heading, #344054);
    white-space: nowrap;
}

.pf-dash-head__live i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.45);
    animation: pf-live 2s ease-out infinite;
}

@keyframes pf-live {
    0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.45); }
    100% { box-shadow: 0 0 0 9px rgba(18, 183, 106, 0); }
}

.pf-period {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--clr-border, #e4e7ec);
    border-radius: 12px;
    background: var(--clr-white, #fff);
}

.pf-period a {
    padding: 7px 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    color: var(--clr-body, #667085) !important;
    text-decoration: none !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pf-period a:hover {
    color: var(--clr-heading, #101828) !important;
}

.pf-period a.is-active {
    color: #fff !important;
    background: var(--dh-accent);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--dh-accent) 30%, transparent);
}

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

.pf-metric {
    --m-tone: #2563eb;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    padding: 20px 20px 18px;
    border: 1px solid var(--clr-border, #e4e7ec);
    border-radius: 18px;
    background: var(--clr-white, #fff);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pf-metric::after {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--m-tone) 16%, transparent), transparent);
    pointer-events: none;
}

.pf-metric:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--m-tone) 35%, var(--clr-border, #e4e7ec));
    box-shadow: 0 14px 30px rgba(16, 24, 40, 0.08);
}

.pf-metric--blue { --m-tone: #2563eb; }
.pf-metric--green { --m-tone: #16a34a; }
.pf-metric--amber { --m-tone: #f59e0b; }
.pf-metric--rose { --m-tone: #e11d48; }
.pf-metric--violet { --m-tone: #7c3aed; }
.pf-metric--teal { --m-tone: #0d9488; }
.pf-metric--indigo { --m-tone: #4f46e5; }
.pf-metric--sky { --m-tone: #0284c7; }

.pf-metric__top {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pf-metric__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 17px;
    color: var(--m-tone);
    background: color-mix(in srgb, var(--m-tone) 12%, transparent);
}

.pf-metric__label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--clr-body, #667085);
}

.pf-metric__value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--clr-heading, #101828);
    font-variant-numeric: tabular-nums;
}

.pf-metric__foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px dashed var(--clr-border, #e4e7ec);
    font-size: 12px;
}

.pf-metric__trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.pf-metric__trend.is-up {
    color: #067647;
    background: #ecfdf3;
}

.pf-metric__trend.is-flat {
    color: var(--clr-body, #667085);
    background: color-mix(in srgb, var(--clr-body, #667085) 10%, transparent);
}

.pf-metric__note {
    color: var(--clr-body, #667085);
}

body.dark-mode .pf-metric__trend.is-up {
    color: #6ce9a6;
    background: rgba(18, 183, 106, 0.15);
}

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

@media (max-width: 640px) {
    .pf-dash-head { flex-direction: column; align-items: flex-start; padding: 20px; }
    .pf-metrics { grid-template-columns: minmax(0, 1fr); }
}

body.dark-mode .pf-option input[type="checkbox"]:not(:checked),
body.dark-mode .pf-option input[type="radio"]:not(:checked) {
    background-color: transparent;
}

/* Website theme tile: Atlas (home3 design) */
.wt-mock--atlas { background: linear-gradient(160deg, #0b1026, #1e1b4b); }
.wt-mock--atlas .wt-mock__bar { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.85); }
.wt-mock--atlas .wt-mock__hero { min-height: 60px; border-radius: 10px; background: linear-gradient(90deg, rgb(var(--primary-color, 90, 92, 246)), #f59e0b); }
.wt-mock--atlas .wt-mock__cards span { background: rgba(255, 255, 255, 0.14); }

/* ==========================================================================
   Form kit (pff-*): step cards, option cards, chips, inputs with icon/unit,
   route stops and a sticky summary. Used by the business-line module forms.
   ========================================================================== */
:root { --pff-line: #e3e7ee; --pff-soft: #f6f8fb; --pff-muted: #8a94a6; }
.dark-mode { --pff-line: #2c3546; --pff-soft: rgba(255,255,255,.03); --pff-muted: #98a2b3; }
.pff-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.pff-aside { position: sticky; top: 90px; display: grid; gap: 14px; }
.pff-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.pff-summary { border: 1px solid var(--pff-line); border-radius: 16px; background: var(--card-bg, #fff); overflow: hidden; box-shadow: 0 10px 30px rgba(16,24,40,.06); }
.dark-mode .pff-summary { background: rgba(255,255,255,.02); }
.pff-summary-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px; color: #fff; background: linear-gradient(135deg, var(--clr-primary-2, #4f46e5), rgba(var(--primary-color, 79,70,229), .78)); }
.pff-summary-head strong { display: block; font-size: 15px; }
.pff-summary-head small { opacity: .85; font-size: 12px; }
.pff-summary-head .pff-summary-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); }
.pff-summary-body { padding: 16px 18px; font-size: 13.5px; }
.pff-summary-body ul { margin: 0; padding-left: 18px; color: var(--pff-muted); }
.pff-summary-body li + li { margin-top: 6px; }
@media (max-width: 1199px) { .pff-grid { grid-template-columns: 1fr; } .pff-aside { position: static; } }

    .pff { display: grid; gap: 18px; }
    .pff-card { border: 1px solid var(--pff-line, #e3e7ee); border-radius: 16px; padding: 20px 22px 22px; background: var(--card-bg, #fff); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
    .dark-mode .pff-card { background: rgba(255, 255, 255, .02); }
    .pff-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px dashed var(--pff-line, #e3e7ee); }
    .pff-head h5 { margin: 0 0 2px; font-size: 16px; font-weight: 700; }
    .pff-head p { margin: 0; font-size: 13px; color: var(--pff-muted, #8a94a6); }
    .pff-step { flex-shrink: 0; width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
        color: var(--clr-primary-2, #4f46e5); background: rgba(var(--primary-color, 79, 70, 229), .1); }
    .pff-label { font-size: 13px; font-weight: 600; margin: 4px 0 8px; color: inherit; }
    .pff-opt { font-weight: 400; font-size: 12px; color: var(--pff-muted, #8a94a6); }
    .pff-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--pff-muted, #8a94a6); }

    /* Option cards (vehicle, speed, payer) */
    .pff-options { display: grid; gap: 10px; margin-bottom: 18px; }
    .pff-options--3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
    .pff-options--2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
    .pff-option { position: relative; display: flex; gap: 12px; align-items: center; margin: 0; padding: 13px 14px; border: 1.5px solid var(--pff-line, #e3e7ee); border-radius: 12px;
        cursor: pointer; background: var(--card-bg, #fff); transition: border-color .15s, box-shadow .15s, background .15s; }
    .dark-mode .pff-option { background: transparent; }
    .pff-option:hover { border-color: rgba(var(--primary-color, 79, 70, 229), .45); }
    .pff-option input { position: absolute; opacity: 0; pointer-events: none; }
    .pff-option-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
        color: #64748b; background: var(--pff-soft, #f6f8fb); transition: background .15s, color .15s; }
    .pff-option-body { display: flex; flex-direction: column; min-width: 0; }
    .pff-option-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
    .pff-option-sub { font-size: 12px; color: var(--pff-muted, #8a94a6); line-height: 1.35; }
    .pff-option-check { position: absolute; top: 9px; right: 10px; font-size: 15px; color: var(--clr-primary-2, #4f46e5); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
    .pff-option:has(input:checked) { border-color: var(--clr-primary-2, #4f46e5); background: rgba(var(--primary-color, 79, 70, 229), .05); box-shadow: 0 0 0 3px rgba(var(--primary-color, 79, 70, 229), .12); }
    .pff-option:has(input:checked) .pff-option-icon { color: #fff; background: var(--clr-primary-2, #4f46e5); }
    .pff-option:has(input:checked) .pff-option-check { opacity: 1; transform: none; }
    .pff-option:has(input:focus-visible) { outline: 2px solid var(--clr-primary-2, #4f46e5); outline-offset: 2px; }
    .pff-tag { margin-left: auto; margin-right: 18px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef2f7; color: #475569; }
    .pff-tag--up { background: #fff4e5; color: #b54708; }
    .pff-tag--down { background: #e8f7ef; color: #067647; }

    /* Inputs with icon / unit */
    .pff-affix { position: relative; }
    .pff-affix .form-control { padding-left: 38px; }
    .pff-affix--post .form-control { padding-right: 52px; }
    .pff-affix-pre { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #98a2b3; pointer-events: none; z-index: 2; }
    .pff-affix-post { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 3px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; color: #475569; background: var(--pff-soft, #f2f4f7); pointer-events: none; }
    .pff-affix:focus-within .pff-affix-pre { color: var(--clr-primary-2, #4f46e5); }
    .pff .form-control:focus { border-color: var(--clr-primary-2, #4f46e5); box-shadow: 0 0 0 3px rgba(var(--primary-color, 79, 70, 229), .12); }

    /* Route: two stops joined by a line */
    .pff-route { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .pff-route::before { content: ''; position: absolute; top: 24px; left: calc(50% - 22px); width: 44px; border-top: 2px dashed rgba(var(--primary-color, 79, 70, 229), .35); }
    .pff-stop { border-radius: 14px; padding: 16px 16px 12px; background: var(--pff-soft, #f8fafc); border: 1px solid var(--pff-line, #e3e7ee); }
    .pff-stop .form-group { margin-bottom: 12px; }
    .pff-stop .form-control { background: var(--card-bg, #fff); }
    .dark-mode .pff-stop .form-control { background: transparent; }
    .pff-stop-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
    .pff-stop-head strong { display: block; font-size: 14.5px; line-height: 1.2; }
    .pff-stop-head small { color: var(--pff-muted, #8a94a6); font-size: 12px; }
    .pff-marker { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fff; }
    .pff-stop--pickup .pff-marker { background: #12b76a; box-shadow: 0 0 0 4px rgba(18, 183, 106, .15); }
    .pff-stop--drop .pff-marker { background: #f04438; box-shadow: 0 0 0 4px rgba(240, 68, 56, .15); }
    .pff-pin { border-top: 1px dashed var(--pff-line, #e3e7ee); padding-top: 10px; }
    .pff-pin summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--clr-primary-2, #4f46e5); }
    .pff-pin summary::-webkit-details-marker { display: none; }
    .pff-pin-caret { margin-left: auto; font-size: 11px; transition: transform .2s; }
    .pff-pin[open] .pff-pin-caret { transform: rotate(180deg); }
    .pff-pin-body { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; }
    .pff-locate { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 8px; border: 1.5px solid rgba(var(--primary-color, 79, 70, 229), .35);
        background: transparent; color: var(--clr-primary-2, #4f46e5); font-size: 13px; font-weight: 600; white-space: nowrap; }
    .pff-locate:hover { background: rgba(var(--primary-color, 79, 70, 229), .07); }
    .pff-locate:disabled { opacity: .6; }

    /* Item chips */
    .pff-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
    .pff-chip { margin: 0; cursor: pointer; }
    .pff-chip input { position: absolute; opacity: 0; pointer-events: none; }
    .pff-chip span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--pff-line, #e3e7ee); font-size: 13px; font-weight: 500;
        transition: border-color .15s, background .15s, color .15s; }
    .pff-chip span i { color: #98a2b3; }
    .pff-chip:hover span { border-color: rgba(var(--primary-color, 79, 70, 229), .45); }
    .pff-chip input:checked + span { border-color: var(--clr-primary-2, #4f46e5); background: rgba(var(--primary-color, 79, 70, 229), .08); color: var(--clr-primary-2, #4f46e5); font-weight: 600; }
    .pff-chip input:checked + span i { color: inherit; }
    .pff-chip input:focus-visible + span { outline: 2px solid var(--clr-primary-2, #4f46e5); outline-offset: 2px; }

    @media (max-width: 991px) { .pff-route { grid-template-columns: 1fr; } .pff-route::before { display: none; } }
    @media (max-width: 575px) { .pff-card { padding: 16px; } .pff-pin-body { grid-template-columns: 1fr 1fr; } .pff-locate { grid-column: 1 / -1; justify-content: center; padding: 8px; } }
