        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', sans-serif;
            background: #F8F9FA;
            color: #212529;
            min-height: 100vh;
        }
        .container {
            max-width: 512px;
            margin: 0 auto;
            background: #FFFFFF;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }
        .header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: #FFFFFF;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            z-index: 100;
        }
        .header-inner {
            max-width: 512px;
            margin: 0 auto;
            padding: 20px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .header-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .logo {
            width: 32px;
            height: 32px;
        }
        .header-title {
            font-size: 20px;
            font-weight: 500;
        }
        .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #E5E7EB;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 500;
            color: #374151;
        }
        .main {
            flex: 1;
            padding: 96px 16px 96px 16px;
        }
        .page { }
        .page-title {
            font-size: 30px;
            font-weight: 700;
            margin-bottom: 4px;
        }
        .page-subtitle {
            color: #6C757D;
            margin-bottom: 24px;
        }
        .dashboard-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-top: 24px;
        }
        @media (min-width: 512px) {
            .dashboard-grid {
                grid-template-columns: 1fr 1fr 1fr;
            }
        }
        .dashboard-card {
            padding: 16px;
            border-radius: 8px;
            cursor: pointer;
            transition: opacity 0.2s;
        }
        .dashboard-card:hover { opacity: 0.9; }
        .dashboard-card.green {
            background: #E9F5E3;
        }
        .dashboard-card.red {
            background: rgba(220, 53, 69, 0.1);
        }
        .dashboard-card.blue {
            background: rgba(0, 122, 255, 0.1);
        }
        .dashboard-number {
            font-size: 30px;
            font-weight: 700;
        }
        .dashboard-number.green { color: #556B2F; }
        .dashboard-number.red { color: #DC3545; }
        .dashboard-number.blue { color: #007AFF; }
        .dashboard-label {
            font-size: 14px;
            font-weight: 600;
            margin-top: 4px;
        }
        .dashboard-label.green { color: #556B2F; }
        .dashboard-label.red { color: #DC3545; }
        .dashboard-label.blue { color: #007AFF; }
        .section {
            margin-top: 32px;
        }
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }
        .section-title-group {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .section-title {
            font-size: 24px;
            font-weight: 700;
        }
        .section-count {
            font-size: 20px;
            font-weight: 600;
        }
        .section-desc {
            color: #6C757D;
            margin-bottom: 16px;
        }
        .progress-bar {
            width: 100%;
            height: 12px;
            background: #E5E7EB;
            border-radius: 999px;
            overflow: hidden;
            margin-bottom: 24px;
        }
        .progress-fill {
            height: 100%;
            background: #556B2F;
            border-radius: 999px;
            transition: width 0.3s;
        }
        .cards-container {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .card {
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        .card-header {
            padding: 20px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            transition: background 0.2s;
        }
        .card-header:hover { background: #F9FAFB; }
        .card-content {
            flex: 1;
        }
        .card-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }
        .card-supplier {
            font-weight: 700;
        }
        .card-price {
            font-weight: 500;
        }
        .card-cutoff {
            margin-bottom: 4px;
        }
        .card-delivery {
            font-size: 14px;
            color: #6C757D;
        }
        .badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 600;
            color: white;
            margin-top: 8px;
        }
        .badge.urgent { background: #DC3545; }
        .badge.upcoming { background: #FD7E14; }
        .badge.active { background: #28A745; }
        .badge.submitted { background: #007BFF; }
        .badge.delivered { background: #6C757D; }
        .expand-icon {
            font-family: 'Material Symbols Outlined';
            font-size: 24px;
            transition: transform 0.3s;
            margin-left: 16px;
        }
        .expand-icon.rotated {
            transform: rotate(180deg);
        }
        .card-body {
            border-top: 1px solid #F3F4F6;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
        }
        .card-body.expanded {
            max-height: 2000px;
        }
        .table-container {
            overflow-x: auto;
        }
        table {
            width: 100%;
            font-size: 14px;
        }
        thead {
            background: #F9FAFB;
        }
        th {
            padding: 8px 16px;
            text-align: left;
            font-size: 12px;
            font-weight: 600;
            color: #6C757D;
            text-transform: uppercase;
        }
        th.center { text-align: center; }
        td {
            padding: 12px 16px;
            border-bottom: 1px solid #F3F4F6;
        }
        td.center { text-align: center; }
        tbody tr:last-child td {
            border-bottom: none;
        }
        .product-name {
            font-weight: 500;
        }
        .product-desc {
            font-size: 12px;
            color: #6C757D;
            margin-top: 2px;
        }
        .qty-control {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .qty-btn {
            width: 32px;
            height: 32px;
            background: #F3F4F6;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }
        .qty-btn:hover { background: #E5E7EB; }
        .qty-btn:active { background: #D1D5DB; }
        .qty-input {
            width: 48px;
            text-align: center;
            padding: 6px;
            border: 1px solid #D1D5DB;
            border-radius: 8px;
            font-size: 14px;
        }
        .qty-input:focus {
            outline: none;
            border-color: #556B2F;
        }
        .submit-btn {
            width: 100%;
            padding: 12px 24px;
            background: #556B2F;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.2s;
            margin: 20px;
            width: calc(100% - 40px);
        }
        .submit-btn:hover {
            opacity: 0.9;
        }
        .message-card {
            background: white;
            padding: 16px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            transition: box-shadow 0.2s;
        }
        .message-card:hover {
            box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        }
        .message-card.unread {
            border-left: 4px solid #556B2F;
        }
        .message-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 4px;
        }
        .message-from {
            font-weight: 700;
        }
        .message-date {
            font-size: 12px;
            color: #6C757D;
        }
        .message-subject {
            font-size: 14px;
            color: #6C757D;
        }
        .invoice-card {
            background: white;
            padding: 16px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: box-shadow 0.2s;
        }
        .invoice-card:hover {
            box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        }
        .invoice-supplier {
            font-weight: 700;
        }
        .invoice-due {
            font-size: 14px;
            color: #6C757D;
        }
        .invoice-amount {
            font-weight: 700;
            text-align: right;
        }
        .invoice-amount.overdue {
            color: #DC3545;
        }
        /* Invoice Table View */
        .invoice-table {
            width: 100%;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .invoice-table table {
            width: 100%;
            border-collapse: collapse;
        }
        .invoice-table thead {
            background: #F8F9FA;
        }
        .invoice-table th {
            padding: 12px 16px;
            text-align: left;
            font-size: 12px;
            font-weight: 600;
            color: #6C757D;
            text-transform: uppercase;
            border-bottom: 2px solid #DEE2E6;
        }
        .invoice-table td {
            padding: 14px 16px;
            border-bottom: 1px solid #F1F3F5;
            font-size: 14px;
        }
        .invoice-table tbody tr {
            cursor: pointer;
            transition: background 0.2s;
        }
        .invoice-table tbody tr:hover {
            background: #F8F9FA;
        }
        .invoice-table tbody tr:last-child td {
            border-bottom: none;
        }
        .view-toggle-btn {
            padding: 8px 12px;
            background: white;
            border: 1px solid #DEE2E6;
            border-radius: 6px;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .view-toggle-btn:hover {
            background: #F8F9FA;
        }
        .view-toggle-btn.active {
            background: #007BFF;
            color: white;
            border-color: #007BFF;
        }
        .settings-card {
            background: white;
            padding: 16px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .form-group {
            margin-bottom: 16px;
        }
        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 500;
            color: #6C757D;
            margin-bottom: 4px;
        }
        .form-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #D1D5DB;
            border-radius: 8px;
            font-size: 16px;
            font-family: 'Inter', sans-serif;
        }
        .form-input:focus {
            outline: none;
            border-color: #556B2F;
        }
        .logout-btn {
            width: 100%;
            padding: 12px;
            background: #DC3545;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 24px;
            transition: opacity 0.2s;
        }
        .logout-btn:hover {
            opacity: 0.9;
        }

        /* Settings Tabs */
        .settings-tabs {
            display: flex;
            gap: 8px;
            margin-top: 16px;
            padding: 0 16px;
            border-bottom: 1px solid #E5E7EB;
        }
        .settings-tab {
            flex: 1;
            padding: 12px 16px;
            background: none;
            border: none;
            border-bottom: 3px solid transparent;
            font-size: 14px;
            font-weight: 500;
            color: #6B7280;
            cursor: pointer;
            transition: all 0.2s;
        }
        .settings-tab.active {
            color: #556B2F;
            border-bottom-color: #556B2F;
        }
        .settings-tab:hover {
            color: #556B2F;
            background: #F9FAFB;
        }
        .settings-tab-content {
            padding: 16px;
        }
        .settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        .settings-subtitle {
            font-size: 18px;
            font-weight: 600;
            color: #111827;
        }

        /* Users List */
        .users-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .user-card {
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 8px;
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }
        .user-info {
            flex: 1;
        }
        .user-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }
        .user-name {
            font-size: 16px;
            font-weight: 600;
            color: #111827;
        }
        .role-badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
        }
        .role-badge.role-sysadmin {
            background: #FDE2E4;
            color: #991B1B;
        }
        .role-badge.role-owner {
            background: #FEF3C7;
            color: #92400E;
        }
        .role-badge.role-manager {
            background: #DBEAFE;
            color: #1E40AF;
        }
        .role-badge.role-finance {
            background: #D1FAE5;
            color: #065F46;
        }
        .role-badge.role-supervisor {
            background: #FED7AA;
            color: #9A3412;
        }
        .role-badge.role-staff {
            background: #E5E7EB;
            color: #374151;
        }
        .user-details {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 8px;
        }
        .user-email {
            font-size: 14px;
            color: #6B7280;
        }
        .user-phone {
            font-size: 13px;
            color: #9CA3AF;
        }
        .user-locations {
            font-size: 13px;
            color: #6B7280;
        }
        .label-small {
            font-weight: 600;
            margin-right: 4px;
        }
        .user-actions {
            display: flex;
            gap: 8px;
        }

        /* Sales Reps List */
        .sales-reps-list {
            display: flex;
            flex-direction: column;
            gap: 24px;
        }
        .supplier-group {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .supplier-name {
            font-size: 16px;
            font-weight: 700;
            color: #111827;
            padding-bottom: 8px;
            border-bottom: 2px solid #556B2F;
        }
        .sales-rep-card {
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 8px;
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }
        .sales-rep-info {
            flex: 1;
        }
        .sales-rep-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
        }
        .sales-rep-name {
            font-size: 16px;
            font-weight: 600;
            color: #111827;
        }
        .primary-badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            background: #DCFCE7;
            color: #166534;
        }
        .sales-rep-details {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .detail-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            color: #6B7280;
        }
        .detail-icon {
            font-size: 18px;
            color: #9CA3AF;
        }
        .sales-rep-actions {
            display: flex;
            gap: 8px;
        }

        /* Buttons */
        .btn-primary {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 8px 16px;
            background: #556B2F;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.2s;
        }
        .btn-primary:hover {
            opacity: 0.9;
        }
        .btn-icon {
            padding: 6px;
            background: #F3F4F6;
            color: #6B7280;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .btn-icon:hover {
            background: #E5E7EB;
            color: #111827;
        }
        .btn-icon.btn-danger {
            color: #DC2626;
        }
        .btn-icon.btn-danger:hover {
            background: #FEE2E2;
        }
        .btn-icon .material-symbols-outlined {
            font-size: 20px;
        }

        /* Empty State */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 16px;
            color: #9CA3AF;
        }
        .empty-state .material-symbols-outlined {
            font-size: 48px;
            margin-bottom: 12px;
        }
        .empty-state p {
            font-size: 14px;
            font-weight: 500;
        }

        .nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
            z-index: 10;
        }
        .nav-inner {
            max-width: 512px;
            margin: 0 auto;
            display: flex;
            justify-content: space-around;
            padding: 4px;
        }
        .nav-btn {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 8px 16px;
            background: none;
            border: none;
            color: #6C757D;
            cursor: pointer;
            border-radius: 999px;
            transition: all 0.2s;
            position: relative;
        }
        .nav-btn:hover {
            color: #556B2F;
        }
        .nav-btn.active {
            background: #E9F5E3;
            color: #556B2F;
        }
        .nav-icon {
            font-family: 'Material Symbols Outlined';
            font-size: 24px;
        }
        .nav-btn.active .nav-icon {
            font-variation-settings: 'FILL' 1;
        }
        .nav-label {
            font-size: 12px;
            font-weight: 500;
        }
        .nav-badge {
            position: absolute;
            top: 4px;
            right: 14px;
            background: #DC3545;
            color: white;
            font-size: 10px;
            font-weight: 700;
            min-width: 16px;
            height: 16px;
            border-radius: 10px;
            padding: 0 4px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .nav-badge.blue {
            background: #007AFF;
        }
        .empty-state {
            text-align: center;
            padding: 32px 16px;
            color: #6C757D;
        }
        .material-symbols-outlined {
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
        }
        .simple-card {
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .simple-card.faded {
            opacity: 0.75;
        }
        .toggle-zero-qty-btn {
            width: 100%;
            padding: 10px 16px;
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #6C757D;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s;
            font-family: 'Inter', sans-serif;
        }
        .toggle-zero-qty-btn:hover {
            background: #F9FAFB;
            border-color: #D1D5DB;
        }
        .toggle-zero-qty-btn.active {
            background: #E9F5E3;
            border-color: #556B2F;
            color: #556B2F;
        }
        .toggle-zero-qty-btn.active:hover {
            background: #dcefd0;
        }

        /* Invoice-specific styles */
        .add-invoice-btn {
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, #556B2F 0%, #6B8E3C 100%);
            color: white;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 4px 12px rgba(85, 107, 47, 0.3);
            border: none;
            cursor: pointer;
            transition: all 0.2s;
            font-family: 'Inter', sans-serif;
        }
        .add-invoice-btn:hover {
            background: linear-gradient(135deg, #6B8E3C 0%, #556B2F 100%);
            box-shadow: 0 6px 16px rgba(85, 107, 47, 0.4);
            transform: translateY(-2px);
        }
        .add-invoice-btn:active {
            transform: translateY(0);
        }
        .upload-progress-card {
            background: white;
            padding: 16px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            margin-bottom: 24px;
        }
        .upload-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            font-weight: 600;
        }
        .invoice-review-card {
            background: white;
            padding: 16px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            transition: box-shadow 0.2s;
            margin-bottom: 12px;
        }
        .invoice-review-card:hover {
            box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        }
        .review-card-content {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .spinning {
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }
        .retry-btn {
            padding: 8px 16px;
            background: #DC3545;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 8px;
            font-family: 'Inter', sans-serif;
        }
        .retry-btn:hover {
            opacity: 0.9;
        }
        /* Login Screen */
        .login-container {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            padding: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .login-card {
            background: white;
            border-radius: 16px;
            padding: 40px;
            max-width: 400px;
            width: 100%;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
        }
        .login-header {
            text-align: center;
            margin-bottom: 32px;
        }
        .login-logo {
            width: 64px;
            height: 64px;
            margin: 0 auto 16px;
            border-radius: 12px;
        }
        .login-title {
            font-size: 24px;
            font-weight: 700;
            color: #212529;
            margin-bottom: 8px;
        }
        .login-subtitle {
            font-size: 14px;
            color: #6C757D;
        }
        .login-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .form-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .form-label {
            font-size: 14px;
            font-weight: 600;
            color: #495057;
        }
        .form-input {
            padding: 12px 16px;
            border: 1px solid #DEE2E6;
            border-radius: 8px;
            font-size: 14px;
            font-family: 'Inter', sans-serif;
            transition: all 0.2s;
        }
        .form-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        .login-button {
            padding: 14px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 8px;
        }
        .login-button:hover {
            background: #5568d3;
        }
        .login-button:disabled {
            background: #CED4DA;
            cursor: not-allowed;
        }
        .login-error {
            background: #fee;
            border: 1px solid #fcc;
            color: #c33;
            padding: 12px;
            border-radius: 8px;
            font-size: 14px;
        }

        /* Review Modal */
        .review-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            overflow-y: auto;
        }
        .review-modal {
            background: white;
            width: 100%;
            max-width: 900px;
            max-height: 90vh;
            border-radius: 16px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            margin: auto;
        }
        .form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
        @media (max-width: 768px) {
            .review-modal {
                max-width: 100%;
                max-height: 95vh;
                border-radius: 12px;
            }
            .review-modal-overlay {
                padding: 8px;
                align-items: flex-start;
            }
            .form-grid {
                grid-template-columns: 1fr;
                gap: 0;
            }
            /* Invoice table: hide on mobile, show cards instead */
            .invoice-table {
                overflow-x: auto;
            }
            .invoice-table th,
            .invoice-table td {
                padding: 10px 8px;
                font-size: 13px;
            }
            /* View toggle buttons: stack on small screens */
            .view-toggle-btn {
                font-size: 13px;
                padding: 6px 10px;
            }
            /* Bulk action toolbar: stack buttons vertically */
            .bulk-action-toolbar {
                flex-direction: column !important;
                align-items: stretch !important;
            }
            .bulk-action-toolbar > div {
                width: 100%;
                justify-content: center;
            }
        }
        .review-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid #DEE2E6;
        }
        .review-modal-title {
            font-size: 18px;
            font-weight: 700;
            color: #212529;
        }
        .review-modal-close {
            background: none;
            border: none;
            font-size: 24px;
            color: #6C757D;
            cursor: pointer;
            padding: 4px;
        }
        .review-modal-body {
            display: flex;
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
        }
        .review-image-panel {
            flex: 1;
            background: #F8F9FA;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            overflow: auto;
        }
        .review-image {
            max-width: 100%;
            max-height: 100%;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        .review-data-panel {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
        }
        .review-field {
            margin-bottom: 20px;
        }
        .review-field-label {
            font-size: 12px;
            font-weight: 600;
            color: #6C757D;
            text-transform: uppercase;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .review-field-value {
            font-size: 16px;
            color: #212529;
            padding: 10px 12px;
            background: #F8F9FA;
            border-radius: 6px;
            border: 1px solid transparent;
            cursor: pointer;
            transition: all 0.2s;
        }
        .review-field-value:hover {
            background: #E9ECEF;
        }
        .review-field-value.editing {
            background: white;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        .review-field-input {
            width: 100%;
            padding: 10px 12px;
            font-size: 16px;
            border: 1px solid #667eea;
            border-radius: 6px;
            font-family: 'Inter', sans-serif;
        }
        .confidence-dots {
            display: flex;
            gap: 4px;
        }
        .confidence-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #DEE2E6;
        }
        .confidence-dot.filled {
            background: #28A745;
        }
        .confidence-dot.filled.medium {
            background: #FFC107;
        }
        .confidence-dot.filled.low {
            background: #DC3545;
        }
        .review-modal-footer {
            padding: 16px 20px;
            border-top: 1px solid #DEE2E6;
            display: flex;
            gap: 12px;
            justify-content: flex-end;
        }
        .review-btn {
            padding: 12px 24px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 14px;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
        }
        .review-btn-secondary {
            background: #E9ECEF;
            color: #495057;
        }
        .review-btn-secondary:hover {
            background: #DEE2E6;
        }
        .review-btn-primary {
            background: #28A745;
            color: white;
        }
        .review-btn-primary:hover {
            background: #218838;
        }
        .review-btn-icon {
            border: none;
            background: transparent;
            color: #0066CC;
            cursor: pointer;
            padding: 4px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .review-btn-icon:hover {
            opacity: 0.8;
        }
        .review-items-summary {
            background: #F8F9FA;
            padding: 12px;
            border-radius: 6px;
            margin-top: 8px;
        }
        .review-items-count {
            font-size: 14px;
            color: #495057;
        }
        @media (max-width: 768px) {
            .review-modal-body {
                flex-direction: column;
            }
            .review-image-panel {
                max-height: 40vh;
            }
        }

        /* Messages Page Styles */

        /* Section Switcher */
        .messages-section-switcher {
            display: flex;
            background: #F9FAFB;
            border-bottom: 2px solid #E5E7EB;
            padding: 8px;
            gap: 8px;
            max-width: 512px;
            margin: 0 auto;
        }
        .message-section-tab {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 16px;
            border: none;
            border-radius: 10px;
            background: transparent;
            color: #6B7280;
            font-weight: 600;
            font-size: 15px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }
        .message-section-tab:hover {
            background: rgba(0, 0, 0, 0.05);
        }
        .message-section-tab.active.internal-theme {
            background: linear-gradient(135deg, #6B8E3C 0%, #556B2F 100%);
            color: white;
            box-shadow: 0 2px 8px rgba(85, 107, 47, 0.3);
        }
        .message-section-tab.active.sms-theme {
            background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
            color: white;
            box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
        }
        .message-section-tab.active.external-theme {
            background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
            color: white;
            box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
        }
        .message-section-tab .material-symbols-outlined {
            font-size: 20px;
        }
        .section-badge {
            position: absolute;
            top: 4px;
            right: 8px;
            min-width: 20px;
            height: 20px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            padding: 0 6px;
            color: white;
        }
        .section-badge.internal {
            background: #DC2626;
        }
        .section-badge.sms {
            background: #DC2626;
        }
        .section-badge.external {
            background: #DC2626;
        }

        /* Online Status Dot */
        .online-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #10B981;
            border: 2px solid white;
            position: absolute;
            bottom: 0;
            right: 0;
            box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
        }

        /* Color Theming */
        .compose-btn.internal {
            background: linear-gradient(135deg, #6B8E3C 0%, #556B2F 100%);
            box-shadow: 0 2px 8px rgba(107, 142, 60, 0.3);
        }
        .compose-btn.sms {
            background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
            box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
        }
        .supplier-avatar.internal {
            background: linear-gradient(135deg, #6B8E3C 0%, #556B2F 100%);
        }
        .supplier-avatar.sms {
            background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
        }
        .unread-indicator.internal {
            background: #556B2F;
            box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.1);
        }
        .unread-indicator.sms {
            background: #0EA5E9;
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
        }
        .supplier-conversation-item.internal-theme.active {
            background: linear-gradient(90deg, #E7F3FF 0%, #F0F8FF 100%);
            border-left: 3px solid #556B2F;
        }
        .supplier-conversation-item.sms-theme.active {
            background: linear-gradient(90deg, #E0F2FE 0%, #F0F9FF 100%);
            border-left: 3px solid #0EA5E9;
        }
        .supplier-conversation-item.external-theme.active {
            background: linear-gradient(90deg, #E0F2FE 0%, #F0F9FF 100%);
            border-left: 3px solid #0EA5E9;
        }
        .message-bubble.internal-theme.outbound {
            background: linear-gradient(135deg, #6B8E3C 0%, #556B2F 100%);
            color: white;
        }
        .message-bubble.sms-theme.outbound {
            background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
            color: white;
        }
        .message-bubble.external-theme.outbound {
            background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
            color: white;
        }
        .messages-send-btn.internal {
            background: linear-gradient(135deg, #6B8E3C 0%, #556B2F 100%);
        }
        .messages-send-btn.sms {
            background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
        }
        .message-status {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            margin-top: 4px;
        }

        .messages-container {
            display: flex;
            height: calc(100% - 60px);
            width: 100%;
            max-width: 512px;
            margin: 0 auto;
            background: white;
            position: relative;
        }
        .messages-sidebar {
            width: 100%;
            border-right: 1px solid #E5E7EB;
            display: flex;
            flex-direction: column;
            background: white;
            transition: transform 0.3s ease;
        }
        .messages-sidebar.hidden-mobile {
            transform: translateX(-100%);
            position: absolute;
            height: 100%;
        }
        .messages-sidebar-header {
            padding: 20px 16px;
            border-bottom: 1px solid #E5E7EB;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: white;
        }
        .compose-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #6B8E3C 0%, #556B2F 100%);
            border: none;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 2px 8px rgba(107, 142, 60, 0.3);
        }
        .compose-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(107, 142, 60, 0.4);
        }
        .compose-btn:active {
            transform: scale(0.95);
        }
        .compose-btn .material-symbols-outlined {
            font-size: 20px;
        }
        .supplier-list {
            flex: 1;
            overflow-y: auto;
        }
        .supplier-conversation-item {
            padding: 16px;
            border-bottom: 1px solid #F3F4F6;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: all 0.2s ease;
            position: relative;
        }
        .supplier-conversation-item:hover {
            background: #F9FAFB;
        }
        .supplier-conversation-item.active {
            background: linear-gradient(90deg, #E7F3FF 0%, #F0F8FF 100%);
            border-left: 3px solid #556B2F;
        }
        .supplier-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, #6B8E3C 0%, #556B2F 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 16px;
            flex-shrink: 0;
            box-shadow: 0 2px 8px rgba(107, 142, 60, 0.2);
        }
        .supplier-conversation-content {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .supplier-conversation-header {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            gap: 8px;
        }
        .supplier-conversation-name {
            font-weight: 600;
            font-size: 15px;
            color: #1F2937;
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .supplier-conversation-time {
            font-size: 12px;
            color: #9CA3AF;
            flex-shrink: 0;
            font-weight: 500;
        }
        .supplier-conversation-bottom {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
        }
        .supplier-conversation-preview {
            font-size: 13px;
            color: #6B7280;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }
        .supplier-conversation-preview.unread {
            color: #1F2937;
            font-weight: 600;
        }
        .unread-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #556B2F;
            flex-shrink: 0;
            box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.1);
        }
        .messages-thread-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: white;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            transform: translateX(100%);
            transition: transform 0.3s ease;
        }
        .messages-thread-panel.visible-mobile {
            transform: translateX(0);
        }
        .messages-empty-state {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .messages-thread {
            display: flex;
            flex-direction: column;
            height: 100%;
        }
        .messages-thread-header {
            padding: 20px 16px;
            border-bottom: 1px solid #E5E7EB;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
        }
        .messages-thread-header-left {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
        }
        .messages-back-btn {
            background: transparent;
            border: none;
            color: #556B2F;
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }
        .messages-back-btn:hover {
            background: #F3F4F6;
        }
        .messages-thread-supplier {
            font-weight: 600;
            font-size: 16px;
            color: #1F2937;
        }
        .messages-thread-rep {
            font-size: 13px;
            color: #6B7280;
            margin-top: 2px;
        }
        .messages-thread-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px 8px;
            background: #FFFFFF;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .message-group {
            display: flex;
            flex-direction: column;
            gap: 2px;
            margin-bottom: 16px;
        }
        .message-group.outbound {
            align-items: flex-end;
        }
        .message-group.inbound {
            align-items: flex-start;
        }
        .message-sender-label {
            font-size: 13px;
            color: #8E8E93;
            margin: 4px 0 4px 12px;
            font-weight: 500;
        }
        .message-bubble-container {
            display: flex;
            flex-direction: column;
            max-width: 75%;
            gap: 4px;
        }
        .message-bubble {
            padding: 8px 14px;
            border-radius: 18px;
            position: relative;
            box-shadow: 0 0.5px 2px rgba(0,0,0,0.08);
        }
        .message-bubble.outbound {
            background: #34C759;
            color: white;
        }
        .message-bubble.inbound {
            background: #E9E9EB;
            color: #000000;
        }
        .message-bubble.first.outbound {
            border-bottom-right-radius: 4px;
        }
        .message-bubble.first.inbound {
            border-bottom-left-radius: 4px;
        }
        .message-bubble-body {
            font-size: 17px;
            line-height: 1.35;
            white-space: pre-wrap;
            word-wrap: break-word;
            letter-spacing: -0.4px;
        }
        .message-timestamp {
            text-align: center;
            font-size: 13px;
            color: #8E8E93;
            margin: 16px 0 8px 0;
        }
        .date-divider {
            text-align: center;
            font-size: 13px;
            font-weight: 500;
            color: #8E8E93;
            margin: 20px 0 12px 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .message-bubble-order-link {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid rgba(255,255,255,0.2);
        }
        .message-bubble.inbound .message-bubble-order-link {
            border-top-color: #E5E7EB;
        }
        .message-bubble-order-link a {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: inherit;
            text-decoration: none;
            opacity: 0.9;
        }
        .message-bubble-order-link a:hover {
            text-decoration: underline;
        }
        .message-bubble-status {
            margin-top: 4px;
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .messages-reply-container {
            border-top: 0.5px solid #E5E7EB;
            background: #F7F7F7;
            padding: 8px;
        }
        .messages-reply-input-wrapper {
            display: flex;
            gap: 6px;
            align-items: flex-end;
            background: white;
            border-radius: 22px;
            padding: 6px 6px 6px 14px;
            border: 1px solid #D1D5DB;
        }
        .messages-reply-textarea {
            flex: 1;
            padding: 6px 0;
            border: none;
            font-family: inherit;
            font-size: 17px;
            resize: none;
            min-height: 22px;
            max-height: 100px;
            line-height: 1.35;
            background: transparent;
        }
        .messages-reply-textarea:focus {
            outline: none;
        }
        .messages-send-btn {
            background: #34C759;
            color: white;
            border: none;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        .messages-send-btn:hover:not(:disabled) {
            background: #2FB350;
            transform: scale(1.05);
        }
        .messages-send-btn:disabled {
            background: #C7C7CC;
            cursor: not-allowed;
            opacity: 0.5;
        }
        .messages-send-btn .material-symbols-outlined {
            font-size: 18px;
            transform: rotate(-45deg);
        }
        .icon-btn {
            background: transparent;
            border: none;
            color: #6B7280;
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }
        .icon-btn:hover {
            background: #F3F4F6;
        }

        /* Modal Styles */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.75);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            overflow-y: auto;
        }
        .modal-content {
            background: white;
            width: 100%;
            max-width: 500px;
            border-radius: 16px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 24px;
            border-bottom: 1px solid #E5E7EB;
        }
        .modal-title {
            font-size: 20px;
            font-weight: 700;
            color: #111827;
            margin: 0;
        }
        .modal-close-btn {
            background: transparent;
            border: none;
            color: #6B7280;
            cursor: pointer;
            padding: 8px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .modal-close-btn:hover {
            background: #F3F4F6;
            color: #111827;
        }
        .modal-body {
            padding: 24px;
            overflow-y: auto;
            max-height: calc(90vh - 160px);
        }
        @media (max-width: 768px) {
            .modal-overlay {
                padding: 8px;
                align-items: flex-start;
            }
            .modal-content {
                max-width: 100%;
                border-radius: 12px;
            }
            .modal-header {
                padding: 16px 20px;
            }
            .modal-body {
                padding: 20px;
                max-height: calc(95vh - 140px);
            }
        }

        /* Product Correction Styles */
        .correction-badge {
            font-size: 10px;
            color: #28A745;
            background: #D4EDDA;
            border: 1px solid #C3E6CB;
            padding: 2px 6px;
            border-radius: 3px;
            margin-left: 6px;
            font-weight: normal;
            cursor: pointer;
            user-select: none;
            transition: background 0.2s;
        }
        .correction-badge:hover {
            background: #C3E6CB;
        }
        .correction-badge.expanded {
            background: #C3E6CB;
        }
        .correction-panel {
            margin-top: 8px;
            padding: 12px;
            background: #F8F9FA;
            border: 1px solid #DEE2E6;
            border-radius: 6px;
            font-size: 12px;
        }
        .correction-panel-header {
            color: #6C757D;
            margin-bottom: 6px;
            font-weight: 600;
        }
        .correction-panel-item {
            color: #495057;
            margin-bottom: 4px;
        }
        .correction-panel-label {
            font-weight: 500;
        }
        .correction-panel-value {
            font-style: italic;
        }
        .correction-revert-btn {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 6px 12px;
            background: #FFC107;
            color: #000;
            border: none;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            float: right;
            margin-top: -4px;
            transition: all 0.2s;
        }
        .correction-revert-btn:hover:not(:disabled) {
            background: #FFB300;
        }
        .correction-revert-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .correction-revert-icon {
            font-size: 16px;
            line-height: 1;
        }
