/* ===== PAGE-SPECIFIC STYLES ===== */

/* ===== DASHBOARD ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-grid .full-width {
        grid-column: 1 / -1;
    }
}

/* ===== LOW STOCK ITEM ===== */
.low-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.low-stock-name {
    font-size: var(--font-sm);
    font-weight: 500;
}

.low-stock-qty {
    font-size: var(--font-sm);
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.low-stock-qty.danger {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.low-stock-qty.warning {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
}

/* ===== BILLING PAGE ===== */
.billing-search-container {
    position: relative;
    z-index: 10;
}

.cart-empty {
    padding: var(--space-2xl) var(--space-md);
    text-align: center;
    color: var(--text-muted);
}

.cart-empty .material-symbols-rounded {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: var(--space-sm);
}

.payment-options {
    display: flex;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.payment-option {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.payment-option.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary-glow);
    color: var(--accent-primary-hover);
}

.payment-option:hover {
    border-color: var(--accent-primary);
}

/* ===== INVENTORY PAGE ===== */
.stock-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
}

.stock-in {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.stock-low {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
}

.stock-out {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

/* ===== SALES ANALYTICS ===== */
.analytics-period-chips {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-xs);
}

.period-chip {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.period-chip:hover {
    background: var(--bg-card-hover);
}

.period-chip.active {
    background: var(--accent-primary-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary-hover);
}

/* ===== EXPENSE PAGE ===== */
.expense-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.expense-card:hover {
    background: var(--bg-tertiary);
}

.expense-card:last-child {
    border-bottom: none;
}

.expense-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.expense-icon .material-symbols-rounded {
    font-size: 20px;
    color: white;
}

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

.expense-title {
    font-weight: 600;
    font-size: var(--font-base);
}

.expense-category {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.expense-amount {
    font-weight: 700;
    font-size: var(--font-base);
    color: var(--accent-danger);
    white-space: nowrap;
}

.expense-date {
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-align: right;
}

/* ===== REPORTS PAGE ===== */
.report-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: var(--space-lg);
    overflow-x: auto;
}

.report-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.report-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.report-tab:hover:not(.active) {
    color: var(--text-secondary);
}

/* ===== REPORTS MOBILE RESPONSIVE ===== */
@media (max-width: 767px) {
    .report-tabs {
        gap: 1px;
        padding: 2px;
    }

    .report-tab {
        padding: 8px 6px;
        font-size: 11px;
        flex: 0 0 auto;
        min-width: max-content;
    }

    /* Force all inline 2-col grids to stack on mobile */
    #page-reports div[style*="grid-template-columns: 1fr 1fr"],
    #page-reports div[style*="grid-template-columns:1fr 1fr"],
    #reportContent div[style*="grid-template-columns: 1fr 1fr"],
    #reportContent div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Today's snapshot: 4-col → 2-col */
    #page-reports div[style*="grid-template-columns:repeat(4,1fr)"],
    #page-reports div[style*="grid-template-columns: repeat(4, 1fr)"],
    #reportContent div[style*="grid-template-columns:repeat(4,1fr)"],
    #reportContent div[style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Stats grid 2-col on mobile */
    #page-reports .stats-grid[style*="grid-template-columns:repeat(2,1fr)"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ===== USER MANAGEMENT ===== */
.user-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.user-card:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-lg);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

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

.user-name {
    font-weight: 600;
    font-size: var(--font-base);
}

.user-role {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.user-status {
    font-size: var(--font-xs);
}

/* ===== INVOICE/RECEIPT ===== */
.receipt {
    background: white;
    color: #111;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed #ccc;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.receipt-header h3 {
    font-size: 16px;
    color: #111;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.receipt-divider {
    border-top: 1px dashed #ccc;
    margin: var(--space-sm) 0;
}

.receipt-total {
    font-weight: 700;
    font-size: 14px;
}

/* ===== PRINT STYLES ===== */
@media print {
    body * {
        visibility: hidden;
    }

    .receipt,
    .receipt * {
        visibility: visible;
    }

    .receipt {
        position: absolute;
        top: 0;
        left: 0;
    }
}