/* Bodway OMS v6.1 — Refined Design System */

/* ── Prevent Horizontal Blowout (Responsive Taşıma Koruması) ─ */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* ── Scrollbar (Evrensel Gizleme & İnce Scrollbar) ─ */
.scrollbar-none,
.no-scrollbar,
#model-chips-bar,
#model-chips-container,
#orders-operational-toolbar {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}
.scrollbar-none::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar,
#model-chips-bar::-webkit-scrollbar,
#model-chips-container::-webkit-scrollbar,
#orders-operational-toolbar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}
.scrollbar-thin::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.dark .scrollbar-thin::-webkit-scrollbar-thumb {
    background: #334155;
}

/* ── Modal Backdrop ────────────────────────────── */
.modal-backdrop {
    backdrop-filter: blur(8px);
    background-color: rgba(15, 23, 42, 0.7);
}

/* ── Generic Order Card (Grid) ─────────────────── */
.order-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.order-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}
.order-card.is-selected {
    border-color: #2563EB !important;
    background-color: rgba(37, 99, 235, 0.03) !important;
    box-shadow: 0 0 0 2px #2563EB, 0 12px 24px -6px rgba(37, 99, 235, 0.15) !important;
}
.dark .order-card.is-selected {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

/* ── Sidebar Icon ──────────────────────────────── */
.sidebar-icon {
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-icon:hover {
    transform: translateY(-1px);
}

/* ── Status Tabs (Capsule Pills) ───────────────── */
.tab-capsule {
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.tab-capsule:hover {
    transform: translateY(-1px);
}
.tab-capsule.is-active {
    background: #0F172A !important;
    border-color: #0F172A !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}
.tab-capsule.is-active * {
    color: #ffffff !important;
}
.dark .tab-capsule.is-active {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
}
.dark .tab-capsule.is-active * {
    color: #ffffff !important;
}

/* ── Compact Table Row ─────────────────────────── */
.order-row-compact {
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.order-row-compact:not(.is-selected):hover {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
.dark .order-row-compact:not(.is-selected):hover {
    background: rgba(30, 41, 59, 0.5) !important;
}

/* Selected Row — left blue indicator bar */
.order-row-compact.is-selected {
    background: #EFF6FF !important;
    border-color: #BFDBFE !important;
}
.dark .order-row-compact.is-selected {
    background: rgba(37, 99, 235, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
}
.order-row-compact.is-selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background-color: #1e3a8a;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}
.dark .order-row-compact.is-selected::before {
    background-color: #3b82f6;
}

/* ── Split View: Master Card ───────────────────── */
.master-card {
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.master-card:not(.is-active):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -3px rgba(0, 0, 0, 0.06);
}
.master-card.is-active {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 12px 24px -4px rgba(37, 99, 235, 0.35) !important;
    transform: scale(1.01);
}
.master-card.is-active * {
    color: #ffffff !important;
}
.master-card.is-active .badge-soft-dot {
    background-color: #ffffff !important;
}

/* ── Split View: Detail Sheet ──────────────────── */
.detail-sheet-card {
    background: #ffffff;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.04);
}
.dark .detail-sheet-card {
    background: #0f172a;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.4);
}

.detail-item-elevated {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
}
.dark .detail-item-elevated {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* ── Status Badges (Soft Pastel) ───────────────── */
.badge-fulfilled {
    background-color: #DCFCE7;
    color: #15803D;
    border: 1px solid #BBF7D0;
}
.dark .badge-fulfilled {
    background-color: rgba(5, 150, 105, 0.15);
    color: #6EE7B7;
    border-color: rgba(5, 150, 105, 0.35);
}

.badge-confirmed {
    background-color: #DBEAFE;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}
.dark .badge-confirmed {
    background-color: rgba(37, 99, 235, 0.15);
    color: #93C5FD;
    border-color: rgba(37, 99, 235, 0.35);
}

.badge-partial {
    background-color: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}
.dark .badge-partial {
    background-color: rgba(217, 119, 6, 0.15);
    color: #FCD34D;
    border-color: rgba(217, 119, 6, 0.35);
}

.badge-cancelled {
    background-color: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}
.dark .badge-cancelled {
    background-color: rgba(220, 38, 38, 0.15);
    color: #FCA5A5;
    border-color: rgba(220, 38, 38, 0.35);
}

/* ── Action Pill Button ────────────────────────── */
.btn-action-pill {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #2563eb;
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}
.btn-action-pill:hover {
    background-color: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px -2px rgba(37, 99, 235, 0.15);
}
.dark .btn-action-pill {
    background-color: #1e293b;
    border-color: #334155;
    color: #60a5fa;
}
.dark .btn-action-pill:hover {
    background-color: #253349;
    border-color: #475569;
}

/* ── Grid Card ─────────────────────────────────── */
.order-grid-card {
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.order-grid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -6px rgba(0, 0, 0, 0.09);
}
.order-grid-card.is-selected {
    border-color: #2563EB !important;
    box-shadow: 0 0 0 2px #2563EB, 0 16px 32px -8px rgba(37, 99, 235, 0.22) !important;
}

.cover-thumbnail {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-in;
}
.cover-thumbnail:hover {
    transform: scale(1.05);
}

/* ── Soft Color Badges ─────────────────────────── */
.badge-soft-pink { background-color: #FEE2E2; color: #DC2626; }
.dark .badge-soft-pink { background-color: rgba(220, 38, 38, 0.2); color: #FCA5A5; }

.badge-soft-blue { background-color: #DBEAFE; color: #2563EB; }
.dark .badge-soft-blue { background-color: rgba(37, 99, 235, 0.2); color: #93C5FD; }

.badge-soft-emerald { background-color: #D1FAE5; color: #059669; }
.dark .badge-soft-emerald { background-color: rgba(5, 150, 105, 0.2); color: #6EE7B7; }

.badge-soft-amber { background-color: #FEF3C7; color: #D97706; }
.dark .badge-soft-amber { background-color: rgba(217, 119, 6, 0.2); color: #FCD34D; }

/* ── View Mode Button Active ───────────────────── */
.view-mode-btn {
    transition: all 0.15s ease;
}

/* ══════════════════════════════════════════════════
   PHASE 1-3: MODERN MICRO-INTERACTIONS & COMPONENTS
   ══════════════════════════════════════════════════ */

/* ── Ripple Button Effect ─────────────────────── */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple .ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleExpand 0.5s ease-out forwards;
    pointer-events: none;
}
@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ── Modal Enter/Exit Animations ──────────────── */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
}
.modal-enter {
    animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.modal-exit {
    animation: modalSlideOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ── Backdrop Fade ────────────────────────────── */
@keyframes backdropFadeIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to   { opacity: 1; backdrop-filter: blur(8px); }
}
.modal-backdrop-animated {
    animation: backdropFadeIn 0.25s ease forwards;
}

/* ── Toast Slide In/Out ───────────────────────── */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}
@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
}
.toast-enter {
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-exit {
    animation: toastSlideOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ── Toast Progress Bar ───────────────────────── */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    transition: width linear;
}
.toast-progress-success { background: #059669; }
.toast-progress-error   { background: #DC2626; }
.toast-progress-warning { background: #D97706; }
.toast-progress-info    { background: #2563EB; }

/* ── Skeleton Loader ──────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid #f1f5f9;
}
.dark .skeleton-row {
    border-bottom-color: #1e293b;
}
.skeleton-bone {
    border-radius: 8px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.dark .skeleton-bone {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* ── Sortable Table Header ────────────────────── */
.sortable-header {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color 0.15s ease;
}
.sortable-header:hover {
    color: #475569;
}
.dark .sortable-header:hover {
    color: #94a3b8;
}
.sortable-header .sort-icon {
    opacity: 0.3;
    transition: opacity 0.15s ease, transform 0.15s ease;
    font-size: 9px;
}
.sortable-header:hover .sort-icon {
    opacity: 0.6;
}
.sortable-header.sort-asc .sort-icon,
.sortable-header.sort-desc .sort-icon {
    opacity: 1;
    color: #FD8C00;
}
.dark .sortable-header.sort-asc .sort-icon,
.dark .sortable-header.sort-desc .sort-icon {
    color: #FB923C;
}
.sortable-header.sort-desc .sort-icon {
    transform: rotate(180deg);
}

/* ── Row Hover Actions ────────────────────────── */
.row-actions-hidden {
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}
.order-row-compact:hover .row-actions-hidden {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.row-action-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #64748b;
    transition: all 0.15s ease;
    cursor: pointer;
}
.row-action-icon:hover {
    background-color: #FFF7ED;
    color: #EA580C;
    transform: translateY(-1px);
}
.dark .row-action-icon:hover {
    background-color: #1e293b;
    color: #FD8C00;
}

/* ── Context Menu ─────────────────────────────── */
@keyframes contextMenuIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.06);
    padding: 4px;
    animation: contextMenuIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.dark .context-menu {
    background: rgba(15, 23, 42, 0.97);
    border-color: #334155;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.5);
}
.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: background 0.1s ease;
}
.dark .context-menu-item {
    color: #cbd5e1;
}
.context-menu-item:hover {
    background: #eef2ff;
}
.dark .context-menu-item:hover {
    background: rgba(99, 102, 241, 0.1);
}
.context-menu-item.danger {
    color: #DC2626;
}
.context-menu-item.danger:hover {
    background: #FEF2F2;
}
.dark .context-menu-item.danger {
    color: #FCA5A5;
}
.dark .context-menu-item.danger:hover {
    background: rgba(220, 38, 38, 0.1);
}
.context-menu-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 8px;
}
.dark .context-menu-divider {
    background: #1e293b;
}

/* ── Inline Status Dropdown ───────────────────── */
@keyframes dropdownOpen {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-2px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.status-dropdown {
    position: absolute;
    z-index: 60;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.12);
    padding: 4px;
    animation: dropdownOpen 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.dark .status-dropdown {
    background: rgba(15, 23, 42, 0.98);
    border-color: #334155;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5);
}
.status-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: background 0.1s ease;
}
.dark .status-dropdown-item {
    color: #cbd5e1;
}
.status-dropdown-item:hover {
    background: #f8fafc;
}
.dark .status-dropdown-item:hover {
    background: #1e293b;
}
.status-dropdown-item.is-current {
    background: #FFF7ED;
    color: #EA580C;
    font-weight: 600;
}
.dark .status-dropdown-item.is-current {
    background: rgba(253, 140, 0, 0.15);
    color: #FB923C;
}

/* ── Command Palette (Ctrl+K) ─────────────────── */
@keyframes paletteSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    padding-top: 18vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
}
.command-palette-box {
    width: 100%;
    max-width: 540px;
    max-height: 420px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: paletteSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.dark .command-palette-box {
    background: rgba(15, 23, 42, 0.98);
    border-color: #334155;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
}
.command-palette-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 15px;
    border: none;
    background: transparent;
    color: #0f172a;
    outline: none;
    border-bottom: 1px solid #f1f5f9;
}
.dark .command-palette-input {
    color: #f1f5f9;
    border-bottom-color: #1e293b;
}
.command-palette-results {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}
.command-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: background 0.1s ease;
}
.dark .command-palette-item {
    color: #cbd5e1;
}
.command-palette-item:hover,
.command-palette-item.is-focused {
    background: #eef2ff;
}
.dark .command-palette-item:hover,
.dark .command-palette-item.is-focused {
    background: rgba(99, 102, 241, 0.1);
}
.command-palette-item .kbd {
    margin-left: auto;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
}
.dark .command-palette-item .kbd {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

/* ── Progress Tracker (Order Lifecycle) ───────── */
.progress-tracker {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 16px 0;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
}
.progress-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    transition: all 0.3s ease;
}
.progress-dot.completed {
    background: #FD8C00;
    color: white;
    box-shadow: 0 4px 8px -2px rgba(253, 140, 0, 0.4);
}
.progress-dot.current {
    background: #FFF7ED;
    color: #EA580C;
    border: 2.5px solid #EA580C;
    animation: progressPulse 2s ease-in-out infinite;
}
.progress-dot.pending {
    background: #f1f5f9;
    color: #94a3b8;
    border: 2px solid #e2e8f0;
}
.dark .progress-dot.completed {
    background: #FD8C00;
    box-shadow: 0 4px 8px -2px rgba(253, 140, 0, 0.45);
}
.dark .progress-dot.current {
    background: rgba(253, 140, 0, 0.2);
    color: #FB923C;
    border-color: #FD8C00;
}
.dark .progress-dot.pending {
    background: #1e293b;
    color: #475569;
    border-color: #334155;
}
@keyframes progressPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(253, 140, 0, 0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(253, 140, 0, 0); }
}
.progress-line {
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}
.dark .progress-line {
    background: #334155;
}
.progress-line.completed {
    background: #FD8C00;
}
.dark .progress-line.completed {
    background: #EA580C;
}
.progress-label {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
}
.progress-label.current {
    color: #EA580C;
}
.dark .progress-label.current {
    color: #FB923C;
}
.progress-date {
    font-size: 9px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Checkbox Draw Animation ──────────────────── */
@keyframes checkDraw {
    from { stroke-dashoffset: 24; }
    to   { stroke-dashoffset: 0; }
}

/* ── Selection Pulse ──────────────────────────── */
@keyframes selectPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.select-pulse {
    animation: selectPulse 0.6s ease-out;
}

/* ── Tooltip Rich Card ────────────────────────── */
.rich-tooltip {
    position: absolute;
    z-index: 70;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.1);
    padding: 12px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.dark .rich-tooltip {
    background: rgba(15, 23, 42, 0.98);
    border-color: #334155;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5);
}
.rich-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Export Button Glow ───────────────────────── */
.btn-glow-indigo:hover {
    box-shadow: 0 0 20px -4px rgba(79, 70, 229, 0.35);
}
.btn-glow-emerald:hover {
    box-shadow: 0 0 20px -4px rgba(5, 150, 105, 0.35);
}

/* ── Print Styles (A5 Yatay Tek Sayfa Toplama Fişi) ──────────────── */
@media print {
    @page {
        size: A5 landscape;
        margin: 3.5mm 5mm;
    }
    html, body {
        background: white !important;
        color: black !important;
        font-size: 8pt !important;
        line-height: 1.1 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Renkli kart başlıkları baskıda korunsun */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Gövde seviyesinde SADECE paketleme özeti kalsın (sidebar, tablo, diğer modallar gizlenir) */
    body > *:not(#packing-summary-modal) {
        display: none !important;
    }

    /* Modal ve tüm kapsayıcıları düz akışa alınır */
    #packing-summary-modal,
    #packing-summary-modal * {
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }
    #packing-summary-modal {
        display: block !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        inset: auto !important;
        z-index: auto !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }
    #packing-summary-modal > div {
        max-width: 100% !important;
        width: 100% !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    /* Modal Üst Başlığı: Sade, beyaz zeminli kurumsal A5 başlık */
    #packing-summary-modal .bg-slate-900 {
        background: transparent !important;
        color: #0f172a !important;
        padding: 0 0 1mm 0 !important;
        border-bottom: 1.2px solid #0f172a !important;
        margin-bottom: 1.5mm !important;
        display: flex !important;
        align-items: baseline !important;
        justify-content: space-between !important;
    }
    #packing-summary-modal .bg-slate-900 .bg-indigo-600,
    #packing-summary-modal .bg-slate-900 svg {
        display: none !important;
    }
    #packing-summary-modal h2 {
        font-size: 9.5pt !important;
        font-weight: 800 !important;
        letter-spacing: -0.01em !important;
        color: #0f172a !important;
        display: inline !important;
    }
    #packing-summary-subtitle {
        color: #64748b !important;
        font-size: 7pt !important;
        font-weight: 600 !important;
        display: inline !important;
        margin-left: 6px !important;
    }

    #packing-summary-printable-area {
        padding: 0 !important;
        margin: 0 !important;
        gap: 1.5mm !important;
        background: white !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Ekrana özel parçalar baskıda çıkmaz */
    .no-print,
    button,
    #packing-tabs-nav,
    #packing-tab-multi-content,
    #packing-tab-single-content {
        display: none !important;
    }

    /* KPI Kartları: Tek satırlık yatay ultra-kompakt şerit */
    #packing-kpi-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 1.8mm !important;
        margin-bottom: 1.2mm !important;
    }
    #packing-kpi-container > div {
        flex: 1 1 0 !important;
        padding: 0.8mm 1.8mm !important;
        border: 0.8px solid #cbd5e1 !important;
        border-radius: 3px !important;
        background: #f8fafc !important;
        box-shadow: none !important;
        min-width: 0 !important;
    }
    #packing-kpi-container > div > div:first-child {
        font-size: 5.5pt !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        color: #64748b !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    #packing-kpi-container > div > div:last-child {
        font-size: 8.5pt !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
        margin-top: 0.4mm !important;
        white-space: nowrap !important;
    }
    #packing-kpi-container > div > div:last-child span {
        font-size: 6.5pt !important;
        font-weight: 600 !important;
    }

    /* Kargo Dağılımı Çubuğu */
    #packing-cargo-breakdown {
        display: flex !important;
        align-items: center !important;
        padding: 0.5mm 1.8mm !important;
        margin-bottom: 1.5mm !important;
        border: 0.8px solid #e2e8f0 !important;
        border-radius: 3px !important;
        background: #ffffff !important;
        font-size: 6.5pt !important;
        gap: 1.8mm !important;
    }
    #packing-cargo-breakdown > div:first-child {
        font-size: 6.5pt !important;
    }
    #packing-cargo-breakdown span {
        padding: 0.2mm 1.2mm !important;
        font-size: 6.5pt !important;
        border-radius: 2px !important;
    }

    /* Model & Beden Kartları Izgarası (Kompakt 3-4 Sütun Baskı) */
    #packing-tab-picking-content,
    #packing-tab-picking-content > [class*="columns-"] {
        display: block !important;
        columns: 4 !important;
        column-gap: 2.2mm !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .packing-model-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        border: 0.8px solid #94a3b8 !important;
        border-radius: 3px !important;
        overflow: hidden !important;
        box-shadow: none !important;
        margin-bottom: 2mm !important;
        background: white !important;
    }
    .packing-model-card > div:first-child {
        padding: 0.6mm 1.6mm !important;
        font-size: 7pt !important;
        line-height: 1 !important;
        color: white !important;
        font-weight: 800 !important;
    }
    .packing-model-card .size-section {
        border-bottom: 0.5px solid #cbd5e1 !important;
    }
    .packing-model-card .size-section:last-child {
        border-bottom: none !important;
    }
    .packing-model-card .size-header {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        padding: 0.35mm 1.5mm !important;
        font-size: 6.3pt !important;
        border-bottom: 0.5px solid #cbd5e1 !important;
        line-height: 1 !important;
    }
    .packing-model-card .pick-item-row {
        padding: 0.35mm 1.5mm !important;
        font-size: 6pt !important;
        line-height: 1 !important;
        border-bottom: 0.4px solid #f1f5f9 !important;
    }
    .packing-model-card .pick-item-row:last-child {
        border-bottom: none !important;
    }
    .packing-model-card input[type="checkbox"] {
        display: inline-block !important;
        width: 7.5px !important;
        height: 7.5px !important;
        border: 0.8px solid #64748b !important;
        border-radius: 1.5px !important;
        margin: 0 !important;
    }
    .packing-model-card table {
        font-size: 6.5pt !important;
        line-height: 1.05 !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }
    .packing-model-card table tr {
        border-bottom: 0.5px solid #e2e8f0 !important;
    }
    .packing-model-card table td {
        padding: 0.4mm 1.5mm !important;
        line-height: 1.05 !important;
    }
}

/* ── Ana Tablo Detaylı Görünüm (Kompakt Dengeli Kurumsal Izgara) ─────────────────── */
.detailed-table-grid {
    display: grid;
    /* Checkbox | Sipariş Bilgileri | Alıcı & Lokasyon | Ürün & Varyant | Kargo & Takip | İşlemler */
    grid-template-columns: 36px 215px 165px minmax(280px, 1fr) 155px 185px;
}

@media (max-width: 1440px) {
    .detailed-table-grid {
        grid-template-columns: 36px 205px 155px minmax(250px, 1fr) 150px 180px;
    }
}

@media (max-width: 1200px) {
    .detailed-table-grid {
        grid-template-columns: 34px 195px 145px minmax(220px, 1fr) 140px 175px;
    }
}

.detailed-row {
    display: grid;
    grid-column: 1 / -1;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

/* Tablo Satır Ayrımı & Zebra Deseni */
.detailed-row:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.45);
}

.dark .detailed-row:nth-child(even) {
    background-color: rgba(17, 24, 39, 0.35);
}

.detailed-row:hover {
    background-color: rgba(241, 245, 249, 0.85) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.dark .detailed-row:hover {
    background-color: rgba(30, 41, 59, 0.85) !important;
}

/* Sipariş Bilgileri Sütunu Ayrımı & Hover */
.col-order {
    background-color: rgba(248, 250, 252, 0.75);
    border-right: 2px solid #e2e8f0 !important;
}

.dark .col-order {
    background-color: rgba(21, 28, 44, 0.5);
    border-right: 2px solid #334155 !important;
}

.detailed-row:hover .col-order {
    background-color: rgba(238, 242, 246, 0.95) !important;
}

.dark .detailed-row:hover .col-order {
    background-color: rgba(26, 33, 52, 0.95) !important;
}

/* Kargo etiket butonları (İç arkaplanı beyaz, çerçevesi renkli outline butonlar) */
.btn-outline-orange {
    border: 1.5px solid #ea580c;
    color: #ea580c;
    background-color: #ffffff;
    padding: 6.5px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn-outline-orange:hover {
    background-color: #fff7ed;
    border-color: #c2410c;
    color: #c2410c;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.12);
}
.dark .btn-outline-orange {
    border: 1.5px solid #f97316;
    color: #fb923c;
    background-color: #1e293b;
}
.dark .btn-outline-orange:hover {
    background-color: rgba(249, 115, 22, 0.15);
    border-color: #fb923c;
}

.invoice-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}
.invoice-status-red {
    background-color: #f43f5e;
    box-shadow: 0 0 4px rgba(244, 63, 94, 0.4);
}
.invoice-status-green {
    background-color: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
}
.invoice-status-blue {
    background-color: #3b82f6;
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

/* ── Tıklama & Hover Geliştirmeleri (High-Impact SaaS Elevation) ────────── */
.detailed-row {
    border-left: 4px solid transparent;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.18s ease,
                border-left-color 0.18s ease;
    position: relative;
}

.detailed-row:hover {
    border-left-color: #FD8C00 !important;
    background-color: #FFFDF9 !important;
    box-shadow: 0 8px 24px -4px rgba(253, 140, 0, 0.18), 0 2px 8px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    z-index: 15;
}

.dark .detailed-row:hover {
    border-left-color: #FD8C00 !important;
    background-color: #1E273D !important;
    box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(253, 140, 0, 0.35);
    transform: translateY(-2px);
    z-index: 15;
}

.detailed-row.is-active-row {
    border-left-color: #EA580C !important;
    background-color: rgba(255, 237, 213, 0.8) !important;
    box-shadow: inset 0 0 0 1px rgba(253, 140, 0, 0.35);
}

.dark .detailed-row.is-active-row {
    border-left-color: #FD8C00 !important;
    background-color: rgba(67, 20, 7, 0.45) !important;
    box-shadow: inset 0 0 0 1px rgba(253, 140, 0, 0.4);
}

/* Hover esnasında sipariş numarası ve ürün başlığı canlanması */
.detailed-row:hover .order-number-text {
    color: #EA580C !important;
    transition: color 0.15s ease;
}
.dark .detailed-row:hover .order-number-text {
    color: #FD8C00 !important;
}

/* Hover esnasında ürün görseline yumuşak zoom */
.product-thumb-img {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.detailed-row:hover .product-thumb-img {
    transform: scale(1.05);
    box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.18);
}

/* Hover esnasında ana baskı butonunun canlanması */
.detailed-row:hover .btn-print-primary {
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.45);
}

/* Hücre ayrışma çizgileri: sütunlar arası dikey net kılavuz çizgileri */
.detailed-row > .col-cell {
    transition: border-color 0.15s ease;
}
.detailed-row:hover > .col-cell {
    border-color: rgba(253, 140, 0, 0.22) !important;
}
.dark .detailed-row:hover > .col-cell {
    border-color: rgba(253, 140, 0, 0.3) !important;
}

/* ── Müşteri Etiketleri (CRM Badges) ───────────────────── */
.customer-tag-vip {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
    font-weight: 800;
}

.customer-tag-loyal {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.customer-tag-risk {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.customer-tag-corporate {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ── Zaman Çizelgesi (Audit Timeline) ──────────────────── */
.timeline-item {
    position: relative;
    padding-left: 24px;
    padding-bottom: 16px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 14px;
    bottom: 0;
    width: 2px;
    background-color: #e2e8f0;
}

.dark .timeline-item::before {
    background-color: #334155;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid #FD8C00;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .timeline-dot {
    background-color: #0f172a;
    border-color: #FB923C;
}

/* ── Dinamik Sipariş Detay Penceresi (Dynamic Order Modal) ── */
.modal-dynamic-frame {
    width: 88vw;
    max-width: 1120px;
    min-width: 420px;
    height: auto;
    max-height: 92vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
                max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
                height 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark .modal-dynamic-frame {
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Farklı Ekran / Kullanıcı Seçim Boyut Modları */
.modal-dynamic-frame.size-compact {
    width: 78vw;
    max-width: 820px;
    max-height: 88vh;
}

.modal-dynamic-frame.size-wide {
    width: 94vw;
    max-width: 1380px;
    max-height: 94vh;
}

.modal-dynamic-frame.size-full {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 96vh !important;
    max-height: 96vh !important;
    border-radius: 1.25rem !important;
}

/* Sürükleme / Boyutlandırma Tutamacı (Resize Handle) */
.modal-resize-handle {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    color: #94a3b8;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.modal-resize-handle:hover {
    color: #3b82f6;
    transform: scale(1.15);
}

.dark .modal-resize-handle {
    color: #64748b;
}

.dark .modal-resize-handle:hover {
    color: #60a5fa;
}

/* ── Modal Katman Hiyerarşisi (Z-Index Layering) ── */
#order-detail-modal {
    z-index: 50 !important;
}

#preview-modal,
#packing-summary-modal,
#customer-modal,
#order-history-modal,
#settings-modal {
    z-index: 70 !important;
}

#image-lightbox-modal {
    z-index: 85 !important;
}

.context-menu,
#command-palette-overlay {
    z-index: 9999 !important;
}

#toast-container {
    z-index: 10000 !important;
}

#global-loader {
    z-index: 10001 !important;
}

/* ── BODWAY OMS v6.2: Bütünleşik Üst Menü Mimarisi (Sol Sidebar Emekliye Ayrıldı) ── */

/* ── BODWAY OMS v6.2: Çalışma Alanı Sekmeleri (Workspace Tabs) ────────── */
.ws-tab {
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}
.ws-tab:hover {
    transform: translateY(-0.5px);
}
.ws-tab.is-active {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
    border-color: rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}
.dark .ws-tab.is-active {
    background-color: #1B2236 !important;
    color: #FFFFFF !important;
    border-color: rgba(71, 85, 105, 0.8) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
}

/* ── Kargo Etiketi Yazdır Butonu (Bodway Sunset Amber Birincil Buton) ─── */
.btn-print-primary {
    background: linear-gradient(135deg, #FD8C00 0%, #EA580C 100%);
    color: #FFFFFF !important;
    border: 1px solid #C2410C;
    padding: 6.5px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 5px rgba(234, 88, 12, 0.25);
    cursor: pointer;
}
.btn-print-primary:hover {
    background: linear-gradient(135deg, #EA580C 0%, #C2410C 100%);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
    transform: translateY(-0.5px);
}
.btn-print-primary:active {
    transform: scale(0.98);
}
.dark .btn-print-primary {
    background: linear-gradient(135deg, #FD8C00 0%, #EA580C 100%);
    color: #FFFFFF !important;
    border-color: #FB923C;
    box-shadow: 0 2px 8px rgba(253, 140, 0, 0.25);
}
.dark .btn-print-primary:hover {
    background: linear-gradient(135deg, #FF9E26 0%, #EA580C 100%);
    box-shadow: 0 4px 14px rgba(253, 140, 0, 0.4);
}

.btn-outline-orange {
    background-color: #FFFFFF;
    color: #0F172A;
    border: 1px solid #CBD5E1;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-outline-orange:hover {
    background-color: #FFF8F1;
    border-color: #FD8C00;
    color: #EA580C;
}
.dark .btn-outline-orange {
    background-color: #1E293B;
    color: #F8FAFC;
    border-color: #475569;
}
.dark .btn-outline-orange:hover {
    background-color: #242F48;
    border-color: #FD8C00;
    color: #FD8C00;
}

/* ── Kurumsal Tablo Satırı & Vurgular (High-Density Table) ─── */
.detailed-row {
    transition: background-color 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease;
}
.detailed-row:not(.is-active-row):not(.bg-brand-50\/40):not(.bg-indigo-50\/40):hover {
    background-color: #FFF8F1 !important;
}
.dark .detailed-row:not(.is-active-row):not(.dark\:bg-brand-950\/20):not(.dark\:bg-indigo-950\/20):hover {
    background-color: rgba(30, 41, 59, 0.75) !important;
}

/* Koyu mod checkbox ince ayarı */
.dark input[type="checkbox"].order-checkbox {
    background-color: #1E293B;
    border-color: #475569;
}
.dark input[type="checkbox"].order-checkbox:checked {
    background-color: #FD8C00;
    border-color: #FD8C00;
}

/* ── Statü Sekmeleri (Status Capsules) ────────── */
.tab-capsule {
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab-capsule:hover {
    transform: translateY(-0.5px);
}
.tab-capsule:active {
    transform: scale(0.98);
}

/* ── BODWAY OMS v6.0: Dalga Toplama Merkezi (Wave Picking) ────────── */
.pick-item-row {
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}
.pick-item-row:hover {
    background-color: rgba(245, 158, 11, 0.08);
}
.pick-item-row.is-picked {
    background-color: rgba(16, 185, 129, 0.1) !important;
}
.pick-item-row.is-picked .pick-cell-text {
    text-decoration: line-through;
    color: #059669 !important;
}
.dark .pick-item-row.is-picked .pick-cell-text {
    color: #34d399 !important;
}

/* ── BODWAY OMS v6.3.4: Belirgin Yazdırıldı & Baskı Bekliyor Satır Stilleri ────────── */
.detailed-row.is-order-printed {
    border-left-color: #10B981 !important;
}
.detailed-row.is-order-unprinted {
    border-left-color: #F59E0B !important;
}
.detailed-row.is-order-printed:hover .col-order {
    background-color: rgba(236, 253, 245, 0.95) !important;
}
.dark .detailed-row.is-order-printed:hover .col-order {
    background-color: rgba(6, 78, 59, 0.35) !important;
}

