/* ==========================================================================
   Aura Job Ticket Modal — Dispatch calendar ticket (responsive)
   Material Icons · Inter · Light/Dark mode
   ========================================================================== */

#aura-job-ticket-modal.ajt-backdrop[style*="display: block"],
#aura-job-ticket-modal.ajt-backdrop[style*="display:block"],
.ajt-backdrop[style*="display: block"],
.ajt-backdrop[style*="display:block"] {
    display: flex !important;
}

#aura-job-ticket-modal.ajt-backdrop,
.ajt-backdrop {
    --ajt-brand: #0071e3;
    --ajt-brand-soft: rgba(0, 113, 227, 0.12);
    --ajt-surface: #ffffff;
    --ajt-surface-muted: #f5f5f7;
    --ajt-border: #e5e5ea;
    --ajt-text: #1d1d1f;
    --ajt-muted: #86868b;
    --ajt-radius: 16px;
    --ajt-radius-lg: 20px;
    --ajt-shadow: -8px 0 40px rgba(15, 23, 42, 0.14);
    --ajt-touch: 44px;
    --ajt-header-pad: 1rem 1.25rem 1rem;
    --ajt-section-pad: 1.125rem 1.25rem;
    --ajt-footer-pad: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    --ajt-panel-max: 28rem;
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(9, 13, 24, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.aura-dark-mode .ajt-backdrop {
    --ajt-surface: #101622;
    --ajt-surface-muted: #1e293b;
    --ajt-border: #334155;
    --ajt-text: #f1f5f9;
    --ajt-muted: #94a3b8;
    background: rgba(0, 0, 0, 0.55);
}

body.modal-open.ajt-modal-open,
body.ajt-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

/* ---------- Panel ---------- */
.ajt-panel {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 100%);
    background: var(--ajt-surface);
    border-radius: var(--ajt-radius-lg) var(--ajt-radius-lg) 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    color: var(--ajt-text);
    overflow: hidden;
    animation: ajt-slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ajt-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Header ---------- */
.ajt-header {
    padding: var(--ajt-header-pad);
    border-bottom: 1px solid var(--ajt-border);
    background: linear-gradient(180deg, var(--ajt-surface) 0%, var(--ajt-surface-muted) 100%);
    position: sticky;
    top: 0;
    z-index: 30;
    flex-shrink: 0;
}

.ajt-header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -0.25rem 0 0.5rem;
    position: relative;
    min-height: 20px;
}

.ajt-header-drag {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--ajt-border);
}

.ajt-close-header {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: var(--ajt-touch);
    height: var(--ajt-touch);
    min-width: var(--ajt-touch);
    min-height: var(--ajt-touch);
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: var(--ajt-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ajt-close-header:hover {
    background: rgba(0, 0, 0, 0.08);
}

.ajt-close-header:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.35);
    outline-offset: 2px;
}

body.aura-dark-mode .ajt-close-header {
    background: rgba(255, 255, 255, 0.08);
}

.ajt-eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ajt-muted);
}

.ajt-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.ajt-header-left {
    flex: 1;
    min-width: 0;
}

.ajt-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ajt-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ajt-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ajt-text);
    margin: 0;
    line-height: 1.15;
}

/* ---------- Price ---------- */
.ajt-price {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--ajt-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.25rem 0.625rem;
    border-radius: 10px;
    background: var(--ajt-text);
    color: #fff;
    line-height: 1.2;
}

body.aura-dark-mode .ajt-price {
    background: #f8fafc;
    color: #0f172a;
}

/* ---------- Pills ---------- */
.ajt-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.ajt-pill-pending {
    background-color: #fef3c7;
    color: #b45309;
}

.ajt-pill-confirmed,
.ajt-pill-accepted {
    background-color: #dcfce7;
    color: #15803d;
}

.ajt-pill-completed {
    background-color: #f1f5f9;
    color: #475569;
}

.ajt-pill-cancelled {
    background-color: #fee2e2;
    color: #b91c1c;
}

.ajt-pill-assigned,
.ajt-pill-in_progress,
.ajt-pill-enroute,
.ajt-pill-arrived {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.ajt-pill-vehicle {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Dark pills */
body.aura-dark-mode .ajt-pill-pending {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

body.aura-dark-mode .ajt-pill-vehicle {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

body.aura-dark-mode .ajt-pill-confirmed,
body.aura-dark-mode .ajt-pill-accepted {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

body.aura-dark-mode .ajt-pill-cancelled {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* ---------- Meta Row ---------- */
.ajt-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--ajt-muted);
}

.ajt-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    background: var(--ajt-surface-muted);
    max-width: 100%;
}

.ajt-meta-item span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ajt-meta-item .material-icons-outlined {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ---------- Scrollable Body ---------- */
.ajt-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    min-height: 0;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* Loading state */
.ajt-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--ajt-muted);
    font-size: 0.875rem;
}

.ajt-loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--ajt-border);
    border-top-color: var(--ajt-brand);
    border-radius: 50%;
    animation: ajt-spin 0.8s linear infinite;
}

/* ---------- Driver Note Alert ---------- */
.ajt-alert {
    margin: 1.5rem 1.5rem 0;
    padding: 1rem;
    background-color: #fefce8;
    border-left: 4px solid #facc15;
    border-radius: 0 0.5rem 0.5rem 0;
}

body.aura-dark-mode .ajt-alert {
    background-color: rgba(234, 179, 8, 0.1);
}

.ajt-alert-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #854d0e;
    margin-bottom: 0.25rem;
}

body.aura-dark-mode .ajt-alert-title {
    color: #eab308;
}

.ajt-alert-title .material-icons-outlined {
    font-size: 1rem;
}

.ajt-alert-text {
    font-size: 0.875rem;
    color: #334155;
    margin: 0;
    line-height: 1.5;
}

body.aura-dark-mode .ajt-alert-text {
    color: #cbd5e1;
}

/* ---------- Assign Box ---------- */
.ajt-assign-box {
    margin: 1rem 1.5rem 0;
    padding: 0.75rem;
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.aura-dark-mode .ajt-assign-box {
    background-color: rgba(30, 41, 59, 0.5);
    border-color: #334155;
}

.ajt-assign-box .material-icons-outlined {
    color: #94a3b8;
}

.ajt-assign-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

body.aura-dark-mode .ajt-assign-label {
    color: #94a3b8;
}

.ajt-assign-btn {
    font-size: 0.875rem;
    font-weight: 600;
    color: #135bec;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.ajt-assign-btn:hover {
    text-decoration: underline;
}

/* ---------- Sections ---------- */
.ajt-section {
    padding: var(--ajt-section-pad);
}

.ajt-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ajt-muted);
    margin: 0 0 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ajt-section-marker {
    width: 3px;
    height: 14px;
    background-color: var(--ajt-brand);
    border-radius: 9999px;
    flex-shrink: 0;
}

.ajt-divider {
    border: 0;
    height: 1px;
    background-color: #f1f5f9;
    margin: 0 1.5rem;
}

body.aura-dark-mode .ajt-divider {
    background-color: #1e293b;
}

/* ---------- Passenger ---------- */
.ajt-passenger-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ajt-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    overflow: hidden;
    flex-shrink: 0;
}

body.aura-dark-mode .ajt-avatar {
    background-color: #1e293b;
}

.ajt-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ajt-passenger-name {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

body.aura-dark-mode .ajt-passenger-name {
    color: #ffffff;
}

.ajt-passenger-contact {
    font-size: 0.875rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.125rem;
}

.ajt-passenger-contact .material-icons-outlined {
    font-size: 0.875rem;
}

.ajt-passenger-action {
    margin-left: auto;
    width: var(--ajt-touch);
    height: var(--ajt-touch);
    min-width: var(--ajt-touch);
    min-height: var(--ajt-touch);
    padding: 0;
    border-radius: 9999px;
    background: var(--ajt-surface-muted);
    border: 1px solid var(--ajt-border);
    cursor: pointer;
    color: var(--ajt-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s, border-color 0.2s;
}

.ajt-passenger-action:hover {
    background-color: #f1f5f9;
}

body.aura-dark-mode .ajt-passenger-action:hover {
    background-color: #1e293b;
}

/* ---------- Trip Timeline ---------- */
.ajt-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ajt-timeline-item {
    position: relative;
    padding-left: 2rem;
}

.ajt-timeline-dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    z-index: 1;
}

.ajt-timeline-dot.pickup {
    border: 2px solid #135bec;
    background-color: #ffffff;
}

body.aura-dark-mode .ajt-timeline-dot.pickup {
    background-color: #101622;
}

.ajt-timeline-dot.dropoff {
    background-color: #135bec;
}

.ajt-timeline-dot.stop {
    border: 2px solid #f59e0b;
    background-color: #ffffff;
}

body.aura-dark-mode .ajt-timeline-dot.stop {
    background-color: #101622;
}

.ajt-timeline-line {
    position: absolute;
    left: 5.5px;
    top: 16px;
    bottom: -32px;
    width: 2px;
    background-color: #e2e8f0;
}

body.aura-dark-mode .ajt-timeline-line {
    background-color: #1e293b;
}

.ajt-timeline-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    color: #135bec;
}

.ajt-timeline-label.dropoff {
    color: #94a3b8;
}

.ajt-timeline-label.stop {
    color: #f59e0b;
}

.ajt-timeline-address {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    margin-top: 0.125rem;
}

body.aura-dark-mode .ajt-timeline-address {
    color: #ffffff;
}

/* Trip estimate row (distance · time) */
.ajt-trip-estimate {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1.25rem;
    padding: 0.5rem 0.75rem;
    background-color: #f1f5f9;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
}

.ajt-trip-estimate .material-icons-outlined {
    font-size: 1rem;
    color: #94a3b8;
}

body.aura-dark-mode .ajt-trip-estimate {
    background-color: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
}

.ajt-action-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.ajt-action-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s;
}

.ajt-action-link:hover {
    color: #135bec;
}

.ajt-action-link .material-icons-outlined {
    font-size: 0.875rem;
}

/* ---------- Capacity & Extras Grid ---------- */
.ajt-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: var(--ajt-section-pad);
}

.ajt-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.ajt-list-label {
    color: #64748b;
}

.ajt-list-value {
    font-weight: 600;
    color: #0f172a;
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 0.25rem;
}

body.aura-dark-mode .ajt-list-value {
    background-color: #1e293b;
    color: #ffffff;
}

.ajt-extra-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #334155;
    margin-bottom: 0.75rem;
}

body.aura-dark-mode .ajt-extra-item {
    color: #e2e8f0;
}

.ajt-extra-item .material-icons-outlined {
    font-size: 1rem;
    color: #135bec;
}

/* ---------- Payment ---------- */
.ajt-payment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ajt-refund-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 11px;
    font-weight: 700;
    color: #135bec;
    background: none;
    border: 1px solid rgba(19, 91, 236, 0.2);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

.ajt-refund-btn:hover {
    background-color: rgba(19, 91, 236, 0.05);
}

.ajt-refund-btn .material-icons-outlined {
    font-size: 0.875rem;
}

.ajt-payment-card {
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
}

body.aura-dark-mode .ajt-payment-card {
    background-color: rgba(30, 41, 59, 0.4);
}

.ajt-payment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ajt-payment-row:last-child {
    margin-bottom: 0;
}

.ajt-payment-label {
    font-size: 0.8125rem;
    color: #64748b;
}

.ajt-payment-value {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #0f172a;
}

body.aura-dark-mode .ajt-payment-value {
    color: #e2e8f0;
}

.ajt-payment-value .material-icons-outlined {
    font-size: 1rem;
}

.ajt-payment-divider {
    border-top: 1px solid #e2e8f0;
    margin: 0.5rem 0;
}

body.aura-dark-mode .ajt-payment-divider {
    border-top-color: #334155;
}

.ajt-total-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
}

body.aura-dark-mode .ajt-total-label {
    color: #f8fafc;
}

.ajt-total-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}

body.aura-dark-mode .ajt-total-amount {
    color: #f8fafc;
}

/* ---------- Stripe Badge ---------- */
.ajt-stripe-badge {
    display: inline-block;
    background: linear-gradient(135deg, #635bff, #7c3aed);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Footer ---------- */
.ajt-footer {
    padding: var(--ajt-footer-pad);
    border-top: 1px solid var(--ajt-border);
    background: var(--ajt-surface);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    position: sticky;
    bottom: 0;
    z-index: 30;
    flex-shrink: 0;
}

.ajt-footer-primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.ajt-footer-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.ajt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    min-height: var(--ajt-touch);
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--ajt-border);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ajt-btn:active:not(:disabled) {
    transform: scale(0.98);
}

body.aura-dark-mode .ajt-btn {
    border-color: #334155;
}

.ajt-btn .material-icons-outlined {
    font-size: 14px;
}

.ajt-btn-primary {
    background-color: var(--ajt-brand);
    color: #ffffff;
    border-color: var(--ajt-brand);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.ajt-btn-primary:hover {
    background-color: #0056d6;
    border-color: #0056d6;
}

body.aura-dark-mode .ajt-btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
}

body.aura-dark-mode .ajt-btn-primary:hover {
    background: #2563eb;
}

.ajt-footer-primary .ajt-btn-invoice {
    grid-column: 1 / -1;
}

.ajt-btn-secondary {
    background: transparent;
    color: #334155;
}

body.aura-dark-mode .ajt-btn-secondary {
    color: #94a3b8;
}

.ajt-btn-secondary:hover {
    background-color: #f8fafc;
}

body.aura-dark-mode .ajt-btn-secondary:hover {
    background-color: #334155;
}

.ajt-btn-danger {
    background: transparent;
    color: #ef4444;
}

.ajt-btn-danger:hover {
    background-color: #fef2f2;
}

body.aura-dark-mode .ajt-btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.ajt-btn-ghost {
    background: transparent;
    color: #64748b;
}

.ajt-btn-ghost:hover {
    background-color: #f1f5f9;
}

body.aura-dark-mode .ajt-btn-ghost:hover {
    background-color: #1e293b;
}

/* ---------- Disabled / Loading state ---------- */
.ajt-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- Send Invoice button ---------- */
#ajt-btn-send-receipt {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
}

#ajt-btn-send-receipt:hover {
    background-color: #047857;
    border-color: #047857;
}

body.aura-dark-mode #ajt-btn-send-receipt {
    background-color: #10b981;
    border-color: #10b981;
}

body.aura-dark-mode #ajt-btn-send-receipt:hover {
    background-color: #059669;
    border-color: #059669;
}

/* ==========================================================================
   Receipt / Invoice Form Styles
   ========================================================================== */

.ajt-receipt-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Info banner */
.ajt-receipt-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    color: #065f46;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.ajt-receipt-info .material-icons-outlined {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
    color: #059669;
}

body.aura-dark-mode .ajt-receipt-info {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
    color: #6ee7b7;
}

body.aura-dark-mode .ajt-receipt-info .material-icons-outlined {
    color: #34d399;
}

/* Recipient section */
.ajt-receipt-recipient-section {
    position: relative;
}

.ajt-receipt-input-wrap {
    position: relative;
}

/* Recipient badge */
.ajt-receipt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.375rem;
    color: #065f46;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

body.aura-dark-mode .ajt-receipt-badge {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.25);
    color: #6ee7b7;
}

.ajt-receipt-badge-clear {
    background: none;
    border: none;
    color: #065f46;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.125rem;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.ajt-receipt-badge-clear:hover {
    opacity: 1;
}

body.aura-dark-mode .ajt-receipt-badge-clear {
    color: #6ee7b7;
}

/* Search results dropdown */
.ajt-receipt-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0.25rem;
    display: none;
}

.ajt-receipt-search-results.visible {
    display: block;
}

body.aura-dark-mode .ajt-receipt-search-results {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.ajt-receipt-search-results li[data-id] {
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.1s;
}

.ajt-receipt-search-results li[data-id]:hover,
.ajt-receipt-search-results li[data-id].focused {
    background: #f1f5f9;
}

body.aura-dark-mode .ajt-receipt-search-results li[data-id]:hover,
body.aura-dark-mode .ajt-receipt-search-results li[data-id].focused {
    background: #334155;
}

.ajt-receipt-result-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
}

body.aura-dark-mode .ajt-receipt-result-name {
    color: #f1f5f9;
}

.ajt-receipt-result-meta {
    font-size: 0.6875rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.125rem;
}

.ajt-receipt-result-type {
    background: #e2e8f0;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

body.aura-dark-mode .ajt-receipt-result-type {
    background: #334155;
    color: #94a3b8;
}

.ajt-receipt-result-email {
    color: #64748b;
}

body.aura-dark-mode .ajt-receipt-result-email {
    color: #94a3b8;
}

.ajt-receipt-search-loading,
.ajt-receipt-search-empty {
    padding: 0.625rem;
    font-size: 0.8125rem;
    color: #64748b;
    text-align: center;
}

body.aura-dark-mode .ajt-receipt-search-loading,
body.aura-dark-mode .ajt-receipt-search-empty {
    color: #94a3b8;
}

/* Invoice preview summary card */
.ajt-receipt-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
}

body.aura-dark-mode .ajt-receipt-summary {
    background: #0f172a;
    border-color: #1e293b;
}

.ajt-receipt-summary-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.625rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

body.aura-dark-mode .ajt-receipt-summary-title {
    color: #94a3b8;
    border-bottom-color: #1e293b;
}

.ajt-receipt-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.3125rem 0;
}

.ajt-receipt-summary-label {
    font-size: 0.75rem;
    color: #64748b;
}

body.aura-dark-mode .ajt-receipt-summary-label {
    color: #94a3b8;
}

.ajt-receipt-summary-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1e293b;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

body.aura-dark-mode .ajt-receipt-summary-value {
    color: #f1f5f9;
}

.ajt-receipt-summary-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.375rem 0;
}

body.aura-dark-mode .ajt-receipt-summary-divider {
    background: #1e293b;
}

.ajt-receipt-total-row .ajt-receipt-summary-label {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.8125rem;
}

body.aura-dark-mode .ajt-receipt-total-row .ajt-receipt-summary-label {
    color: #f1f5f9;
}

.ajt-receipt-total {
    font-weight: 700;
    color: #059669;
    font-size: 0.9375rem;
    font-family: monospace;
}

body.aura-dark-mode .ajt-receipt-total {
    color: #34d399;
}

/* Receipt actions */
.ajt-receipt-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

.ajt-receipt-actions .ajt-btn-success {
    background: #059669;
    color: #fff;
    border: none;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: inherit;
    transition: all 0.15s;
}

.ajt-receipt-actions .ajt-btn-success:hover {
    background: #047857;
}

.ajt-receipt-actions .ajt-btn-success:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

body.aura-dark-mode .ajt-receipt-actions .ajt-btn-success {
    background: #10b981;
}

body.aura-dark-mode .ajt-receipt-actions .ajt-btn-success:hover {
    background: #059669;
}

.ajt-receipt-actions .ajt-btn-secondary {
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

body.aura-dark-mode .ajt-receipt-actions .ajt-btn-secondary {
    border-color: #334155;
    color: #94a3b8;
}

/* ---------- Payment status pills ---------- */
.ajt-pay-paid {
    background-color: #dcfce7;
    color: #15803d;
}

.ajt-pay-unpaid {
    background-color: #fef3c7;
    color: #b45309;
}

.ajt-pay-refunded,
.ajt-pay-part_refunded,
.ajt-pay-failed {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* ==========================================================================
   Refund Form Styles
   ========================================================================== */

.ajt-refund-form,
.ajt-reschedule-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ajt-refund-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.ajt-refund-info .material-icons-outlined {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.ajt-refund-info.stripe {
    background: linear-gradient(135deg, rgba(99, 91, 255, 0.06), rgba(124, 58, 237, 0.06));
    border: 1px solid rgba(99, 91, 255, 0.2);
    color: #4338ca;
}

.ajt-refund-info.manual {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

body.aura-dark-mode .ajt-refund-info.stripe {
    background: rgba(99, 91, 255, 0.1);
    border-color: rgba(99, 91, 255, 0.3);
    color: #a5b4fc;
}

body.aura-dark-mode .ajt-refund-info.manual {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
}

.ajt-refund-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    color: #b91c1c;
    font-size: 0.8125rem;
    font-weight: 500;
}

body.aura-dark-mode .ajt-refund-warning {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.ajt-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ajt-form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.aura-dark-mode .ajt-form-label {
    color: #94a3b8;
}

.ajt-form-input,
.ajt-form-select,
.ajt-form-textarea {
    padding: 0.625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.ajt-form-input:focus,
.ajt-form-select:focus,
.ajt-form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

body.aura-dark-mode .ajt-form-input,
body.aura-dark-mode .ajt-form-select,
body.aura-dark-mode .ajt-form-textarea {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.aura-dark-mode .ajt-form-input:focus,
body.aura-dark-mode .ajt-form-select:focus,
body.aura-dark-mode .ajt-form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ajt-form-input[readonly] {
    background-color: #f1f5f9;
    color: #64748b;
}

body.aura-dark-mode .ajt-form-input[readonly] {
    background-color: #0f172a;
    color: #94a3b8;
}

.ajt-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ajt-input-prefix {
    position: absolute;
    left: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    pointer-events: none;
}

.ajt-input-wrapper .ajt-form-input {
    padding-left: 1.75rem;
}

.ajt-form-hint {
    font-size: 0.6875rem;
    color: #94a3b8;
}

.ajt-form-textarea {
    resize: vertical;
    min-height: 60px;
}

.ajt-form-row {
    display: flex;
    gap: 0.75rem;
}

.ajt-flex-1 {
    flex: 1;
}

.ajt-refund-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

.ajt-refund-actions .ajt-btn-danger,
.ajt-refund-actions .ajt-btn-primary {
    border: none;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: inherit;
    transition: all 0.15s;
}

.ajt-refund-actions .ajt-btn-danger {
    background: #ef4444;
    color: #fff;
}

.ajt-refund-actions .ajt-btn-danger:hover {
    background: #dc2626;
}

.ajt-refund-actions .ajt-btn-secondary {
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

body.aura-dark-mode .ajt-refund-actions .ajt-btn-secondary {
    border-color: #334155;
    color: #94a3b8;
}

/* ---------- Refund History ---------- */
.ajt-refund-history {
    margin-top: 1rem;
}

.ajt-refund-history-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem;
}

.ajt-refund-entry {
    padding: 0.625rem 0;
    border-bottom: 1px solid #f1f5f9;
}

body.aura-dark-mode .ajt-refund-entry {
    border-bottom-color: #1e293b;
}

.ajt-refund-entry:last-child {
    border-bottom: none;
}

.ajt-refund-entry-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.ajt-refund-type-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ajt-refund-type-badge.stripe {
    background: linear-gradient(135deg, #635bff, #7c3aed);
    color: #fff;
}

.ajt-refund-type-badge.manual {
    background: #e2e8f0;
    color: #475569;
}

body.aura-dark-mode .ajt-refund-type-badge.manual {
    background: #334155;
    color: #94a3b8;
}

.ajt-refund-amount {
    font-weight: 600;
    color: #ef4444;
    font-size: 0.8125rem;
}

.ajt-refund-meta {
    font-size: 0.6875rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* ---------- Reschedule Current Info ---------- */
.ajt-reschedule-current {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    color: #0369a1;
    font-size: 0.8125rem;
}

.ajt-reschedule-current .material-icons-outlined {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

body.aura-dark-mode .ajt-reschedule-current {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
}

/* ---------- Spinner ---------- */
@keyframes ajt-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ajt-spin {
    animation: ajt-spin 0.8s linear infinite;
}

/* ---------- Business Account Badge ---------- */
.ajt-business-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    margin-top: 8px;
    border-radius: 8px;
    background: #f0ebf8;
    color: #6c3483;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
}
body.aura-dark-mode .ajt-business-badge {
    background: rgba(108, 52, 131, 0.15);
    color: #d2b4de;
}

/* ---------- Passenger & timeline polish ---------- */
.ajt-passenger-row {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ajt-passenger-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.ajt-passenger-contact a {
    color: var(--ajt-brand, #0071e3);
    text-decoration: none;
    font-weight: 500;
}

.ajt-passenger-contact a:hover {
    text-decoration: underline;
}

.ajt-body--messages {
    position: relative;
    padding: 0 !important;
    overflow: hidden;
}

.ajt-body--messages .abm-panel--overlay {
    border: none;
}

.ajt-passenger-row > div:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.ajt-passenger-name,
.ajt-timeline-address {
    word-break: break-word;
}

.ajt-payment-card {
    border: 1px solid var(--ajt-border);
}

.ajt-assign-box {
    margin-left: var(--ajt-section-pad);
    margin-right: var(--ajt-section-pad);
}

.ajt-alert {
    margin-left: var(--ajt-section-pad);
    margin-right: var(--ajt-section-pad);
}

.ajt-divider {
    margin-left: var(--ajt-section-pad);
    margin-right: var(--ajt-section-pad);
}

/* ==========================================================================
   Responsive — phone · tablet · desktop
   ========================================================================== */

/* Tablet+ — slide-over from right */
@media (min-width: 640px) {
    .ajt-backdrop {
        align-items: stretch;
        justify-content: flex-end;
        padding: 0;
    }

    .ajt-panel {
        max-width: var(--ajt-panel-max);
        max-height: 100%;
        height: 100%;
        border-radius: var(--ajt-radius-lg) 0 0 var(--ajt-radius-lg);
        box-shadow: var(--ajt-shadow);
        animation: ajt-slide-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    @keyframes ajt-slide-in {
        from {
            opacity: 0;
            transform: translateX(24px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .ajt-header-bar {
        display: none;
    }

    .ajt-close-header {
        display: none;
    }

    .ajt-header {
        --ajt-header-pad: 1.25rem 1.5rem 1rem;
    }

    .ajt-footer-primary {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .ajt-footer-primary .ajt-btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
    }

    .ajt-footer-primary .ajt-btn-invoice {
        grid-column: auto;
        flex: 1 1 100%;
    }
}

@media (min-width: 768px) {
    .ajt-backdrop {
        --ajt-panel-max: 30rem;
    }

    .ajt-grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .ajt-meta-row {
        flex-wrap: nowrap;
    }

    .ajt-footer-primary .ajt-btn {
        min-width: unset;
        flex: 0 1 auto;
    }
}

@media (min-width: 1024px) {
    .ajt-backdrop {
        --ajt-panel-max: 32rem;
    }

    .ajt-title {
        font-size: 1.5rem;
    }

    .ajt-price {
        font-size: 1.5rem;
    }
}

/* Small phones — single-column footer, full-width actions */
@media (max-width: 380px) {
    .ajt-footer-primary,
    .ajt-footer-secondary {
        grid-template-columns: 1fr;
    }

    .ajt-header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .ajt-price {
        align-self: flex-start;
    }

    .ajt-meta-item--service {
        flex: 1 1 100%;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ajt-panel {
        animation: none;
    }

    .ajt-loading-spinner,
    .ajt-spin {
        animation: none;
    }
}