* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #16a085;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --light-text: #fff;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    color: var(--light-text);
    padding: 18px 25px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    z-index: 100;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    opacity: 0.5;
    pointer-events: none;
}

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

header h1 {
    margin: 0;
    font-size: 1.5rem;
    white-space: nowrap;
}

footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    color: var(--light-text);
    padding: 12px 25px;
    border-radius: 12px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    z-index: 100;
}

footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    opacity: 0.5;
    pointer-events: none;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.footer-item.footer-credit {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.footer-label {
    font-size: 0.85rem;
    opacity: 0.8;
    white-space: nowrap;
}

.footer-value {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    color: rgba(255,255,255,0.95);
}

.footer-credit .footer-value {
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 500;
}

.main-nav-compact {
    position: relative;
    display: inline-block;
    z-index: 101;
}

.menu-toggle {
    padding: 8px 15px;
    background: rgba(255,255,255,0.2);
    color: var(--light-text);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 1002;
    overflow: hidden;
}

.menu-dropdown.show {
    display: block;
}

.nav-btn-compact {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background: white;
    color: var(--primary-color);
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: left;
}

.nav-btn-compact:last-child {
    border-bottom: none;
}

.nav-btn-compact:hover {
    background: #f5f5f5;
}

.nav-btn-compact.active {
    background: var(--secondary-color);
    color: white;
}

.view {
    display: none;
}

.view.active {
    display: block;
}


.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(52, 152, 219, 0.02) 100%);
    border-radius: 12px;
    border: 1px solid rgba(52, 152, 219, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.view-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

/* Report Controls Styles */
.report-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.report-date-controls {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.report-date-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.95rem;
}

.report-date-label strong {
    font-weight: 600;
    color: var(--dark-text);
    font-size: 0.9rem;
}

.report-date-input {
    padding: 12px 16px;
    border: 2px solid rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: var(--dark-text);
    min-width: 160px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.report-date-input:hover {
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: 0 3px 6px rgba(52, 152, 219, 0.1);
}

.report-date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2), 0 2px 4px rgba(52, 152, 219, 0.1);
}

.report-btn {
    min-height: 48px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--light-text);
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #28a745;
    color: var(--light-text);
}

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #28a745;
    color: var(--light-text);
}

.btn-warning:hover {
    background: #218838;
}

.btn-info {
    background: #ff8c00;
    color: var(--light-text);
}

.btn-info:hover {
    background: #ff7700;
}

.btn-secondary {
    background: #95a5a6;
    color: var(--light-text);
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-add-icon {
    width: auto;
    min-width: 52px;
    height: 52px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    flex-shrink: 0;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: 2px solid rgba(52, 152, 219, 0.3);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.25), 0 2px 4px rgba(52, 152, 219, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-add-icon::after {
    content: '';
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 900;
}

.btn-add-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-add-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.35), 0 3px 6px rgba(52, 152, 219, 0.2);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    border-color: rgba(52, 152, 219, 0.5);
}

.btn-add-icon:hover::before {
    left: 100%;
}

.btn-add-icon:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 6px rgba(52, 152, 219, 0.3), 0 1px 3px rgba(52, 152, 219, 0.15);
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    min-width: 0;
}

.table-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Hourly table delayed start button (top-right, red) */
.table-card .table-delay-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 0 12px 0 28px;
    background: var(--danger-color);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.35);
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.table-card .table-delay-btn:hover {
    background: #c0392b;
    transform: scale(1.06);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.45);
}

.table-card .table-delay-btn:active {
    transform: scale(0.96);
}

.delayed-start-modal-content {
    max-width: 420px;
}

.delayed-start-time-input {
    width: 100%;
    margin-top: 8px;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-size: 1.1rem;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.delayed-start-time-input:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.55);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}

.manual-session-modal-content {
    max-width: 520px;
}

#manual-sessions-list .usage-item {
    align-items: flex-start;
}

.manual-session-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.manual-delete-btn {
    background: var(--danger-color);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.manual-delete-btn:active {
    transform: scale(0.96);
}

.table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(44, 62, 80, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.table-card:hover::before {
    opacity: 1;
}

.table-icon {
    font-size: 2.5rem;
    margin-bottom: 6px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

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

.table-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.1);
    border-color: rgba(52, 152, 219, 0.3);
}

.table-card.active {
    border: 3px solid var(--success-color);
    background: linear-gradient(135deg, #e8f8f5 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.25), 0 2px 4px rgba(39, 174, 96, 0.15);
}

.table-card.active::before {
    background: linear-gradient(90deg, transparent, var(--success-color), transparent);
    opacity: 1;
}

.table-card.inactive {
    opacity: 0.75;
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
}

.table-card.inactive:hover {
    opacity: 0.9;
}

.table-card.instant-table {
    border: 3px solid #ff8c00;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
}

.table-card.instant-table::before {
    background: linear-gradient(90deg, transparent, #ff8c00, transparent);
    opacity: 1;
}

.table-card.instant-table:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.25), 0 2px 6px rgba(255, 140, 0, 0.15);
    border-color: #ff8c00;
}

.table-card h3 {
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 6px;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
    letter-spacing: 0.3px;
}

.table-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-top: 4px;
    line-height: 1;
    padding: 4px 8px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    display: inline-block;
}

.table-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge-hourly {
    background: var(--warning-color);
    color: white;
}

.badge-regular {
    background: var(--info-color);
    color: white;
}

.badge-active {
    background: var(--success-color);
    color: white;
}

.badge-inactive {
    background: var(--danger-color);
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.table-info-item {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.table-info-item strong {
    color: var(--dark-text);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.product-card {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 60px;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.product-card-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: 50%;
    flex-shrink: 0;
}

.product-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-card h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.product-card-details {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-details {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.product-stock {
    margin: 0;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    font-size: 0.85rem;
}

.stock-high {
    background: #d5f4e6;
    color: #229954;
}

.stock-low {
    background: #fadbd8;
    color: #c0392b;
}

.stock-out {
    background: #f4f4f4;
    color: #7f8c8d;
}

.product-actions {
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.product-actions .btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    min-width: 48px;
    max-width: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.product-actions .btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.product-actions .btn-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.product-actions .btn-icon:hover::before {
    width: 100%;
    height: 100%;
}

.product-actions .btn-icon:active {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    min-width: 28px;
    max-width: 28px;
    flex-shrink: 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: normal;
}

.btn-icon:hover {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.customer-card {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 60px;
}

.customer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.customer-card-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: 50%;
    flex-shrink: 0;
}

.customer-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.customer-card h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.customer-card-balance {
    font-size: 0.9rem;
    font-weight: bold;
}

.customer-details {
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
}

.balance-positive {
    color: var(--success-color);
}

.customer-selection-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.customer-selection-btn {
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1rem;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.customer-selection-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(44, 62, 80, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.customer-selection-btn:hover::before {
    opacity: 1;
}

.customer-selection-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.1);
    border-color: rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.customer-selection-btn strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

.customer-selection-btn small {
    color: var(--danger-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.balance-negative {
    color: var(--danger-color);
}

.customer-actions {
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.customer-actions .btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    min-width: 48px;
    max-width: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.customer-actions .btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.customer-actions .btn-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.customer-actions .btn-icon:hover::before {
    width: 100%;
    height: 100%;
}

.customer-actions .btn-icon:active {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sales-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sale-card {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 60px;
}

.sale-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.sale-card-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: 50%;
    flex-shrink: 0;
}

.sale-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sale-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sale-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.sale-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.sale-header-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

.sale-items {
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.sale-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--light-bg);
    margin: 3px 0;
    border-radius: 5px;
    font-size: 0.9rem;
}

.sale-header h3 {
    margin: 0;
    font-size: 1rem;
}

.sale-header p {
    margin: 2px 0;
    font-size: 0.85rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* App dialog (must be above every panel/modal) */
#app-dialog.modal {
    z-index: 5000;
}

.app-dialog-content {
    max-width: 520px;
    padding: 22px 22px;
    border-radius: 16px;
}

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

.app-dialog-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.app-dialog-message {
    font-size: 1.05rem;
    line-height: 1.45;
    color: var(--dark-text);
    padding: 10px 2px 6px 2px;
    white-space: pre-wrap;
}

.app-dialog-actions {
    gap: 12px;
}

.app-dialog-close {
    cursor: pointer;
    user-select: none;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
    position: relative;
}

/* Auth modal */
.auth-modal-content {
    max-width: 460px;
    padding: 26px 26px 22px 26px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(44, 62, 80, 0.10);
    box-shadow: 0 14px 50px rgba(0,0,0,0.22), 0 2px 10px rgba(0,0,0,0.10);
}

.auth-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.auth-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.18) 0%, rgba(52, 152, 219, 0.08) 100%);
    border: 1px solid rgba(52, 152, 219, 0.18);
    font-size: 1.2rem;
}

.auth-title-wrap h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-color);
}

.auth-subtitle {
    margin: 2px 0 0 0;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.92rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.auth-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: var(--dark-text);
}

.auth-label > span {
    font-size: 0.92rem;
    color: rgba(44, 62, 80, 0.85);
}

.auth-input {
    padding: 12px 12px;
    border: 1px solid rgba(189, 195, 199, 0.9);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.85);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

.auth-password-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.auth-toggle {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(189, 195, 199, 0.9);
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    color: rgba(44, 62, 80, 0.85);
    transition: background 0.2s;
}

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

.auth-error {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(231, 76, 60, 0.10);
    border: 1px solid rgba(231, 76, 60, 0.25);
    color: #c0392b;
    font-weight: 800;
}

.auth-submit {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.auth-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.55);
    border-top-color: rgba(255,255,255,1);
    animation: authspin 0.9s linear infinite;
}

@keyframes authspin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#product-modal .modal-content {
    max-width: 500px;
    padding: 30px 25px;
}

/* Receipt Modal Styles */
.receipt-modal-content {
    max-width: 550px;
    padding: 30px;
    border-radius: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.receipt-header {
    text-align: center;
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(52, 152, 219, 0.05) 100%);
    border-radius: 12px;
    border: 2px solid rgba(52, 152, 219, 0.15);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.receipt-header h2 {
    color: var(--primary-color);
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.receipt-date-time {
    position: static;
    font-size: 0.95rem;
    color: #7f8c8d;
    font-weight: 600;
    margin-top: 5px;
}

.receipt-body {
    margin-bottom: 25px;
    padding: 0 5px;
}

.receipt-section {
    margin-bottom: 20px;
    background: white;
    padding: 15px 18px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(236, 240, 241, 0.6);
}

.receipt-section-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(52, 152, 219, 0.2);
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: rgba(236, 240, 241, 0.3);
    transition: background 0.2s;
}

.receipt-item:hover {
    background: rgba(236, 240, 241, 0.5);
}

.receipt-item:last-child {
    margin-bottom: 0;
}

.receipt-item-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-text);
}

.receipt-item-details {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-left: 10px;
}

.receipt-item-price {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 90px;
    text-align: right;
    color: var(--secondary-color);
}

.receipt-total {
    margin-top: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #d5f4e6 0%, #c8f0dc 100%);
    border-radius: 12px;
    border: 2px solid #229954;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2), 0 2px 4px rgba(39, 174, 96, 0.1);
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 1rem;
    font-weight: 600;
}

.receipt-total-row.final {
    font-size: 1.4rem;
    font-weight: 700;
    color: #229954;
    padding-top: 12px;
    margin-top: 8px;
}

.receipt-total-row.final:not(:first-child) {
    border-top: 2px solid #229954;
}

.receipt-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(236, 240, 241, 0.8);
    flex-wrap: wrap;
}

.receipt-actions .btn {
    min-height: 52px;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    flex: 1;
    min-width: 140px;
}

#table-modal .modal-content {
    max-width: 900px;
    padding: 20px 25px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#table-modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 10px;
}

.table-modal-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    position: relative;
    width: 100%;
    min-height: 44px;
}

.table-modal-header h2 {
    margin: 0;
    padding: 12px 20px;
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--dark-text);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: left;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(52, 152, 219, 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    text-shadow: none;
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
    max-width: 300px;
    z-index: 1;
}

.table-modal-header-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    height: 40px;
}

.table-modal-header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-modal-footer {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
    padding: 15px 0 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-wrap: nowrap;
}

.table-info-footer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.table-info-footer .table-info-grid {
    margin: 0;
    padding: 0;
}

.table-footer-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.table-modal-footer .table-footer-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 12px;
    align-items: stretch;
    justify-items: stretch;
    max-width: 360px;
}

.table-modal-footer .table-footer-buttons .btn-footer {
    width: 100%;
}

.table-modal-footer .table-footer-buttons #cancel-hourly-btn {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    .table-modal-footer .table-footer-buttons {
        grid-template-columns: 1fr;
        max-width: 180px;
    }

    .table-modal-footer .table-footer-buttons #cancel-hourly-btn {
        grid-column: auto;
    }
}

.btn-footer {
    min-width: 140px;
    height: 56px;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 28px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-footer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-footer:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-footer:hover::before {
    width: 200%;
    height: 200%;
}

.btn-footer:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.close-header {
    width: auto;
    height: 48px;
    min-width: 44px;
    min-height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    font-size: 1.8rem;
    font-weight: bold;
    border: 2px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    padding: 8px 12px;
    margin: 0;
    margin-left: auto;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.close-header:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: rgba(231, 76, 60, 0.5);
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(231, 76, 60, 0.3);
}

.btn-header {
    height: 40px;
    min-height: auto;
    padding: 7px 18px;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0;
    box-sizing: border-box;
    line-height: 1;
    box-shadow: none;
    transition: all 0.15s ease;
}

.btn-header:hover {
    transform: none;
    box-shadow: none;
    opacity: 0.85;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: var(--danger-color);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

form label {
    display: block;
    margin: 15px 0 5px;
    font-weight: bold;
    color: var(--dark-text);
}

form input,
form select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

form input:focus,
form select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-actions {
    margin-top: 35px;
    display: flex;
    gap: 15px;
    justify-content: stretch;
    flex-direction: row;
    width: 100%;
}

.form-actions .btn {
    min-height: 58px;
    padding: 16px 24px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 12px;
    flex: 1;
    min-width: 0;
}

#pay-full-amount-btn {
    background: #27ae60 !important;
    border-color: #229954 !important;
    font-weight: 700 !important;
}

#pay-full-amount-btn:hover {
    background: #229954 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.table-info {
    margin: 0 0 20px 0;
}

.table-info-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
    background: transparent;
    border-radius: 0;
    font-size: 1.1rem;
    align-items: center;
    width: 100%;
    box-shadow: none;
    border: none;
}

.table-info-grid span {
    white-space: nowrap;
    color: var(--dark-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-weight: 500;
    padding: 12px 20px;
    height: 48px;
    background: rgba(52, 152, 219, 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.table-info-grid span strong {
    color: #495057;
    font-weight: 600;
    font-size: 1.1rem;
}

.table-info-grid span > span {
    color: #212529;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.table-info-total {
    background: #d5f4e6 !important;
    border: none !important;
    color: #229954 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.table-info-total strong {
    color: #229954 !important;
    font-size: 1.1rem !important;
}

.table-info-total > span {
    color: #229954 !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
}

.table-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-modal-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 20px 0;
    border-radius: 2px;
}

.sales-items {
    margin-top: 15px;
}

.sale-item-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 4px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid rgba(236, 240, 241, 0.8);
    transition: all 0.3s ease;
    position: relative;
    min-height: 48px;
}

.sale-item-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
    border-radius: 8px 0 0 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.sale-item-row:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
    border-color: rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.sale-item-row:hover::before {
    opacity: 1;
}

.sale-item-content {
    width: 100%;
    display: flex;
    align-items: center;
}

.sale-item-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
    width: 100%;
}

.sale-item-product {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sale-item-separator {
    color: #bdc3c7;
    font-weight: normal;
    margin: 0 2px;
}

.sale-item-total {
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.sale-item-time {
    font-size: 0.9rem;
    color: #7f8c8d;
    white-space: nowrap;
}

.sale-item-row .btn-icon {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    margin-left: 6px !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid transparent !important;
    position: relative;
    overflow: hidden;
}

.sale-item-row .btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.sale-item-row .btn-icon:hover {
    transform: translateY(-3px) scale(1.1) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.sale-item-row .btn-icon:hover::before {
    width: 100%;
    height: 100%;
}

.sale-item-row .btn-icon:active {
    transform: translateY(-1px) scale(1.05) !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.sale-item-single {
    margin-bottom: 6px !important;
    padding: 10px 12px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04) !important;
    border: 1px solid rgba(236, 240, 241, 0.6) !important;
    transition: all 0.3s ease !important;
}

.sale-item-single:hover {
    transform: translateX(2px) !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%) !important;
}

.sale-item-single > div {
    font-size: 0.85rem;
}

.sale-item-single strong {
    font-size: 0.9rem;
}

.sale-item-total {

    font-size: 0.9rem !important;
}

.sale-item-date {
    font-size: 0.7rem !important;
    margin-top: 3px !important;
    color: #7f8c8d !important;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.empty-state h3 {
    margin-bottom: 10px;
}

/* Daily Dashboard Styles */
#daily-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 60px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 3px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.2;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.chart-card canvas {
    max-height: 300px;
}

.table-usage-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.table-usage-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.3rem;
}

#table-usage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.usage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    transition: background 0.3s;
}

.usage-item:hover {
    background: #dfe6e9;
}

.usage-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.usage-info strong {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.usage-info span {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.usage-income {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--success-color);
}

/* Products grid for table modal */
.products-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.product-card-mini {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 18px 12px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.product-card-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card-mini:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.1);
    border-color: rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.product-card-mini:hover::before {
    opacity: 1;
}

.product-card-mini.selected {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #e8f8f5 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.25), 0 2px 4px rgba(39, 174, 96, 0.15);
}

.product-card-mini.selected::before {
    background: linear-gradient(90deg, transparent, var(--success-color), transparent);
    opacity: 1;
}

.product-card-mini h4 {
    color: #ff8c00;
    font-size: 0.9rem;
    margin-bottom: 14px;
    margin-right: 35px;
    font-weight: 700;
    padding-right: 5px;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.product-card-mini .product-price-mini {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 800;
    margin-bottom: 8px;
    padding: 3px 8px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    display: inline-block;
}

.product-card-mini .product-stock-mini {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    display: inline-block;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.product-card-mini .product-stock-mini.stock-high {
    background: #d5f4e6;
    color: #229954;
}

.product-card-mini .product-stock-mini.stock-low {
    background: #fadbd8;
    color: #c0392b;
}

.product-card-mini .product-stock-mini.stock-out {
    background: #f4f4f4;
    color: #7f8c8d;
}

.product-card-mini .quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    padding: 2px;
    background: rgba(236, 240, 241, 0.5);
    border-radius: 8px;
}

.product-card-mini .quantity-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--primary-color);
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.product-card-mini .quantity-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: scale(1.05);
}

.product-card-mini .quantity-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.product-card-mini .quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #6c757d;
}

.product-card-mini .product-quantity-input {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    height: 42px;
    padding: 4px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center !important;
    font-weight: bold;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1.2;
    vertical-align: middle;
    direction: ltr;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.product-card-mini .product-add-btn-top {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 0 10px 0 30px;
    background: var(--success-color);
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.product-card-mini .product-add-btn-top:hover:not(:disabled) {
    background: #218838;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.product-card-mini .product-add-btn-top:active:not(:disabled) {
    transform: scale(0.95);
}

.product-card-mini .product-add-btn-top:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #6c757d;
}

.product-card-mini.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card-mini.out-of-stock:hover {
    transform: none;
    border-color: transparent;
}

.product-card-mini button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Stock Control Label */
.stock-control-label {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin: 20px 0 !important;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.stock-checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.stock-checkbox-group input[type="checkbox"] {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.stock-checkbox-group span {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-text);
    cursor: pointer;
}

.stock-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.stock-input-group span {
    white-space: nowrap;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-text);
    min-width: 60px;
}

.stock-input {
    flex: 1;
    max-width: 150px !important;
    min-width: 100px;
    width: auto !important;
    padding: 16px 18px !important;
    min-height: 52px !important;
    font-size: 1.1rem !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 10px !important;
    background: white !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.3rem;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

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

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

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

    .view-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        padding: 20px;
        margin: 10px;
    }

    .table-modal-header h2 {
        font-size: 1.2rem;
    }

    .table-info-grid {
        flex-wrap: wrap;
        gap: 8px 12px;
        font-size: 0.85rem;
    }

    .form-actions {
        flex-direction: row;
    }

    .form-actions .btn {
        flex: 1;
    }
}

/* Mobile-only tweaks (phones). Keep tablet layout unchanged. */
@media (max-width: 540px) {
    .app-container {
        padding: 14px;
    }

    header {
        padding: 14px 16px;
        border-radius: 14px;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .menu-toggle {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Tables grid: 2 columns on phones */
    .tables-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .table-card {
        padding: 10px;
        border-radius: 14px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.05);
    }

    .table-card .table-delay-btn {
        width: 40px;
        height: 40px;
        border-radius: 0 14px 0 26px;
        font-size: 1.2rem;
    }

    .table-icon {
        font-size: 2.1rem;
        margin-bottom: 4px;
    }

    .table-card h3 {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .table-price {
        font-size: 0.95rem;
        padding: 4px 8px;
    }

    /* View header spacing on small screens */
    .view-header {
        padding: 12px 14px;
        border-radius: 14px;
    }

    .view-header h2 {
        font-size: 1.6rem;
    }

    /* Footer: prevent overlap on narrow screens */
    footer {
        padding: 10px 14px;
        border-radius: 14px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .footer-item {
        width: 100%;
        justify-content: flex-start;
    }

    .footer-item.footer-credit {
        justify-content: flex-start;
    }

    .footer-label {
        font-size: 0.82rem;
        white-space: normal;
    }

    .footer-value {
        font-size: 0.88rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .footer-credit .footer-value {
        font-size: 0.78rem;
    }
}
