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

body {
    font-family: 'Poppins', sans-serif;
    background: #f5f2ed;
    color: #1e1e2a;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

.hidden {
    display: none !important;
}

.text-muted {
    color: #999;
}

/* ============================================
   LANDING / LOGIN PAGE
   ============================================ */
#landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2a4a 0%, #2c1a3a 100%);
}

.landing-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1100px;
    width: 100%;
    min-height: 600px;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin: 20px;
}

.landing-brand {
    background: linear-gradient(135deg, #8b1a2b 0%, #5c0e1c 100%);
    padding: 48px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.brand-content {
    max-width: 360px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand-logo i {
    font-size: 3rem;
    color: #d4a84b;
}

.brand-logo h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
}

.brand-tagline {
    font-size: 1.2rem;
    font-weight: 600;
    color: #d4a84b;
    margin-bottom: 4px;
}

.brand-sub {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 32px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-features span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.brand-features i {
    color: #d4a84b;
}

.brand-footer {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 20px;
}

.landing-auth {
    padding: 48px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.auth-container {
    max-width: 380px;
    width: 100%;
}

.auth-form {
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e2a4a;
    margin-bottom: 4px;
}

.auth-form h2 i {
    color: #8b1a2b;
    margin-right: 10px;
}

.auth-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #1e2a4a;
}

.auth-form .form-group label i {
    color: #8b1a2b;
    margin-right: 6px;
    width: 18px;
}

.auth-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

.auth-form .form-group input:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.1);
}

.auth-form .form-group small {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}

.auth-switch {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 20px;
}

.auth-switch a {
    color: #8b1a2b;
    font-weight: 600;
    cursor: pointer;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ============================================
   SETUP PAGE
   ============================================ */
#setup-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 20px;
    position: relative;
}

#setup-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.03"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

.setup-wrapper {
    width: 100%;
    max-width: 1000px;
    position: relative;
    z-index: 1;
}

.setup-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #ffffff;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    min-height: 600px;
}

.setup-brand {
    background: linear-gradient(135deg, #8b1a2b 0%, #5c0e1c 50%, #3a0a12 100%);
    padding: 48px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.setup-brand::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 168, 75, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.setup-brand-content {
    max-width: 340px;
    position: relative;
    z-index: 1;
}

.setup-brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.setup-brand-logo i {
    font-size: 2.8rem;
    color: #d4a84b;
}

.setup-brand-logo h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}

.setup-brand-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #d4a84b;
    margin-bottom: 8px;
}

.setup-brand-content p {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 32px;
}

.setup-brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 40px;
}

.setup-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
    opacity: 0.9;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.setup-feature:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(212, 168, 75, 0.3);
}

.setup-feature i {
    color: #d4a84b;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.setup-brand-footer {
    font-size: 0.75rem;
    opacity: 0.5;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.setup-form-wrapper {
    padding: 48px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.setup-form-container {
    max-width: 400px;
    width: 100%;
}

.setup-form-header {
    margin-bottom: 32px;
}

.setup-form-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e2a4a;
    margin-bottom: 6px;
}

.setup-form-header h2 i {
    color: #d4a84b;
    margin-right: 10px;
}

.setup-form-header p {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
}

.setup-form-group {
    margin-bottom: 20px;
}

.setup-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #1e2a4a;
}

.setup-form-group label i {
    color: #8b1a2b;
    margin-right: 8px;
    width: 18px;
}

.setup-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #fafafa;
}

.setup-form-group input:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 4px rgba(139, 26, 43, 0.1);
    background: #ffffff;
}

.setup-form-group input::placeholder {
    color: #9ca3af;
}

.setup-hint {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 6px;
}

.setup-hint i {
    margin-right: 4px;
}

.setup-error {
    color: #dc2626;
    background: #fef2f2;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    border-left: 3px solid #dc2626;
    margin-bottom: 16px;
}

.setup-success {
    color: #16a34a;
    background: #f0fdf4;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    border-left: 3px solid #16a34a;
    margin-bottom: 16px;
}

.setup-uid-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef7e0 0%, #fef3c7 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #d4a84b;
}

.setup-uid-icon {
    width: 44px;
    height: 44px;
    background: #d4a84b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.setup-uid-content {
    flex: 1;
}

.setup-uid-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #92400e;
    letter-spacing: 0.5px;
}

.setup-uid-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #1e2a4a;
    margin: 2px 0;
}

.setup-uid-hint {
    display: block;
    font-size: 0.65rem;
    color: #92400e;
    opacity: 0.7;
}

.setup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
}

.setup-btn-primary {
    background: linear-gradient(135deg, #8b1a2b 0%, #6b141f 100%);
    color: #fff;
}

.setup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 26, 43, 0.35);
}

.setup-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: #8b1a2b;
    color: #fff;
}
.btn-primary:hover {
    background: #6b141f;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 26, 43, 0.3);
}

.btn-success {
    background: #2e7d32;
    color: #fff;
}
.btn-success:hover {
    background: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
}

.btn-danger {
    background: #c62828;
    color: #fff;
}
.btn-danger:hover {
    background: #b71c1c;
}

.btn-secondary {
    background: #e0e0e0;
    color: #1e2a4a;
}
.btn-secondary:hover {
    background: #ccc;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 8px;
}

.btn-sm i {
    font-size: 0.7rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    border-left: 4px solid;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.alert i {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.alert > div {
    flex: 1;
}

.alert strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.alert p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.alert .btn {
    margin-top: 8px;
}

.alert-success {
    border-left-color: #2e7d32;
    background: #e8f5e9;
}

.alert-success i {
    color: #2e7d32;
}

.alert-success strong {
    color: #1b5e20;
}

.alert-warning {
    border-left-color: #ed6c02;
    background: #fff3e0;
}

.alert-warning i {
    color: #ed6c02;
}

.alert-warning strong {
    color: #e65100;
}

.alert-danger {
    border-left-color: #c62828;
    background: #ffebee;
}

.alert-danger i {
    color: #c62828;
}

.alert-danger strong {
    color: #b71c1c;
}

.alert-info {
    border-left-color: #0d47a1;
    background: #e3f2fd;
}

.alert-info i {
    color: #0d47a1;
}

.alert-info strong {
    color: #0d47a1;
}

/* ============================================
   MESSAGES
   ============================================ */
.error-message {
    color: #c62828;
    background: #ffebee;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    border-left: 3px solid #c62828;
}

.success-message {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    border-left: 3px solid #2e7d32;
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
#dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1e2a4a;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-brand {
    text-align: center;
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand i {
    font-size: 2.4rem;
    color: #d4a84b;
}

.sidebar-brand span {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
}

.sidebar-brand small {
    font-size: 0.7rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    font-weight: 500;
    margin-bottom: 4px;
    cursor: pointer;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-link.active {
    background: #8b1a2b;
    color: #fff;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    text-align: center;
}

.sidebar-footer .user-info {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.sidebar-footer .user-uid {
    display: block;
    font-size: 0.65rem;
    font-family: monospace;
    opacity: 0.5;
    margin-top: 2px;
}

.sidebar-footer .user-role {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.6;
    letter-spacing: 1px;
}

.main-content {
    flex: 1;
    padding: 28px 32px;
    background: #f5f2ed;
    overflow-y: auto;
    min-width: 0;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0;
}

.page-header h2 i {
    color: #8b1a2b;
    margin-right: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-superadmin {
    background: #ffd700;
    color: #1e2a4a;
}

.badge-admin {
    background: #8b1a2b;
    color: #fff;
}

.badge-accountant {
    background: #2e7d32;
    color: #fff;
}

.badge-salesperson {
    background: #0d47a1;
    color: #fff;
}

.badge-info {
    background: #0d47a1;
    color: #fff;
}

.badge-success {
    background: #2e7d32;
    color: #fff;
}

.badge-warning {
    background: #ed6c02;
    color: #fff;
}

.badge-danger {
    background: #c62828;
    color: #fff;
}

/* ============================================
   STAFF ROLE BADGES
   ============================================ */
.staff-role {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.staff-role.badge-superadmin {
    background: #ffd700;
    color: #1e2a4a;
}

.staff-role.badge-admin {
    background: #8b1a2b;
    color: #fff;
}

.staff-role.badge-accountant {
    background: #2e7d32;
    color: #fff;
}

.staff-role.badge-salesperson {
    background: #0d47a1;
    color: #fff;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 16px 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-height: 70px;
    overflow: hidden;
}

.stat-card i {
    font-size: 1.8rem;
    color: #8b1a2b;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.stat-card > div {
    flex: 1;
    min-width: 0;
}

.stat-card h3 {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card span {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e2a4a;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.stat-card.danger i {
    color: #c62828;
}
.stat-card.success i {
    color: #2e7d32;
}

/* ============================================
   FINANCIAL OVERVIEW - FIXED NO SPILLING
   ============================================ */

.finance-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.finance-stat-card {
    background: white;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border-left: 4px solid #8b1a2b;
    min-height: 70px;
    overflow: hidden;
}

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

.finance-stat-card.revenue {
    border-left-color: #0d47a1;
}

.finance-stat-card.revenue .finance-stat-icon {
    background: #e3f2fd;
    color: #0d47a1;
}

.finance-stat-card.cogs {
    border-left-color: #ed6c02;
}

.finance-stat-card.cogs .finance-stat-icon {
    background: #fff3e0;
    color: #ed6c02;
}

.finance-stat-card.profit {
    border-left-color: #2e7d32;
}

.finance-stat-card.profit .finance-stat-icon {
    background: #e8f5e9;
    color: #2e7d32;
}

.finance-stat-card.margin {
    border-left-color: #6a1b4d;
}

.finance-stat-card.margin .finance-stat-icon {
    background: #f3e5f5;
    color: #6a1b4d;
}

.finance-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.finance-stat-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.finance-stat-label {
    display: block;
    font-size: 0.6rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finance-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.finance-stat-change {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    margin-top: 2px;
    white-space: nowrap;
}

.finance-stat-change.positive {
    background: #e8f5e9;
    color: #2e7d32;
}

.finance-stat-change.negative {
    background: #ffebee;
    color: #c62828;
}

/* Quick Stats Row */
.quick-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.quick-stat {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.quick-stat-label {
    display: block;
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e2a4a;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Finance Charts Grid */
.finance-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.finance-chart-panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.finance-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0eeea;
}

.finance-chart-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0;
}

.finance-chart-header h3 i {
    color: #8b1a2b;
    margin-right: 8px;
}

.finance-chart-period {
    font-size: 0.65rem;
    color: #666;
    background: #f0eeea;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.finance-chart-container {
    min-height: 180px;
}

/* Trend Chart */
.trend-chart-container {
    width: 100%;
}

.trend-chart-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8f6f4;
    border-radius: 8px;
}

.trend-summary-item {
    text-align: center;
}

.trend-summary-label {
    display: block;
    font-size: 0.5rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.trend-summary-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.chart-legend .legend-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 4px;
}

.chart-legend .revenue-color {
    background: #0d47a1;
}

.chart-legend .cogs-color {
    background: #ed6c02;
}

.chart-bars-wrapper {
    overflow-x: auto;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 100px;
    padding: 0 2px;
    min-width: 100%;
}

.chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    height: 100%;
    min-width: 12px;
}

.chart-column.today .chart-bar.revenue-bar {
    background: #8b1a2b;
}

.chart-column.today .chart-bar.cogs-bar {
    background: #d4a84b;
}

.chart-bars-group {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
}

.chart-bar {
    flex: 1;
    max-width: 10px;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.5s ease;
}

.chart-bar.revenue-bar {
    background: #0d47a1;
}

.chart-bar.cogs-bar {
    background: #ed6c02;
}

.chart-label {
    font-size: 0.45rem;
    color: #999;
}

.chart-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    color: #999;
    margin-top: 4px;
    padding: 0 2px;
}

/* Variance Report */
.variance-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}

.variance-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 6px 12px;
    background: #f8f6f4;
    border-radius: 6px;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.variance-item:hover {
    background: #f0eeea;
}

.variance-item.danger {
    background: #ffebee;
    border-left: 3px solid #c62828;
}

.variance-item.warning {
    background: #fff3e0;
    border-left: 3px solid #ed6c02;
}

.variance-name {
    font-weight: 600;
    flex: 1;
    min-width: 60px;
}

.variance-stock {
    color: #666;
}

.variance-stock strong {
    color: #1e2a4a;
}

.variance-threshold {
    color: #666;
}

.variance-status {
    font-weight: 600;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.variance-action {
    font-size: 0.6rem;
    color: #8b1a2b;
    font-weight: 600;
    white-space: nowrap;
}

.variance-note {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e3f2fd;
    border-radius: 6px;
    font-size: 0.7rem;
    color: #0d47a1;
    border-left: 3px solid #0d47a1;
}

.variance-note i {
    margin-right: 4px;
}

/* Stock Summary Panel */
.finance-stock-panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.finance-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0eeea;
}

.finance-panel-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0;
}

.finance-panel-header h3 i {
    color: #8b1a2b;
    margin-right: 8px;
}

.finance-panel-badge {
    font-size: 0.6rem;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.inventory-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.inventory-summary-item {
    background: #f8f6f4;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    overflow: hidden;
}

.inventory-summary-item:hover {
    background: #f0eeea;
}

.inventory-summary-item.warning {
    background: #fff3e0;
}

.inventory-summary-item.danger {
    background: #ffebee;
}

.inventory-summary-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: white;
    flex-shrink: 0;
}

.inventory-summary-item.warning .inventory-summary-icon {
    color: #ed6c02;
}

.inventory-summary-item.danger .inventory-summary-icon {
    color: #c62828;
}

.inventory-summary-item > div {
    flex: 1;
    min-width: 0;
}

.inventory-summary-label {
    display: block;
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inventory-summary-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.dashboard-panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.dashboard-panel h3 {
    margin: 0 0 14px 0;
    font-size: 0.95rem;
    color: #1e2a4a;
    border-bottom: 2px solid #f0eeea;
    padding-bottom: 10px;
}

.dashboard-panel h3 i {
    color: #8b1a2b;
    margin-right: 8px;
}

/* ============================================
   FEED & STOCK COMPONENTS
   ============================================ */
.feed-container {
    max-height: 350px;
    overflow-y: auto;
}

.feed-entry {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 80px;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid #f0eeea;
    font-size: 0.8rem;
    align-items: center;
}

.feed-entry .feed-time {
    color: #999;
    font-size: 0.7rem;
}
.feed-entry .feed-name {
    font-weight: 600;
}
.feed-entry .feed-total {
    font-weight: 700;
    color: #8b1a2b;
    text-align: right;
}

.feed-placeholder {
    padding: 20px;
    text-align: center;
    color: #999;
}

.live-indicator {
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-indicator i {
    color: #4caf50;
    animation: pulse 1.5s infinite;
}

.stock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    background: #f8f6f4;
    border-radius: 6px;
    font-size: 0.8rem;
    overflow: hidden;
}

.stock-item.low-stock {
    background: #ffebee;
    border-left: 3px solid #c62828;
}

.stock-item .stock-badge {
    color: #c62828;
    font-weight: 700;
    font-size: 0.65rem;
}

.employee-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.employee-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f6f4;
    border-radius: 10px;
    overflow: hidden;
}

.employee-rank {
    font-size: 1.1rem;
    font-weight: 800;
    color: #d4a84b;
    width: 24px;
}

.employee-info h4 {
    margin: 0;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-stats {
    font-size: 0.7rem;
    color: #666;
}

.employee-stats i {
    margin: 0 2px;
}

/* ============================================
   CATEGORY FILTERS
   ============================================ */
.category-filters {
    display: flex;
    gap: 6px;
    padding: 10px 0 14px 0;
    overflow-x: auto;
    flex-wrap: wrap;
    align-items: center;
}

.category-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.category-filter-btn:hover {
    border-color: #8b1a2b;
    color: #8b1a2b;
    background: #fef5f5;
}

.category-filter-btn.active {
    background: #8b1a2b;
    color: white;
    border-color: #8b1a2b;
}

.category-filter-btn i {
    font-size: 0.8rem;
}

.category-filter-btn.active i {
    color: white;
}

/* ============================================
   SALESPERSON - TAB STYLES
   ============================================ */
.tabs-bar {
    display: flex;
    gap: 8px;
    padding: 6px 0 14px 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    align-items: center;
}

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
    color: #1e2a4a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.tab-item .tab-name {
    cursor: pointer;
    user-select: none;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-item .tab-name:hover {
    text-decoration: underline dotted #8b1a2b;
}

.tab-item:hover {
    border-color: #8b1a2b;
    background: #fef5f5;
}

.tab-item.active {
    background: #8b1a2b;
    color: #fff;
    border-color: #8b1a2b;
}

.tab-item .tab-badge {
    background: rgba(0,0,0,0.1);
    padding: 0 6px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.tab-item.active .tab-badge {
    background: rgba(255,255,255,0.2);
}

.tab-item .tab-close {
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    padding: 0 2px;
    margin-left: 2px;
}

.tab-item .tab-close:hover {
    opacity: 1;
    color: #c62828;
}

.tab-item.tab-add {
    background: transparent;
    border: 2px dashed #8b1a2b;
    color: #8b1a2b;
}

.tab-item.tab-add:hover {
    background: #8b1a2b;
    color: #fff;
    border-style: solid;
}

/* Order Summary */
.order-summary {
    background: white;
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    bottom: 0;
}

.order-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0eeea;
    margin-bottom: 10px;
}

.order-summary-header .order-tab-name {
    font-weight: 700;
    color: #1e2a4a;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-summary-header .order-item-count {
    font-size: 0.75rem;
    color: #666;
    background: #f0eeea;
    padding: 2px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.order-items {
    max-height: 180px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f5f2ed;
    gap: 8px;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item .item-name {
    font-weight: 500;
    flex: 1;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item .item-name i {
    margin-right: 6px;
    width: 16px;
    text-align: center;
}

.order-item .item-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.order-item .item-controls button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 1px 6px;
    font-size: 0.7rem;
    transition: all 0.2s;
    color: #1e2a4a;
}

.order-item .item-controls button:hover {
    background: #8b1a2b;
    color: #fff;
    border-color: #8b1a2b;
}

.order-item .item-controls .remove {
    color: #c62828;
}

.order-item .item-controls .remove:hover {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

.order-item .item-qty {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    font-size: 0.85rem;
}

.order-item .item-total {
    font-weight: 600;
    min-width: 70px;
    text-align: right;
    font-size: 0.85rem;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 12px 0 10px 0;
    border-top: 2px solid #f0eeea;
    margin-top: 6px;
}

.order-total span:last-child {
    color: #8b1a2b;
    font-size: 1.2rem;
}

.empty-order {
    color: #999;
    text-align: center;
    padding: 16px 0;
    font-size: 0.9rem;
}

#close-order-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 10px;
    margin-top: 6px;
}

#close-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Salesperson stats */
.salesperson-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: #666;
    flex-wrap: wrap;
}

.salesperson-stats strong {
    color: #1e2a4a;
}

/* ============================================
   DRINK CARDS
   ============================================ */
.drink-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    margin-top: 6px;
}

.drink-card {
    background: white;
    padding: 14px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drink-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
    pointer-events: none;
}

.drink-card.out-of-stock:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.drink-card.out-of-stock .drink-icon {
    filter: grayscale(1);
}

.drink-card .badge.out {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #c62828;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
}

.drink-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: #d4a84b;
}

.drink-card .drink-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
    font-size: 1.6rem;
    color: white;
    transition: all 0.3s ease;
}

.drink-card:hover .drink-icon {
    transform: scale(1.1);
}

.drink-card .drink-icon i {
    font-size: 1.8rem;
}

.drink-card h4 {
    margin: 6px 0 2px 0;
    font-size: 0.8rem;
    color: #1e2a4a;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.drink-card p {
    font-weight: 700;
    color: #8b1a2b;
    font-size: 0.85rem;
    margin: 0;
}

/* ============================================
   INVENTORY
   ============================================ */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.inventory-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.inventory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.inventory-icon-wrapper {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    transition: all 0.3s ease;
}

.inventory-card:hover .inventory-icon-wrapper {
    transform: scale(1.02);
}

.inventory-icon-wrapper i {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.inventory-details {
    padding: 14px;
    flex: 1;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    gap: 6px;
}

.inventory-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #1e2a4a;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inventory-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
}

.inventory-category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 500;
    color: white;
    margin-bottom: 8px;
}

.inventory-category-badge i {
    margin-right: 4px;
}

.inventory-stats {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.inventory-stats i {
    color: #8b1a2b;
    width: 14px;
    margin-right: 2px;
}

.inventory-stats strong {
    color: #1e2a4a;
}

.inventory-prices {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.inventory-prices i {
    color: #8b1a2b;
    width: 14px;
    margin-right: 2px;
}

.inventory-prices strong {
    color: #1e2a4a;
}

.inventory-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f0eeea;
}

.inventory-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 4px 14px;
    border-radius: 30px;
    border: 2px solid #ddd;
    flex: 1;
    min-width: 180px;
}

.search-bar i {
    color: #999;
}

.search-bar input {
    border: none;
    padding: 8px 0;
    flex: 1;
    font-size: 0.85rem;
    outline: none;
    background: transparent;
    font-family: inherit;
}

.search-bar:focus-within {
    border-color: #8b1a2b;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.filter-group input,
.filter-group select {
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ============================================
   INVENTORY - UNIT INFO
   ============================================ */
.inventory-unit-info-wrapper {
    margin: 2px 0 6px 0;
}

.inventory-unit-info {
    font-size: 0.7rem;
    color: #666;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 2px;
}

.inventory-unit-info i {
    color: #8b1a2b;
    margin-right: 4px;
}

.inventory-unit-info .fas {
    width: 14px;
    text-align: center;
}

/* ============================================
   FORM UNIT FIELDS
   ============================================ */
#pack-fields .form-group,
#tot-fields .form-group,
#edit-pack-fields .form-group,
#edit-tot-fields .form-group {
    margin-bottom: 6px;
}

#pack-fields .form-group label,
#tot-fields .form-group label,
#edit-pack-fields .form-group label,
#edit-tot-fields .form-group label {
    font-size: 0.75rem;
    font-weight: 500;
}

#pack-fields .form-group input,
#tot-fields .form-group input,
#edit-pack-fields .form-group input,
#edit-tot-fields .form-group input {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 100%;
}

#pack-fields .form-group input:focus,
#tot-fields .form-group input:focus,
#edit-pack-fields .form-group input:focus,
#edit-tot-fields .form-group input:focus {
    border-color: #8b1a2b;
    outline: none;
}

#pack-fields .form-row,
#tot-fields .form-row,
#edit-pack-fields .form-row,
#edit-tot-fields .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ============================================
   STAFF MANAGEMENT
   ============================================ */
.staff-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.staff-stat-card {
    background: white;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    overflow: hidden;
}

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

.staff-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.staff-stat-info {
    flex: 1;
    min-width: 0;
}

.staff-stat-label {
    display: block;
    font-size: 0.6rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Staff Filters */
.staff-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.staff-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f2ed;
    padding: 4px 14px;
    border-radius: 30px;
    border: 2px solid transparent;
    flex: 1;
    min-width: 160px;
    transition: all 0.2s;
}

.staff-search-wrapper:focus-within {
    border-color: #8b1a2b;
    background: white;
}

.staff-search-wrapper i {
    color: #999;
}

.staff-search-wrapper input {
    border: none;
    padding: 8px 0;
    flex: 1;
    font-size: 0.85rem;
    outline: none;
    background: transparent;
    font-family: inherit;
}

.staff-filter-group select {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s;
    min-width: 120px;
    color: #1e2a4a;
}

.staff-filter-group select:focus {
    border-color: #8b1a2b;
    outline: none;
}

/* Staff Grid */
.staff-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.staff-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    border: 2px solid transparent;
    overflow: hidden;
}

.staff-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: #f0eeea;
}

.staff-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.staff-info {
    flex: 1;
    min-width: 0;
}

.staff-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-email {
    font-size: 0.75rem;
    color: #666;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-email i {
    margin-right: 4px;
    color: #8b1a2b;
    width: 12px;
}

.staff-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.accountant {
    background: #e8f5e9;
    color: #1b5e20;
}

.role-badge.salesperson {
    background: #e3f2fd;
    color: #0d47a1;
}

.staff-code {
    font-size: 0.65rem;
    color: #ed6c02;
    background: #fff3e0;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: monospace;
    font-weight: 600;
}

.staff-code i {
    margin-right: 4px;
}

.staff-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.staff-actions .btn-sm {
    padding: 4px 8px;
    border-radius: 6px;
}

/* ============================================
   SALES HISTORY
   ============================================ */
.history-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.history-stat-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    overflow: hidden;
}

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

.history-stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.history-stat-card .stat-info {
    flex: 1;
    min-width: 0;
}

.history-stat-card .stat-label {
    display: block;
    font-size: 0.65rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-stat-card .stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* History Filters */
.history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.history-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-filters .filter-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.history-filters .filter-group label i {
    margin-right: 4px;
}

.history-filters .filter-group input,
.history-filters .filter-group select {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s;
}

.history-filters .filter-group input:focus,
.history-filters .filter-group select:focus {
    border-color: #8b1a2b;
    outline: none;
}

.history-filters .filter-group select {
    min-width: 70px;
}

/* Table Styling */
.order-number {
    font-weight: 700;
    color: #8b1a2b;
    font-size: 0.8rem;
}

.order-date {
    font-weight: 600;
    font-size: 0.8rem;
    color: #1e2a4a;
}

.order-time {
    font-size: 0.65rem;
    color: #999;
}

.order-tab-name {
    font-weight: 500;
    font-size: 0.8rem;
    color: #1e2a4a;
}

.order-tab-name i {
    color: #d4a84b;
    margin-right: 4px;
}

.order-items-list {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: #666;
}

.order-qty-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #0d47a1;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.order-total {
    font-size: 0.9rem;
    color: #1e2a4a;
}

/* Pagination */
.history-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 0;
    margin-top: 14px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: #1e2a4a;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #8b1a2b;
    background: #fef5f5;
    color: #8b1a2b;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* ============================================
   ORDER HISTORY
   ============================================ */
.history-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.history-stat {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    overflow: hidden;
}

.history-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.history-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f8f6f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.history-stat > div {
    flex: 1;
    min-width: 0;
}

.history-stat-label {
    display: block;
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.history-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filters Bar */
.history-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.history-filters-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-filters-bar .filter-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.history-filters-bar .filter-group label i {
    margin-right: 4px;
    color: #8b1a2b;
}

.history-filters-bar .filter-group select,
.history-filters-bar .filter-group input {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    background: white;
    transition: all 0.2s;
    min-width: 120px;
}

.history-filters-bar .filter-group select:focus,
.history-filters-bar .filter-group input:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.1);
}

.history-filters-bar .filter-group input[type="date"] {
    min-width: 130px;
}

.history-filters-bar .btn {
    margin-top: auto;
    height: 36px;
}

/* Table Container */
.history-table-container {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.history-table thead {
    background: #f8f6f4;
}

.history-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #1e2a4a;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.history-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0eeea;
    vertical-align: middle;
}

.history-table tbody tr:hover {
    background: #f8f6f4;
}

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

/* Table Cell Styles */
.order-id {
    font-weight: 700;
    color: #8b1a2b;
    font-family: monospace;
    font-size: 0.8rem;
}

.order-date {
    font-size: 0.75rem;
    color: #1e2a4a;
}

.order-supplier {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #1e2a4a;
}

.order-supplier i {
    color: #8b1a2b;
}

.order-item-count {
    display: inline-block;
    background: #f0eeea;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #1e2a4a;
}

.order-cost {
    font-weight: 700;
    color: #1e2a4a;
}

/* Status Badges for Table */
.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.status-pending {
    background: #fff3e0;
    color: #ed6c02;
}

.status-badge.status-sent {
    background: #e3f2fd;
    color: #0d47a1;
}

.status-badge.status-partial {
    background: #fff3e0;
    color: #ed6c02;
}

.status-badge.status-received {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-cancelled {
    background: #ffebee;
    color: #c62828;
}

/* Pagination Bar */
.history-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 0;
    margin-top: 6px;
}

.pagination-info {
    font-size: 0.8rem;
    color: #666;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    padding: 4px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #1e2a4a;
    font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #8b1a2b;
    background: #fef5f5;
    color: #8b1a2b;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 2px;
}

.page-number {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #666;
    min-width: 32px;
    text-align: center;
}

.page-number:hover {
    background: #f0eeea;
    color: #1e2a4a;
}

.page-number.active {
    background: #8b1a2b;
    color: white;
}

.page-dots {
    padding: 4px 2px;
    font-size: 0.8rem;
    color: #999;
}

.pagination-entries {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #666;
}

.pagination-entries select {
    padding: 4px 6px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    background: white;
}

/* Order Detail Modal */
.order-detail-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 14px;
    background: #f8f6f4;
    border-radius: 10px;
    margin-bottom: 14px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-item.total {
    grid-column: span 1;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    border: 2px solid #8b1a2b;
    justify-content: center;
}

.detail-item.total .detail-value {
    font-size: 1rem;
    color: #8b1a2b;
}

.detail-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e2a4a;
}

.detail-value i {
    margin-right: 4px;
    color: #8b1a2b;
}

.order-detail-items {
    margin-bottom: 14px;
}

.order-detail-items h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0 0 8px 0;
}

.order-detail-items h4 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.detail-table th {
    background: #f8f6f4;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    color: #1e2a4a;
    border-bottom: 2px solid #e0e0e0;
}

.detail-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0eeea;
}

.detail-table tfoot td {
    border-top: 2px solid #e0e0e0;
    padding-top: 8px;
}

.detail-table .text-center {
    text-align: center;
}

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

.order-detail-notes {
    padding: 8px 12px;
    background: #e3f2fd;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #0d47a1;
    border-left: 3px solid #0d47a1;
    margin-top: 10px;
}

.order-detail-notes i {
    margin-right: 4px;
}

.order-detail-notes.discrepancy {
    background: #fff3e0;
    color: #ed6c02;
    border-left-color: #ed6c02;
}

/* Receive Modal */
.receive-modal-info {
    padding: 8px 12px;
    background: #e3f2fd;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #0d47a1;
    border-left: 3px solid #0d47a1;
    margin-bottom: 14px;
}

.receive-modal-info i {
    margin-right: 4px;
}

.receive-order-header {
    margin-bottom: 14px;
}

.receive-order-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0 0 2px 0;
}

.receive-order-header h4 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.receive-order-header p {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.receive-items-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 14px;
}

.receive-item-row {
    background: #f8f6f4;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.receive-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.receive-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e2a4a;
}

.receive-item-ordered {
    font-size: 0.75rem;
    color: #666;
}

.receive-item-ordered strong {
    color: #1e2a4a;
}

.receive-item-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.receive-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.receive-field label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #666;
}

.receive-field label i {
    margin-right: 2px;
}

.receive-field input {
    padding: 4px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    width: 100%;
}

.receive-field input:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.1);
}

.receive-status {
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 500;
}

.receive-notes {
    margin-bottom: 14px;
}

.receive-notes label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e2a4a;
    margin-bottom: 2px;
}

.receive-notes label i {
    color: #8b1a2b;
    margin-right: 4px;
}

.receive-notes textarea {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    resize: vertical;
    min-height: 50px;
}

.receive-notes textarea:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.1);
}

.receive-summary {
    background: #f8f6f4;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.receive-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e0e0e0;
}

.receive-summary-row:last-child {
    border-bottom: none;
}

.receive-summary-warning {
    padding: 8px 12px;
    background: #fff3e0;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #ed6c02;
    border-left: 3px solid #ed6c02;
}

.receive-summary-warning i {
    margin-right: 4px;
}

.receive-summary-success {
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #2e7d32;
    border-left: 3px solid #2e7d32;
}

.receive-summary-success i {
    margin-right: 4px;
}

.receive-result-success {
    padding: 10px 14px;
    background: #e8f5e9;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #2e7d32;
    border-left: 3px solid #2e7d32;
    margin-bottom: 14px;
}

.receive-result-success i {
    margin-right: 6px;
}

.receive-result-summary {
    background: #f8f6f4;
    padding: 14px;
    border-radius: 10px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e0e0e0;
}

.result-row:last-child {
    border-bottom: none;
}

/* ============================================
   PLACE ORDER
   ============================================ */
.order-tabs {
    display: flex;
    gap: 4px;
    background: #f0eeea;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
}

.order-tab {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    background: transparent;
    color: #666;
}

.order-tab:hover {
    color: #1e2a4a;
}

.order-tab.active {
    background: white;
    color: #8b1a2b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.order-tab i {
    margin-right: 6px;
}

/* MAIN CONTAINER */
.order-container {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    align-items: flex-start;
}

/* LEFT SECTION */
.order-items-section {
    flex: 1;
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-width: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0eeea;
}

.section-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0;
}

.section-header h3 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.item-count {
    font-size: 0.75rem;
    color: #666;
    background: #f0eeea;
    padding: 2px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* SCROLL */
.items-scroll {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 4px;
}

.items-scroll::-webkit-scrollbar {
    width: 4px;
}

.items-scroll::-webkit-scrollbar-track {
    background: #f0eeea;
    border-radius: 3px;
}

.items-scroll::-webkit-scrollbar-thumb {
    background: #d4a84b;
    border-radius: 3px;
}

/* ITEMS LIST */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* ITEM CARD */
.item-card {
    background: #f8f6f4;
    border-radius: 10px;
    border: 1px solid #e8e5e0;
    transition: all 0.2s ease;
    overflow: hidden;
    width: 100%;
}

.item-card:hover {
    background: #f0eeea;
    border-color: #d4a84b;
}

/* ITEM ROW */
.item-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 12px;
    width: 100%;
}

/* ITEM INFO */
.item-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.item-num {
    font-weight: 700;
    color: #d4a84b;
    font-size: 0.8rem;
    min-width: 24px;
    padding-top: 2px;
    flex-shrink: 0;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e2a4a;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.item-tags span {
    font-size: 0.65rem;
    color: #666;
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.item-tags span i {
    color: #8b1a2b;
    font-size: 0.55rem;
}

.item-tags .status {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
}

.item-tags .status.in {
    background: #e8f5e9;
    color: #2e7d32;
}

.item-tags .status.low {
    background: #fff3e0;
    color: #ed6c02;
}

.item-tags .status.out {
    background: #ffebee;
    color: #c62828;
}

/* CONTROLS */
.item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.qty-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.qty label {
    font-size: 0.45rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.qty input {
    width: 36px;
    padding: 2px 2px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 600;
    background: white;
    transition: all 0.2s;
}

.qty input:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.1);
}

.total-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 10px;
    background: white;
    border-radius: 4px;
    border: 2px solid #8b1a2b;
    min-width: 70px;
}

.total-label {
    font-size: 0.45rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.total-value {
    font-weight: 700;
    font-size: 0.8rem;
    color: #8b1a2b;
    white-space: nowrap;
}

/* RIGHT SIDEBAR */
.order-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* SUMMARY CARD */
.summary-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.summary-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0eeea;
}

.summary-card h4 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}

.stat {
    background: #f8f6f4;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.55rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1e2a4a;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.total-row {
    background: linear-gradient(135deg, #8b1a2b 0%, #6b141f 100%);
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-row span:first-child {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
}

.total-row span:last-child {
    font-size: 1.1rem;
    font-weight: 700;
    color: #d4a84b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SUPPLIER CARD */
.supplier-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.supplier-card h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0 0 10px 0;
}

.supplier-card h4 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.supplier-card input,
.supplier-card textarea {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #fafafa;
    margin-bottom: 8px;
}

.supplier-card input:focus,
.supplier-card textarea:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.1);
}

.supplier-card textarea {
    min-height: 40px;
    resize: vertical;
}

/* SEARCH BAR */
.search-bar-wrapper {
    margin-bottom: 10px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f2ed;
    padding: 4px 14px;
    border-radius: 30px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.search-bar:focus-within {
    border-color: #8b1a2b;
    background: white;
}

.search-bar i {
    color: #999;
}

.search-bar input {
    border: none;
    padding: 6px 0;
    flex: 1;
    font-size: 0.8rem;
    outline: none;
    background: transparent;
    font-family: inherit;
}

/* RECENT ORDERS */
.recent-orders {
    background: white;
    border-radius: 14px;
    padding: 18px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.recent-orders h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0eeea;
}

.recent-orders h4 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.order-item-mini {
    background: #f8f6f4;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.order-item-mini:hover {
    background: #f0eeea;
}

.order-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 4px;
}

.order-mini-id {
    font-weight: 700;
    font-size: 0.8rem;
    color: #1e2a4a;
}

.order-mini-status {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.order-mini-status.pending {
    background: #fff3e0;
    color: #ed6c02;
}

.order-mini-status.sent {
    background: #e3f2fd;
    color: #0d47a1;
}

.order-mini-status.received {
    background: #e8f5e9;
    color: #1b5e20;
}

.order-mini-status i {
    font-size: 0.6rem;
}

.order-mini-date {
    font-size: 0.7rem;
    color: #999;
}

.order-mini-details {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: #666;
    flex-wrap: wrap;
}

.order-mini-details i {
    margin-right: 4px;
    color: #8b1a2b;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.empty-state i {
    font-size: 2.5rem;
    color: #ccc;
    display: block;
    margin-bottom: 10px;
}

.empty-state.success i {
    color: #2e7d32;
}

.empty-state p {
    margin: 4px 0;
}

/* ============================================
   ACCOUNTANT REPORTS
   ============================================ */
.report-period-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.period-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.period-btn {
    padding: 4px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: #666;
    white-space: nowrap;
}

.period-btn:hover {
    border-color: #8b1a2b;
    color: #8b1a2b;
}

.period-btn.active {
    background: #8b1a2b;
    color: white;
    border-color: #8b1a2b;
}

.custom-period {
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-period input[type="date"] {
    padding: 4px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: inherit;
}

.custom-period span {
    color: #666;
    font-size: 0.75rem;
}

/* Executive Summary */
.report-executive-summary {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.report-executive-summary h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0eeea;
}

.report-executive-summary h3 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.executive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.executive-item {
    background: #f8f6f4;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
}

.executive-label {
    display: block;
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.executive-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1e2a4a;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Report Financial Grid */
.report-financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.report-financial-card {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #8b1a2b;
    overflow: hidden;
}

.report-financial-card.revenue {
    border-left-color: #0d47a1;
}

.report-financial-card.cogs {
    border-left-color: #ed6c02;
}

.report-financial-card.profit {
    border-left-color: #2e7d32;
}

.report-financial-card.margin {
    border-left-color: #6a1b4d;
}

.financial-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    background: #f8f6f4;
    color: #8b1a2b;
}

.report-financial-card.revenue .financial-icon {
    background: #e3f2fd;
    color: #0d47a1;
}

.report-financial-card.cogs .financial-icon {
    background: #fff3e0;
    color: #ed6c02;
}

.report-financial-card.profit .financial-icon {
    background: #e8f5e9;
    color: #2e7d32;
}

.report-financial-card.margin .financial-icon {
    background: #f3e5f5;
    color: #6a1b4d;
}

.financial-label {
    display: block;
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.financial-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.financial-change {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    margin-top: 2px;
}

.financial-change.positive {
    background: #e8f5e9;
    color: #2e7d32;
}

.financial-change.negative {
    background: #ffebee;
    color: #c62828;
}

.financial-change.neutral {
    background: #f5f5f5;
    color: #666;
}

/* Report Charts */
.report-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.report-chart-panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.report-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0eeea;
}

.report-chart-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0;
}

.report-chart-header h3 i {
    margin-right: 6px;
}

.report-chart-container {
    min-height: 160px;
}

/* Category Breakdown */
.report-category-panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.report-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0eeea;
}

.report-panel-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0;
}

.report-panel-header h3 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.report-panel-badge {
    font-size: 0.6rem;
    color: #0d47a1;
    background: #e3f2fd;
    padding: 2px 10px;
    border-radius: 12px;
}

.category-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #f8f6f4;
    border-radius: 6px;
    transition: background 0.2s;
}

.category-item:hover {
    background: #f0eeea;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.category-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.category-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: #1e2a4a;
}

.category-items {
    font-size: 0.65rem;
    color: #666;
}

.category-bar-wrapper {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.category-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.category-revenue {
    font-weight: 700;
    font-size: 0.8rem;
    color: #1e2a4a;
    min-width: 80px;
    text-align: right;
    white-space: nowrap;
}

.category-pct {
    font-size: 0.7rem;
    color: #666;
    min-width: 40px;
    text-align: right;
}

/* Top Products */
.top-products-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top-product-item {
    display: grid;
    grid-template-columns: 28px 1fr 1fr 70px 90px;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f6f4;
    border-radius: 8px;
    align-items: center;
    font-size: 0.8rem;
    transition: background 0.2s;
    overflow: hidden;
    max-width: 100%;
}

.top-product-item:hover {
    background: #f0eeea;
}

.top-product-item .rank {
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
    min-width: 20px;
}

.top-product-item .rank.gold { 
    color: #f9a825; 
}
.top-product-item .rank.silver { 
    color: #9e9e9e; 
}
.top-product-item .rank.bronze { 
    color: #bf6a30; 
}

.top-product-item .rank i {
    font-size: 0.9rem;
}

.top-product-item .name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 60px;
}

.top-product-item .bar-wrapper {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.top-product-item .bar-wrapper .bar {
    height: 100%;
    background: linear-gradient(90deg, #8b1a2b, #d4a84b);
    border-radius: 3px;
    transition: width 0.5s ease;
    max-width: 100%;
}

.top-product-item .qty {
    font-weight: 600;
    color: #1e2a4a;
    text-align: center;
    font-size: 0.75rem;
    white-space: nowrap;
}

.top-product-item .revenue {
    font-weight: 700;
    color: #8b1a2b;
    text-align: right;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 70px;
}

/* Staff Performance - Fixed Spilling */
.staff-performance-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
    overflow: hidden;
}

.staff-performance-item {
    display: grid;
    grid-template-columns: 32px 1fr 1fr 110px;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f6f4;
    border-radius: 8px;
    align-items: center;
    transition: background 0.2s;
    overflow: hidden;
    max-width: 100%;
}

.staff-performance-item:hover {
    background: #f0eeea;
}

.staff-performance-item .staff-rank {
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    min-width: 24px;
}

.staff-performance-item .staff-rank.gold { 
    color: #f9a825; 
}
.staff-performance-item .staff-rank.silver { 
    color: #9e9e9e; 
}
.staff-performance-item .staff-rank.bronze { 
    color: #bf6a30; 
}

.staff-performance-item .staff-rank i {
    font-size: 1rem;
}

.staff-performance-item .staff-info {
    min-width: 0;
    overflow: hidden;
}

.staff-performance-item .staff-info .staff-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-performance-item .staff-info .staff-stats {
    display: flex;
    gap: 12px;
    font-size: 0.7rem;
    color: #666;
    flex-wrap: wrap;
}

.staff-performance-item .staff-info .staff-stats i {
    color: #8b1a2b;
    margin-right: 2px;
    width: 12px;
}

.staff-performance-item .staff-bar-wrapper {
    flex: 1;
    min-width: 60px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.staff-performance-item .staff-bar-wrapper .staff-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d47a1, #42a5f5);
    border-radius: 3px;
    transition: width 0.5s ease;
    max-width: 100%;
}

.staff-performance-item .staff-revenue {
    font-weight: 700;
    color: #8b1a2b;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 80px;
    font-size: 0.85rem;
}

/* Report Details Grid */
.report-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.report-detail-card {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.report-detail-label {
    display: block;
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.report-detail-label i {
    color: #8b1a2b;
    margin-right: 2px;
}

.report-detail-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1e2a4a;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Order Breakdown */
.report-breakdown-panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-top: 16px;
}

.report-breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0eeea;
}

.report-breakdown-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0;
}

.report-breakdown-header h3 i {
    color: #8b1a2b;
    margin-right: 6px;
}

.report-breakdown-count {
    font-size: 0.75rem;
    color: #666;
    background: #f0eeea;
    padding: 2px 12px;
    border-radius: 20px;
}

.order-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 250px;
    overflow-y: auto;
}

.order-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f6f4;
    border-radius: 6px;
    transition: background 0.2s;
}

.order-breakdown-item:hover {
    background: #f0eeea;
}

.order-breakdown-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.order-breakdown-id {
    font-weight: 700;
    font-size: 0.75rem;
    color: #8b1a2b;
    font-family: monospace;
}

.order-breakdown-date {
    font-size: 0.7rem;
    color: #666;
}

.order-breakdown-date i {
    margin-right: 2px;
    color: #8b1a2b;
}

.order-breakdown-items {
    font-size: 0.7rem;
    color: #666;
}

.order-breakdown-items i {
    margin-right: 2px;
    color: #8b1a2b;
}

.order-breakdown-total {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e2a4a;
    white-space: nowrap;
}

.order-breakdown-more {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    padding: 6px 0;
    margin-top: 2px;
    border-top: 1px solid #f0eeea;
}

/* ============================================
   STOCK MONITOR
   ============================================ */
.stock-monitor-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stock-stat-card {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    overflow: hidden;
}

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

.stock-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.stock-stat-card > div {
    flex: 1;
    min-width: 0;
}

.stock-stat-label {
    display: block;
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stock-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filters */
.stock-monitor-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.stock-monitor-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stock-monitor-filters .filter-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stock-monitor-filters .filter-group label i {
    margin-right: 4px;
    color: #8b1a2b;
}

.stock-monitor-filters .filter-group input,
.stock-monitor-filters .filter-group select {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    background: white;
    transition: all 0.2s;
    min-width: 130px;
}

.stock-monitor-filters .filter-group input:focus,
.stock-monitor-filters .filter-group select:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.1);
}

.stock-monitor-filters .btn {
    margin-top: auto;
    height: 34px;
}

/* Stock Grid */
.stock-monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-top: 4px;
}

/* Product Card */
.monitor-product-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border-left: 4px solid #e0e0e0;
    position: relative;
    overflow: hidden;
}

.monitor-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    opacity: 0.04;
    transform: translate(20px, -20px);
    background: #8b1a2b;
}

.monitor-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.monitor-product-card.out {
    border-left-color: #c62828;
}

.monitor-product-card.out .monitor-product-name {
    color: #c62828;
}

.monitor-product-card.low {
    border-left-color: #ed6c02;
}

.monitor-product-card.low .monitor-product-name {
    color: #ed6c02;
}

.monitor-product-card.in {
    border-left-color: #2e7d32;
}

/* Product Header */
.monitor-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.monitor-product-info {
    flex: 1;
    min-width: 0;
}

.monitor-product-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e2a4a;
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitor-product-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
}

.monitor-product-status {
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f8f6f4;
}

.monitor-product-card.out .monitor-product-status {
    background: #ffebee;
}

.monitor-product-card.low .monitor-product-status {
    background: #fff3e0;
}

.monitor-product-card.in .monitor-product-status {
    background: #e8f5e9;
}

/* Product Details */
.monitor-product-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.monitor-detail-item {
    background: #f8f6f4;
    padding: 6px 8px;
    border-radius: 6px;
    text-align: center;
}

.monitor-detail-label {
    display: block;
    font-size: 0.5rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.monitor-detail-label i {
    margin-right: 2px;
}

.monitor-detail-value {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e2a4a;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitor-detail-value.out {
    color: #c62828;
}

.monitor-detail-value.low {
    color: #ed6c02;
}

.monitor-detail-value.in {
    color: #2e7d32;
}

/* Stock Bar */
.monitor-product-bar {
    margin-bottom: 10px;
}

.monitor-bar-track {
    height: 6px;
    background: #f0eeea;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.monitor-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.monitor-bar-fill.success {
    background: linear-gradient(90deg, #4caf50, #2e7d32);
}

.monitor-bar-fill.warning {
    background: linear-gradient(90deg, #ffa726, #ed6c02);
}

.monitor-bar-fill.danger {
    background: linear-gradient(90deg, #ef5350, #c62828);
}

.monitor-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.5rem;
    color: #999;
    margin-top: 2px;
}

/* Product Footer */
.monitor-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: #999;
    padding-top: 8px;
    border-top: 1px solid #f0eeea;
}

.monitor-product-updated i {
    margin-right: 2px;
}

.monitor-product-readonly {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0eeea;
    color: #666;
}

/* ============================================
   REPORTS
   ============================================ */
.report-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.report-filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.report-filter-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.report-filter-group label i {
    margin-right: 4px;
    color: #8b1a2b;
}

.report-filter-group select,
.report-filter-group input {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s;
}

.report-filter-group select:focus,
.report-filter-group input:focus {
    border-color: #8b1a2b;
    outline: none;
}

.report-filter-group .btn-sm {
    margin-top: auto;
}

/* Report Stats */
.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.report-stat-card {
    background: white;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

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

.report-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.report-stat-info {
    flex: 1;
    min-width: 0;
}

.report-stat-label {
    display: block;
    font-size: 0.6rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e2a4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-stat-change {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    position: absolute;
    top: 8px;
    right: 10px;
    white-space: nowrap;
}

.report-stat-change.positive {
    background: #e8f5e9;
    color: #2e7d32;
}

.report-stat-change.negative {
    background: #ffebee;
    color: #c62828;
}

.report-stat-change.neutral {
    background: #f5f5f5;
    color: #666;
}

/* Report Charts Grid */
.report-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.report-chart-panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.report-chart-panel h3 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #1e2a4a;
    border-bottom: 2px solid #f0eeea;
    padding-bottom: 8px;
}

.report-chart-panel h3 i {
    margin-right: 6px;
}

/* Trend Chart */
.trend-chart {
    padding: 8px 0;
}

.trend-chart .chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    padding: 0 4px;
    border-bottom: 2px solid #f0eeea;
}

.trend-chart .chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    height: 100%;
}

.trend-chart .chart-column.today .chart-bar {
    background: #8b1a2b;
}

.trend-chart .chart-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.trend-chart .chart-bar {
    width: 100%;
    max-width: 20px;
    border-radius: 3px 3px 0 0;
    min-height: 3px;
    transition: height 0.5s ease;
    background: #d4a84b;
}

.trend-chart .chart-label {
    font-size: 0.55rem;
    color: #999;
}

.trend-chart .chart-value {
    font-size: 0.5rem;
    color: #666;
    font-weight: 500;
}

.trend-chart .chart-summary {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 8px 10px;
    background: #f8f6f4;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #666;
}

/* ============================================
   MONITOR
   ============================================ */
.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.monitor-card {
    background: white;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.monitor-header h4 {
    margin: 0;
}

.monitor-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.monitor-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.monitor-row .stock-value {
    font-weight: 700;
}

.stock-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin: 6px 0;
    overflow: hidden;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.bg-success {
    background: #2e7d32;
}
.bg-warning {
    background: #ed6c02;
}
.bg-danger {
    background: #c62828;
}

.monitor-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #999;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0eeea;
}

.read-only-label {
    color: #666;
}

.read-only-label i {
    margin-right: 2px;
}

/* ============================================
   TABLES & FILTERS
   ============================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 14px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table-container {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    background: #f8f6f4;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #1e2a4a;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0eeea;
}

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

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

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-pending {
    background: #fff3e0;
    color: #ed6c02;
}
.status-success {
    background: #e8f5e9;
    color: #2e7d32;
}
.status-warning {
    background: #fff3e0;
    color: #ed6c02;
}
.status-info {
    background: #e3f2fd;
    color: #0d47a1;
}
.status-danger {
    background: #ffebee;
    color: #c62828;
}
.status-received {
    background: #e8f5e9;
    color: #1b5e20;
}

/* ============================================
   HISTORY
   ============================================ */
.history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin: 14px 0 20px 0;
}

.history-summary .summary-card {
    background: white;
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.history-summary .summary-card i {
    font-size: 1.4rem;
    color: #8b1a2b;
}

.history-summary .summary-card h4 {
    margin: 0;
    font-size: 0.7rem;
    color: #666;
}

.history-summary .summary-card span {
    font-size: 1rem;
    font-weight: 700;
    color: #1e2a4a;
}

/* ============================================
   PLACEHOLDERS
   ============================================ */
.loading-placeholder {
    padding: 24px;
    text-align: center;
    color: #999;
}

.loading-placeholder i {
    margin-right: 6px;
}

.empty-placeholder {
    padding: 24px;
    text-align: center;
    color: #999;
}

.error-placeholder {
    padding: 24px;
    text-align: center;
    color: #c62828;
}

.error-page {
    text-align: center;
    padding: 40px 20px;
}

.error-page i {
    font-size: 3rem;
    color: #c62828;
    margin-bottom: 12px;
}

.error-page h2 {
    font-size: 1.6rem;
    margin: 0;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
    width: 100%;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    border-left: 4px solid #8b1a2b;
}

.toast-success {
    border-left-color: #2e7d32;
}
.toast-error {
    border-left-color: #c62828;
}
.toast-warning {
    border-left-color: #ed6c02;
}
.toast-info {
    border-left-color: #0d47a1;
}

.toast i {
    font-size: 1.2rem;
}
.toast-success i {
    color: #2e7d32;
}
.toast-error i {
    color: #c62828;
}
.toast-warning i {
    color: #ed6c02;
}
.toast-info i {
    color: #0d47a1;
}

.toast button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    margin-left: auto;
    padding: 0 4px;
}

.toast button:hover {
    color: #333;
}

/* ============================================
   MODAL SYSTEM - UNIFIED
   ============================================ */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalFadeIn 0.3s ease;
}

.modal-container.hidden {
    display: none !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: modalSlideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-box.modal-lg {
    max-width: 700px;
}

.modal-box.modal-sm {
    max-width: 380px;
}

.modal-box.modal-full {
    max-width: 95%;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 2px solid #f0eeea;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e2a4a;
    margin: 0;
}

.modal-header h3 i {
    color: #8b1a2b;
    margin-right: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #999;
    cursor: pointer;
    padding: 0 6px;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .form-group {
    margin-bottom: 14px;
}

.modal-body .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: #1e2a4a;
}

.modal-body .form-group label i {
    color: #8b1a2b;
    margin-right: 4px;
    width: 16px;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #fafafa;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
    border-color: #8b1a2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.1);
    background: #ffffff;
}

.modal-body .form-group small {
    display: block;
    font-size: 0.7rem;
    color: #999;
    margin-top: 2px;
}

.modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.modal-body .error-message {
    color: #c62828;
    background: #ffebee;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    border-left: 3px solid #c62828;
    margin-bottom: 14px;
}

.modal-body .success-message {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    border-left: 3px solid #2e7d32;
    margin-bottom: 14px;
}

.modal-body .modal-info {
    padding: 10px 14px;
    background: #e3f2fd;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0d47a1;
    border-left: 3px solid #0d47a1;
    margin-bottom: 14px;
}

.modal-body .modal-info i {
    margin-right: 6px;
}

.modal-body .modal-uid-display {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fef7e0 0%, #fef3c7 100%);
    border-radius: 10px;
    margin-bottom: 16px;
    border: 2px solid #d4a84b;
}

.modal-body .modal-uid-icon {
    width: 40px;
    height: 40px;
    background: #d4a84b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.modal-body .modal-uid-content {
    flex: 1;
}

.modal-body .modal-uid-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #92400e;
    letter-spacing: 0.3px;
}

.modal-body .modal-uid-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #1e2a4a;
    margin: 2px 0;
}

.modal-body .modal-uid-hint {
    display: block;
    font-size: 0.6rem;
    color: #92400e;
    opacity: 0.7;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 2px solid #f0eeea;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.modal-footer .btn {
    min-width: 80px;
    justify-content: center;
}

.modal-footer .btn-sm {
    min-width: 60px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal responsive */
@media (max-width: 600px) {
    .modal-box {
        max-width: 95%;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 14px 16px;
    }
    
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-body .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .modal-footer {
        padding: 10px 16px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .modal-body .modal-uid-display {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   CHART
   ============================================ */
.chart-container {
    min-height: 160px;
}

.trend-chart {
    padding: 8px 0;
}

.chart-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.chart-legend .legend-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 4px;
}

.chart-legend .revenue-color {
    background: #8b1a2b;
}
.chart-legend .cogs-color {
    background: #d4a84b;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 100px;
    padding: 0 4px;
}

.chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.chart-column .bar {
    width: 100%;
    max-width: 16px;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}

.chart-column .revenue-bar {
    background: #8b1a2b;
}

.chart-column .cogs-bar {
    background: #d4a84b;
}

.chart-column .bar-label {
    font-size: 0.55rem;
    color: #999;
}

.chart-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #999;
    margin-top: 6px;
    padding: 0 4px;
}

/* ============================================
   PROFILE - REDESIGNED UI (Fits Page Properly)
   ============================================ */

.profile-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 0;
    width: 100%;
}

.profile-card {
    max-width: 750px;
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #f8f6f4 0%, #f0eeea 100%);
    border-bottom: 2px solid #f0eeea;
}

.profile-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-avatar .profile-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.profile-avatar .profile-status i {
    font-size: 0.65rem;
}

.profile-avatar .profile-status.active i {
    color: #2e7d32;
}

.profile-avatar .profile-status.inactive i {
    color: #c62828;
}

.profile-name-section {
    flex: 1;
    min-width: 0;
}

.profile-name-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e2a4a;
    margin: 0 0 6px 0;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.profile-meta .badge {
    font-size: 0.7rem;
    padding: 3px 12px;
}

.profile-meta .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.profile-body {
    padding: 24px 32px;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 32px;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f2ed;
}

.profile-info-item:last-child {
    border-bottom: none;
}

.profile-info-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info-label i {
    margin-right: 6px;
    color: #8b1a2b;
    width: 14px;
    font-size: 0.7rem;
}

.profile-info-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e2a4a;
    word-break: break-word;
}

.profile-info-value.profile-uid {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #8b1a2b;
    font-size: 0.9rem;
}

.profile-divider {
    height: 1px;
    background: #f0eeea;
    margin: 20px 0;
}

.profile-actions h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e2a4a;
    margin: 0 0 12px 0;
}

.profile-actions h4 i {
    color: #8b1a2b;
    margin-right: 8px;
}

.profile-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-action-buttons .btn {
    min-width: 100px;
    justify-content: center;
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Profile Responsive */
@media (max-width: 768px) {
    .profile-wrapper {
        padding: 5px 0;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 16px;
    }
    
    .profile-name-section h2 {
        font-size: 1.2rem;
    }
    
    .profile-meta {
        justify-content: center;
    }
    
    .profile-body {
        padding: 20px;
    }
    
    .profile-info-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .profile-info-item {
        padding: 5px 0;
    }
    
    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .profile-action-buttons {
        justify-content: center;
    }
    
    .profile-action-buttons .btn {
        min-width: 80px;
        padding: 7px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .profile-header {
        padding: 16px;
        gap: 12px;
    }
    
    .profile-body {
        padding: 16px;
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .profile-name-section h2 {
        font-size: 1rem;
    }
    
    .profile-info-value {
        font-size: 0.85rem;
    }
    
    .profile-info-label {
        font-size: 0.6rem;
    }
    
    .profile-actions h4 {
        font-size: 0.85rem;
    }
    
    .profile-action-buttons .btn {
        min-width: 70px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ============================================
   VERY LARGE NUMBER HANDLING
   ============================================ */
.finance-stat-value.very-large,
.financial-value.very-large,
.inventory-summary-value.very-large,
.stat-value.very-large,
.history-stat-value.very-large,
.stock-stat-value.very-large,
.report-stat-value.very-large,
.executive-value.very-large,
.report-detail-value.very-large {
    font-size: 0.85rem !important;
}

@media (max-width: 768px) {
    .finance-stat-value.very-large,
    .financial-value.very-large,
    .inventory-summary-value.very-large,
    .stat-value.very-large,
    .history-stat-value.very-large,
    .stock-stat-value.very-large,
    .report-stat-value.very-large,
    .executive-value.very-large,
    .report-detail-value.very-large {
        font-size: 0.7rem !important;
    }
}

@media (max-width: 480px) {
    .finance-stat-value.very-large,
    .financial-value.very-large,
    .inventory-summary-value.very-large,
    .stat-value.very-large,
    .history-stat-value.very-large,
    .stock-stat-value.very-large,
    .report-stat-value.very-large,
    .executive-value.very-large,
    .report-detail-value.very-large {
        font-size: 0.6rem !important;
    }
}

/* ============================================
   RESPONSIVE - FULL
   ============================================ */
@media (max-width: 1024px) {
    .order-container {
        flex-direction: column;
    }
    
    .order-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .summary-card,
    .supplier-card {
        flex: 1;
        min-width: 240px;
    }
    
    .finance-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .report-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .executive-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
}

@media (max-width: 900px) {
    .landing-container {
        grid-template-columns: 1fr;
        min-height: auto;
        margin: 10px;
    }
    
    .landing-brand {
        padding: 28px 20px;
    }
    
    .landing-auth {
        padding: 28px 20px;
    }
    
    .brand-logo h1 {
        font-size: 2.2rem;
    }
    
    .setup-container {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 24px;
    }

    .setup-brand {
        padding: 28px 24px;
    }

    .setup-brand-content {
        max-width: 100%;
        text-align: center;
    }

    .setup-brand-logo {
        justify-content: center;
    }

    .setup-brand-features {
        align-items: center;
    }

    .setup-feature {
        width: 100%;
        max-width: 300px;
    }

    .setup-form-wrapper {
        padding: 28px 24px;
    }

    .setup-form-container {
        max-width: 100%;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .report-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 64px;
        padding: 12px 0;
    }
    
    .sidebar-brand span,
    .sidebar-brand small,
    .sidebar-link span,
    .sidebar-footer .user-info,
    .sidebar-footer .user-uid {
        display: none;
    }
    
    .sidebar-link {
        justify-content: center;
        padding: 10px;
    }
    
    .sidebar-link i {
        font-size: 1.1rem;
        width: auto;
    }
    
    .main-content {
        padding: 14px 16px;
    }
    
    .page-header h2 {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px 14px;
        min-height: 60px;
    }
    
    .stat-card i {
        font-size: 1.4rem;
        width: 30px;
    }
    
    .stat-card span {
        font-size: 1rem;
    }
    
    .stat-card h3 {
        font-size: 0.65rem;
    }
    
    .finance-stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .finance-stat-card {
        padding: 10px 12px !important;
        min-height: 60px !important;
    }
    
    .finance-stat-value {
        font-size: 0.9rem !important;
    }
    
    .finance-stat-label {
        font-size: 0.5rem !important;
    }
    
    .finance-stat-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }
    
    .quick-stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .quick-stat {
        padding: 8px 10px !important;
        min-height: 50px !important;
    }
    
    .quick-stat-value {
        font-size: 0.9rem !important;
    }
    
    .quick-stat-label {
        font-size: 0.5rem !important;
    }
    
    .finance-charts-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .finance-chart-panel {
        padding: 14px;
    }
    
    .inventory-summary-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .inventory-summary-item {
        padding: 8px 10px !important;
        min-height: 50px !important;
    }
    
    .inventory-summary-value {
        font-size: 0.85rem !important;
    }
    
    .inventory-summary-label {
        font-size: 0.5rem !important;
    }
    
    .inventory-summary-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
    }
    
    .employee-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .employee-card {
        padding: 8px 10px;
    }
    
    .stock-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .staff-grid {
        grid-template-columns: 1fr;
    }
    
    .staff-dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .staff-stat-card {
        padding: 10px 12px;
        min-height: 55px;
    }
    
    .staff-stat-value {
        font-size: 1rem;
    }
    
    .staff-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 14px;
    }
    
    .staff-search-wrapper {
        min-width: auto;
    }
    
    .staff-grid-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .staff-card {
        flex-wrap: wrap;
        padding: 12px 14px;
    }
    
    .staff-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }
    
    .staff-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .monitor-grid {
        grid-template-columns: 1fr;
    }
    
    .inventory-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .inventory-card {
        border-radius: 10px;
    }
    
    .inventory-icon-wrapper {
        height: 80px;
        font-size: 2.4rem;
    }
    
    .history-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .history-stat-card {
        padding: 10px 12px;
        min-height: 55px;
    }
    
    .history-stat-card .stat-value {
        font-size: 1rem;
    }
    
    .history-stat-card .stat-label {
        font-size: 0.55rem;
    }
    
    .history-stat-card .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .history-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 14px;
    }
    
    .history-filters .filter-group {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }
    
    .history-filters .filter-group label {
        min-width: 50px;
        font-size: 0.6rem;
    }
    
    .history-filters .filter-group input,
    .history-filters .filter-group select {
        flex: 1;
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .history-pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .pagination-btn {
        padding: 4px 12px;
        font-size: 0.75rem;
    }
    
    .pagination-info {
        font-size: 0.75rem;
        min-width: 100px;
    }
    
    .order-detail-summary {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px;
    }
    
    .detail-item.total {
        grid-column: span 2;
    }
    
    .report-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .report-stat-card {
        padding: 10px 12px;
        min-height: 55px;
    }
    
    .report-stat-value {
        font-size: 0.95rem;
    }
    
    .report-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .report-detail-card {
        padding: 8px 10px;
        min-height: 50px;
    }
    
    .report-detail-value {
        font-size: 0.95rem;
    }
    
    .report-period-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 14px;
    }
    
    .period-buttons {
        justify-content: center;
    }
    
    .period-btn {
        padding: 3px 10px;
        font-size: 0.7rem;
    }
    
    .custom-period {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .report-executive-summary .executive-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .executive-item {
        padding: 8px 10px;
    }
    
    .executive-value {
        font-size: 0.9rem;
    }
    
    .report-financial-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .report-financial-card {
        padding: 10px 12px !important;
        min-height: 55px !important;
    }
    
    .financial-value {
        font-size: 0.9rem !important;
    }
    
    .financial-label {
        font-size: 0.5rem !important;
    }
    
    .financial-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.75rem !important;
    }
    
    .top-product-item {
        grid-template-columns: 24px 1fr 50px 60px;
        font-size: 0.7rem;
        gap: 4px;
        padding: 6px 8px;
    }
    
    .top-product-item .revenue {
        font-size: 0.7rem;
        min-width: 50px;
    }
    
    .top-product-item .bar-wrapper {
        min-width: 30px;
    }
    
    .staff-performance-item {
        grid-template-columns: 28px 1fr 60px;
        gap: 6px;
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .staff-performance-item .staff-bar-wrapper {
        display: none;
    }
    
    .staff-performance-item .staff-revenue {
        font-size: 0.75rem;
        min-width: 60px;
    }
    
    .staff-performance-item .staff-info .staff-name {
        font-size: 0.75rem;
    }
    
    .staff-performance-item .staff-info .staff-stats {
        font-size: 0.6rem;
        gap: 6px;
    }
    
    .order-breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .order-breakdown-total {
        align-self: flex-end;
    }
    
    .category-item {
        flex-wrap: wrap;
        padding: 4px 8px;
    }
    
    .category-info {
        min-width: auto;
    }
    
    .category-revenue {
        min-width: auto;
        font-size: 0.75rem;
    }
    
    .category-pct {
        min-width: auto;
        font-size: 0.65rem;
    }
    
    .category-filters {
        gap: 4px;
        padding: 6px 0 10px 0;
    }
    
    .category-filter-btn {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
    
    .category-filter-btn i {
        font-size: 0.65rem;
    }
    
    .drink-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .drink-card {
        min-height: 110px;
        padding: 10px;
    }
    
    .drink-card .drink-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .drink-card .drink-icon i {
        font-size: 1.4rem;
    }
    
    .drink-card h4 {
        font-size: 0.7rem;
    }
    
    .drink-card p {
        font-size: 0.75rem;
    }
    
    .tabs-bar {
        gap: 4px;
        padding: 4px 0 10px 0;
    }
    
    .tab-item {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .tab-item .tab-name {
        max-width: 50px;
    }
    
    .salesperson-stats {
        flex-direction: column;
        gap: 2px;
        font-size: 0.75rem;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .history-summary {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .variance-item {
        grid-template-columns: 1fr 60px 40px 60px;
        font-size: 0.7rem;
        gap: 4px 8px;
        padding: 4px 8px;
    }
    
    .order-tabs {
        flex-direction: column;
        gap: 2px;
        padding: 4px;
    }
    
    .order-tab {
        text-align: center;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .report-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
    }
    
    .report-filter-group {
        width: 100%;
    }
    
    .report-filter-group select,
    .report-filter-group input {
        width: 100%;
    }
    
    .report-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .report-stat-card {
        padding: 10px 12px;
    }
    
    .report-stat-value {
        font-size: 0.9rem;
    }
    
    .report-stat-change {
        font-size: 0.55rem;
        top: 6px;
        right: 8px;
        padding: 1px 6px;
    }
    
    .staff-performance-item {
        grid-template-columns: 24px 1fr 50px;
        gap: 4px;
        padding: 6px 8px;
    }
    
    .staff-performance-item .staff-rank i {
        font-size: 0.8rem;
    }
    
    .staff-performance-item .staff-revenue {
        font-size: 0.65rem;
        min-width: 50px;
    }
    
    .staff-performance-item .staff-info .staff-name {
        font-size: 0.65rem;
    }
    
    .staff-performance-item .staff-info .staff-stats {
        font-size: 0.55rem;
        gap: 4px;
    }
    
    .top-product-item {
        grid-template-columns: 20px 1fr 40px;
        font-size: 0.65rem;
        gap: 3px;
        padding: 4px 6px;
    }
    
    .top-product-item .revenue {
        display: none;
    }
    
    .top-product-item .bar-wrapper {
        min-width: 20px;
    }
    
    .top-product-item .rank i {
        font-size: 0.7rem;
    }
    
    .feed-entry {
        grid-template-columns: 60px 1fr 60px;
        font-size: 0.7rem;
        gap: 4px;
        padding: 4px 8px;
    }
    
    .feed-entry .feed-items {
        display: none;
    }
    
    .setup-brand {
        padding: 20px 16px;
    }

    .setup-brand-logo h1 {
        font-size: 1.8rem;
    }

    .setup-brand-logo i {
        font-size: 1.8rem;
    }

    .setup-brand-content h2 {
        font-size: 1.2rem;
    }

    .setup-form-wrapper {
        padding: 20px 16px;
    }

    .setup-form-header h2 {
        font-size: 1.3rem;
    }

    .setup-uid-display {
        flex-direction: column;
        text-align: center;
        padding: 12px 16px;
    }
    
    .staff-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .report-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-bars {
        height: 70px;
    }
    
    .po-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .po-details {
        flex-direction: column;
        gap: 2px;
    }

    /* Place Order responsive */
    .item-row {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 10px;
        gap: 6px;
    }
    
    .item-info {
        flex-wrap: wrap;
    }
    
    .item-controls {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        gap: 6px;
    }
    
    .qty-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .order-sidebar {
        flex-direction: column;
        width: 100%;
    }
    
    .summary-card,
    .supplier-card {
        min-width: auto;
    }
    
    .summary-stats {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    
    .order-tabs {
        flex-direction: column;
    }
    
    .order-tab {
        text-align: center;
    }
    
    .items-scroll {
        max-height: 300px;
    }
    
    .trend-chart-summary {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        padding: 6px 8px;
    }
    
    .trend-summary-value {
        font-size: 0.75rem;
    }
    
    .receive-item-fields {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .order-container {
        flex-direction: column;
        gap: 14px;
    }
    
    .stock-monitor-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .stock-stat-card {
        padding: 10px 12px !important;
        min-height: 50px !important;
    }
    
    .stock-stat-value {
        font-size: 0.9rem !important;
    }
    
    .stock-stat-label {
        font-size: 0.5rem !important;
    }
    
    .stock-stat-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.75rem !important;
    }
    
    .stock-monitor-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .monitor-product-card {
        padding: 12px 14px;
    }
    
    .monitor-product-details {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    
    .monitor-detail-item {
        padding: 4px 6px;
    }
    
    .monitor-detail-value {
        font-size: 0.7rem;
    }
    
    .stock-monitor-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .stock-monitor-filters .filter-group {
        width: 100%;
    }
    
    .stock-monitor-filters .filter-group input,
    .stock-monitor-filters .filter-group select {
        width: 100%;
        min-width: auto;
    }
    
    .stock-monitor-filters .btn {
        width: 100%;
    }
    
    .history-stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .history-stat {
        padding: 8px 10px !important;
        min-height: 50px !important;
    }
    
    .history-stat-value {
        font-size: 0.9rem !important;
    }
    
    .history-stat-label {
        font-size: 0.5rem !important;
    }
    
    .history-stat-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
    }
    
    .history-filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .history-filters-bar .filter-group {
        width: 100%;
    }
    
    .history-filters-bar .filter-group input,
    .history-filters-bar .filter-group select {
        width: 100%;
        min-width: auto;
    }
    
    .history-filters-bar .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .landing-brand {
        padding: 20px 12px;
    }
    
    .landing-auth {
        padding: 20px 12px;
    }
    
    .brand-logo h1 {
        font-size: 1.8rem;
    }
    
    .brand-logo i {
        font-size: 2.2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 8px 10px;
        min-height: 50px;
        border-radius: 10px;
    }
    
    .stat-card i {
        font-size: 1.2rem;
        width: 24px;
    }
    
    .stat-card span {
        font-size: 0.85rem;
    }
    
    .stat-card h3 {
        font-size: 0.55rem;
    }
    
    .finance-stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    
    .finance-stat-card {
        padding: 8px 10px !important;
        min-height: 50px !important;
        border-radius: 10px;
    }
    
    .finance-stat-value {
        font-size: 0.75rem !important;
    }
    
    .finance-stat-label {
        font-size: 0.45rem !important;
    }
    
    .finance-stat-icon {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.65rem !important;
    }
    
    .finance-stat-change {
        font-size: 0.5rem !important;
        padding: 1px 4px !important;
    }
    
    .quick-stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    
    .quick-stat {
        padding: 6px 8px !important;
        min-height: 40px !important;
        border-radius: 8px;
    }
    
    .quick-stat-value {
        font-size: 0.8rem !important;
    }
    
    .quick-stat-label {
        font-size: 0.45rem !important;
    }
    
    .inventory-summary-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    
    .inventory-summary-item {
        padding: 6px 8px !important;
        min-height: 40px !important;
        border-radius: 8px;
    }
    
    .inventory-summary-value {
        font-size: 0.7rem !important;
    }
    
    .inventory-summary-label {
        font-size: 0.45rem !important;
    }
    
    .inventory-summary-icon {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.6rem !important;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .history-summary {
        grid-template-columns: 1fr;
    }
    
    .history-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .order-detail-summary {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .detail-item.total {
        grid-column: span 1;
    }
    
    .report-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .report-details-grid {
        grid-template-columns: 1fr;
    }
    
    .report-executive-summary .executive-grid {
        grid-template-columns: 1fr;
    }
    
    .report-financial-grid {
        grid-template-columns: 1fr !important;
    }
    
    .staff-dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .staff-stat-card {
        padding: 8px 10px;
        min-height: 45px;
        border-radius: 10px;
    }
    
    .staff-stat-value {
        font-size: 0.85rem;
    }
    
    .staff-stat-label {
        font-size: 0.45rem;
    }
    
    .staff-stat-icon {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }
    
    .staff-card {
        flex-direction: column;
        text-align: center;
        padding: 12px 14px;
    }
    
    .staff-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .staff-meta {
        justify-content: center;
    }
    
    .staff-actions {
        justify-content: center;
    }
    
    .inventory-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .inventory-card {
        border-radius: 8px;
    }
    
    .inventory-icon-wrapper {
        height: 60px;
        font-size: 2rem;
    }
    
    .inventory-details {
        padding: 10px;
    }
    
    .category-filters {
        gap: 3px;
        padding: 4px 0 8px 0;
    }
    
    .category-filter-btn {
        padding: 2px 6px;
        font-size: 0.6rem;
        border-radius: 16px;
    }
    
    .drink-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }
    
    .drink-card {
        min-height: 90px;
        padding: 6px 8px;
        border-radius: 10px;
    }
    
    .drink-card .drink-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .drink-card .drink-icon i {
        font-size: 1rem;
    }
    
    .drink-card h4 {
        font-size: 0.6rem;
        margin: 4px 0 2px 0;
    }
    
    .drink-card p {
        font-size: 0.65rem;
    }
    
    #pack-fields .form-row,
    #tot-fields .form-row,
    #edit-pack-fields .form-row,
    #edit-tot-fields .form-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .modal-content {
        padding: 16px 12px;
    }
    
    .data-table {
        font-size: 0.7rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
    
    .order-date {
        font-size: 0.65rem;
    }
    
    .order-time {
        font-size: 0.55rem;
    }
    
    .pagination-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .report-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .top-product-item {
        grid-template-columns: 20px 1fr 40px;
        font-size: 0.6rem;
        gap: 2px;
        padding: 4px 6px;
    }
    
    .top-product-item .revenue {
        display: none;
    }
    
    .top-product-item .bar-wrapper {
        min-width: 15px;
    }
    
    .staff-performance-item {
        grid-template-columns: 20px 1fr 40px;
        font-size: 0.6rem;
        padding: 4px 6px;
        gap: 3px;
    }
    
    .staff-performance-item .staff-rank i {
        font-size: 0.65rem;
    }
    
    .staff-performance-item .staff-revenue {
        font-size: 0.6rem;
        min-width: 40px;
    }
    
    .staff-performance-item .staff-info .staff-name {
        font-size: 0.6rem;
    }
    
    .staff-performance-item .staff-info .staff-stats {
        font-size: 0.5rem;
        gap: 3px;
    }
    
    .trend-chart .chart-bar {
        max-width: 12px;
    }
    
    .trend-chart .chart-label {
        font-size: 0.45rem;
    }
    
    .trend-chart .chart-value {
        display: none;
    }
    
    .feed-entry {
        grid-template-columns: 1fr 60px;
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    .feed-entry .feed-items {
        display: none;
    }
    
    .feed-entry .feed-time {
        display: none;
    }

    /* Place Order responsive - mobile */
    .item-row {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .item-tags span {
        font-size: 0.5rem;
        padding: 1px 4px;
        border-radius: 8px;
    }
    
    .qty input {
        width: 28px;
        padding: 2px 2px;
        font-size: 0.65rem;
    }
    
    .qty label {
        font-size: 0.4rem;
    }
    
    .total-box {
        min-width: 50px;
        padding: 2px 6px;
    }
    
    .total-value {
        font-size: 0.7rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr 1fr;
        gap: 3px;
    }
    
    .stat {
        padding: 4px 6px;
        border-radius: 6px;
    }
    
    .stat-value {
        font-size: 0.8rem;
    }
    
    .stat-label {
        font-size: 0.45rem;
    }
    
    .total-row span:last-child {
        font-size: 0.9rem;
    }
    
    .order-items-section {
        padding: 10px;
        border-radius: 10px;
    }
    
    .summary-card,
    .supplier-card {
        padding: 12px;
        border-radius: 10px;
    }
    
    .trend-chart-summary {
        grid-template-columns: 1fr;
        padding: 4px 6px;
    }
    
    .receive-item-fields {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .period-btn {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
    
    .history-stat {
        padding: 6px 8px !important;
        min-height: 40px !important;
    }
    
    .history-stat-value {
        font-size: 0.8rem !important;
    }
    
    .order-breakdown-info {
        gap: 4px;
    }
    
    .order-breakdown-date {
        font-size: 0.6rem;
    }
    
    .category-item {
        flex-direction: column;
        align-items: stretch;
        padding: 4px 6px;
    }
    
    .category-info {
        min-width: auto;
    }
    
    .category-bar-wrapper {
        width: 100%;
    }
    
    .category-revenue {
        text-align: left;
        font-size: 0.7rem;
    }
    
    .monitor-product-details {
        grid-template-columns: 1fr 1fr;
    }
    
    .monitor-product-card {
        padding: 10px 12px;
        border-radius: 10px;
    }
    
    .finance-chart-panel {
        padding: 10px;
        border-radius: 10px;
    }
    
    .finance-chart-header h3 {
        font-size: 0.8rem;
    }
    
    .report-chart-panel {
        padding: 10px;
        border-radius: 10px;
    }
    
    .report-chart-header h3 {
        font-size: 0.8rem;
    }
    
    .report-panel-header h3 {
        font-size: 0.8rem;
    }
    
    .variance-item {
        grid-template-columns: 1fr 40px 30px 50px;
        font-size: 0.6rem;
        gap: 2px 6px;
        padding: 3px 6px;
    }
    
    .order-item .item-name {
        font-size: 0.75rem;
    }
    
    .order-item .item-total {
        font-size: 0.75rem;
        min-width: 50px;
    }
    
    .order-item .item-controls button {
        padding: 1px 4px;
        font-size: 0.6rem;
    }
    
    .order-item .item-qty {
        font-size: 0.75rem;
        min-width: 16px;
    }
    
    .order-total {
        font-size: 0.95rem;
    }
    
    .order-total span:last-child {
        font-size: 1rem;
    }
    
    .stock-monitor-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .history-stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    
    .history-stat {
        padding: 6px 8px !important;
        min-height: 38px !important;
    }
    
    .history-stat-value {
        font-size: 0.75rem !important;
    }
    
    .history-table td,
    .history-table th {
        padding: 6px 8px;
        font-size: 0.65rem;
    }
    
    .order-id {
        font-size: 0.65rem;
    }
    
    .order-cost {
        font-size: 0.7rem;
    }
}

/* ============================================
   VERY LARGE NUMBER HANDLING - EXTRA SMALL
   ============================================ */
@media (max-width: 480px) {
    .finance-stat-value.very-large,
    .financial-value.very-large,
    .inventory-summary-value.very-large,
    .stat-value.very-large,
    .history-stat-value.very-large,
    .stock-stat-value.very-large,
    .report-stat-value.very-large,
    .executive-value.very-large,
    .report-detail-value.very-large {
        font-size: 0.55rem !important;
    }
}