/* ═══════════════════════════════════════════════════════
   LuizaGoods — Premium Design System V4 (Dark + Light)
   Telegram WebApp Prototype
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables: Dark Theme (default) ──────────────── */
:root {
    --main-bg: #12142B;
    --main-bg-deep: #0a0b1a;
    --card-bg: #242754;
    --card-inner: #2D316A;
    --accent: #6339F9;
    --cyan: #00D1FF;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.40);
    --text-muted: rgba(255, 255, 255, 0.15);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --glass-bg: rgba(36, 39, 84, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --header-bg: rgba(18, 20, 43, 0.60);
    --glow-purple: rgba(66, 29, 138, 0.6);
    --glow-cyan: rgba(0, 209, 255, 0.15);
    --status-badge-bg: rgba(255, 255, 255, 0.05);
    --toggle-track: rgba(255, 255, 255, 0.1);
    --img-fallback-bg: rgba(255, 255, 255, 0.05);
    --white-10: rgba(255, 255, 255, 0.05);
}

/* ── CSS Variables: Light Theme ───────────────────────── */
.light-theme {
    --main-bg: #F2F2F7;
    --main-bg-deep: #E5E5EA;
    --card-bg: #FFFFFF;
    --card-inner: #F5F5FA;
    --accent: #6339F9;
    --cyan: #007AFF;
    --text-primary: #1C1C1E;
    --text-secondary: rgba(0, 0, 0, 0.40);
    --text-muted: rgba(0, 0, 0, 0.50);
    --border-subtle: rgba(0, 0, 0, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-shadow: rgba(0, 0, 0, 0.08);
    --header-bg: rgba(242, 242, 247, 0.80);
    --glow-purple: rgba(99, 57, 249, 0.08);
    --glow-cyan: rgba(0, 122, 255, 0.08);
    --status-badge-bg: rgba(0, 0, 0, 0.03);
    --toggle-track: rgba(0, 0, 0, 0.1);
    --img-fallback-bg: rgba(0, 0, 0, 0.04);
    --white-10: rgba(0, 0, 0, 0.04);
}

/* ── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    background: var(--main-bg-deep);
    color: var(--text-primary);
    transition: background 0.4s ease, color 0.3s ease;
}

/* Lock page viewport: move only inside app scroll areas */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}

body {
    position: fixed;
    inset: 0;
    touch-action: none;
}

/* Allow scrolling only in explicit internal containers */
#delivery-list,
.modal-content,
#users-list-container,
#settings-content,
#hidden-list-container,
.filter-dropdown-list,
.calendar-container {
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ── Scrollbar hidden ─────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ═══ THEME TOGGLE ═════════════════════════════════════ */
.theme-toggle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0 2px 0;
}

.theme-toggle-track {
    position: relative;
    width: 42px;
    height: 22px;
    background: var(--toggle-track);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.3s;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid var(--border-subtle);
}

.theme-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle-track.night::after {
    transform: translateX(20px);
}

.theme-icon {
    font-size: 13px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.theme-icon.active {
    opacity: 1;
}

.profile-avatar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--glass-bg);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.profile-avatar-btn:active {
    transform: scale(0.94);
}

.profile-fab-wrap {
    transform: scale(0.8);
    transform-origin: top right;
}

.profile-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(210px, 46vw);
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transform: translateY(6px);
    opacity: 0;
    transition: transform 0.16s ease, opacity 0.16s ease;
    z-index: 170;
}

.profile-popover.show {
    transform: translateY(0);
    opacity: 1;
}

.profile-popover-item {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    padding: 11px 12px;
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.profile-popover-item + .profile-popover-item {
    border-top: 1px solid var(--border-subtle);
}

.profile-popover-item:hover {
    background: var(--white-10);
}

.profile-popover-item-danger {
    color: #ff6b6b;
}



/* ═══ HASHTAG PILLS ═══════════════════════════════════ */
.hashtag-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid currentColor;
    background: transparent;
    line-height: 1.4;
    transition: all 0.2s ease;
}

/* ═══ SWIPE INTERACTION ════════════════════════════════ */
.swipe-container {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    will-change: transform;
    /* Add strict background under swipe content */
}

.swipe-content {
    transition: margin-right 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
    min-height: 110px;
    display: flex !important;
    align-items: stretch !important;
    position: relative;
    z-index: 2;
    /* Content is above actions */
    background: var(--card-bg);
    border-radius: 32px !important;
    overflow: hidden !important;
    /* Ensure card stays beautifully rounded when it shrinks */
}

.swiped .swipe-content {
    margin-right: 95px;
    /* Compact swipe: shrinks the card instead of sliding it off screen */
    transform: none;
    /* Reset transform */
}

/* Light theme: swiped text stays dark */
.light-theme .swiped .swipe-content * {
    color: var(--text-primary) !important;
}

.swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 110px;
    /* Negative margin creates overlap (cross) with the content */
    margin-left: -15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    padding: 8px;
    padding-left: 20px;
    background: var(--accent);
    border-radius: 32px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(20px);
    z-index: 0;
}

.swiped .swipe-actions {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
}

.action-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.9);
}

.action-btn.large {
    grid-column: span 2;
}

/* ═══ CALENDAR ═════════════════════════════════════════ */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: var(--status-badge-bg);
    -webkit-tap-highlight-color: transparent;
}

.calendar-day:hover {
    background: var(--toggle-track);
}

.calendar-day:active {
    transform: scale(0.9);
}

.calendar-day.selected {
    background: var(--accent) !important;
    color: white !important;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(99, 57, 249, 0.4);
}

.calendar-day.in-range {
    background: rgba(99, 57, 249, 0.2);
}

.calendar-day.other-month {
    opacity: 0.15;
    pointer-events: none;
}

.has-order-dot {
    width: 4px;
    height: 4px;
    background: var(--cyan);
    border-radius: 50%;
    margin-top: 2px;
}

.calendar-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px;
    background: var(--status-badge-bg);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 12px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.calendar-dropdown-trigger.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: var(--toggle-track);
}

.calendar-container {
    background: var(--status-badge-bg);
    border-radius: 0 0 16px 16px;
    padding: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

/* ═══ RENAME SUGGESTIONS ═══════════════════════════════ */
.rename-suggestion {
    background: var(--status-badge-bg);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.rename-suggestion:active {
    background: var(--toggle-track);
    transform: scale(0.98);
}

/* ═══ MODALS ═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 360px;
    background: var(--card-bg);
    border-radius: 32px;
    padding: 24px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-primary);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

/* ═══ TOGGLE SWITCH ════════════════════════════════════ */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--toggle-track);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-active {
    background: var(--accent);
}

.toggle-active::after {
    transform: translateX(20px);
}

/* ═══ COMPACT LAYOUT ═══════════════════════════════════ */
header {
    padding-top: 2.5rem !important;
    padding-bottom: 1.5rem !important;
}

nav {
    height: 4.5rem !important;
    bottom: 1.5rem !important;
}

nav .relative.-top-5 {
    top: -1.25rem !important;
}

nav button svg {
    width: 1.5rem;
    height: 1.5rem;
}

nav .w-20 {
    width: 4.5rem;
    height: 4.5rem;
}


/* ═══ SORT BUTTONS ═════════════════════════════════════ */
.sort-btn {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.25s;
    cursor: pointer;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.sort-btn.active {
    background: var(--accent) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(99, 57, 249, 0.35);
}

/* ═══ FILTER CHIPS ═════════════════════════════════════ */
.filter-chip {
    padding: 8px 14px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--white-5);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    cursor: pointer;
}

.filter-chip.active {
    background: var(--accent) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(99, 57, 249, 0.3);
}

.filter-chip[style*="--chip-color"] {
    border-color: color-mix(in srgb, var(--chip-color) 40%, transparent);
    color: var(--chip-color);
}

.filter-chip[style*="--chip-color"].active {
    background: var(--chip-color) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--chip-color) 40%, transparent);
}

#filter-badge {
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ═══ FILTER DROPDOWNS ═════════════════════════════════ */
.filter-dropdown-btn {
    flex: 1;
    padding: 10px 8px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--white-5);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    position: relative;
}

.filter-dropdown-btn.open {
    background: var(--accent);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 57, 249, 0.3);
}

.filter-dropdown-btn.has-selection {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-dropdown-btn.open.has-selection {
    color: white;
}

.filter-dropdown-btn .dd-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 9px;
    font-weight: 800;
    margin-left: 4px;
    vertical-align: middle;
}

.filter-dropdown-btn.open .dd-count {
    background: white;
    color: var(--accent);
}

.filter-dropdown-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease;
    padding: 0;
}

.filter-dropdown-list.open {
    max-height: 300px;
    padding: 8px 0;
    overflow-y: auto;
}

/* ═══ FILTER CALENDAR (compact) ════════════════════════ */
.filter-calendar {
    border-radius: 16px;
    background: var(--white-5);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.filter-calendar .cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
}

.filter-calendar .cal-header button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white-5);
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.filter-calendar .cal-header button:active {
    transform: scale(0.9);
    background: var(--accent);
    color: white;
}

.filter-calendar .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 0 8px 10px;
}

.filter-calendar .cal-grid .day-label {
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 0;
    text-transform: uppercase;
}

.filter-calendar .cal-grid .cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    position: relative;
    transition: all 0.15s;
}

.filter-calendar .cal-grid .cal-day:hover {
    background: var(--white-5);
}

.filter-calendar .cal-grid .cal-day.other {
    color: var(--text-muted);
    opacity: 0.3;
    pointer-events: none;
}

.filter-calendar .cal-grid .cal-day.selected {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 57, 249, 0.35);
}

.filter-calendar .cal-grid .cal-day.in-range {
    background: rgba(99, 57, 249, 0.15);
    border-radius: 4px;
}

.filter-calendar .cal-grid .cal-day .order-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cyan);
    position: absolute;
    bottom: 3px;
}

.filter-calendar .cal-grid .cal-day.selected .order-dot {
    background: white;
}

/* ═══ USERS PAGE ═══════════════════════════════════════ */
.user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    transition: all 0.2s;
}

.user-card:active {
    transform: scale(0.98);
}

.user-card .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-card .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
}

.user-card .user-delete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.1);
    border: none;
    color: #ff3b30;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.user-card .user-delete:active {
    transform: scale(0.85);
    background: rgba(255, 59, 48, 0.25);
}

/* ═══ EFFECTS ══════════════════════════════════════════ */
.scroll-fade-mask {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 90%, transparent 100%);
}

.glass-menu {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 -4px 30px var(--glass-shadow);
}

.logo-text {
    text-shadow: 0 0 30px rgba(0, 209, 255, 0.25),
        0 0 60px rgba(0, 209, 255, 0.1);
}

.logo-text.brand-super {
    letter-spacing: -0.03em;
    font-style: normal;
    color: #dffcff !important;
    text-shadow:
        0 0 8px rgba(84, 255, 245, 0.9),
        0 0 16px rgba(84, 255, 245, 0.75),
        0 0 32px rgba(84, 255, 245, 0.5);
}

.logo-text.brand-dynamic {
    font-style: normal;
}

.brand-logo-img {
    display: block;
    width: auto;
    height: 38px;
    max-width: 200px;
    object-fit: contain;
}

.light-theme .logo-text.brand-super {
    color: #0f2630 !important;
    text-shadow:
        0 0 6px rgba(0, 209, 255, 0.45),
        0 0 12px rgba(0, 209, 255, 0.25);
}

.role-center-label {
    position: absolute;
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
    font-size: 10px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 4px 8px;
    pointer-events: none;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.light-theme .logo-text {
    text-shadow: none;
    color: #1C1C1E;
}

.light-theme .logo-text span {
    color: var(--cyan) !important;
}

.light-theme .role-center-label {
    background: rgba(255, 255, 255, 0.8);
}

/* ═══ FILTER MODAL ANIMATION ══════════════════════════ */
#filter-modal-content {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#filter-modal-content.show {
    transform: translateY(0) !important;
}

/* ═══ CARD BADGE ═══════════════════════════════════════ */
.card-badge {
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* ═══ TOAST NOTIFICATIONS ═════════════════════════════ */
.toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 28px;
    box-shadow: 0 12px 40px var(--glass-shadow);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 10000;
    transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    max-width: calc(100% - 40px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast.show {
    bottom: 140px;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.18);
    flex: 0 0 auto;
}

.toast-icon-svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toast-icon[data-type="ok"] {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.18);
}

.toast-icon[data-type="error"] {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.18);
}

.toast-icon[data-type="warn"] {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.2);
}

.toast-icon[data-type="load"] {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.18);
}

.toast-icon[data-type="info"] {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.18);
}

.toast-text {
    color: var(--text-secondary);
}

/* ═══ LOADING ══════════════════════════════════════════ */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--toggle-track);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton-card {
    height: 120px;
    border-radius: 32px;
    background: linear-gradient(90deg,
            var(--card-bg) 25%,
            var(--card-inner) 50%,
            var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ═══ QR MODAL ════════════════════════════════════════ */
.qr-container {
    width: 260px;
    height: 260px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 0;
    border: 1px solid #d6d6d6;
    overflow: hidden;
}

.qr-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
    border-radius: 0;
    mix-blend-mode: normal;
    filter: none;
    image-rendering: crisp-edges;
    background: #fff;
}

.light-theme .qr-container img {
    mix-blend-mode: normal;
    filter: none;
}

/* ═══ CARD ANIMATIONS ═════════════════════════════════ */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-animate {
    animation: cardSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ═══ EMPTY STATE ══════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    opacity: 0.6;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ═══ PULSE GLOW ══════════════════════════════════════ */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 15px 30px rgba(0, 209, 255, 0.3);
    }

    50% {
        box-shadow: 0 15px 40px rgba(0, 209, 255, 0.5);
    }
}

.home-btn-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

.light-theme .home-btn-glow {
    animation: none;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.25);
}

/* ═══ LIGHT THEME OVERRIDES ═══════════════════════════ */
.light-theme #app-container {
    background: var(--main-bg);
}

.light-theme header {
    background: var(--header-bg) !important;
    backdrop-filter: blur(20px);
}

.light-theme .bg-main-bg {
    background: var(--main-bg) !important;
}

.light-theme .bg-product-card {
    background: var(--card-bg) !important;
}

.light-theme .text-white {
    color: var(--text-primary) !important;
}

.light-theme .text-white\/90 {
    color: var(--text-primary) !important;
}

.light-theme .text-white\/40 {
    color: var(--text-secondary) !important;
}

.light-theme .text-white\/20 {
    color: var(--text-muted) !important;
}

.light-theme .text-white\/10 {
    color: var(--text-muted) !important;
}

.light-theme .text-system-gray {
    color: rgba(0, 0, 0, 0.35) !important;
}

.light-theme .bg-white\/5 {
    background: var(--status-badge-bg) !important;
}

.light-theme .bg-white\/10 {
    background: rgba(0, 0, 0, 0.06) !important;
}

.light-theme .border-white\/5 {
    border-color: var(--border-subtle) !important;
}

.light-theme .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.light-theme .bg-gradient-to-br {
    background: var(--main-bg) !important;
}

.light-theme .mix-blend-screen {
    display: none !important;
}

/* Light nav */
.light-theme .glass-menu {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.06);
}

.light-theme .home-btn-glow {
    background: var(--cyan) !important;
}

/* Light filter modal */
.light-theme #filter-modal-content {
    background: var(--card-bg);
}

.light-theme .modal-content {
    background: var(--card-bg);
}

/* Light theme: swipe actions use blue instead of purple */
.light-theme .swipe-actions {
    background-color: var(--cyan) !important;
}

/* Auth status button colors */
.auth-green {
    color: #34C759 !important;
}

.auth-red {
    color: #FF3B30 !important;
}

.auth-pending {
    color: #FF9F0A !important;
    animation: auth-pulse 1.2s ease-in-out infinite;
}

@keyframes auth-pulse {
    0% { opacity: 0.55; }
    50% { opacity: 1; }
    100% { opacity: 0.55; }
}

/* Adaptive sizing */
#app-container.compact-height header {
    padding-top: 1.65rem !important;
    padding-bottom: 0.75rem !important;
}

#app-container.compact-height nav {
    height: 4rem !important;
    bottom: calc(0.8rem + var(--tg-safe-bottom, 0px)) !important;
}

#app-container.compact-height nav .w-20 {
    width: 4rem;
    height: 4rem;
}

#app-container.ultra-compact-height header {
    padding-top: 1.2rem !important;
    padding-bottom: 0.5rem !important;
}

#app-container.ultra-compact-height #delivery-list {
    padding-top: 0.5rem !important;
    padding-bottom: 5.5rem !important;
}

#app-container.narrow-width .logo-text {
    font-size: 1.8rem !important;
}

#app-container.narrow-width .theme-toggle-row {
    transform: scale(0.72) !important;
}

#app-container.narrow-width .role-center-label {
    font-size: 9px;
    top: 8px;
    max-width: 66%;
}

/* Light theme modal text */
.light-theme .modal-content h2 {
    color: var(--text-primary) !important;
}

.light-theme .modal-content .text-white {
    color: var(--text-primary) !important;
}

.light-theme .modal-content .text-white\/80 {
    color: var(--text-primary) !important;
}

.light-theme .modal-content .text-white\/40 {
    color: var(--text-secondary) !important;
}

.light-theme input::placeholder {
    color: var(--text-muted) !important;
}

.light-theme .modal-content .bg-white\/5 {
    background: rgba(0, 0, 0, 0.04) !important;
}

.light-theme .modal-content .border-white\/5 {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Smart viewport scaling */
:root {
    --app-vh: 100dvh;
    --app-vw: 430px;
    --tg-safe-bottom: 0px;
    --nav-height: 72px;
    --nav-offset: 24px;
    --list-bottom-pad: 138px;
}

#app-container {
    height: var(--app-vh) !important;
    max-height: min(932px, var(--app-vh)) !important;
}

#delivery-list {
    padding-bottom: calc(var(--list-bottom-pad) + var(--tg-safe-bottom)) !important;
}

#app-container nav.glass-menu {
    min-height: var(--nav-height);
    bottom: calc(var(--nav-offset) + var(--tg-safe-bottom)) !important;
}

.toast.show {
    bottom: calc(140px + var(--tg-safe-bottom));
}

.modal-overlay {
    padding-bottom: calc(24px + var(--tg-safe-bottom));
}

.modal-content {
    max-height: calc(var(--app-vh) - 64px - var(--tg-safe-bottom));
    overflow-y: auto;
}

#app-container.compact-height {
    --nav-height: 64px;
    --nav-offset: 12px;
    --list-bottom-pad: 118px;
}

#app-container.ultra-compact-height {
    --nav-height: 60px;
    --nav-offset: 8px;
    --list-bottom-pad: 108px;
}

#app-container.ultra-compact-height .modal-content {
    border-radius: 24px;
    padding: 18px;
}

#app-container.narrow-width .glass-menu {
    left: 12px !important;
    right: 12px !important;
}

#app-container.narrow-width .empty-state {
    padding: 44px 14px;
}

#app-container.wide-screen .empty-state {
    padding-left: 28px;
    padding-right: 28px;
}

@media (max-width: 767px) {
    body {
        display: block !important;
        align-items: initial !important;
        justify-content: initial !important;
    }

    #app-container {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: var(--app-vh) !important;
        max-height: var(--app-vh) !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
}
