/* Giulio POS - iPad Optimized | Modern UI */

:root {
    /* Brand Colors - Refined palette */
    --color-bg: #F7F3EE;
    --color-bg-dark: #EDE6DC;
    --color-surface: #FFFFFF;
    --color-surface-elevated: #FFFFFF;
    
    --color-primary: #9B2335;
    --color-primary-hover: #7D1C2A;
    --color-primary-light: rgba(155, 35, 53, 0.1);
    
    --color-secondary: #2E7D32;
    --color-secondary-hover: #1B5E20;
    --color-secondary-light: rgba(46, 125, 50, 0.1);
    
    --color-text-primary: #1A1A1A;
    --color-text-secondary: #666666;
    --color-text-tertiary: #999999;
    --color-text-inverse: #FFFFFF;
    
    --color-accent: #D4A853;
    --color-danger: #D32F2F;
    --color-danger-light: rgba(211, 47, 47, 0.1);
    --color-success: #388E3C;
    
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-strong: rgba(0, 0, 0, 0.12);
    
    /* Shadows - Subtle and modern */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-focus: 0 0 0 3px rgba(155, 35, 53, 0.2);
    
    /* Border Radius - Consistent scale */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Georgia', 'Times New Roman', serif;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== LAYOUT ==================== */

.pos-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    background: var(--color-bg);
}

.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-6);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    z-index: 10;
    min-height: 64px;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
}

.logo h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo .tagline {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.pos-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 1px;
    background: var(--color-border);
}

/* ==================== CATEGORIES SIDEBAR ==================== */

.categories-sidebar {
    width: 110px;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.categories-sidebar h2 {
    padding: var(--space-4) var(--space-3);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--color-text-tertiary);
    border-bottom: 1px solid var(--color-border);
}

.categories-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--space-3) var(--space-2);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
}

.category-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

.category-btn.active {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-sm);
}

.category-btn .icon {
    font-size: 24px;
    margin-bottom: var(--space-1);
    line-height: 1;
}

.category-btn .name {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* ==================== PRODUCTS SECTION ==================== */

.products-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: var(--space-5);
    background: var(--color-bg);
}

.products-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--color-text-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-3);
    overflow-y: auto;
    padding-bottom: var(--space-4);
    padding-right: var(--space-2);
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-3);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    min-height: 110px;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-secondary);
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}

.product-card:hover {
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-sm);
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-xs);
}

.product-card .product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.product-card .product-description {
    font-size: 11px;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-2);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.3px;
}

/* ==================== ORDER PANEL ==================== */

.order-panel {
    width: 300px;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.order-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.order-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
}

.empty-order {
    text-align: center;
    color: var(--color-text-tertiary);
    padding: var(--space-8) var(--space-4);
    font-size: 14px;
}

.order-item {
    display: flex;
    align-items: center;
    padding: var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
    gap: var(--space-3);
}

.order-item-qty {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    min-width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

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

.order-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-price {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.order-item-total {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.order-item-actions {
    display: flex;
    gap: var(--space-1);
}

.order-item-actions button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-qty-minus {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-strong);
}

.btn-qty-minus:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-qty-plus {
    background: var(--color-secondary);
    color: var(--color-text-inverse);
}

.btn-qty-plus:hover {
    background: var(--color-secondary-hover);
}

.order-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.order-customer-row {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.customer-name-input {
    flex: 1;
    padding: var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--color-bg);
    transition: all var(--transition-fast);
    min-width: 0;
}

.customer-name-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
}

.customer-name-input::placeholder {
    color: var(--color-text-tertiary);
}

.pickup-time-select {
    width: 90px;
    padding: var(--space-3) var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    background: var(--color-bg);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.pickup-time-select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
}

.order-discount-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding: var(--space-2) 0;
}

.order-discount-row label {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.discount-input {
    width: 60px;
    padding: var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: var(--color-bg);
}

.discount-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.order-discount-row span {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.order-totals {
    margin-bottom: var(--space-4);
}

.order-subtotal,
.order-discount-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

.order-discount-display span:last-child {
    color: var(--color-accent);
    font-weight: 500;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.order-total span:first-child {
    font-size: 14px;
    color: var(--color-text-secondary);
}

#order-total-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.5px;
}

/* ==================== BUTTONS ==================== */

.btn {
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-admin,
.btn-kitchen {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text-inverse);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 13px;
    text-decoration: none;
}

.btn-admin:hover,
.btn-kitchen:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-kitchen {
    background: var(--color-secondary);
}

.btn-kitchen:hover {
    background: var(--color-secondary-hover);
}

.btn-clear {
    background: transparent;
    color: var(--color-text-tertiary);
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
    font-weight: 500;
}

.btn-clear:hover {
    color: var(--color-danger);
    background: var(--color-danger-light);
}

.btn-pay {
    width: 100%;
    background: var(--color-secondary);
    color: var(--color-text-inverse);
    font-size: 15px;
    padding: var(--space-4);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-md);
}

.btn-pay:hover {
    background: var(--color-secondary-hover);
}

.btn-print {
    width: 100%;
    background: var(--color-bg-dark);
    color: var(--color-text-primary);
    font-size: 14px;
    padding: var(--space-3);
}

.btn-print:hover {
    background: var(--color-bg);
}

.btn-add {
    background: var(--color-secondary);
    color: var(--color-text-inverse);
    width: 100%;
    padding: var(--space-3);
}

.btn-add:hover {
    background: var(--color-secondary-hover);
}

.btn-save {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    width: 100%;
    padding: var(--space-3);
}

.btn-save:hover {
    background: var(--color-primary-hover);
}

.btn-edit {
    background: var(--color-bg-dark);
    color: var(--color-text-primary);
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
}

.btn-edit:hover {
    background: var(--color-accent);
    color: var(--color-text-inverse);
}

.btn-delete {
    background: transparent;
    color: var(--color-text-tertiary);
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
}

.btn-delete:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* ==================== MODALS ==================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-surface);
    z-index: 1;
}

.modal-header h2 {
    color: var(--color-text-primary);
    font-size: 18px;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background: var(--color-bg-dark);
    color: var(--color-text-primary);
}

/* ==================== ADMIN PANEL ==================== */

.admin-panel {
    max-width: 700px;
}

.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    padding: 0 var(--space-4);
    gap: var(--space-1);
}

.tab-btn {
    padding: var(--space-4) var(--space-4);
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}

.tab-btn:hover {
    color: var(--color-text-primary);
}

.tab-btn.active {
    color: var(--color-primary);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-content {
    display: none;
    padding: var(--space-5);
}

.tab-content.active {
    display: block;
}

.admin-form {
    background: var(--color-bg);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
}

.admin-form h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--color-text-primary);
}

.admin-form input,
.admin-form select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: var(--space-3);
    background: var(--color-surface);
    transition: all var(--transition-fast);
}

.admin-form input:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.admin-form input::placeholder {
    color: var(--color-text-tertiary);
}

.admin-list h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
}

.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
    transition: background var(--transition-fast);
}

.admin-list-item:hover {
    background: var(--color-bg-dark);
}

.admin-list-item-info {
    flex: 1;
    min-width: 0;
}

.admin-list-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-primary);
}

.admin-list-item-meta {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 2px;
}

.admin-list-item-actions {
    display: flex;
    gap: var(--space-2);
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.admin-list-item:hover .admin-list-item-actions {
    opacity: 1;
}

/* ==================== PAYMENT SUCCESS ==================== */

.payment-success {
    text-align: center;
    padding: var(--space-8);
}

.success-icon {
    font-size: 56px;
    margin-bottom: var(--space-4);
}

.payment-success h2 {
    color: var(--color-secondary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.payment-success p {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-6);
    line-height: 1.4;
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

/* ==================== ORDER HISTORY ==================== */

.order-item-admin {
    flex-wrap: wrap;
}

.order-number {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 15px;
}

.order-total-badge {
    background: var(--color-secondary);
    color: var(--color-text-inverse);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-left: var(--space-2);
}

.order-items-preview {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: var(--space-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}

.order-customer {
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-left: var(--space-2);
}

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: var(--space-2);
}

.status-badge.active {
    background: var(--color-accent);
    color: #fff;
}

.status-badge.completed {
    background: var(--color-secondary);
    color: #fff;
}

.order-completed {
    opacity: 0.6;
}

.order-detail-header {
    text-align: center;
    margin-bottom: var(--space-5);
}

.order-detail-header h3 {
    color: var(--color-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.order-detail-header p {
    color: var(--color-text-secondary);
    font-size: 14px;
}

.order-detail-items {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.order-detail-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

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

.order-detail-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    padding: var(--space-4);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-radius: var(--radius-sm);
}

/* ==================== RESPONSIVE (iPad) ==================== */

@media (max-width: 1024px) {
    .categories-sidebar {
        width: 90px;
    }
    
    .order-panel {
        width: 260px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    }
    
    .category-btn .icon {
        font-size: 22px;
    }
    
    .category-btn .name {
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .pos-main {
        flex-direction: column;
    }
    
    .categories-sidebar {
        width: 100%;
        flex-direction: row;
        height: auto;
    }
    
    .categories-sidebar h2 {
        display: none;
    }
    
    .categories-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: var(--space-2);
        gap: var(--space-2);
    }
    
    .category-btn {
        flex-direction: row;
        min-width: auto;
        padding: var(--space-2) var(--space-3);
        gap: var(--space-2);
    }
    
    .category-btn .icon {
        margin-bottom: 0;
        font-size: 18px;
    }
    
    .order-panel {
        width: 100%;
        max-height: 45vh;
    }
}

/* ==================== UTILITY ==================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==================== REVENUE TAB ==================== */

.revenue-overview {
    padding: var(--space-4);
}

.revenue-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.revenue-card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    text-align: center;
    border-left: 4px solid var(--color-border);
}

.revenue-card.today {
    border-left-color: var(--color-secondary);
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.1), transparent);
}

.revenue-card.week {
    border-left-color: var(--color-accent);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), transparent);
}

.revenue-card.month {
    border-left-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), transparent);
}

.revenue-card.year {
    border-left-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
}

.revenue-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.revenue-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.revenue-orders {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.revenue-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
}

.revenue-table-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.revenue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.revenue-table thead {
    background: var(--color-bg);
    position: sticky;
    top: 0;
}

.revenue-table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
}

.revenue-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.revenue-table tbody tr:hover {
    background: var(--color-bg);
}

.revenue-table .amount {
    font-weight: 600;
    color: var(--color-secondary);
}

@media (max-width: 768px) {
    .revenue-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .revenue-amount {
        font-size: 22px;
    }
}

/* ==================== EDIT ORDER MODAL ==================== */

.edit-order-modal {
    max-width: 480px;
    padding: var(--space-5);
}

.edit-order-modal .modal-header {
    margin-bottom: var(--space-4);
}

.edit-order-info {
    padding: var(--space-4);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    border: 1px solid var(--color-border);
}

.edit-order-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: center;
    margin-bottom: var(--space-3);
    gap: var(--space-3);
}

.edit-order-row:last-child {
    margin-bottom: 0;
}

.edit-order-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.edit-order-row input {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--color-surface);
}

.edit-order-row input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.1);
}

.edit-order-row input[type="number"] {
    width: 80px;
}

.edit-order-row > span {
    font-weight: 700;
    font-size: 18px;
    color: var(--color-primary);
}

.edit-order-items {
    margin-bottom: var(--space-4);
}

.edit-order-items h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#edit-order-items-list {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
}

.edit-order-item {
    display: flex;
    align-items: center;
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    gap: var(--space-3);
}

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

.edit-order-item-qty input {
    width: 55px;
    padding: var(--space-2);
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    background: var(--color-surface);
}

.edit-order-item-qty input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.edit-order-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.edit-order-item-price {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    min-width: 60px;
    text-align: right;
}

.edit-order-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    padding: var(--space-1);
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.edit-order-item-remove:hover {
    opacity: 1;
}

.edit-order-totals {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border: 1px solid var(--color-border);
}

.edit-order-subtotal,
.edit-order-discount-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.edit-order-discount-display span:last-child {
    color: var(--color-accent);
}

.edit-order-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    padding-top: var(--space-3);
    margin-top: var(--space-2);
    border-top: 2px solid var(--color-border);
    color: var(--color-text-primary);
}

.edit-order-actions {
    display: flex;
    gap: var(--space-3);
}

.edit-order-actions .btn {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-size: 14px;
    font-weight: 600;
}

.btn-cancel {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-cancel:hover {
    background: var(--color-bg);
}
