:root {
    color-scheme: light;
    letter-spacing: -0.02em;
}

[data-theme="marketjet"] {
    color-scheme: light;
    --p: 0.452014 0.313214 264.052; /* #0000ff */
    --pc: 1 0 0;
    --s: 0.7359 0.0234 264.36; /* #a2aab9 */
    --sc: 1 0 0;
    --a: 0.5435 0.2542 273.95; /* #4d4dff */
    --ac: 1 0 0;
}

a:hover {
    opacity: 0.7;
}

.status-created {
    color: #4b5563;
    background-color: #f9fafb;
    padding: 0.25rem 0.5rem;
}

.status-confirmed {
    color: #0ea5e9;
    background-color: #f0f9ff;
    padding: 0.25rem 0.5rem;
}

.status-approved {
    color: #0891b2;
    background-color: #ecfeff;
    padding: 0.25rem 0.5rem;
}

.status-shipped {
    color: #8b5cf6;
    background-color: #faf5ff;
    padding: 0.25rem 0.5rem;
}

.status-delivered {
    color: #059669;
    background-color: #ecfdf5;
    padding: 0.25rem 0.5rem;
}

.status-cancelled {
    color: #dc2626;
    background-color: #fef2f2;
    padding: 0.25rem 0.5rem;
}

.status-cancellationrequested {
    color: #ea580c;
    background-color: #fff7ed;
    padding: 0.25rem 0.5rem;
}

.status-pending {
    color: #ea580c;
    background-color: #fff7ed;
    padding: 0.25rem 0.5rem;
}

.status-rejected {
    color: #dc2626;
    background-color: #fef2f2;
    padding: 0.25rem 0.5rem;
}

.status-returned {
    color: #475569;
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
}

/* Let a daisyUI tooltip wrap onto multiple lines instead of being clipped. */
.tooltip-multiline:before {
    white-space: normal;
    width: max-content;
    max-width: 20rem;
    overflow-wrap: anywhere;
    text-align: center;
}

/* Toast Notification Styles */
#toast-container .alert {
    background-color: white;
    color: #111827;
    /* gray-900 for text */
    border: 1px solid;
    border-radius: 0.5rem;
    /* rounded-lg */
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1rem 1.25rem;
    min-width: 300px;
    max-width: 500px;
    cursor: pointer;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

#toast-container .alert span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-width: 0;
}

#toast-container .alert-success {
    border-color: #86efac;
    /* green-300 - lighter */
    background-color: #f0fdf4;
    /* very light green tint */
}

#toast-container .alert-error {
    border-color: #fca5a5;
    /* red-300 - lighter */
    background-color: #fef2f2;
    /* very light red tint */
}

#toast-container .alert-warning {
    border-color: #fcd34d;
    /* amber-300 - lighter */
    background-color: #fffbeb;
    /* very light amber tint */
}

#toast-container .alert-info {
    border-color: #93c5fd;
    /* blue-300 - lighter */
    background-color: #eff6ff;
    /* very light blue tint */
}

/* Icon colors matching border */
#toast-container .alert-success svg {
    stroke: #10b981;
    /* green-500 */
}

#toast-container .alert-error svg {
    stroke: #ef4444;
    /* red-500 */
}

#toast-container .alert-warning svg {
    stroke: #f59e0b;
    /* amber-500 */
}

#toast-container .alert-info svg {
    stroke: #3b82f6;
    /* blue-500 */
}

.shipping-route-info {
    display: flex;
    align-items: center;
}

.shipping-route-info span {
    display: inline-flex;
    padding: 2px;
}

.shipping-route-info .flag img {
    width: 20px;
    height: 12px;
}

/* Toast Animations */
@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

.animate-slide-out {
    animation: slide-out 0.3s ease-in;
}

/* HTMX Loading Spinner Styles */
.spinner {
    display: none;
}

.htmx-request.spinner {
    display: inline;
}

.htmx-request.spinner ~ .button-text {
    visibility: hidden;
}

.shipment-status-draft {
    color: #78716c;
    background-color: #fafaf9;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.shipment-status-ready {
    color: #ca8a04;
    background-color: #fefce8;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.shipment-status-intransit {
    color: #ea580c;
    background-color: #fff7ed;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.shipment-status-delivered {
    color: #57534e;
    background-color: #f5f5f4;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.shipment-status-cancelled {
    color: #dc2626;
    background-color: #fef2f2;
    padding: 0.25rem 0.5rem;
}

.invoice-payment-status-unpaid {
    color: #78716c;
    background-color: #fafaf9;
    padding: 0.25rem 0.5rem;
}

.invoice-payment-status-paid {
    color: #15803d;
    background-color: #f0fdf4;
    padding: 0.25rem 0.5rem;
}

.connection-status-active {
    color: #059669;
    background-color: #ecfdf5;
    padding: 0.25rem 0.5rem;
}

.connection-status-pending {
    color: #ea580c;
    background-color: #fff7ed;
    padding: 0.25rem 0.5rem;
}

.connection-status-error {
    color: #dc2626;
    background-color: #fef2f2;
    padding: 0.25rem 0.5rem;
}

.connection-status-revoked {
    color: #475569;
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
}

#popover-add-order {
    margin-top: -40px;
}

tbody tr:hover {
    background-color: #f5f5ff;
}

/* --- Responsive sidebar ---------------------------------------------------
   The shell is driven by a single `data-nav` state on <html> (see layout.js),
   defaulted per breakpoint on load and overridable via the topbar toggle:

     expanded  full sidebar, pushes content            (desktop / laptop)
     rail      64px icon-only sidebar, pushes content   (tablet default)
     overlay   full sidebar floating over content       (tablet/phone expanded)
     hidden    off-canvas, content full width           (phone default)

   The sidebar is position:fixed (set via utility classes on the element), so
   "push" is expressed as a matching margin on #app-main and "float" simply
   drops that margin and shows the backdrop. */
#app-sidebar {
    width: 16rem;
    transition: width 0.2s ease, transform 0.2s ease;
}

#app-main {
    margin-left: 16rem;
    transition: margin-left 0.2s ease;
}

#nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 30;
}

/* Smooth collapse: labels fade (opacity) and icons glide (padding) while the
   width animates, instead of snapping via display:none / justify-content. */
#app-sidebar nav a { transition: padding 0.2s ease; white-space: nowrap; overflow: hidden; }
#app-sidebar .nav-toggle-btn { transition: padding 0.2s ease; }
#app-sidebar .nav-label { transition: opacity 0.18s ease; }
#app-sidebar .nav-toggle-icon { transition: transform 0.2s ease; transform-origin: center; }

/* rail: collapsed icon rail, still pushing content */
html[data-nav="rail"] #app-sidebar { width: 4rem; }
html[data-nav="rail"] #app-main { margin-left: 4rem; }
html[data-nav="rail"] #app-sidebar .nav-label { opacity: 0; }
html[data-nav="rail"] #app-sidebar .nav-section,
html[data-nav="rail"] #app-sidebar .seller-badge { display: none; }
html[data-nav="rail"] #app-sidebar nav a { padding-left: 0.75rem; padding-right: 0; }
/* keep the notification dot visible in the rail, beside the icon on the right */
html[data-nav="rail"] #app-sidebar .nav-badge { position: absolute; top: 50%; right: 8px; left: auto; transform: translateY(-50%); margin: 0; padding: 0; }
html[data-nav="rail"] #app-sidebar .sidebar-header { padding: 1rem 0; }
html[data-nav="rail"] #app-sidebar .sidebar-logo { display: none; }
html[data-nav="rail"] #app-sidebar .sidebar-logo-mini { display: block; }
/* bottom collapse arrow: right-aligned when open, centered + flipped when rail */
html[data-nav="rail"] #app-sidebar .nav-toggle-btn { justify-content: center; padding-left: 0; padding-right: 0; }
html[data-nav="rail"] #app-sidebar .nav-toggle-icon { transform: rotate(180deg); }

/* honour reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    #app-sidebar,
    #app-main,
    #app-sidebar nav a,
    #app-sidebar .nav-label,
    #app-sidebar .nav-toggle-btn,
    #app-sidebar .nav-toggle-icon { transition: none; }
}

/* overlay: full sidebar floating over the content + dim backdrop */
html[data-nav="overlay"] #app-sidebar { width: 16rem; transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.28); }
html[data-nav="overlay"] #app-main { margin-left: 0; }
html[data-nav="overlay"] #nav-backdrop { display: block; }

/* hidden: fully off-canvas, content spans the full width */
html[data-nav="hidden"] #app-sidebar { transform: translateX(-100%); }
html[data-nav="hidden"] #app-main { margin-left: 0; }
