/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* ============================================
   NEW LAYOUT STRUCTURE
   ============================================ */

/* Main Layout Container */
.layout-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    margin-left: -260px;
    width: 260px;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h1 {
    font-size: 24px;
    color: #6366f1;
    margin-bottom: 4px;
    font-weight: 800;
}

.sidebar-header p {
    font-size: 12px;
    color: #888;
    margin: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav .nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background: none;
    border: none;
    border-right: 4px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-nav .nav-btn:hover {
    background: #f9fafb;
}

.sidebar-nav .nav-btn.active {
    background: #eef2ff;
    color: #6366f1;
    border-right-color: #6366f1;
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
    display: inline-block;
    width: 24px;
}

.nav-label {
    flex: 1;
}

/* Nav Group Button */
.nav-group-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background: none;
    border: none;
    border-top: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.nav-group-btn:first-of-type {
    border-top: none;
    margin-top: 0;
}

.nav-group-btn:hover {
    background: #f9fafb;
}

.nav-group-btn.expanded {
    background: #f9fafb;
    color: #6366f1;
}

.nav-arrow {
    font-size: 10px;
    margin-left: auto;
    transition: transform 0.2s;
}

.nav-group-btn.expanded .nav-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f9fafb;
}

.nav-submenu.expanded {
    max-height: 500px;
}

/* Sub-buttons */
.nav-sub-btn {
    padding-left: 52px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

.nav-sub-btn .nav-icon {
    font-size: 16px;
    width: 20px;
}

/* Nested submenu (for bundles submenu within inventory) */
.nav-sub-submenu {
    background: #f0f1f3;
    padding-left: 20px;
}

.nav-sub-submenu.expanded {
    max-height: 300px;
}

/* Sub-sub-buttons (third level) */
.nav-sub-sub-btn {
    padding-left: 72px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}

.nav-sub-sub-btn .nav-icon {
    font-size: 14px;
    width: 18px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Header */
.top-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: #f5f5f5;
}

.toggle-icon {
    font-size: 24px;
    color: #333;
}

.header-date {
    font-size: 13px;
    color: #888;
}

/* Content Wrapper (Scrollable) */
.content-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    padding: 32px;
    background: #f5f5f5;
}

/* ============================================
   DASHBOARD SPECIFIC STYLES
   ============================================ */

/* Greeting Section */
.dashboard-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.greeting-section {
    margin-bottom: 0;
}

.greeting-time {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.greeting-title {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Stats Grid - Single Row */
.stats-grid-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.dashboard-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-month-pill {
    align-self: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: #e8eefc;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    border: 1px solid #dbe3ea;
    border-radius: 14px;
    padding: 18px 24px;
    text-align: left;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Dashboard Two-Column Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* Cards */
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.card h3,
.card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.card h4 {
    font-size: 15px;
    margin-top: 0;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.card-title-row h3 {
    margin: 0;
    padding: 0;
    border: 0;
}

.card-title-note {
    font-size: 12px;
    color: #6b7280;
}

/* Quick Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.primary {
    background: #6366f1;
    color: white;
}

.action-btn.primary:hover {
    background: #4f46e5;
}

.action-btn.success {
    background: #22c55e;
    color: white;
}

.action-btn.success:hover {
    background: #16a34a;
}

.action-btn.secondary {
    background: white;
    color: #333;
    border: 1px solid #d0d0d0;
}

.action-btn.secondary:hover {
    background: #f9fafb;
}

/* System Status */
.system-status-card {
    height: 100%;
}

.status-summary {
    margin-bottom: 18px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #333;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    flex: 0 0 auto;
}

.dashboard-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.status-panel-item {
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-panel-item-wide {
    grid-column: 1 / -1;
}

.status-item-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.status-panel-item strong {
    color: #111827;
    font-size: 15px;
    line-height: 1.4;
}

.dashboard-activity-card {
    margin-bottom: 0;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid #eef2f7;
}

.activity-row:last-child {
    border-bottom: 0;
}

.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #eff6ff;
}

.activity-content {
    min-width: 0;
}

.activity-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.activity-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.activity-ref {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.activity-primary {
    color: #374151;
    font-size: 14px;
    margin-bottom: 4px;
}

.activity-secondary {
    color: #6b7280;
    font-size: 12px;
}

.activity-meta {
    text-align: right;
    min-width: 120px;
}

.activity-amount {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.activity-amount.negative {
    color: #b91c1c;
}

.activity-amount.positive {
    color: #047857;
}

.activity-quantity {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 4px;
}

.activity-time {
    color: #6b7280;
    font-size: 12px;
}

.no-activity {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
    display: none;
}

.content-section.active {
    display: block !important;
}

/* ============================================
   OLD STYLES (For backward compatibility)
   Keep these for other sections
   ============================================ */

/* Old container - now hidden/not used but keeping for reference */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Old header - now part of sidebar */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Old main-nav - now part of sidebar-nav */
.main-nav {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Old stats-grid - replaced by stats-grid-row */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Dashboard Grid for other sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.orders-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.order-hub-layout {
    display: grid;
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.order-hub-actions-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 16px;
}

.order-hub-actions-header h3 {
    margin-bottom: 8px;
}

.order-hub-actions-header p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.order-hub-platform-scope label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.order-hub-action-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-hub-action-group-rare {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.order-hub-actions-subtitle {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.order-hub-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    margin: 0;
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
    background-image: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.order-hub-action-btn.active {
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    transform: none;
}

.order-hub-action-btn.btn.secondary.active {
    background: #e5e7eb;
    background-image: none;
    color: #374151;
    border: 1px solid #d1d5db;
}

.order-hub-action-primary {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.order-hub-detail-panel {
    min-width: 0;
}

.order-hub-tabs {
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.order-hub-tabs .product-tab {
    flex: 1 1 180px;
}

.order-hub-tab-panel {
    min-height: 260px;
}

.orders-processing-card .btn {
    margin-right: 12px;
    margin-bottom: 12px;
}

.orders-table-wrap {
    overflow-x: auto;
}

.orders-table {
    min-width: 780px;
}

.orders-table th:first-child,
.orders-table td:first-child {
    min-width: 150px;
    word-break: break-word;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
    min-width: 140px;
}

.orders-table th:last-child,
.orders-table td:last-child {
    min-width: 110px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    background: linear-gradient(135deg, #4a5ced 0%, #6366f1 50%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 50%, #6b21a8 100%);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.btn.secondary {
    background: #f3f4f6;
    color: #4b5563;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.btn.secondary:hover {
    background: #e5e7eb;
    color: #374151;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.btn.danger {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    box-shadow: 0 10px 20px rgba(238, 90, 82, 0.3);
}

.btn.success {
    background: linear-gradient(45deg, #51cf66, #40c057);
    box-shadow: 0 10px 20px rgba(64, 192, 87, 0.3);
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.table td {
    padding: 5px 10px;
    text-align: left;
    border-bottom: 1px solid #d1d5db;
}

.table th {
    background: #f5f7f9;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #d1d5db;
	text-align: left;
    padding: 5px;
}

/* Sortable table header styles */
.table th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
    padding-right: 25px;
}

.table th[data-sort]:hover {
    background: #e8ecf0;
}

.table th[data-sort] .sort-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.table th[data-sort]:hover .sort-indicator {
    color: #6366f1;
}

.table th[data-sort][data-order="asc"] .sort-indicator,
.table th[data-sort][data-order="desc"] .sort-indicator {
    color: #6366f1;
    font-weight: bold;
}

.table tbody tr:hover {
    background: #f5faff;
}

/* Data table inside modals - cleaner styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tfoot tr {
    background: #f8f9fa;
    font-weight: 600;
}

.data-table tfoot td {
    border-top: 2px solid #dee2e6;
}

/* Modal content spacing improvements */
.modal-content strong {
    color: #495057;
    font-weight: 600;
}

.modal-content .badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-danger {
    background: #f8d7da;
    color: #721c24;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   WORKFLOW INDICATORS
   ============================================ */
.workflow-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.workflow-indicator.success {
    background: #51cf66;
}

.workflow-indicator.warning {
    background: #ffd43b;
}

.workflow-indicator.error {
    background: #ff6b6b;
}

/* ============================================
   FORMS
   ============================================ */

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    font-size: 14px;
    background-color: #ffffff;
    transition: all 0.2s ease;
    color: #1f2937;
}

.form-control:hover {
    border-color: #d1d5db;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background-color: #ffffff;
}

/* Validation states */
.form-control.is-invalid,
.form-control:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control.is-valid {
    border-color: #28a745;
}

/* Required field indicator */
.form-group label.required::after {
    content: ' *';
    color: #dc3545;
}

/* Inline validation error message (dropdown style) */
.validation-message {
    display: none;
    position: relative;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 12px;
    color: #856404;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.validation-message::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 12px;
    width: 10px;
    height: 10px;
    background: #fff3cd;
    border-left: 1px solid #ffc107;
    border-top: 1px solid #ffc107;
    transform: rotate(45deg);
}

.validation-message.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.validation-message .validation-icon {
    color: #f59e0b;
    font-size: 14px;
}

/* Form group with validation */
.form-group.has-error .form-control {
    border-color: #dc3545;
}

.form-group.has-error .validation-message {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    padding: 0;
    animation: modalSlideIn 0.3s ease;
}

/* Modal header with close button */
.modal-content > h3:first-of-type,
.modal-content > .modal-header {
    background: linear-gradient(135deg, #4a5ced 0%, #6366f1 50%, #7c3aed 100%);
    color: white;
    margin: 0;
    padding: 16px 24px;
    font-size: 22px;
    font-weight: 700;
    border-radius: 16px 16px 0 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

/* Adjust padding when close button is present */
.modal-content > .close + h3 {
    background: linear-gradient(135deg, #4a5ced 0%, #6366f1 50%, #7c3aed 100%);
    color: white;
    margin: 0;
    padding: 28px 70px 28px 35px;
    font-size: 22px;
    font-weight: 700;
    border-radius: 16px 16px 0 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

/* Modal body wrapper */
.modal-content > div:not(.modal-header):not(.modal-footer),
.modal-content > form {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-header {
    background: linear-gradient(135deg, #4a5ced 0%, #6366f1 50%, #7c3aed 100%);
    color: white;
    margin: 0;
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.modal-footer {
    margin-top: 24px;
    padding: 20px 35px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #e5e7eb;
}

/* Close button */
.close,
.close-btn {
    position: absolute;
    top: 24px;
    right: 28px;
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    opacity: 1;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.close:hover,
.close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.close:active,
.close-btn:active {
    transform: scale(0.95);
}

/* Close button for help modals */
.close-modal-btn {
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: #f0f0f0 !important;
    color: #333 !important;
    transform: scale(1.1);
}

.close-modal-btn:active {
    transform: scale(0.95);
}

/* Modal slide in animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   PLATFORM SYNC STYLES
   ============================================ */
.platform-sync-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.platform-sync-btn:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.platform-sync-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.platform-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.platform-name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.platform-status {
    font-size: 0.85em;
    color: #666;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 12px;
    display: inline-block;
    margin-top: 5px;
}

.platform-sync-btn.active .platform-status {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 2em;
    margin-bottom: 5px;
}

.section-description {
    color: #666;
    font-size: 1.1em;
}

/* ============================================
   BANNERS
   ============================================ */
.info-banner {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.error-banner {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
}

.error-banner ul {
    margin: 10px 0 0 20px;
}

.error-banner li {
    margin: 5px 0;
}

/* ============================================
   FILTERS & SEARCH
   ============================================ */
.filters {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

/* ============================================
   DATA ATTRIBUTES FOR CLICK HANDLING
   ============================================ */
[data-navigate],
[data-action] {
    cursor: pointer;
}

[data-navigate] *,
[data-action] * {
    pointer-events: none;
}

/* ============================================
   SPINNER / LOADING
   ============================================ */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.busy-host {
    position: relative;
}

.screen-busy-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(2px);
    z-index: 20;
    border-radius: inherit;
}

.screen-busy-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    text-align: center;
}

.screen-busy-content .spinner {
    margin: 0;
}

.screen-busy-message {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .order-hub-layout {
        grid-template-columns: 1fr;
    }

    .order-hub-actions-card {
        position: static;
    }

    .dashboard-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-grid-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-hub-tabs {
        flex-direction: column;
        border-bottom: none;
        background: transparent;
        gap: 8px;
    }

    .order-hub-tabs .product-tab {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }

    .order-hub-tabs .product-tab.active {
        border-color: #6366f1;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-260px);
        margin-left: 0;
    }

    .sidebar.collapsed {
        margin-left: 0;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    }
    
    .stats-grid-row {
        grid-template-columns: 1fr;
    }

    .dashboard-kpis {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .activity-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .activity-meta {
        grid-column: 2;
        text-align: left;
        min-width: 0;
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .greeting-title {
        font-size: 24px;
    }
    
    .top-header {
        padding: 12px 16px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.stat-card {
    animation: fadeIn 0.5s ease;
}

/* Custom Confirmation Modal Styles
   Add this to your sellersync.css file */

/* Modal Overlay */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-confirm-overlay.show {
    opacity: 1;
}

/* Modal Content */
.custom-confirm-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    text-align: center;
}

.custom-confirm-content.custom-confirm-content-scrollable {
    width: min(94vw, 760px);
    max-height: min(90vh, 820px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    text-align: left;
    overflow: hidden;
}

.custom-confirm-content-scrollable .custom-confirm-body {
    overflow-y: auto;
    padding-right: 6px;
    margin-right: -6px;
}

.custom-confirm-content-scrollable .custom-confirm-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
    flex-shrink: 0;
    background: white;
}

.custom-confirm-overlay.show .custom-confirm-content {
    transform: scale(1);
}

/* Icon */
.custom-confirm-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
}

/* Title */
.custom-confirm-title {
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
}

/* Message */
.custom-confirm-message {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 28px 0;
}

/* Actions */
.custom-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-confirm-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.custom-confirm-cancel {
    background: #f5f5f5;
    color: #666;
}

.custom-confirm-cancel:hover {
    background: #e0e0e0;
}

.custom-confirm-ok {
    background: #6366f1;
    color: white;
}

.custom-confirm-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
    .custom-confirm-content {
        padding: 24px;
        max-width: 95%;
    }

    .custom-confirm-content.custom-confirm-content-scrollable {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        padding: 16px;
        border-radius: 12px;
    }
    
    .custom-confirm-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }
    
    .custom-confirm-title {
        font-size: 18px;
    }
    
    .custom-confirm-message {
        font-size: 14px;
    }
    
    .custom-confirm-actions {
        flex-direction: column-reverse;
    }

    .custom-confirm-content-scrollable .custom-confirm-actions {
        justify-content: stretch;
    }
    
    .custom-confirm-btn {
        width: 100%;
    }
}

/* ========================================
   MODERN NOTIFICATION SYSTEM
   ======================================== */

/* Notification Container - stacks multiple notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Allow clicks through container */
}

/* Individual Notification */
.notification {
    pointer-events: all; /* But catch clicks on notifications */
    min-width: 320px;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

/* Notification hiding animation */
.notification.hiding {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Notification Types */
.notification.success {
    border-left: 4px solid #4CAF50;
}

.notification.error {
    border-left: 4px solid #f44336;
}

.notification.warning {
    border-left: 4px solid #ff9800;
}

.notification.info {
    border-left: 4px solid #2196F3;
}

/* Banner Style (full width at top) */
.notification.banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: none;
    min-width: 100%;
    border-radius: 0;
    border-left: none;
    border-bottom: 4px solid;
    padding: 20px;
    animation: slideDown 0.4s ease-out;
    z-index: 10001; /* Above regular notifications */
}

.notification.banner.success {
    background: #e8f5e9;
    border-bottom-color: #4CAF50;
}

.notification.banner.error {
    background: #ffebee;
    border-bottom-color: #f44336;
}

.notification.banner.warning {
    background: #fff3e0;
    border-bottom-color: #ff9800;
}

.notification.banner.info {
    background: #e3f2fd;
    border-bottom-color: #2196F3;
}

.notification.banner.hiding {
    animation: slideUp 0.3s ease-in forwards;
}

/* Pulse effect for critical messages */
.notification.pulse {
    animation: slideInRight 0.3s ease-out, notificationPulse 2s ease-in-out infinite 0.3s;
}

.notification.banner.pulse {
    animation: slideDown 0.4s ease-out, notificationPulse 2s ease-in-out infinite 0.4s;
}

/* Notification Icon */
.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification.success .notification-icon {
    color: #4CAF50;
}

.notification.error .notification-icon {
    color: #f44336;
}

.notification.warning .notification-icon {
    color: #ff9800;
}

.notification.info .notification-icon {
    color: #2196F3;
}

/* Notification Content */
.notification-content {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

.notification-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.notification.success .notification-title {
    color: #2e7d32;
}

.notification.error .notification-title {
    color: #c62828;
}

.notification.warning .notification-title {
    color: #e65100;
}

.notification.info .notification-title {
    color: #1565c0;
}

.notification-message {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Close Button */
.notification-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.notification-close:hover {
    color: #333;
}

.notification.banner .notification-close {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* Progress Bar */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    background: currentColor;
    animation: progressBar linear forwards;
}

.notification.success .notification-progress-bar {
    background: #4CAF50;
}

.notification.error .notification-progress-bar {
    background: #f44336;
}

.notification.warning .notification-progress-bar {
    background: #ff9800;
}

.notification.info .notification-progress-bar {
    background: #2196F3;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes notificationPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notification-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .notification {
        min-width: auto;
        max-width: none;
    }
    
    .notification.banner {
        padding: 16px;
    }
}

/* Purchase Management Styles */

.purchase-line-row {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.purchase-line-row:hover {
    background: #e9ecef;
}

.form-control-sm {
    padding: 5px 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.item-code-input {
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.description-input {
    background: #f0f0f0;
    cursor: not-allowed;
}

.total-input,
.calc-unit-input {
    background: #e8f4f8;
    font-weight: bold;
    cursor: not-allowed;
}

.calc-total-input {
    background: #fff3cd;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    color: white;
    text-transform: uppercase;
}

.badge.success {
    background: #28a745;
    color: white;
}

.badge.info {
    background: #17a2b8;
    color: white;
}

.badge.primary {
    background: #007bff;
    color: white;
}

.badge.warning {
    background: #ffc107;
    color: #333;
}

.badge.secondary {
    background: #6c757d;
    color: white;
}

.badge.danger {
    background: #dc3545;
    color: white;
}

.product-link-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.product-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    min-width: 100px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
    text-align: center;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.product-link-badge.bundle {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.product-link-badge.master {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.product-link-badge.group {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #007bff;
    color: white;
}

.btn-small:hover {
    opacity: 0.8;
}

.btn-small.danger {
    background: #dc3545;
}

.btn-small.danger:hover {
    background: #c82333;
}

/* Outline button styles for bundles */
.btn-small[style*="background: transparent"] {
    transition: all 0.2s ease;
}

.btn-small[style*="background: transparent"]:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-small[style*="color: #6366f1"]:hover {
    background: #6366f1 !important;
    color: white !important;
}

.btn-small[style*="color: #dc3545"]:hover {
    background: #dc3545 !important;
    color: white !important;
}

#purchaseLineItems thead th {
    background: #343a40;
    color: white;
    padding: 10px;
    font-size: 13px;
}

#purchaseLineItems tbody td {
    padding: 8px;
    vertical-align: middle;
}

#purchaseLineItems tfoot td {
    background: #f8f9fa;
    padding: 12px;
    border-top: 2px solid #343a40;
}

/* Grid layout for form fields */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Responsive table */
@media (max-width: 768px) {
    .table {
        font-size: 12px;
    }
    
    .btn-small {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    #purchaseLineItems input {
        font-size: 12px;
        padding: 3px 5px;
    }
}

/* Filter section */
#purchaseFilters {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Purchase table */
#purchasesTable .table tbody tr:hover {
    background: #f0f8ff;
    cursor: pointer;
}

/* Highlight required fields */
input:required:invalid {
    border-left: 3px solid #ffc107;
}

input:required:valid {
    border-left: 3px solid #28a745;
}

/* Add this to sellersync.css */

/* Sales Form Styles */
.sale-item-input {
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.sale-description-input {
    background: #f0f0f0;
    cursor: not-allowed;
}

.sale-total-input {
    background: #e8f4f8;
    font-weight: bold;
    cursor: not-allowed;
}

.sale-type-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    background: #e9ecef;
}

#saleLineItems thead th {
    background: #343a40;
    color: white;
    padding: 10px;
    font-size: 13px;
}

#saleLineItems tbody td {
    padding: 8px;
    vertical-align: middle;
}

#saleLineItems tfoot td {
    background: #f8f9fa;
    padding: 12px;
    border-top: 2px solid #343a40;
}

/* Distribution Modal Styles */
#variantDistributionModal .modal-content {
    max-width: 600px;
}

.variant-qty-input {
    text-align: center;
    font-weight: bold;
}

#distTotal {
    color: #007bff;
    font-size: 18px;
}

#distWarning {
    font-weight: bold;
    animation: warningPulse 1s infinite;
}

@keyframes warningPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Filter/Search Bar Area Styling */
.filter-bar {
    margin-bottom: 20px;
    padding: 0px 15px 0px 15px;
    background: #f5f7f9;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-container {
    margin: 20px 0 0 0;
    padding: 0px 15px 0px 15px;
    background: transparent;
    border: 1px solid #e5e7eb;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #333;
    font-size: 14px;
}

.pagination-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.page-number {
    padding: 8px 16px;
    background: white;
    border-radius: 4px;
    font-weight: 500;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-jump label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.error-message {
    color: #ff6b6b;
    padding: 20px;
    text-align: center;
    background: #ffe0e0;
    border-radius: 8px;
    margin: 20px;
}

/* Add spacing for pagination at top */
.pagination-top {
    margin-bottom: 20px;
    margin-top: 0;
}

/* Keep spacing for pagination at bottom */
.pagination-bottom {
    margin-top: 20px;
}

/* Optional: Make top pagination slightly smaller/more compact */
.pagination-top .pagination-info {
    font-size: 13px;
}

.pagination-top .pagination-buttons button {
    padding: 6px 12px;
    font-size: 13px;
}

/* ============================================
   REFUND MANAGEMENT STYLES
   ============================================ */

/* Refund Form Styles */
.refund-item-input {
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.refund-description-input {
    background: #f0f0f0;
    cursor: not-allowed;
}

.refund-line-row {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.refund-line-row:hover {
    background: #ffe0e0;
}

#refundLineItems thead th {
    background: #dc3545;
    color: white;
    padding: 10px;
    font-size: 13px;
}

#refundLineItems tbody td {
    padding: 8px;
    vertical-align: middle;
}

#refundLineItems tfoot td {
    background: #fff5f5;
    padding: 12px;
    border-top: 2px solid #dc3545;
}

/* Refund type badges */
.refund-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.refund-type-badge.full {
    background: #dc3545;
    color: white;
}

.refund-type-badge.partial {
    background: #ffc107;
    color: #333;
}

.refund-type-badge.item {
    background: #17a2b8;
    color: white;
}

/* Refund table row highlighting */
#refundsTable .table tbody tr:hover {
    background: #fff5f5;
    cursor: pointer;
}

/* ============================================
   COLLAPSIBLE TABLE ROWS
   ============================================ */

/* Header row that can be clicked to expand/collapse */
.transaction-header-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Actions cell should have default cursor */
.transaction-header-row .actions-cell {
    cursor: default;
}

.transaction-header-row:hover {
    background-color: #e8f4f8 !important;
}

.transaction-header-row td {
    font-weight: 600;
    position: relative;
}

/* Expanded state - different background color when drilled down */
.transaction-header-row.expanded {
    background-color: #c5e1f5 !important;
}

.transaction-header-row.expanded:hover {
    background-color: #b3d9f0 !important;
}

/* Expand/collapse indicator */
.collapse-indicator {
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #6366f1;
}

.transaction-header-row.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}

/* Detail rows container */
.transaction-details-row {
    background-color: #f8f9fa !important;
    transition: all 0.3s ease;
}

.transaction-details-row.hidden {
    display: none;
}

/* Detail lines table (nested inside detail row) */
.detail-lines-container {
    padding: 0px 24px;
    background-color: #f8f9fa;
    overflow-x: auto;
}

.details-container,
.detail-section,
#salesTable {
    overflow-x: auto;
}

#salesTableElement,
.detail-lines-table,
.sale-view-line-items-table {
    min-width: max-content;
}

.detail-lines-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.detail-lines-table thead {
    background-color: #e9ecef;
}

.detail-lines-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.detail-lines-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid #e9ecef;
}

.detail-lines-table tbody tr:last-child td {
    border-bottom: none;
}

.detail-lines-table tbody tr:hover {
    background-color: #f1f3f5;
}

/* ============================================
   PRODUCT VIEW TABS
   ============================================ */

.product-view-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.product-tab {
    flex: 1;
    padding: 16px 20px;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    position: relative;
    text-align: center;
}

.product-tab:hover {
    background: #f9fafb;
    color: #333;
}

.product-tab.active {
    color: #6366f1;
    background: #eef2ff;
    border-bottom-color: #6366f1;
}

/* ============================================
   CUSTOM CONFIRMATION MODAL
   ============================================ */
.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.confirm-modal.show {
    display: flex;
}

.confirm-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: confirmSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.confirm-modal-header {
    padding: 24px 28px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.confirm-modal-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.confirm-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.confirm-modal-body {
    padding: 28px;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

.confirm-modal-footer {
    padding: 20px 28px;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e5e7eb;
}

.confirm-modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.confirm-modal-btn-cancel {
    background: white;
    color: #666;
    border: 2px solid #d1d5db;
}

.confirm-modal-btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.confirm-modal-btn-confirm {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
}

.confirm-modal-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.confirm-modal-btn-confirm:active {
    transform: translateY(0);
}

@keyframes confirmSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.product-tab-icon {
    font-size: 18px;
    margin-right: 8px;
}

.product-tab-content {
    display: none;
}

.product-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Detail line summary footer */
.detail-lines-summary {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 4px;
    text-align: right;
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.detail-lines-summary span {
    margin-left: 20px;
}

/* Styling for different transaction types */
.transaction-header-row.sales-header {
    background-color: #e8f5e9;
}

.transaction-header-row.sales-header:hover {
    background-color: #c8e6c9 !important;
}

.transaction-header-row.purchase-header:active {
    background-color: #bbdefb !important;
}

.transaction-header-row.refund-header {
    background-color: #ffebee;
}

.transaction-header-row.refund-header:hover {
    background-color: #ffcdd2 !important;
}

.transaction-header-row.assembly-header {
    background-color: #fff3e0;
}

.transaction-header-row.assembly-header:hover {
    background-color: #ffe0b2 !important;
}

.transaction-header-row.bundle-header {
    background-color: #f3e5f5;
}

.transaction-header-row.bundle-header:hover {
    background-color: #e1bee7 !important;
}

/* Animation for smooth expand/collapse */
@keyframes expandRow {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.transaction-details-row:not(.hidden) {
    animation: expandRow 0.3s ease-out;
}

/* Refund condition indicators */
.condition-new {
    color: #28a745;
    font-weight: bold;
}

.condition-opened {
    color: #17a2b8;
    font-weight: bold;
}

.condition-damaged {
    color: #ffc107;
    font-weight: bold;
}

/* ============================================
   MASTER DATA VIEW SCREENS - ENHANCED STYLING
   ============================================ */

/* View field container - consistent spacing and visual hierarchy */
.view-field {
    margin-bottom: 0;
}

.view-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.view-field > div:not(label) {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    min-height: 38px;
    display: flex;
    align-items: center;
}

/* For value-only divs (no nested structure) */
.view-value {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    min-height: 38px;
    display: flex;
    align-items: center;
}

/* Special formatting for specific data types */
.view-value-code,
.view-field .item-code-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    border-color: #c7d2fe;
}

.view-value-currency {
    font-weight: 700;
    color: #059669;
}

.view-value-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
}

/* Grid layouts for view screens */
.view-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.view-grid-full {
    grid-column: 1 / -1;
}

.condition-defective {
    color: #dc3545;
    font-weight: bold;
}

/* Return to stock checkbox styling */
input[type="checkbox"][data-field="return_to_stock"] {
    accent-color: #28a745;
    cursor: pointer;
}

/* Refund stats cards */
.refund-stat-card {
    transition: transform 0.2s;
}

.refund-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

/* Refund filters section */
#refundFilters {
    padding: 15px;
    background: #fff5f5;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f8d7da;
}

/* Refund amount highlighting */
#refundGrandTotal {
    color: #dc3545;
}

#refundRestockingDisplay {
    color: #28a745;
    font-style: italic;
}

/* Refund modal specific styles */
#refundModal .card {
    border-left: 4px solid #dc3545;
}

#refundModal h4 {
    color: #dc3545;
    border-bottom: 2px solid #f8d7da;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Refund reason select styling */
select[name="refund_reason"] {
    border-left: 3px solid #dc3545;
}

/* Refund form required field indicators */
#refundForm input:required:invalid {
    border-left: 3px solid #ffc107;
}

#refundForm input:required:valid {
    border-left: 3px solid #28a745;
}

#refundForm select:required:invalid {
    border-left: 3px solid #ffc107;
}

#refundForm select:required:valid {
    border-left: 3px solid #28a745;
}

/* Refund action buttons */
button[data-refund-action] {
    transition: all 0.2s;
}

button[data-refund-action]:hover {
    transform: translateY(-1px);
}

/* Empty refund state */
.refund-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.refund-empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ============================================
   PRODUCT VIEW FORM STYLING OVERRIDES
   ============================================ */

.product-tab-content[data-tab-content="overview"] .form-group label,
.product-tab-content[data-tab-content="pricing"] .form-group label {
    margin-bottom: 5px;
}

.product-tab-content[data-tab-content="overview"] .form-group > div,
.product-tab-content[data-tab-content="pricing"] .form-group > div {
    padding: 8px;
	border-radius: 4px;
	border: 1px solid #ddd;
	display: block;
	font-weight: normal;
	color: #666;
}

/* Refund details view (for future expansion) */
.refund-detail-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.refund-detail-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.refund-timeline {
    position: relative;
    padding-left: 30px;
}

.refund-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dc3545;
}

.refund-timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.refund-timeline-item::before {
    content: '●';
    position: absolute;
    left: -24px;
    top: 0;
    color: #dc3545;
    font-size: 20px;
}

/* ============================================
   SCREEN-BASED NAVIGATION
   Replaces modal-based CRUD with full-screen navigation
   ============================================ */

/* Screen containers */
.content-section [data-screen] {
    display: none;
    animation: fadeIn 0.2s ease-in;
}

.content-section [data-screen]:first-child {
    display: block; /* Show list screen by default */
}

/* Screen header - top bar with back button and title */
.screen-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px 0 15px 0;
    border-bottom: 2px solid #e3e3e3;
}

.screen-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.screen-header .btn {
    margin: 0;
}

.sync-panel-header {
    margin-bottom: 8px;
    padding-top: 0;
}

.sync-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.sync-platform-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.sync-platform-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sync-platform-icon.sync-platform-text {
    background: #e8eefc;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sync-panel-description {
    margin-bottom: 20px;
}

.sync-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    flex-wrap: nowrap;
    padding-top: 10px;
    padding-bottom: 10px;
}

.sync-toolbar-left {
    display: flex;
    flex: 0 0 auto;
    min-width: 640px;
}

.sync-toolbar-right {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    gap: 14px;
}

.sync-toolbar-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
    align-items: start;
    width: 100%;
    max-width: 760px;
}

.sync-filter-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe3ea;
    border-radius: 12px;
    padding: 14px 16px;
    min-height: 100%;
}

.sync-filter-section-full {
    grid-column: 1 / -1;
}

.sync-filter-section-header {
    margin-bottom: 12px;
}

.sync-filter-section-header h3,
.sync-filter-subsection-header h4,
.sync-action-section-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.sync-filter-section-header p,
.sync-filter-subsection-header p,
.sync-action-section-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.sync-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
    align-items: start;
}

.sync-filter-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.woo-sync-section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.sync-filter-subsection {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
}

.sync-filter-subsection-header {
    margin-bottom: 12px;
}

.sync-subsection-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.sync-subsection-actions-header {
    margin-bottom: 12px;
}

.sync-subsection-actions-header h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}

.sync-subsection-actions-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.sync-filter-checkbox-field {
    align-self: center;
}

.sync-inline-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.sync-filter-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.sync-filter-help {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.sync-toolbar-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    width: 100%;
}

.sync-action-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe3ea;
    border-radius: 12px;
    padding: 14px 16px;
    min-width: 240px;
    flex: 1 1 260px;
}

.sync-action-section-header {
    margin-bottom: 12px;
}

.sync-action-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sync-action-group-secondary {
    margin-top: 10px;
}

.sync-toolbar-ebay-actions {
    display: contents;
}

.sync-toolbar-woo-actions {
    display: contents;
}

.sync-toolbar-side-panels {
    display: grid;
    gap: 14px;
    width: 100%;
}

.sync-filter-details summary {
    cursor: pointer;
    color: #1f2937;
    font-weight: 700;
    list-style: none;
}

.sync-filter-details summary::-webkit-details-marker {
    display: none;
}

.sync-filter-details[open] summary {
    margin-bottom: 12px;
}

.sync-toolbar-actions .btn,
.sync-toolbar-ebay-actions .btn,
.sync-toolbar-woo-actions .btn {
    width: auto;
}

.sync-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.sync-summary-card {
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 24px;
    border-radius: 16px;
}

.sync-summary-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 10px;
}

.sync-summary-value {
    font-size: 30px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
    word-break: break-word;
}

.sync-summary-card:nth-child(1) .sync-summary-value {
    color: #6366f1;
}

.sync-summary-card:nth-child(2) .sync-summary-value {
    color: #0891b2;
}

.sync-summary-card:nth-child(3) .sync-summary-value {
    color: #16a34a;
}

/* Screen content wrapper */
.screen-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* View screen - read-only detail view */
.screen-content .card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Detail grid layout for view screens */
.screen-content .card > div[style*="grid"] {
    padding: 20px 0;
}

.screen-content .card > div[style*="grid"] > div:nth-child(odd) {
    font-weight: 600;
    color: #666;
}

.screen-content .card > div[style*="grid"] > div:nth-child(even) {
    color: #333;
}

/* Form screens (add/edit) */
.screen-content form {
    background: white;
    padding: 0;
}

.screen-content form .form-group:last-of-type {
    margin-bottom: 0;
}

/* Action buttons in screens */
.screen-content .btn,
.screen-header .btn {
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.group-attribute-add-btn {
    min-width: 0 !important;
    width: fit-content;
    align-self: flex-start;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .screen-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .screen-content {
        padding: 0 15px;
    }

    .screen-content .card {
        padding: 20px;
    }

    .screen-content .card > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .sync-toolbar-filters,
    .sync-summary-grid,
    .sync-filter-grid,
    .woo-sync-section-grid {
        grid-template-columns: 1fr;
    }

    .sync-toolbar-left,
    .sync-toolbar-right {
        width: 100%;
        flex-basis: 100%;
        min-width: 0;
    }

    .sync-toolbar {
        flex-wrap: wrap;
    }

    .sync-toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .sync-toolbar-side-panels {
        width: 100%;
    }

    .sync-action-section {
        width: 100%;
        min-width: 0;
        flex-basis: 100%;
    }

    .sync-toolbar-ebay-actions {
        display: flex;
        width: 100%;
    }

    .sync-toolbar-woo-actions {
        display: flex;
        width: 100%;
    }

    .sync-toolbar-actions .btn,
    .sync-inline-actions .btn {
        width: 100%;
    }
}

/* Back button specific styling */
[data-nav-action="back"] {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

[data-nav-action="back"]:hover {
    background: #5a6268;
    transform: translateX(-2px);
}

[data-nav-action="back"]:active {
    transform: translateX(-1px);
}


/* ============================================
   TRACKING FIELDS HIGHLIGHTING (Import Manager)
   ============================================ */

/* Highlight tracking-related fields in import mapping table */
.tracking-field-row {
    background: linear-gradient(to right, #f0f9ff 0%, #ffffff 100%) !important;
    border-left: 3px solid #3b82f6;
}

.tracking-field-row:hover {
    background: linear-gradient(to right, #e0f2fe 0%, #f8fafc 100%) !important;
}

/* Unmapped required field styling */
.unmapped-row {
    background: #fff5f5 !important;
    border-left: 3px solid #ef4444;
}

.unmapped-row:hover {
    background: #ffe5e5 !important;
}

/* ============================================
   INACTIVE ITEM STYLING (Universal for all entities)
   ============================================ */

/* Universal inactive item styling for consistent appearance across all modules */
.item-inactive,
.product-inactive {
    background-color: #f9fafb !important;
}

.item-inactive:hover,
.product-inactive:hover {
    background-color: #f3f4f6 !important;
}

/* Inactive badge styling */
.badge.inactive {
    background-color: #6b7280;
    color: white;
}

/* Inactive item row in tables */
tr.item-inactive td,
tr.product-inactive td {
    color: #6b7280;
}

/* Inactive item in autocomplete/dropdowns */
.autocomplete-item.item-inactive,
.autocomplete-item.product-inactive {
    opacity: 0.6;
    background-color: #f9fafb;
    font-style: italic;
}

.autocomplete-item.item-inactive::after,
.autocomplete-item.product-inactive::after {
    content: " (Inactive)";
    color: #9ca3af;
    font-size: 0.85em;
    margin-left: 5px;
}


/* Pulse animation for unsaved changes */
@keyframes unsavedPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}


/* ============================================
   PRODUCT GROUP MANAGEMENT
   ============================================ */

/* Groups List */
.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.group-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.group-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.group-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.group-code-badge {
    background: #3b82f6;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.group-card-body {
    margin-bottom: 12px;
}

.group-stat {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

/* ============================================
   DATE INPUT ENHANCEMENTS
   ============================================ */

/* Make all date inputs fully clickable and improve UX */
input[type="date"] {
    cursor: pointer;
    position: relative;
    width: 100%;
    min-height: 38px;
}

/* Ensure the calendar picker icon is always visible and clickable */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Firefox date input */
input[type="date"]::-moz-calendar-picker-indicator {
    cursor: pointer;
}

/* Improve hover state for date inputs */
input[type="date"]:hover {
    border-color: #80bdff;
    background-color: #f8f9fa;
}

/* Active/focus state */
input[type="date"]:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.stat-label {
    color: #6b7280;
}

.stat-value {
    font-weight: 600;
    color: #1f2937;
}

.group-card-footer {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: #6b7280;
    margin-bottom: 8px;
}

.empty-state p {
    color: #9ca3af;
    margin-bottom: 20px;
}

/* Group Wizard */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 20px;
}

.wizard-step-indicator {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 10px;
}

.wizard-step-indicator::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: -1;
}

.wizard-step-indicator:last-child::after {
    display: none;
}

.wizard-step-indicator.active .step-number {
    background: #3b82f6;
    color: white;
}

.wizard-step-indicator.completed .step-number {
    background: #10b981;
    color: white;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-label {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    overflow: visible;
    display: block;
}

.wizard-step-indicator.active .step-label {
    color: #1f2937;
    font-weight: 600;
}

/* Ensure step indicators don't get squished */
#group-wizard-modal .wizard-steps {
    padding: 20px 30px;
    min-width: 400px;
}

#group-wizard-modal .wizard-step-indicator {
    min-width: 100px;
}

/* Wizard Content */
.wizard-step {
    padding: 20px;
}

.wizard-step h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1f2937;
}

.step-description {
    color: #6b7280;
    margin-bottom: 24px;
}

/* Variants Table */
.variants-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.variants-table-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

#variants-table {
    width: 100%;
    margin-bottom: 0;
}

#variants-table thead {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

#variants-table th {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    padding: 10px;
}

#variants-table td {
    padding: 8px;
    vertical-align: middle;
}

.variants-summary {
    padding: 12px;
    background: #f9fafb;
    border-radius: 4px;
    margin-top: 12px;
    text-align: right;
}

/* Attribute Fields */
.attributes-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid #afeeee;
    padding-left: 5px;
}

.attribute-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* New attribute input area - make it stand out */
.attribute-field.new-attribute {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 8px;
    margin-top: 4px;
}

/* Attribute name and value horizontal layout */
.attribute-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 4px;
}

.attribute-display .attribute-name-label {
    font-weight: 500;
    font-size: 12px;
    color: #4b5563;
    min-width: 80px;
}

.attribute-display .attribute-value-text {
    font-size: 12px;
    color: #1f2937;
    flex: 1;
}

.attribute-delete-btn {
    padding: 2px 6px;
    font-size: 16px;
    line-height: 1;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 0 !important;
    width: fit-content;
    flex-shrink: 0;
    font-weight: normal;
    justify-content: center;
}

.attribute-delete-btn:hover {
    background: #dc2626;
}

/* Ensure attribute fields have consistent layout */
.attribute-field .attribute-name-label,
.attribute-field label {
    min-width: 80px;
    max-width: 80px;
    flex-shrink: 0;
}

.attribute-field input.form-control {
    font-size: 11px;
}

.attribute-badge {
    display: inline-block;
    padding: 3px 8px;
    margin: 2px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Review Section */
.review-section {
    margin-bottom: 30px;
}

.review-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f2937;
}

.review-table {
    background: #f9fafb;
    font-size: 14px;
}

.review-table th {
    width: 200px;
    font-weight: 600;
    color: #6b7280;
    padding: 8px 12px;
}

.review-table td {
    color: #1f2937;
    padding: 8px 12px;
}

.variants-review-list {
    max-height: 300px;
    overflow-y: auto;
}

.variant-review-item {
    background: #f9fafb;
    border-left: 3px solid #3b82f6;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.variant-review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.variant-title {
    color: #6b7280;
    font-size: 13px;
}

.variant-attributes {
    margin: 6px 0;
}

.variant-pricing {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* Wizard Buttons */
.wizard-buttons {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Button Styles */
.btn-xs {
    padding: 2px 6px;
    font-size: 11px;
}

.btn-link {
    color: #3b82f6;
    text-decoration: none;
    background: none;
    border: none;
}

.btn-link:hover {
    text-decoration: underline;
}

.line-details-cell {
    position: relative;
    min-width: 72px;
    white-space: nowrap;
}

.line-details-trigger {
    padding: 0;
    font-size: 12px;
    white-space: nowrap;
}

#addSaleLineItems th:first-child,
#editSaleLineItems th:first-child,
#addPurchaseLineItems th:first-child,
#editPurchaseLineItems th:first-child {
    white-space: nowrap;
}

#addSaleLineItems td:nth-child(2),
#editSaleLineItems td:nth-child(2),
#addPurchaseLineItems td:nth-child(2),
#editPurchaseLineItems td:nth-child(2) {
    width: auto;
    min-width: 180px;
}

.line-item-code-input {
    min-width: 0;
    width: 100%;
}

.line-qty-input {
    min-width: 64px;
}

.line-unit-price-input,
.line-total-input {
    min-width: 78px;
}

.tracking-cell {
    white-space: nowrap;
}

@media (max-width: 1100px) {
    #addSaleLineItems,
    #editSaleLineItems,
    #addPurchaseLineItems,
    #editPurchaseLineItems {
        font-size: 13px;
    }

    #addSaleLineItems th,
    #editSaleLineItems th,
    #addPurchaseLineItems th,
    #editPurchaseLineItems th,
    #addSaleLineItems td,
    #editSaleLineItems td,
    #addPurchaseLineItems td,
    #editPurchaseLineItems td {
        padding-left: 6px;
        padding-right: 6px;
    }

    #addSaleLineItems th:nth-child(2),
    #editSaleLineItems th:nth-child(2),
    #addPurchaseLineItems th:nth-child(2),
    #editPurchaseLineItems th:nth-child(2),
    #addSaleLineItems td:nth-child(2),
    #editSaleLineItems td:nth-child(2),
    #addPurchaseLineItems td:nth-child(2),
    #editPurchaseLineItems td:nth-child(2) {
        min-width: 150px;
    }

    .line-details-cell {
        min-width: 58px;
    }

    .line-details-trigger {
        font-size: 11px;
    }

    .line-qty-input {
        min-width: 54px;
    }

    .line-unit-price-input,
    .line-total-input {
        min-width: 68px;
    }

    #addSaleLineItems .form-control,
    #editSaleLineItems .form-control,
    #addPurchaseLineItems .form-control,
    #editPurchaseLineItems .form-control {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 13px;
    }

    #addSaleLineItems .btn-small,
    #editSaleLineItems .btn-small,
    #addPurchaseLineItems .btn-small,
    #editPurchaseLineItems .btn-small {
        padding: 3px 7px;
        font-size: 11px;
    }

    .tracking-cell .tracking-info {
        font-size: 10px !important;
    }
}

@media (max-width: 900px) {
    #addSaleLineItems th:nth-child(2),
    #editSaleLineItems th:nth-child(2),
    #addPurchaseLineItems th:nth-child(2),
    #editPurchaseLineItems th:nth-child(2),
    #addSaleLineItems td:nth-child(2),
    #editSaleLineItems td:nth-child(2),
    #addPurchaseLineItems td:nth-child(2),
    #editPurchaseLineItems td:nth-child(2) {
        min-width: 130px;
    }

    .line-details-cell {
        min-width: 52px;
    }

    .line-qty-input {
        min-width: 48px;
    }

    .line-unit-price-input,
    .line-total-input {
        min-width: 60px;
    }

    #addSaleLineItems th,
    #editSaleLineItems th,
    #addPurchaseLineItems th,
    #editPurchaseLineItems th {
        font-size: 12px;
    }

    #addSaleLineItems .form-control,
    #editSaleLineItems .form-control,
    #addPurchaseLineItems .form-control,
    #editPurchaseLineItems .form-control {
        font-size: 12px;
    }
}

.line-details-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    width: 280px;
    max-width: min(280px, 70vw);
    padding: 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.line-details-popover[hidden] {
    display: none !important;
}

.line-details-section + .line-details-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.line-details-label {
    margin-bottom: 4px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.line-details-value {
    color: #111827;
    font-size: 13px;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
}

.line-details-empty {
    color: #9ca3af;
    font-style: italic;
}

.line-details-popover .sale-line-attributes,
.line-details-popover .purchase-line-attributes {
    display: block !important;
    min-width: 0 !important;
}

.line-details-popover .item-type-badge {
    display: inline-flex;
}

.sale-view-line-items-wrap {
    overflow-x: auto;
}

.sale-view-line-items-table th,
.sale-view-line-items-table td {
    padding: 7px 8px;
    vertical-align: top;
}

.sale-view-line-items-table .transaction-header-row:hover {
    background-color: #f5f7fa !important;
}

.sale-view-line-items-table .transaction-header-row.expanded {
    background-color: #eef2f6 !important;
}

.sale-view-line-items-table th {
    white-space: nowrap;
}

.sale-view-toggle-col {
    width: 34px;
    text-align: center;
}

.sale-view-line-number,
.sale-view-numeric-cell {
    white-space: nowrap;
}

.sale-view-item-code-cell {
    min-width: 120px;
}

.sale-view-item-code {
    font-weight: 700;
    line-height: 1.2;
}

.sale-view-group-row td {
    font-weight: 500;
}

.sale-view-group-row .sale-view-item-code,
.sale-view-group-row .sale-view-description-title {
    font-weight: 600;
}

.sale-view-group-row .sale-view-description-title {
    color: #374151;
}

.sale-view-group-row .sale-view-numeric-cell {
    color: #374151;
}

.sale-view-item-code-subtext {
    margin-top: 2px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.35;
}

.sale-view-description-cell {
    min-width: 280px;
}

.sale-view-attributes-cell {
    min-width: 180px;
}

.sale-view-description {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sale-view-description-title {
    font-size: 13px;
    line-height: 1.35;
    color: #1f2937;
}

.sale-view-description-title .product-image-inline-trigger {
    color: inherit;
    font-weight: 600;
    font-size: inherit;
    line-height: inherit;
    text-decoration: none;
}

.sale-view-description-title .product-image-inline-trigger:hover,
.sale-view-description-title .product-image-inline-trigger:focus-visible {
    color: #111827;
}

.sale-view-attribute-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sale-view-attribute-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: 1px solid #dbe3ea;
    border-radius: 999px;
    background: #f8fafc;
    font-size: 11px;
    line-height: 1.3;
    color: #475569;
}

.sale-view-attribute-chip__name {
    font-weight: 700;
    color: #64748b;
}

.sale-view-attribute-chip__value {
    color: #334155;
}

.sale-view-muted {
    font-size: 11px;
    color: #94a3b8;
}

.sale-view-row-toggle-btn {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: inherit;
}

.sale-view-row-toggle-btn .collapse-indicator {
    margin-right: 0;
    color: #64748b;
    font-size: 11px;
}

.sale-view-group-details-row td {
    padding: 0;
}

.sale-view-group-details-container {
    padding: 0 20px 12px 30px;
    border-left: 3px solid #d7dde5;
    margin-left: 10px;
}

.sale-view-group-detail-table {
    font-size: 12px;
    background: #fdfdfd;
}

.sale-view-group-detail-table td,
.sale-view-group-detail-table th {
    vertical-align: top;
}

.sale-view-group-detail-table thead {
    background: #f3f4f6;
}

.sale-view-group-detail-table tbody tr {
    background: transparent;
}

.sale-view-group-detail-table tbody tr:hover {
    background: #f8fafc;
}

.sale-view-child-description-cell .product-image-inline-trigger {
    color: inherit;
    font-size: inherit;
    font-weight: 600;
    text-decoration: none;
}

.sale-view-tracking-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.3;
}

.sale-view-tracking-badge--serial {
    background: #e0e7ff;
    color: #3730a3;
}

.sale-view-tracking-badge--expiry {
    background: #fef3c7;
    color: #92400e;
}

/* Modal Dialog Base */
.modal-dialog {
    width: 100%;
    margin: 20px auto;
    position: relative;
}

/* Modal Adjustments for Wizard */
#group-wizard-modal .modal-dialog {
    max-width: 95vw;
    width: 700px;
    max-height: 90vh;
    transition: width 0.3s ease;
}

/* Expand modal for Step 2 (variants) */
#group-wizard-modal.step-variants .modal-dialog {
    width: 1400px;
}

#group-wizard-modal .modal-content {
    max-width: none;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#group-wizard-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

#group-wizard-modal .wizard-step-content {
    max-height: calc(90vh - 250px);
    overflow-y: auto;
}

/* Variants table container */
#group-wizard-modal .variants-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(90vh - 400px);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
    width: 100%;
}

#group-wizard-modal .variants-table-container table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

#group-wizard-modal #variants-table {
    border-collapse: collapse;
}

#group-wizard-modal #variants-table th,
#group-wizard-modal #variants-table td {
    white-space: nowrap;
    padding: 8px 12px;
}

/* Column width specifications */
#group-wizard-modal #variants-table th:nth-child(1),
#group-wizard-modal #variants-table td:nth-child(1) {
    width: 40px;
    text-align: center;
}

#group-wizard-modal #variants-table th:nth-child(2),
#group-wizard-modal #variants-table td:nth-child(2) {
    min-width: 200px;
    width: 200px;
}

#group-wizard-modal #variants-table th:nth-child(3),
#group-wizard-modal #variants-table td:nth-child(3) {
    min-width: 180px;
}

#group-wizard-modal #variants-table th:nth-child(4),
#group-wizard-modal #variants-table td:nth-child(4) {
    min-width: 250px;
    max-width: 350px;
}

#group-wizard-modal #variants-table td:nth-child(4) {
    white-space: normal;
}

#group-wizard-modal #variants-table th:nth-child(5),
#group-wizard-modal #variants-table td:nth-child(5),
#group-wizard-modal #variants-table th:nth-child(6),
#group-wizard-modal #variants-table td:nth-child(6) {
    min-width: 120px;
}

#group-wizard-modal #variants-table th:nth-child(7),
#group-wizard-modal #variants-table td:nth-child(7) {
    width: 80px;
    text-align: center;
}

/* Wizard footer - always visible */
#group-wizard-modal .modal-footer.wizard-buttons {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    margin-top: 0;
    z-index: 20;
}

/* Ensure wizard step content has proper padding */
#group-wizard-modal .wizard-step {
    padding: 30px;
}

/* Small form inputs in variants table */
#variants-table .form-control-sm {
    font-size: 13px;
    padding: 6px 8px;
}

/* Attribute field inputs */
.attribute-field input {
    font-size: 12px;
}

/* Bundle components table - compact column widths */
#addBundleComponentsTable,
#editBundleComponentsTable {
    table-layout: fixed;
    width: 100%;
}

#addBundleComponentsTable th,
#addBundleComponentsTable td,
#editBundleComponentsTable th,
#editBundleComponentsTable td {
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#addBundleComponentsTable th,
#editBundleComponentsTable th {
    font-size: 12px;
}

#addBundleComponentsTable .form-control-sm,
#editBundleComponentsTable .form-control-sm {
    width: 100%;
    font-size: 13px;
    padding: 5px 6px;
}

/* Specific column widths for bundle components */
#addBundleComponentsTable th:nth-child(1),
#addBundleComponentsTable td:nth-child(1),
#editBundleComponentsTable th:nth-child(1),
#editBundleComponentsTable td:nth-child(1) {
    width: 40px;
    text-align: center;
}

#addBundleComponentsTable th:nth-child(2),
#addBundleComponentsTable td:nth-child(2),
#editBundleComponentsTable th:nth-child(2),
#editBundleComponentsTable td:nth-child(2) {
    width: 150px;
}

#addBundleComponentsTable th:nth-child(3),
#addBundleComponentsTable td:nth-child(3),
#editBundleComponentsTable th:nth-child(3),
#editBundleComponentsTable td:nth-child(3) {
    width: auto;
}

#addBundleComponentsTable th:nth-child(4),
#addBundleComponentsTable td:nth-child(4),
#editBundleComponentsTable th:nth-child(4),
#editBundleComponentsTable td:nth-child(4) {
    width: 85px;
}

#addBundleComponentsTable th:nth-child(5),
#addBundleComponentsTable td:nth-child(5),
#editBundleComponentsTable th:nth-child(5),
#editBundleComponentsTable td:nth-child(5) {
    width: 85px;
}

#addBundleComponentsTable th:nth-child(6),
#addBundleComponentsTable td:nth-child(6),
#editBundleComponentsTable th:nth-child(6),
#editBundleComponentsTable td:nth-child(6) {
    width: 85px;
}

#addBundleComponentsTable th:nth-child(7),
#addBundleComponentsTable td:nth-child(7),
#editBundleComponentsTable th:nth-child(7),
#editBundleComponentsTable td:nth-child(7) {
    width: 70px;
    text-align: center;
}

/* Control attribute input widths in variants table */
#group-wizard-modal #variants-table .variant-title {
    min-width: 300px;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1500px) {
    #group-wizard-modal.step-variants .modal-dialog {
        width: 90vw;
    }

    #group-wizard-modal .variants-table-container table {
        min-width: 1000px;
    }
}

@media (max-width: 800px) {
    #group-wizard-modal .modal-dialog {
        width: 95vw;
    }

    #group-wizard-modal.step-variants .modal-dialog {
        width: 95vw;
    }

    #group-wizard-modal .wizard-step {
        padding: 20px;
    }
}

/* ============================================
   PRODUCT GROUPS - VARIANT MANAGEMENT
   ============================================ */

/* Delete icon button for variant actions */
.btn-icon-delete {
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-icon-delete:active {
    background: #fecaca;
    transform: scale(0.95);
}

/* ============================================
   ACTIONS DROPDOWN COMPONENT
   ============================================ */

/* Dropdown Container */
.actions-dropdown {
    position: relative;
    display: inline-block;
}

/* Trigger Button */
.actions-dropdown-trigger {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #666;
    transition: all 0.2s ease;
    font-weight: bold;
    letter-spacing: 2px;
}

.actions-dropdown-trigger:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.actions-dropdown-trigger:active {
    transform: scale(0.95);
}

/* Dropdown Menu */
.actions-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #ffffff;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    min-width: 180px;
    max-height: 400px;
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 1;
}

/* Fixed positioning for dropdowns to avoid parent overflow clipping */
.actions-dropdown-menu.position-fixed {
    position: fixed;
}

/* Menu Item */
.actions-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.actions-dropdown-item:hover:not(:disabled) {
    background: #f9fafb;
}

.actions-dropdown-item:active:not(:disabled) {
    background: #f3f4f6;
}

.actions-dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Action Icon */
.actions-dropdown-item .action-icon {
    margin-right: 10px;
    font-size: 16px;
    display: inline-block;
    width: 20px;
    text-align: center;
}

/* Item Variants */
.actions-dropdown-item.success {
    color: #16a34a;
}

.actions-dropdown-item.success:hover:not(:disabled) {
    background: #f0fdf4;
}

.actions-dropdown-item.warning {
    color: #ea580c;
}

.actions-dropdown-item.warning:hover:not(:disabled) {
    background: #fff7ed;
}

.actions-dropdown-item.danger {
    color: #dc2626;
}

.actions-dropdown-item.danger:hover:not(:disabled) {
    background: #fef2f2;
}

/* Separator */
.actions-dropdown-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Position variants */
.actions-dropdown-menu.position-left {
    right: auto;
    left: 0;
}

.actions-dropdown-menu.position-top {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

/* ============================================
   COMPACT LEDGER TABLE THEME
   Inspired by dense investment statement tables: clearer bands,
   smaller row rhythm, and stronger parent/detail hierarchy.
   ============================================ */
:root {
    --ledger-border: #cbd4de;
    --ledger-border-light: #dbe2ea;
    --ledger-header-bg: #f2f5f7;
    --ledger-section-bg: #dce9f7;
    --ledger-parent-bg: #f7fbff;
    --ledger-parent-expanded-bg: #c7ddf2;
    --ledger-detail-bg: #edf4fb;
    --ledger-detail-alt: #dfeaf6;
    --ledger-total-bg: #dbeed9;
    --ledger-kit-bg: #fffdf1;
    --ledger-kit-expanded-bg: #eee6bf;
    --ledger-detail-even-bg: #fffdf1;
    --ledger-text: #1f2933;
    --ledger-muted: #657080;
    --ledger-accent: #1f5fd0;
}

.content-wrapper {
    padding: 18px;
    background: #f3f4f4;
}

.card {
    border-radius: 6px;
    border-color: var(--ledger-border);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: none;
}

.card:hover {
    box-shadow: none;
}

.card h3,
.card h4 {
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--ledger-border);
    color: #174ea6;
    font-size: 16px;
    font-weight: 500;
}

.stats-grid-row {
    gap: 8px !important;
}

.stat-card {
    border-radius: 4px;
    padding: 10px 14px;
    border-color: var(--ledger-border-light);
    box-shadow: none;
}

.stat-number {
    margin-bottom: 3px;
    font-size: 22px;
    line-height: 1.1;
}

.stat-label {
    color: var(--ledger-muted);
    font-size: 10px;
    letter-spacing: 0;
}

.btn {
    margin: 3px;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 13px;
    letter-spacing: 0;
    box-shadow: none;
}

.btn:hover {
    box-shadow: 0 2px 6px rgba(55, 65, 81, 0.14);
}

.btn.secondary {
    box-shadow: none;
}

.form-control {
    min-height: 30px;
    padding: 7px 10px;
    border: 1px solid var(--ledger-border-light);
    border-radius: 0;
    font-size: 13px;
}

.form-group label {
    margin-bottom: 5px;
    font-size: 12px;
    letter-spacing: 0;
}

.table,
.data-table,
#salesTableElement,
.detail-lines-table,
.sale-view-line-items-table,
.review-table {
    border: 1px solid var(--ledger-border);
    border-radius: 0;
    box-shadow: none;
    color: var(--ledger-text);
    font-size: 12px;
}

.table th,
.data-table th,
.detail-lines-table th,
.sale-view-line-items-table th,
.review-table th {
    padding: 4px 8px;
    background: var(--ledger-header-bg);
    border-bottom: 1px solid var(--ledger-border);
    color: #536171;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.25;
    text-transform: none;
}

.table td,
.data-table td,
.detail-lines-table td,
.sale-view-line-items-table td,
.review-table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--ledger-border-light);
    line-height: 1.25;
    vertical-align: middle;
}

.table tbody tr:nth-child(even):not(.transaction-details-row),
.detail-lines-table tbody tr:nth-child(even),
.sale-view-line-items-table tbody tr:nth-child(even):not(.transaction-details-row) {
    background: #f8fbff;
}

.table tbody tr:hover,
.detail-lines-table tbody tr:hover,
.sale-view-line-items-table tbody tr:hover {
    background: #edf5ff;
}

.table th[data-sort] {
    padding-right: 20px;
}

.table th[data-sort] .sort-indicator {
    right: 6px;
    font-size: 10px;
}

.transaction-header-row td {
    font-weight: 500;
}

.transaction-header-row.sale-header,
.transaction-header-row.sales-header,
.transaction-header-row.purchase-header,
.transaction-header-row.refund-header,
.transaction-header-row.assembly-header,
.transaction-header-row.bundle-header {
    background: var(--ledger-parent-bg);
}

.transaction-header-row.sale-header:hover,
.transaction-header-row.sales-header:hover,
.transaction-header-row.purchase-header:hover,
.transaction-header-row.refund-header:hover,
.transaction-header-row.assembly-header:hover,
.transaction-header-row.bundle-header:hover {
    background: #e9f3ff !important;
}

.transaction-header-row.expanded,
.transaction-header-row.sale-header.expanded,
.transaction-header-row.sales-header.expanded,
.transaction-header-row.purchase-header.expanded,
.transaction-header-row.refund-header.expanded,
.transaction-header-row.assembly-header.expanded,
.transaction-header-row.bundle-header.expanded {
    background: var(--ledger-parent-expanded-bg) !important;
}

.transaction-details-row,
.transaction-details-row > td {
    background: var(--ledger-detail-bg) !important;
}

.transaction-details-row > td {
    padding: 0;
}

.detail-lines-container,
.details-container {
    padding: 0 10px 8px;
    background: var(--ledger-detail-bg);
}

.detail-section {
    padding-top: 6px;
}

.detail-section-title {
    margin: 0;
    padding: 4px 8px;
    background: var(--ledger-section-bg);
    border: 1px solid var(--ledger-border);
    border-bottom: 0;
    color: #1f3f73;
    font-size: 12px;
    font-weight: 600;
}

.detail-section h5 {
    margin: 0;
    padding: 4px 8px;
    background: var(--ledger-section-bg);
    border: 1px solid var(--ledger-border);
    border-bottom: 0;
    color: #1f3f73;
    font-size: 12px;
    font-weight: 600;
}

.detail-section h5 + p {
    margin: 0;
    padding: 8px;
    border: 1px solid var(--ledger-border);
    background: #fff;
    color: #4b5563 !important;
    font-size: 12px;
    line-height: 1.4;
}

.detail-note {
    margin-top: 8px;
    border: 1px solid var(--ledger-border);
    background: #fff;
}

.detail-note-body {
    margin: 0;
    padding: 8px;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.detail-lines-table {
    background: #fff;
}

.detail-lines-table td,
.sale-view-line-items-table td {
    background: #fff;
}

.detail-lines-table tbody tr:nth-child(even) td,
.sale-view-line-items-table tbody tr:nth-child(even):not(.transaction-details-row) td {
    background: var(--ledger-detail-even-bg);
}

.sale-view-line-items-table tbody tr.sale-view-line-row.ledger-row-odd:not(.expanded) > td {
    background: #fff !important;
}

.sale-view-line-items-table tbody tr.sale-view-line-row.ledger-row-even:not(.expanded) > td {
    background: var(--ledger-detail-even-bg) !important;
}

.detail-lines-table thead {
    background: var(--ledger-header-bg);
}

.detail-lines-table th {
    border-bottom: 1px solid var(--ledger-border);
}

.detail-lines-table tbody tr:last-child td {
    border-bottom: 1px solid var(--ledger-border-light);
}

.detail-lines-summary {
    margin-top: 0;
    padding: 6px 8px;
    border: 1px solid var(--ledger-border);
    border-top: 0;
    border-radius: 0;
    background: var(--ledger-total-bg);
    box-shadow: none;
    font-size: 12px;
}

.collapse-indicator {
    margin-right: 5px;
    color: var(--ledger-accent);
    font-size: 10px;
}

.badge {
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1.2;
}

.actions-cell {
    width: 72px;
    white-space: nowrap;
}

.pagination-container {
    margin: 8px 0 0;
    padding: 6px 10px;
    border-color: var(--ledger-border);
}

.pagination-top {
    margin-bottom: 8px;
}

.pagination-bottom {
    margin-top: 8px;
}

.pagination-controls {
    gap: 8px;
}

.pagination-info {
    font-size: 12px;
}

.pagination-buttons {
    gap: 5px;
}

.page-number {
    padding: 5px 10px;
    border: 1px solid var(--ledger-border-light);
    border-radius: 3px;
    font-size: 12px;
}

#sales .card > div[style*="background: #f8f9fa"],
#purchases .card > div[style*="background: #f8f9fa"],
#refunds .card > div[style*="background: #f8f9fa"] {
    margin-bottom: 12px !important;
    padding: 8px 10px !important;
    border-color: var(--ledger-border) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

#sales .stats-grid-row {
    margin-bottom: 12px !important;
}

#salesTable,
#purchasesTable,
#refundsTable {
    border-color: var(--ledger-border) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

#salesTableElement td:nth-child(6),
#purchasesTableElement td:nth-child(6),
#refundsTableElement td:nth-child(6),
.detail-lines-table td:nth-last-child(-n + 3),
.sale-view-line-items-table td:nth-child(6),
.sale-view-line-items-table td:nth-child(7),
.sale-view-line-items-table td:nth-child(8) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sale-view-line-items-table th,
.sale-view-line-items-table td {
    padding: 4px 7px;
}

.sale-view-description-title {
    font-size: 12px;
    line-height: 1.25;
}

.sale-view-attribute-list {
    gap: 2px;
}

.sale-view-attribute-chip,
.sale-view-tracking-badge {
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

.sale-view-line-items-table .sale-view-group-row > td {
    border-top: 1px solid var(--ledger-border-light);
    border-bottom: 1px solid var(--ledger-border-light);
    font-weight: 600;
}

.sale-view-line-items-table .sale-view-group-row > td:first-child {
    border-left: 4px solid transparent;
}

.sale-view-line-items-table .sale-view-group-row:hover > td {
    background: #edf5ff !important;
}

.sale-view-line-items-table .sale-view-group-row.expanded > td {
    background: var(--ledger-kit-expanded-bg) !important;
    border-top-color: #d5c98e;
    border-bottom-color: #d5c98e;
}

.sale-view-line-items-table .sale-view-group-row.expanded > td:first-child {
    border-left-color: #b99a2e;
}

.sale-view-line-items-table .sale-view-group-row.expanded:hover > td {
    background: #e8ddb0 !important;
}

.sale-view-line-items-table .sale-view-group-row .sale-view-item-code,
.sale-view-line-items-table .sale-view-group-row .sale-view-description-title {
    color: #17395f;
    font-weight: 700;
}

.sale-view-line-items-table .sale-view-group-row .sale-view-numeric-cell {
    color: #17395f;
    font-weight: 700;
}

.sale-view-group-details-container {
    margin-left: 0;
    padding: 0 0 6px 18px;
    border-left: 2px solid var(--ledger-border);
}

.sale-view-group-details-row > td {
    background: var(--ledger-detail-alt) !important;
}

.screen-header {
    margin-bottom: 12px;
}

.screen-header h2 {
    font-size: 20px;
}

.screen-content .card {
    border-radius: 6px;
    padding: 16px;
}

.platform-workspace-shell {
    display: grid;
    gap: 16px;
}

.platform-workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.platform-workspace-eyebrow {
    margin-bottom: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.platform-workspace-header h2 {
    margin: 0 0 6px;
}

.platform-workspace-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.platform-workspace-switch,
.platform-workspace-tab,
.platform-workspace-action {
    border: 1px solid #d6dde8;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
}

.platform-workspace-switch {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 6px;
    font-weight: 700;
}

.platform-workspace-switch.is-active,
.platform-workspace-tab.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.platform-workspace-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
}

.platform-workspace-date {
    font-size: 16px !important;
    line-height: 1.2;
}

.platform-workspace-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.platform-workspace-sidebar {
    display: grid;
    gap: 8px;
}

.platform-workspace-tab {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: left;
    font-weight: 700;
}

.platform-workspace-panel {
    display: none;
}

.platform-workspace-panel.is-active {
    display: block;
}

.platform-workspace-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.platform-workspace-action {
    display: grid;
    gap: 6px;
    min-height: 116px;
    padding: 14px;
    border-radius: 6px;
    text-align: left;
}

.platform-workspace-action:hover:not(:disabled) {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.platform-workspace-action:disabled {
    cursor: not-allowed;
    opacity: 0.56;
}

.platform-workspace-action-title {
    font-size: 15px;
    font-weight: 800;
}

.platform-workspace-action-badge {
    justify-self: start;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e8f5e9;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
}

.platform-workspace-action-body {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.platform-workspace-detail {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.platform-workspace-sync-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
}

.platform-workspace-woo-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.platform-workspace-inline-actions {
    margin-top: 10px;
}

.platform-workspace-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.platform-workspace-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.platform-workspace-mini-metric {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
}

.platform-workspace-mini-value {
    color: #111827;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.platform-workspace-mini-label {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.platform-workspace-mini-metric-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.platform-workspace-mini-metric-warning {
    border-color: #fed7aa;
    background: #fff7ed;
}

.platform-workspace-mini-metric-danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.platform-workspace-note {
    display: grid;
    gap: 5px;
    padding: 12px;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e3a8a;
}

.platform-workspace-note-success {
    border-left-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}

.platform-workspace-note-warning {
    border-left-color: #f59e0b;
    background: #fff7ed;
    color: #9a3412;
}

.platform-workspace-note-danger {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.platform-workspace-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.platform-workspace-subtext {
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
}

.platform-workspace-error {
    grid-column: 1 / -1;
    padding: 14px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fef2f2;
    color: #991b1b;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 10px;
    }

    .card {
        padding: 10px;
    }

    .stat-number {
        font-size: 18px;
    }

    .table,
    .detail-lines-table,
    .sale-view-line-items-table {
        font-size: 11px;
    }

    .platform-workspace-status-grid,
    .platform-workspace-layout {
        grid-template-columns: 1fr;
    }

    .platform-workspace-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
