/* ═══════════════════════════════════════════════════════════════════════════
   End of Day Report Styles
   File: resources/css/end-of-day-report.css
   Loaded via SellerPanelProvider ->assets() or ->viteTheme()
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Theme Variables (Light mode default) ──────────────────────────────── */
:root {
    --eod-bg: #ffffff;
    --eod-surface: #f8fafc;
    --eod-text: #1e293b;
    --eod-muted: #64748b;
    --eod-border: #e2e8f0;
    --eod-primary: #3b82f6;
    --eod-danger: #ef4444;
    --eod-warning: #f59e0b;
    --eod-success: #22c55e;
}

/* ── Dark mode ─────────────────────────────────────────────────────────── */
.dark {
    --eod-bg: #0f172a;
    --eod-surface: #1e293b;
    --eod-text: #e2e8f0;
    --eod-muted: #8b8fa3;
    --eod-border: #2a2a3a;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.eod-wrap {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    min-height: 600px;
    color: var(--eod-text);
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.eod-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eod-card {
    background: var(--eod-surface);
    border: 1px solid var(--eod-border);
    border-radius: 10px;
    padding: 16px;
}

.eod-card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: var(--eod-muted);
}

.eod-field { margin-bottom: 10px; }

.eod-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--eod-muted);
    margin-bottom: 4px;
}

.eod-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--eod-border);
    border-radius: 6px;
    background: var(--eod-bg);
    color: var(--eod-text);
    font-size: 13px;
}

.eod-input:focus {
    outline: none;
    border-color: var(--eod-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.eod-input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    min-height: 38px;
}

.dark .eod-input[type="date"] { color-scheme: dark; }

.eod-input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
}

.dark .eod-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.eod-btn {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}

.eod-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.eod-btn-primary {
    background: var(--eod-primary);
    color: #fff;
}

.eod-btn-primary:hover { opacity: 0.9; }

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

.eod-btn-secondary:hover {
    background: var(--eod-surface);
}

.eod-btn-endshift {
    background: var(--eod-danger);
    color: #fff;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
}

.eod-btn-endshift:hover { opacity: 0.9; }

.eod-btn-warning {
    background: var(--eod-warning);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.eod-btn-warning:hover { opacity: 0.9; }

/* ── Past Reports List ─────────────────────────────────────────────────── */
.eod-past-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 4px;
    border: 1px solid var(--eod-border);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: var(--eod-text);
    transition: border-color 0.15s;
}

.eod-past-row:hover { border-color: var(--eod-primary); }

.eod-past-row.active {
    border-color: var(--eod-primary);
    background: rgba(59, 130, 246, 0.08);
}

.eod-past-number { font-weight: 700; font-size: 13px; }
.eod-past-date { font-size: 12px; color: var(--eod-muted); margin-left: 6px; }
.eod-past-meta { font-size: 11px; color: var(--eod-muted); }

/* ── Content Area ──────────────────────────────────────────────────────── */
.eod-content { min-width: 0; }

.eod-report-header { margin-bottom: 16px; }

.eod-report-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--eod-text);
}

.eod-report-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--eod-success);
    color: #fff;
    text-transform: uppercase;
}

.eod-report-badge.preview {
    background: var(--eod-warning);
    color: #000;
}

.eod-report-subtitle {
    font-size: 13px;
    color: var(--eod-muted);
    margin-top: 4px;
}

/* ── Section Nav ───────────────────────────────────────────────────────── */
.eod-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--eod-border);
    padding-bottom: 12px;
}

.eod-nav-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--eod-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.eod-nav-btn:hover {
    color: var(--eod-text);
    border-color: var(--eod-border);
}

.eod-nav-btn.active {
    background: var(--eod-primary);
    color: #fff;
    border-color: var(--eod-primary);
}

/* ── KPI Cards ─────────────────────────────────────────────────────────── */
.eod-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.eod-kpi {
    padding: 14px;
    border: 1px solid var(--eod-border);
    border-radius: 8px;
    background: var(--eod-surface);
}

.eod-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--eod-muted);
    margin-bottom: 4px;
}

.eod-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--eod-text);
}

.eod-kpi-highlight {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.eod-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.eod-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--eod-muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--eod-border);
}

.eod-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--eod-border);
    color: var(--eod-text);
}

.eod-table tbody tr:last-child td {
    border-bottom: 1px solid var(--eod-border);
}

.eod-table tfoot td {
    border-top: 2px solid var(--eod-border);
    border-bottom: none;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.eod-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.eod-badge-void { background: var(--eod-danger); color: #fff; }
.eod-badge-comp { background: var(--eod-warning); color: #000; }

/* ── Empty States ──────────────────────────────────────────────────────── */
.eod-empty {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--eod-muted);
}

.eod-empty-cell { text-align: center; color: var(--eod-muted); }

.eod-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

/* ── Cash Drawer Status ────────────────────────────────────────────────── */
.eod-drawer-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--eod-border);
}

.eod-drawer-open {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
}

.eod-drawer-closed { background: var(--eod-surface); }

.eod-drawer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.eod-drawer-open .eod-drawer-dot {
    background: var(--eod-success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: eod-pulse 2s infinite;
}

.eod-drawer-closed .eod-drawer-dot { background: var(--eod-muted); }

@keyframes eod-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Hourly Bar Chart ──────────────────────────────────────────────────── */
.eod-hourly-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 16px 0;
    min-height: 160px;
    overflow-x: auto;
}

.eod-hourly-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 36px;
}

.eod-hourly-value {
    font-size: 10px;
    font-weight: 600;
    color: var(--eod-text);
    margin-bottom: 4px;
}

.eod-hourly-bar {
    width: 100%;
    max-width: 32px;
    background: var(--eod-primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

.eod-hourly-label {
    font-size: 10px;
    color: var(--eod-muted);
    margin-top: 4px;
    white-space: nowrap;
}

/* ── Modals (Dark/Light aware) ─────────────────────────────────────────── */
.eod-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.eod-modal {
    background: var(--eod-bg);
    border: 1px solid var(--eod-border);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: var(--eod-text);
}

.eod-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--eod-border);
}

.eod-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--eod-text);
}

.eod-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--eod-border);
    background: var(--eod-surface);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--eod-muted);
    transition: background 0.15s;
}

.eod-modal-close:hover { background: var(--eod-border); }

.eod-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.eod-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid var(--eod-border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   THERMAL PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Thermal receipt container — always renders white/black for paper */
.eod-thermal {
    width: 72mm;
    background: #fff;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    padding: 8mm 4mm;
    margin: 0 auto;
}

.eod-thermal.thermal-58mm {
    width: 52mm;
    font-size: 10px;
}

.eod-thermal-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.eod-thermal-header .thermal-biz-name {
    font-size: 14px;
    font-weight: 700;
}

.eod-thermal-header .thermal-subtitle {
    font-size: 10px;
}

.eod-thermal-section {
    margin-top: 8px;
    margin-bottom: 4px;
}

.eod-thermal-section-title {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    padding-bottom: 2px;
    margin-bottom: 4px;
}

.eod-thermal-row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
}

.eod-thermal-row.thermal-bold {
    font-weight: 700;
}

.eod-thermal-row.thermal-total {
    font-weight: 700;
    border-top: 1px dashed #000;
    padding-top: 4px;
    margin-top: 4px;
}

.eod-thermal-divider {
    border: none;
    border-top: 1px dashed #000;
    margin: 6px 0;
}

.eod-thermal-center {
    text-align: center;
    font-size: 10px;
    margin-top: 8px;
}

/* ── Screen print preview (the thermal receipt shown in the modal) ─────── */
.eod-print-preview {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.eod-print-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.eod-thermal-size-btn {
    padding: 4px 10px;
    border: 1px solid var(--eod-border);
    border-radius: 4px;
    background: transparent;
    color: var(--eod-text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.eod-thermal-size-btn.active {
    background: var(--eod-primary);
    border-color: var(--eod-primary);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT MEDIA QUERIES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Screen print (full report — Cmd+P / Save as PDF) ──────────────────── */
@media print {
    /* Hide everything except the report content */
    body * {
        visibility: hidden;
    }

    .eod-wrap,
    .eod-wrap * {
        visibility: visible;
    }

    .eod-wrap {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        grid-template-columns: none !important;
    }

    /* Hide sidebar, nav, buttons, modals, filament shell */
    .eod-sidebar,
    .eod-nav,
    .eod-btn,
    .eod-modal-overlay,
    .eod-print-controls,
    .fi-sidebar,
    .fi-topbar,
    .fi-header,
    .fi-main-ctn > :not(.fi-main),
    [class*="filament-"],
    button {
        display: none !important;
    }

    /* Show ALL sections when printing (override tab hiding) */
    .eod-section {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 16px;
    }

    /* Add section labels for print */
    .eod-section::before {
        content: attr(data-print-title);
        display: block;
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        border-bottom: 2px solid #000;
        padding-bottom: 4px;
        margin-bottom: 8px;
    }

    /* Full width for content */
    .eod-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* Force light colors on paper */
    body, .eod-wrap, .eod-content {
        background: #fff !important;
        color: #000 !important;
    }

    .eod-kpi {
        border-color: #ccc !important;
        background: #fff !important;
    }

    .eod-kpi-value,
    .eod-kpi-label {
        color: #000 !important;
    }

    .eod-table th,
    .eod-table td {
        border-color: #ccc !important;
        color: #000 !important;
    }

    .eod-report-title,
    .eod-report-subtitle,
    .eod-card-title {
        color: #000 !important;
    }

    .eod-hourly-bar {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .eod-report-badge {
        border: 1px solid #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Remove URL/date from browser header/footer */
    @page {
        margin: 1cm;
        size: A4;
    }
}

/* ── Thermal print (when printing from the thermal preview modal) ──────── */
@media print {
    .eod-thermal-print-mode .eod-wrap {
        display: none !important;
    }

    .eod-thermal-print-mode .eod-thermal-print-area,
    .eod-thermal-print-mode .eod-thermal-print-area * {
        visibility: visible !important;
    }

    .eod-thermal-print-mode .eod-thermal-print-area {
        position: absolute;
        left: 0;
        top: 0;
    }

    .eod-thermal-print-mode .eod-thermal {
        box-shadow: none !important;
        margin: 0 !important;
    }

    /* For thermal: tight margins */
    .eod-thermal-print-mode {
        @page {
            margin: 2mm;
            size: 80mm auto;
        }
    }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .eod-wrap {
        grid-template-columns: 1fr;
    }

    .eod-sidebar { order: -1; }

    .eod-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .eod-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}