/* Shared premium UI layer for public pages and every authenticated panel. */
:root {
    --ui-surface: #ffffff;
    --ui-ink: #0f172a;
    --ui-radius-sm: 12px;
    --ui-radius-md: 16px;
    --ui-radius-lg: 22px;
    --ui-shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
    --ui-shadow-md: 0 18px 50px rgba(15, 23, 42, .10);
    --ui-focus: 0 0 0 4px color-mix(in srgb, var(--accent-color, #F97316) 18%, transparent);
}

body { font-family: var(--font-body, 'Inter'), sans-serif !important; letter-spacing: -.005em; }
h1, h2, h3, h4, h5, h6, .font-display, .card-title {
    font-family: var(--font-heading, 'Sora'), sans-serif !important;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.site-logo-mark { transition: transform .25s ease, box-shadow .25s ease; }
a:hover .site-logo-mark { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(15, 23, 42, .12) !important; }

/* Legacy authentication templates ship with fixed light-mode colors. */
html.dark .authentication-wrapper .card,
html[data-color-mode="dark"] .authentication-wrapper .card {
    background: #172033 !important;
    border-color: rgba(148, 163, 184, .18) !important;
    color: #F8FAFC !important;
}
html.dark .authentication-wrapper .card :is(h1, h2, h3, h4, h5, p, label, .form-label, .form-check-label, .text-body),
html[data-color-mode="dark"] .authentication-wrapper .card :is(h1, h2, h3, h4, h5, p, label, .form-label, .form-check-label, .text-body) {
    color: #E5E7EB !important;
}
html.dark .authentication-wrapper :is(.form-control, .input-group-text),
html[data-color-mode="dark"] .authentication-wrapper :is(.form-control, .input-group-text) {
    background-color: #0F172A !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
}
html.dark .authentication-wrapper .form-control::placeholder,
html[data-color-mode="dark"] .authentication-wrapper .form-control::placeholder {
    color: #94A3B8 !important;
    opacity: 1;
}
html.dark .authentication-wrapper a,
html[data-color-mode="dark"] .authentication-wrapper a { color: #FDBA74 !important; }

/* Universal avatar & icon centering and proportion fix */
.avatar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle;
    position: relative;
}
.avatar > i,
.avatar > [class^="bx"],
.avatar > [class*=" bx-"],
.avatar > .fas,
.avatar > .fa,
.avatar > svg,
.avatar .avatar-initial {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center;
}
.avatar img {
    object-fit: cover;
    border-radius: inherit;
}

/* Dark/Light mode card and typography consistency */
.card-luxury {
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #0f172a);
    border: 1px solid var(--card-border, var(--border-color, rgba(15, 23, 42, 0.08)));
}
html.dark .card-luxury,
html[data-color-mode="dark"] .card-luxury {
    background: var(--card-bg, #111827);
    color: var(--text-primary, #f8fafc);
    border-color: var(--card-border, rgba(255, 255, 255, 0.08));
}
.card-luxury h1, .card-luxury h2, .card-luxury h3, .card-luxury h4, .card-luxury h5, .card-luxury h6 {
    color: var(--text-primary, #0f172a);
}
html.dark .card-luxury :is(h1, h2, h3, h4, h5, h6),
html[data-color-mode="dark"] .card-luxury :is(h1, h2, h3, h4, h5, h6) {
    color: var(--text-primary, #f8fafc);
}

.card, .card-luxury, .theme-card {
    border-radius: var(--ui-radius-lg) !important;
    border: 1px solid var(--card-border, var(--border-color, rgba(15, 23, 42, .09))) !important;
    box-shadow: var(--ui-shadow-sm);
}
.card-header { background: transparent !important; border-bottom-color: var(--border-color, rgba(15, 23, 42, .08)) !important; padding: 1.25rem 1.5rem !important; }
.card-body { padding: 1.5rem !important; }

.btn, .btn-primary-lux, .btn-secondary-lux { 
    border-radius: 12px !important; 
    font-weight: 600 !important; 
    min-height: 42px; 
    box-shadow: none; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-primary, .btn-primary-lux, a.btn-primary, a.btn-primary-lux, button.btn-primary { 
    background: var(--accent-color, #F97316) !important; 
    border-color: var(--accent-color, #F97316) !important; 
    color: #ffffff !important; 
}
.btn-primary *, .btn-primary-lux *, a.btn-primary *, a.btn-primary-lux *, button.btn-primary * {
    color: #ffffff !important;
}
.btn-success, .btn-danger, .btn-info, .btn-secondary,
a.btn-success, a.btn-danger, a.btn-info, a.btn-secondary,
button.btn-success, button.btn-danger, button.btn-info, button.btn-secondary,
.btn-success *, .btn-danger *, .btn-info *, .btn-secondary * {
    color: #ffffff !important;
}
.btn-warning, a.btn-warning, button.btn-warning, .btn-warning * {
    color: #1f2937 !important;
}
html[data-color-mode="light"] .btn-primary,
html[data-color-mode="light"] .btn-primary *,
html[data-color-mode="dark"] .btn-primary,
html[data-color-mode="dark"] .btn-primary *,
html.dark .btn-primary,
html.dark .btn-primary *,
html[data-color-mode="light"] .btn-success,
html[data-color-mode="light"] .btn-success *,
html[data-color-mode="dark"] .btn-success,
html[data-color-mode="dark"] .btn-success *,
html.dark .btn-success,
html.dark .btn-success *,
html[data-color-mode="light"] .btn-danger,
html[data-color-mode="light"] .btn-danger *,
html[data-color-mode="dark"] .btn-danger,
html[data-color-mode="dark"] .btn-danger *,
html.dark .btn-danger,
html.dark .btn-danger *,
html[data-color-mode="light"] .btn-info,
html[data-color-mode="light"] .btn-info *,
html[data-color-mode="dark"] .btn-info,
html[data-color-mode="dark"] .btn-info *,
html.dark .btn-info,
html.dark .btn-info *,
html[data-color-mode="light"] .btn-secondary,
html[data-color-mode="light"] .btn-secondary *,
html[data-color-mode="dark"] .btn-secondary,
html[data-color-mode="dark"] .btn-secondary *,
html.dark .btn-secondary,
html.dark .btn-secondary *,
html[data-color-mode="light"] .kd-stat-card,
html[data-color-mode="light"] .kd-stat-card *,
html[data-color-mode="dark"] .kd-stat-card,
html[data-color-mode="dark"] .kd-stat-card *,
html.dark .kd-stat-card,
html.dark .kd-stat-card * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}
html[data-color-mode="light"] .card.kd-stat-card,
html[data-color-mode="dark"] .card.kd-stat-card,
html.dark .card.kd-stat-card,
.card.kd-stat-card {
    color: #ffffff !important;
    background: var(--kd-stat-bg, #1d4ed8) !important;
    background-color: var(--kd-stat-bg, #1d4ed8) !important;
}
.kd-stat-card .card-body,
.kd-stat-card h4,
.kd-stat-card h6,
.kd-stat-card small,
.kd-stat-card .card-title {
    color: #ffffff !important;
    background: transparent !important;
}
.btn-primary:hover, .btn-primary-lux:hover, a.btn-primary:hover, a.btn-primary-lux:hover, button.btn-primary:hover { 
    background: var(--accent-hover, #ea580c) !important;
    border-color: var(--accent-hover, #ea580c) !important;
    color: #ffffff !important;
    transform: translateY(-1px); 
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-color, #F97316) 28%, transparent) !important; 
}

.form-control, .form-select, input[type='text'], input[type='email'], input[type='password'], input[type='number'], textarea, select { border-radius: var(--ui-radius-sm) !important; }
.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus { border-color: var(--accent-color, #F97316) !important; box-shadow: var(--ui-focus) !important; }

.layout-menu { border-right: 1px solid var(--border-color, rgba(15, 23, 42, .08)); box-shadow: 12px 0 40px rgba(15, 23, 42, .04) !important; }
.layout-navbar { border: 1px solid var(--border-color, rgba(15, 23, 42, .08)); border-radius: 18px !important; box-shadow: var(--ui-shadow-sm) !important; overflow: visible; height: auto; min-height: 4.5rem; }
.layout-page .container-xxl {
    max-width: none !important;
    width: calc(100% - 2.75rem);
}
.layout-page .content-wrapper > .container-p-y {
    padding-top: 1.75rem;
    padding-bottom: 2.75rem;
}
@media (max-width: 1199.98px) {
    .layout-page .container-xxl { width: calc(100% - 1.25rem); }
}
.brand-wordmark {
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 1.05rem;
    line-height: 1;
    color: inherit;
}
.layout-menu .brand-wordmark { color: #f8fafc; }
.panel-top-actions { gap: 1.35rem; margin-left: auto !important; padding-right: .35rem; }
.panel-top-actions > .nav-item { margin: 0 !important; }
.panel-top-actions .nav-link,
.panel-top-actions #global-theme-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 0 !important;
}
.panel-top-actions .dropdown-notifications { position: relative; }
.panel-top-actions .fi {
    width: 22px;
    height: 16px;
    font-size: 22px;
    line-height: 16px;
    margin: 0 !important;
    border-radius: 3px;
}
.panel-top-actions .avatar,
.panel-top-actions .avatar img {
    width: 36px !important;
    height: 36px !important;
}
.panel-top-actions .bx-bell { font-size: 1.35rem; }
#navbar-collapse.navbar-nav-right { width: 100%; }
.cargo-line {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-top: .35rem;
}
.cargo-line img {
    width: 92px;
    height: 28px;
    object-fit: contain;
    flex: 0 0 auto;
    background: #fff;
    border-radius: 4px;
    padding: 2px;
}
.cargo-line span {
    font-weight: 600;
    white-space: normal;
    line-height: 1.2;
}
.layout-page .table-responsive > .table {
    width: 100% !important;
    table-layout: auto;
}
.layout-page .table-responsive > .table th,
.layout-page .table-responsive > .table td {
    overflow-wrap: normal;
    word-break: normal;
}
@media (max-width: 1199.98px) {
    .layout-page .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .layout-page .table-responsive > .table {
        width: max-content !important;
        min-width: 100%;
    }
    .layout-page .table-responsive > .table th,
    .layout-page .table-responsive > .table td {
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }
    #kd-help { bottom: 84px !important; left: 12px !important; }
    .layout-page .table-responsive > .banner-table,
    .layout-page .table-responsive > .banner-table th,
    .layout-page .table-responsive > .banner-table td {
        width: auto !important;
        min-width: 0 !important;
        white-space: normal !important;
    }
    .banner-table { width: 100% !important; }
}
.panel-top-actions .badge-notifications {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 .28rem;
    font-size: .68rem;
    line-height: 1.15rem;
    transform: none;
}
.menu-inner .menu-link { border-radius: 12px !important; margin: 2px 10px; min-height: 44px; }
.menu-inner .menu-item.active > .menu-link { background: color-mix(in srgb, var(--accent-color, #F97316) 12%, transparent) !important; color: var(--accent-color, #F97316) !important; box-shadow: none !important; }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .9rem 1rem; }

.premium-hero-art {
    position: relative;
    isolation: isolate;
    min-height: 430px;
    border-radius: 30px;
    border: 1px solid var(--card-border, var(--border-color));
    background: radial-gradient(circle at 75% 20%, color-mix(in srgb, var(--accent-color) 18%, transparent), transparent 38%), linear-gradient(145deg, color-mix(in srgb, var(--card-bg) 96%, #fff), var(--bg-secondary));
    box-shadow: 0 30px 80px rgba(2, 8, 23, .16);
    overflow: hidden;
}
.premium-hero-art::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(color-mix(in srgb, var(--text-muted) 28%, transparent) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 82%);
}
.premium-hero-art > img {
    width: 112%;
    max-width: none;
    height: 100%;
    min-height: 430px;
    object-fit: contain;
    object-position: center bottom;
    transform: translateX(-6%);
    filter: drop-shadow(0 30px 36px rgba(2, 8, 23, .22));
}
.premium-hero-pill {
    position: absolute;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1rem;
    border-radius: 16px;
    background: color-mix(in srgb, var(--card-bg) 92%, transparent);
    border: 1px solid var(--card-border, var(--border-color));
    box-shadow: var(--ui-shadow-md);
    backdrop-filter: blur(14px);
}
.premium-hero-pill--top { top: 1.25rem; right: 1.25rem; }
.premium-hero-pill--bottom { bottom: 1.25rem; left: 1.25rem; }
.premium-hero-pill--top-left { top: 1.25rem; left: 1.25rem; }
.premium-hero-pill--top-right { top: 1.25rem; right: 1.25rem; }
.premium-hero-pill--bottom-left { bottom: 1.25rem; left: 1.25rem; }
.premium-hero-pill--bottom-right { bottom: 1.25rem; right: 1.25rem; }

.premium-flow {
    width: min(100%, 300px);
    padding: 18px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.premium-flow__eyebrow { color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.premium-flow__item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border-radius: 13px; background: var(--card-bg); border: 1px solid var(--border-color); }
.premium-flow__item + .premium-flow__item { margin-top: 8px; }
.premium-flow__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--accent-color); }
.premium-flow__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; font-weight: 700; }
.premium-flow__status { width: 8px; height: 8px; border-radius: 50%; background: #10B981; box-shadow: 0 0 0 5px rgba(16,185,129,.12); }

#hero .hero-heading { max-width: 760px; font-size: clamp(2.6rem, 5.2vw, 5.15rem) !important; line-height: 1.04 !important; letter-spacing: -.06em !important; }
#trust h2, section h2.font-display { font-size: clamp(2rem, 3.7vw, 3.6rem) !important; line-height: 1.1; }

@media (max-width: 1023px) {
    .premium-hero-art, .premium-hero-art > img { min-height: 390px; }
}
@media (max-width: 640px) {
    #hero .hero-heading { font-size: clamp(2.25rem, 12vw, 3.35rem) !important; }
    .premium-hero-art, .premium-hero-art > img { min-height: 330px; }
    .premium-hero-art { border-radius: 22px; }
    .premium-hero-pill { padding: .65rem .75rem; }
    .premium-hero-pill--top { top: .75rem; right: .75rem; }
    .premium-hero-pill--bottom { bottom: .75rem; left: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Sidebar scroll shadow fix - eliminates white bar in dark and light modes */
.menu-inner-shadow,
.layout-menu .menu-inner-shadow,
.bg-menu-theme .menu-inner-shadow,
html.dark .menu-inner-shadow,
html[data-color-mode="dark"] .menu-inner-shadow {
    display: none !important;
    background: transparent !important;
    opacity: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* ============================================================
   GLOBAL DARK MODE CONSISTENCY (Tables, Invoices, Calculator)
   ============================================================ */

/* Universal Dark Mode Table Fix */
html.dark .table-light,
html[data-color-mode="dark"] .table-light,
html.dark thead.table-light th,
html[data-color-mode="dark"] thead.table-light th,
html.dark .table thead th,
html[data-color-mode="dark"] .table thead th {
    background-color: #172033 !important;
    color: #94a3b8 !important;
    border-color: rgba(148, 163, 184, 0.15) !important;
}
html.dark .table,
html[data-color-mode="dark"] .table {
    color: #cbd5e1 !important;
    --bs-table-color: #cbd5e1 !important;
    --bs-table-bg: transparent !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
}
html.dark .table td,
html[data-color-mode="dark"] .table td {
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: #cbd5e1 !important;
}
html.dark .table-hover tbody tr:hover,
html[data-color-mode="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
    color: #f8fafc !important;
}

/* Calculator Card Dark Mode */
html.dark .calculator-card,
html[data-color-mode="dark"] .calculator-card {
    background: #172033 !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25) !important;
    color: #f8fafc !important;
}
html.dark .calculator-card .calc-title,
html[data-color-mode="dark"] .calculator-card .calc-title {
    color: #ffffff !important;
}
html.dark .calculator-card .form-label,
html[data-color-mode="dark"] .calculator-card .form-label {
    color: #cbd5e1 !important;
}
html.dark .calculator-card :is(.form-control, .form-select),
html[data-color-mode="dark"] .calculator-card :is(.form-control, .form-select) {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
html.dark .calculator-card :is(.form-control:focus, .form-select:focus),
html[data-color-mode="dark"] .calculator-card :is(.form-control:focus, .form-select:focus) {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15) !important;
}
html.dark .calc-result,
html[data-color-mode="dark"] .calc-result {
    background: #1e293b !important;
    border-left: 6px solid #f97316 !important;
    color: #f8fafc !important;
}

/* Monthly Invoice History Dark Mode */
html.dark .user-info-card,
html[data-color-mode="dark"] .user-info-card,
html.dark .summary-stat-card,
html[data-color-mode="dark"] .summary-stat-card,
html.dark .invoice-card,
html[data-color-mode="dark"] .invoice-card {
    background: #172033 !important;
    border-color: rgba(148, 163, 184, 0.15) !important;
    color: #f8fafc !important;
}
html.dark .invoice-header,
html[data-color-mode="dark"] .invoice-header,
html.dark .invoice-summary,
html[data-color-mode="dark"] .invoice-summary {
    background: #1e293b !important;
    border-color: rgba(148, 163, 184, 0.15) !important;
    color: #f8fafc !important;
}
html.dark .user-info-card .user-value,
html[data-color-mode="dark"] .user-info-card .user-value,
html.dark .invoice-header .invoice-number,
html[data-color-mode="dark"] .invoice-header .invoice-number,
html.dark .invoice-summary .summary-item .value,
html[data-color-mode="dark"] .invoice-summary .summary-item .value {
    color: #ffffff !important;
}
html.dark .invoice-detail-table thead th,
html[data-color-mode="dark"] .invoice-detail-table thead th {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-color: rgba(148, 163, 184, 0.15) !important;
}
html.dark .invoice-detail-table .tracking-code,
html[data-color-mode="dark"] .invoice-detail-table .tracking-code {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
}
html.dark .month-filter .btn-filter,
html[data-color-mode="dark"] .month-filter .btn-filter {
    background: #172033 !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
    color: #cbd5e1 !important;
}
html.dark .month-filter .btn-filter.active,
html[data-color-mode="dark"] .month-filter .btn-filter.active {
    background: #f97316 !important;
    border-color: #f97316 !important;
    color: #ffffff !important;
}

/* 3D Floating Hero Logistics Elements */
.hero-3d-scene {
    perspective: 1200px;
    transform-style: preserve-3d;
    /* isolation: auto ensures float-badges above this scene can stack
       over the 3d-card even though transform creates a new stacking context */
    isolation: auto;
}
.hero-3d-card {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    transform: rotateY(-5deg) rotateX(3deg);
    transform-style: preserve-3d;
    border-radius: 28px;
    position: relative;
    /* Prevent the card from creating a stacking context that traps badge z-index */
    isolation: auto;
}
.hero-3d-card:hover {
    transform: rotateY(0deg) rotateX(0deg) translateY(-4px);
    box-shadow: 0 35px 70px -15px rgba(249, 115, 22, 0.25);
}
.hero-float-badge {
    position: absolute;
    /* Raised from 25 → 40 so badges always render above the rotated 3D card */
    z-index: 40;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 18px;
    padding: 12px 18px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    animation: heroFloat 5s ease-in-out infinite alternate;
}
.hero-float-badge--top,
.hero-float-badge--top-right {
    position: relative;
    top: auto;
    right: auto;
    display: flex;
    width: fit-content;
    margin: 0 0 14px auto;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.9);
    animation: none;
}
html.dark .hero-float-badge--top,
html.dark .hero-float-badge--top-right {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(51, 65, 85, 0.9);
}
.hero-float-badge--bottom,
.hero-float-badge--bottom-left {
    bottom: -22px;
    left: 15px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    animation-delay: 2.5s;
}
html.dark .hero-float-badge--bottom,
html.dark .hero-float-badge--bottom-left {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(51, 65, 85, 0.9);
}
@keyframes heroFloat {
    0% { transform: translateY(0px) translateZ(10px); }
    100% { transform: translateY(-14px) translateZ(30px); }
}

/* Hero View Tabs */
.hero-view-tab {
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.6);
    color: #64748b;
    cursor: pointer;
}
.hero-view-tab.active {
    background: #ffffff;
    border-color: #f97316;
    color: #ea580c;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}
html.dark .hero-view-tab {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(51, 65, 85, 0.8);
    color: #94a3b8;
}
html.dark .hero-view-tab.active {
    background: rgba(15, 23, 42, 0.95);
    border-color: #f97316;
    color: #fb923c;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

/* Admin Orders Dark Mode Fixes */
html.dark .filter-section,
[data-bs-theme="dark"] .filter-section {
    background: #172033 !important;
    border-color: #334155 !important;
}
html.dark .shipping-payer-badge.sender,
[data-bs-theme="dark"] .shipping-payer-badge.sender {
    background: rgba(30, 58, 138, 0.4) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
html.dark .shipping-payer-badge.receiver,
[data-bs-theme="dark"] .shipping-payer-badge.receiver {
    background: rgba(120, 53, 15, 0.4) !important;
    color: #fde68a !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

html.dark,
html[data-color-mode="dark"] {
    --ui-surface: #172033;
    --ui-ink: #f8fafc;
}

.layout-wrapper {
    --bs-primary: var(--accent-color, #F97316);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color, #F97316);
    box-shadow: var(--ui-focus);
}

.form-check-input:checked {
    background-color: var(--accent-color, #F97316);
    border-color: var(--accent-color, #F97316);
}

.layout-menu .menu-item.active > .menu-link {
    color: var(--accent-color, #F97316);
}

.table-responsive {
    max-width: 100%;
}

.table {
    font-size: 0.92rem;
}

html.dark .table,
html[data-color-mode="dark"] .table {
    --bs-table-color: #e5e7eb;
    --bs-table-bg: transparent;
    --bs-table-border-color: #334155;
    color: #e5e7eb;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}

.empty-state p {
    margin-bottom: 1rem;
    color: var(--ui-ink, #0f172a);
}

html.dark .empty-state p,
html[data-color-mode="dark"] .empty-state p {
    color: var(--ui-ink, #f8fafc);
}

.panel-bottom-nav {
    display: none;
}

.summary-stat-card { overflow: hidden; min-width: 0; }
.summary-stat-card .stat-number { overflow-wrap: anywhere; }
@media (max-width: 1199.98px) {
    html, body { overflow-x: clip; }
    .layout-page, .content-wrapper { padding-bottom: 9.5rem; }
    .summary-stat-card .stat-number { font-size: 1.05rem; }
    .panel-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1020;
        background: #fff;
        border-top: 1px solid #e7e7e8;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    html.dark .panel-bottom-nav,
    [data-bs-theme="dark"] .panel-bottom-nav {
        background: #1e293b;
        border-top-color: #334155;
    }
    .panel-bottom-nav a {
        flex: 1;
        text-align: center;
        text-decoration: none;
        color: #697a8d;
        font-size: 11px;
        line-height: 1.2;
    }
    html.dark #cargo-selection-modal .modal-content,
    html[data-color-mode="dark"] #cargo-selection-modal .modal-content,
    html.dark .cargo-option-card,
    html[data-color-mode="dark"] .cargo-option-card {
        background: #111827;
        color: #e5e7eb;
        border-color: #334155;
    }
    html.dark #cargo-selection-modal .modal-body,
    html.dark #cargo-selection-modal .modal-footer,
    html.dark #cargo-selection-modal .bg-light,
    html.dark #cargo-selection-modal .bg-white,
    html[data-color-mode="dark"] #cargo-selection-modal .modal-body,
    html[data-color-mode="dark"] #cargo-selection-modal .modal-footer,
    html[data-color-mode="dark"] #cargo-selection-modal .bg-light,
    html[data-color-mode="dark"] #cargo-selection-modal .bg-white {
        background: #0f172a !important;
        color: #e5e7eb;
    }
    html.dark #cargo-selection-modal .text-dark,
    html[data-color-mode="dark"] #cargo-selection-modal .text-dark {
        color: #e5e7eb !important;
    }
    html.dark #order-loading-overlay,
    html[data-color-mode="dark"] #order-loading-overlay {
        background: rgba(15, 23, 42, 0.9) !important;
        color: #e5e7eb;
    }
    .panel-bottom-nav a.active {
        color: var(--brand-accent, #696cff);
        font-weight: 600;
    }
    .panel-bottom-nav i {
        display: block;
        font-size: 20px;
        margin-bottom: 2px;
    }
    .layout-page {
        padding-bottom: 9.5rem;
    }
    .layout-navbar .layout-menu-toggle,
    .layout-navbar .layout-menu-toggle .nav-link,
    .modal-header .btn-close {
        min-width: 44px;
        min-height: 44px;
    }
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    .modal-dialog {
        margin: .75rem auto;
        max-width: calc(100% - 1.5rem);
    }
}

.carrier-logo-fallback {
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: var(--brand-accent, #f97316);
}
.carrier-theme-compact .card-body {
    padding: 1rem !important;
}
.carrier-theme-compact .carrier-logo-container {
    width: 48px !important;
    height: 36px !important;
}
.carrier-theme-band {
    border-top: 4px solid var(--brand-accent, #f97316) !important;
}

@media (min-width: 1200px) {
    body:not(.layout-menu-collapsed) .menu-vertical,
    body:not(.layout-menu-collapsed) .menu-vertical .menu-block,
    body:not(.layout-menu-collapsed) .menu-vertical .menu-inner > .menu-item,
    body:not(.layout-menu-collapsed) .menu-vertical .menu-inner > .menu-header,
    body:not(.layout-menu-collapsed) .layout-menu {
        width: 17.25rem !important;
    }
    .layout-menu-fixed:not(.layout-menu-collapsed) .layout-page,
    .layout-menu-fixed-offcanvas:not(.layout-menu-collapsed) .layout-page {
        padding-left: 17.25rem !important;
    }
    .layout-navbar-fixed:not(.layout-menu-collapsed) .layout-content-navbar:not(.layout-without-menu) .layout-navbar,
    .layout-menu-fixed.layout-navbar-fixed:not(.layout-menu-collapsed) .layout-content-navbar:not(.layout-without-menu) .layout-navbar,
    .layout-menu-fixed-offcanvas.layout-navbar-fixed:not(.layout-menu-collapsed) .layout-content-navbar:not(.layout-without-menu) .layout-navbar,
    .layout-footer-fixed:not(.layout-menu-collapsed) .layout-wrapper:not(.layout-without-menu) .content-footer {
        left: 17.25rem !important;
    }
}
.layout-menu .app-brand {
    height: auto;
    padding: 1.15rem 1rem 0.35rem;
}
.side-identity {
    margin: 0.35rem 0.75rem 0.85rem;
    padding: 0.9rem 0.85rem 0.8rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
}
.side-person { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.side-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.side-name { display: block; font-weight: 650; line-height: 1.25; }
.side-role { display: block; margin-top: 0.1rem; font-size: 0.75rem; color: #94a3b8; }
.side-money { display: grid; gap: 0.7rem; margin-top: 0.9rem; }
.side-money > div { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.side-money span { font-size: 0.72rem; line-height: 1.2; color: #94a3b8; }
.side-money strong { font-size: 0.98rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.side-money .is-plus { color: #3dd68c; }
.side-money .is-due { color: #f0a0a8; }
.layout-menu #kd-menu-search { min-height: 40px; }
.menu-vertical .menu-inner > .menu-item .menu-link {
    margin-left: 0.6rem;
    margin-right: 0.6rem;
    white-space: normal;
    line-height: 1.3;
    min-height: 42px;
}
.orders-board {
    width: 100%;
}
.orders-board .table {
    width: 100%;
    font-size: 0.9rem;
    line-height: 1.45;
}
.orders-board .table th,
.orders-board .table td {
    white-space: normal;
    padding: 0.95rem 0.75rem;
    vertical-align: middle;
}
.orders-board .form-select-sm,
.layout-page .table-responsive .form-select-sm {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    font-size: 0.75rem;
}
.orders-board .table-responsive { overflow-x: hidden; }
.layout-page .orders-board .table-responsive > .table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed;
}
.layout-page .orders-board .table-responsive > .table th,
.layout-page .orders-board .table-responsive > .table td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding: 0.55rem 0.35rem !important;
}
.layout-page .carrier-rate-board .table-responsive { overflow-x: hidden; }
.layout-page .carrier-rate-board .table-responsive > .table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed;
}
.layout-page .carrier-rate-board .table-responsive > .table th,
.layout-page .carrier-rate-board .table-responsive > .table td {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
.orders-board .order-id { font-size: 12px; }
.orders-board .total-detail { font-size: 11px; line-height: 1.3; }
.orders-board .btn-sm,
.orders-board .action-dropdown .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.layout-page .table-responsive .table {
    font-size: 0.9rem;
    line-height: 1.45;
}
.layout-page .table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #111827;
}
.layout-page .orders-scroll {
    max-width: 100%;
    overflow-x: auto;
}
@media (min-width: 1200px) {
    .layout-page .orders-scroll > .orders-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed;
    }
    .layout-page .orders-table th,
    .layout-page .orders-table td {
        padding: 0.85rem 0.55rem !important;
        vertical-align: middle;
    }
    .layout-page .orders-table thead th {
        white-space: nowrap;
        text-align: left;
    }
    .layout-page .orders-table th:nth-child(1),
    .layout-page .orders-table td[data-field="select"] { width: 40px; padding-left: 0.9rem !important; padding-right: 0 !important; text-align: center; }
    .layout-page .orders-table th:nth-child(2),
    .layout-page .orders-table td[data-field="date"] { width: 108px; }
    .layout-page .orders-table td[data-field="customer"] { width: 18%; overflow: hidden; }
    .layout-page .orders-table td[data-field="product"] { width: 15%; }
    .layout-page .orders-table td[data-field="product"],
    .layout-page .orders-table th:nth-child(4),
    .layout-page .orders-table td[data-field="desi"],
    .layout-page .orders-table th:nth-child(5),
    .layout-page .orders-table td[data-field="fee"],
    .layout-page .orders-table th:nth-child(7),
    .layout-page .orders-table td[data-field="services"],
    .layout-page .orders-table th:nth-child(8),
    .layout-page .orders-table td[data-field="status"],
    .layout-page .orders-table th:nth-child(9) { text-align: center; }
    .layout-page .orders-table td[data-field="desi"] { width: 64px; }
    .layout-page .orders-table td[data-field="shipping"] { width: 216px; }
    .layout-page .orders-table td[data-field="fee"] { width: 104px; font-variant-numeric: tabular-nums; }
    .layout-page .orders-table td[data-field="services"] { width: 92px; }
    .layout-page .orders-table td[data-field="status"] { width: 128px; }
    .layout-page .orders-table th:last-child,
    .layout-page .orders-table td[data-field="actions"] {
        width: 88px;
        white-space: nowrap;
        text-align: center;
    }
    .orders-table .cargo-line { margin-top: 0; align-items: center; }
    .orders-table .cargo-line img { width: 64px; height: 22px; object-fit: contain; }
    .orders-table .order-track { display: block; max-width: 100%; margin-top: 4px; }
    .orders-table td[data-field="services"] .order-icons { justify-content: center; width: 100%; }
    .orders-table td[data-field="status"] .small { display: block; margin-top: 4px; text-align: center; }
    .orders-table td[data-field="actions"] .dropdown { display: flex; justify-content: center; }
    .orders-table .order-clamp {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .orders-table .order-track {
        display: inline-block;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }
    .orders-table .order-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
    .orders-table .order-ref { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .orders-table .order-icons {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 4px;
        color: #475569;
        font-size: 1.05rem;
    }
    .orders-table .order-tip { position: relative; display: inline-flex; cursor: default; }
    .orders-table .order-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; }
    .orders-table .order-tip-text {
        display: none;
        position: absolute;
        z-index: 8;
        top: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%);
        width: max-content;
        max-width: 220px;
        padding: 6px 8px;
        border-radius: 8px;
        background: #0f172a;
        color: #fff;
        font-size: 12px;
        line-height: 1.35;
        white-space: normal;
        text-align: left;
    }
    .layout-page .orders-scroll { overflow: visible; }
    .orders-table .order-tip:hover,
    .orders-table .order-tip:focus { z-index: 9; }
    .orders-table .order-tip:hover .order-tip-text,
    .orders-table .order-tip:focus .order-tip-text { display: block; }
    .orders-table .order-warn { color: #d4a017; }
    .orders-table .order-share {
        margin-left: 6px;
        color: #128C7E;
        font-size: 1.05rem;
    }
}
.orders-board .table td,
.orders-board .table .text-muted,
.orders-board .total-detail,
.orders-board .order-id {
    color: #111827;
}
#desi-guide-modal .modal-body,
#desi-guide-modal .modal-body p,
#desi-guide-modal .modal-body h6,
#desi-guide-modal .modal-body strong,
#desi-guide-modal .modal-body .text-muted,
#desi-guide-modal .modal-title {
    color: #111827 !important;
}
html.dark .orders-board .table td,
html.dark .orders-board .table .text-muted,
html.dark .orders-board .total-detail,
html.dark .orders-board .order-id,
[data-bs-theme="dark"] .orders-board .table td,
[data-bs-theme="dark"] .orders-board .table .text-muted,
[data-color-mode="dark"] .orders-board .table td,
[data-color-mode="dark"] .orders-board .table .text-muted {
    color: #f8fafc !important;
}
html.dark #desi-guide-modal .modal-body,
html.dark #desi-guide-modal .modal-body p,
html.dark #desi-guide-modal .modal-body h6,
html.dark #desi-guide-modal .modal-title,
[data-bs-theme="dark"] #desi-guide-modal .modal-body,
[data-bs-theme="dark"] #desi-guide-modal .modal-body p,
[data-bs-theme="dark"] #desi-guide-modal .modal-body h6,
[data-color-mode="dark"] #desi-guide-modal .modal-body,
[data-color-mode="dark"] #desi-guide-modal .modal-body p,
[data-color-mode="dark"] #desi-guide-modal .modal-body h6 {
    color: #f8fafc !important;
}
@media (max-width: 991.98px) {
    .orders-board .table-responsive { overflow: visible; }
    .orders-board thead { display: none; }
    .layout-page .orders-board .table-responsive > .table,
    .orders-board .table,
    .orders-board tbody,
    .orders-board tr,
    .orders-board td {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .orders-board tr {
        margin: 0.75rem;
        padding: 0.35rem 0;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #fff;
    }
    .orders-board td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.55rem 0.85rem !important;
        border: 0 !important;
        word-break: normal !important;
        overflow-wrap: anywhere;
        text-align: right;
    }
    .layout-page .orders-board .table-responsive > .table td,
    .orders-board td {
        white-space: normal !important;
        display: block !important;
        overflow: hidden;
    }
    .orders-board td::before {
        content: attr(data-label);
        display: block;
        width: auto;
        margin-bottom: 0.2rem;
        text-align: left;
        font-weight: 700;
        color: #111827;
    }
    .orders-board td .badge,
    .orders-board td .form-select,
    .orders-board td .total-amount,
    .orders-board td .total-detail,
    .orders-board td .small {
        white-space: normal !important;
        max-width: 100%;
        height: auto;
    }
    .orders-board td .form-select { width: 100%; }
    .orders-board tr { overflow: hidden; }
    .orders-board > .card-body,
    .orders-board .card-body { padding: 0 !important; }
    .layout-container { height: 100dvh; max-height: 100dvh; }
    .layout-page {
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-bottom: 0 !important;
    }
    .layout-page > .content-wrapper {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        margin-bottom: 168px;
        padding-bottom: 0.75rem !important;
    }
    .orders-board td.orders-extra { display: flex !important; }
    .orders-board td .text-truncate { max-width: none !important; white-space: normal; }
    html.dark .orders-board tr,
    [data-bs-theme="dark"] .orders-board tr,
    [data-color-mode="dark"] .orders-board tr { background: #111827; border-color: #334155; }
    html.dark .orders-board td::before,
    [data-bs-theme="dark"] .orders-board td::before,
    [data-color-mode="dark"] .orders-board td::before { color: #f8fafc; }
}
.layout-page .table-responsive .table th,
.layout-page .table-responsive .table td {
    white-space: normal;
    padding: 0.95rem 0.9rem !important;
    vertical-align: middle;
}
.layout-page .table td[colspan] {
    padding-top: 0.15rem;
    padding-bottom: 1.15rem;
    background: transparent;
}
@media (max-width: 1599.98px) {
    .orders-extra { display: none !important; }
    .orders-board col.orders-extra { width: 0 !important; }
}

#create-shipment-modal .modal-body { overflow-x: hidden; }
.shipment-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.piece-add-line {
    margin-top: 8px; border: 1px dashed #94a3b8; background: transparent; color: inherit;
    border-radius: 10px; padding: 8px 12px; font-weight: 600;
}
.piece-remove {
    height: 38px; padding: 0 12px; border-radius: 10px; flex: 0 0 auto;
    border: 1px solid #fecaca; background: transparent; color: #b91c1c; font-weight: 600;
}
html[data-color-mode="dark"] .piece-remove { color: #fecaca; border-color: #7f1d1d; background: #1f2937; }
.piece-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.piece-row .form-control { min-width: 0; }
.piece-row .product-name { flex: 1.4 1 0; }
.piece-row .product-qty { flex: 0.4 1 72px; }
.piece-row .product-sku, .piece-row .package-width, .piece-row .package-height, .piece-row .package-length, .piece-row .package-weight { flex: 1 1 0; }
@media (max-width: 991.98px) {
    .piece-row { flex-wrap: wrap; }
    .piece-row .product-name { flex: 1 1 100%; }
    .piece-row .product-qty, .piece-row .product-sku { flex: 1 1 calc(50% - 8px); min-width: 0; }
    .shipment-package .form-control { flex: 1 1 calc(50% - 8px); }
    .piece-remove { min-height: 44px; }
}
@media (max-width: 1199.98px) {
    .orders-scroll { overflow: visible; }
    .orders-table { display: block; width: 100%; min-width: 0; }
    .orders-table thead { display: none; }
    .orders-table tbody { display: flex; flex-direction: column; gap: 12px; }
    .orders-table tr.order-row {
        display: flex;
        flex-direction: column;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        background: #fff;
        padding: 4px 0 8px;
        overflow: visible;
    }
    .orders-table tr.order-measure {
        display: block;
        margin-top: -4px;
    }
    .orders-table tr.order-measure td {
        display: block;
        width: 100%;
        padding: 0 !important;
        border: 0 !important;
    }
    .orders-table tr.order-measure td::before { content: none; }
    .orders-table td {
        display: block;
        width: 100%;
        border: 0 !important;
        padding: 0.45rem 0.9rem !important;
        text-align: left;
        white-space: normal;
    }
    .orders-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        font-size: 0.72rem;
        font-weight: 600;
        color: #64748b;
    }
    .orders-table td[data-field="customer"] { order: 1; font-size: 1.05rem; font-weight: 700; padding-top: 0.7rem !important; }
    .orders-table td[data-field="customer"]::before { content: none; }
    .orders-table td[data-field="status"] { order: 2; }
    .orders-table td[data-field="shipping"] { order: 3; }
    .orders-table td[data-field="actions"] {
        order: 4;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .orders-table td[data-field="actions"]::before { margin: 0; }
    .orders-table td[data-field="product"] { order: 5; }
    .orders-table td[data-field="date"] { order: 0; padding-top: 0.7rem !important; }
    .orders-table td[data-field="desi"] { order: 6; }
    .orders-table td[data-field="fee"] { order: 7; }
    .orders-table td[data-field="services"] { order: 8; }
    .orders-table .order-menu-btn {
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
    }
    .orders-table .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .orders-table a.small {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        margin-right: 12px;
    }
    html[data-color-mode="dark"] .orders-table tr.order-row,
    html.dark .orders-table tr.order-row {
        background: #111827;
        border-color: #334155;
    }
    html[data-color-mode="dark"] .orders-table td::before,
    html.dark .orders-table td::before { color: #94a3b8; }
    html[data-color-mode="dark"] .orders-table .order-menu-btn,
    html.dark .orders-table .order-menu-btn { border-color: #334155; color: #e5e7eb; }
    .layout-page .orders-scroll { overflow-x: visible; }
    .layout-page .orders-scroll > .orders-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .layout-page .orders-scroll > .orders-table td,
    .layout-page .orders-scroll > .orders-table th {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }
}
.shipment-addon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.shipment-addon-card { border: 1px solid #e7e7e8; border-radius: 16px; padding: 16px; background: #f8fafc; }
html[data-color-mode="dark"] .shipment-addon-card { background: #0f172a; border-color: #334155; }
.shipment-addon-card h5 { margin-bottom: 4px; }
.shipment-addon-card p { color: #64748b; font-size: 13px; }
.shipment-addon-option { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #e7e7e8; margin: 0; }
html[data-color-mode="dark"] .shipment-addon-option { border-top-color: #334155; }
.shipment-addon-option span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shipment-addon-option small { color: #64748b; }
.shipment-addon-option em { font-style: normal; font-weight: 700; white-space: nowrap; }
.pay-menu { display: flex; flex-direction: column; gap: 8px; max-width: 440px; margin-bottom: 1.25rem; }
.pay-menu a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #eef3f8; color: inherit; text-decoration: none; font-weight: 600; }
.pay-menu a i { font-size: 1.25rem; color: #2563eb; }
.pay-menu a.active, .pay-menu a:hover { background: #fff; box-shadow: inset 0 0 0 1px #93c5fd; }
html[data-color-mode="dark"] .pay-menu a { background: #1e293b; }
html[data-color-mode="dark"] .pay-menu a.active, html[data-color-mode="dark"] .pay-menu a:hover { background: #0f172a; }
#label-sample { background: #fff; color: #111; border: 1px solid #ccc; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
#label-sample .section { border: 2px solid var(--label-accent, #1e3a5f); border-radius: 12px; padding: 8px 10px; background: #fff; }
#label-sample .header-section, #label-sample .note-section { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#label-sample .header-brand { width: 42%; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
#label-sample .header-brand img { max-width: 108px; max-height: 36px; object-fit: contain; }
#label-sample .header-brand .label, #label-sample .header-sender .label, #label-sample .receiver-label { font-size: 10px; color: #555; text-transform: uppercase; }
#label-sample .header-sender { width: 55%; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
#label-sample .header-sender .sender-logo { display: block; max-width: 120px; max-height: 42px; object-fit: contain; margin: 0 0 3px auto; }
#label-sample .header-sender .sender-logo[hidden] { display: none !important; }
#label-sample .header-sender .name, #label-sample .receiver-name { font-weight: 700; }
#label-sample .receiver-name { font-size: 16px; }
#label-sample .cargo-title, #label-sample .order-title, #label-sample .note-title { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--label-accent, #1e3a5f); margin-bottom: 4px; }
#label-sample .note-content { width: 70%; }
#label-sample .note-text { font-size: 11px; line-height: 1.3; }
#label-sample .note-logo { width: 28%; text-align: right; white-space: nowrap; }
#label-sample .barcode-section { text-align: center; }
#label-sample .barcode-bars { letter-spacing: 2px; font-family: monospace; }
#label-sample .barcode-text { letter-spacing: 2px; }
#label-sample .label-date, #label-sample .footer { font-size: 11px; color: #666; text-align: center; }
#label-sample .order-item, #label-sample .label-sku { font-size: 12px; }
#label-sample.label-template-compact { gap: 4px; padding: 6px; }
#label-sample.label-template-compact .section { padding: 4px 6px; border-width: 1px; border-radius: 6px; }
#label-sample.label-template-framed { outline: 3px solid var(--label-accent, #1e3a5f); outline-offset: 4px; }
.pay-menu small { display: block; font-weight: 500; color: #64748b; font-size: 12px; }
@media (max-width: 767.98px) {
    .cod-scroll { overflow-x: visible !important; }
    .layout-page .cod-scroll > .cod-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .cod-table thead { display: none; }
    .cod-table, .cod-table tbody, .cod-table tr, .cod-table td { display: block; width: 100%; }
    .cod-table tr {
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        margin-bottom: 10px;
        padding: 6px 0;
        background: #fff;
    }
    .layout-page .cod-scroll > .cod-table td,
    .layout-page .cod-scroll > .cod-table th {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        border: 0 !important;
        padding: 0.4rem 0.85rem !important;
    }
    .cod-table td {
        border: 0 !important;
    }
    .cod-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 650;
        color: #64748b;
    }
    html[data-color-mode="dark"] .cod-table tr { background: #111827; border-color: #334155; }
}


/* Mobil: sayfalama ve editör araç çubuğu taşmasın */
.pagination { flex-wrap: wrap; row-gap: 4px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; }

.loyalty-mark { pointer-events: none; }
.loyalty-mark-watermark {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.loyalty-mark-watermark span {
    font-family: var(--font-heading, 'Sora'), sans-serif;
    font-size: clamp(3.5rem, 11vw, 8.5rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    color: rgba(15, 23, 42, 0.045);
    transform: rotate(-16deg);
    white-space: nowrap;
    user-select: none;
}
.loyalty-mark-seal {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 30;
    width: min(230px, calc(100vw - 36px));
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px 13px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    color: #0f172a;
    backdrop-filter: blur(12px);
}
.loyalty-mark-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #c2410c;
}
.loyalty-mark-seal strong {
    font-family: var(--font-heading, 'Sora'), sans-serif;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
}
.loyalty-mark-seal span,
.loyalty-mark-next {
    font-size: 0.78rem;
    color: #64748b;
}
html[data-color-mode="dark"] .loyalty-mark-watermark span { color: rgba(248, 250, 252, 0.05); }
html[data-color-mode="dark"] .loyalty-mark-seal {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(248, 250, 252, 0.08);
    color: #f8fafc;
}
html[data-color-mode="dark"] .loyalty-mark-seal span,
html[data-color-mode="dark"] .loyalty-mark-next { color: #cbd5e1; }
@media (max-width: 991px) {
    .loyalty-mark-seal { bottom: 88px; right: 14px; }
}
@media print {
    .loyalty-mark { display: none !important; }
}

/* Tracking code under the carrier logo: share and copy icons sit to the left of the code */
.order-codeline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; max-width: 100%; margin-top: 4px; vertical-align: top; }
.orders-table .order-codeline .order-track { display: inline-block; margin-top: 0; max-width: none; overflow: visible; text-overflow: clip; font-size: .78rem; white-space: nowrap; }
.orders-table td[data-field="shipping"] { min-width: 200px; }
.orders-table .order-codeline .order-share { margin-left: 0; display: inline-flex; align-items: center; color: #128c7e; font-size: 1.1rem; line-height: 1; }
.order-copy { border: 0; background: transparent; padding: 0; margin: 0; line-height: 1; cursor: pointer; color: #64748b; font-size: 1.05rem; display: inline-flex; align-items: center; }
.order-copy:hover { color: var(--accent-color, #f97316); }
.order-copy.is-copied { color: #16a34a; }

/* Admin orders on a phone: the row menu opens outside the card instead of being clipped by it */
@media (max-width: 991.98px) {
    .orders-board tr { overflow: visible; }
    .orders-board td:last-child,
    .orders-board td .dropdown { overflow: visible !important; }
    .orders-board .dropdown-menu { z-index: 1060; }
}

/* Measurement difference: one small badge in the fee column (green: credited, red: charged) */
.order-fee-diff { display: inline-flex; position: relative; margin-top: 4px; vertical-align: top; }
.order-fee-diff .order-tip-rich { display: none; position: absolute; z-index: 12; left: 50%; transform: translateX(-50%); padding: 8px 10px; border-radius: 10px; background: #0f172a; color: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.35); }
.order-fee-diff .fd-amount { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; line-height: 1.5; cursor: help; white-space: nowrap; }
.order-fee-diff.is-plus .fd-amount { background: rgba(34, 197, 94, .14); color: #15803d; }
.order-fee-diff.is-minus .fd-amount { background: rgba(239, 68, 68, .13); color: #dc2626; }
.order-fee-diff.is-neutral .fd-amount { background: rgba(100, 116, 139, .14); color: #475569; }
.order-fee-diff .order-tip-rich { width: 250px; max-width: 70vw; top: 100% !important; margin-top: 8px; text-align: left; font-weight: 400; font-size: 12px; line-height: 1.4; white-space: normal; }
.order-fee-diff .order-tip-rich::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.order-fee-diff .order-tip-rich div { margin-bottom: 2px; }
.order-fee-diff .order-tip-rich .btn { font-size: 11px; padding: 2px 8px; color: #fff; border-color: rgba(255,255,255,.6); }
.order-fee-diff:hover .order-tip-rich, .order-fee-diff.is-open .order-tip-rich { display: block; }
.order-fee-diff .fd-close { position: absolute; top: 2px; right: 6px; border: 0; background: transparent; color: #cbd5e1; font-size: 16px; line-height: 1; cursor: pointer; }
.order-fee-diff:not(.is-open) .fd-close { display: none; }

/* Carrier code stays inside its own column */
.orders-table .order-codeline .order-track { overflow-wrap: anywhere; }

@media (min-width: 1200px) {
    .orders-table td[data-field="shipping"] { overflow: hidden; }
    /* Extra-service icons: a tidy centred grid, two per row */
    .orders-table td[data-field="services"] { width: 84px; }
    .orders-table td[data-field="services"] .order-icons { display: inline-grid; grid-template-columns: repeat(2, 28px); gap: 6px; justify-content: center; justify-items: center; width: auto; }
    .orders-table td[data-field="services"] .order-icons:has(> :only-child) { grid-template-columns: 28px; }
    .orders-table td[data-field="services"] .order-icons .order-tip { display: inline-flex; }
}

/* Phones and tablets: the order card. Icons sit in a row, their explanation opens on tap, never as running text. */
@media (max-width: 1199.98px) {
    .orders-table .order-icons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .orders-table .order-tip { position: relative; display: inline-flex; cursor: pointer; }
    .orders-table .order-badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; }
    .orders-table .order-tip-text {
        display: none; position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; transform: none;
        width: max-content; max-width: min(240px, calc(100vw - 56px)); padding: 7px 10px; border-radius: 10px;
        background: #0f172a; color: #fff; font-size: 12px; line-height: 1.4; white-space: normal; text-align: left; font-weight: 500;
    }
    .orders-table .order-tip:focus .order-tip-text,
    .orders-table .order-tip:focus-within .order-tip-text,
    .orders-table .order-tip:hover .order-tip-text { display: block; }
    .orders-table td[data-field="services"] .order-icons { justify-content: flex-start; }
    .orders-table .order-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; flex-wrap: wrap; }
    .orders-table .order-track { overflow-wrap: anywhere; }
    .order-fee-diff .order-tip-rich { left: 0; transform: none; max-width: min(260px, calc(100vw - 56px)); }
}

/* Final fee after a carrier measurement */
.order-fee-final.is-minus { color: #dc2626 !important; }
.order-fee-final.is-plus { color: #15803d !important; }
html.dark .order-fee-final.is-minus, [data-bs-theme="dark"] .order-fee-final.is-minus { color: #f87171 !important; }
html.dark .order-fee-final.is-plus, [data-bs-theme="dark"] .order-fee-final.is-plus { color: #4ade80 !important; }
