/* ==========================================================================
   Shared report dashboard theme (Sales Tax, Monthly Orders)
   ========================================================================== */

.report-dashboard {
    --report-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --report-ink: #1b2340;
    --report-body: #475569;
    --report-muted: #8b95a7;
    --report-line: #e8ecf2;
    --report-card-border: #eef0f5;
    --report-bg: #f5f6fb;
    --report-surface: #ffffff;
    --report-accent: #3b82f6;
    --report-accent-hover: #2563eb;
    --report-accent-soft: #eff6ff;
    --report-accent-text: #1d4ed8;
    --report-teal: #0f9b8e;
    --report-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
    --report-radius: 14px;
    --report-radius-sm: 10px;

    font-family: var(--report-font);
    color: var(--report-ink);
    background: var(--report-bg);
    min-height: calc(100vh - 2rem);
    margin: -1.5rem -1.5rem 0;
    padding: 1.75rem 1.5rem 2.5rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
    .report-dashboard {
        padding: 2rem 2rem 3rem;
    }
}

/* ── Header ─────────────────────────────────────────────────────────── */
.report-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}

.report-title {
    font-size: 1.95rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--report-ink);
    margin: 0 0 0.4rem 0;
    line-height: 1.15;
}

.report-subtitle {
    font-size: 0.92rem;
    color: var(--report-muted);
    margin: 0;
    font-weight: 400;
    max-width: 40rem;
}

.report-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 0.85rem;
}

.report-period {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.report-period__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--report-muted);
    letter-spacing: 0.01em;
}

.report-period__control {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--report-surface);
    border: 1px solid var(--report-line);
    border-radius: var(--report-radius-sm);
    padding: 0.55rem 0.85rem;
    min-width: 13.5rem;
    min-height: 42px;
    box-shadow: var(--report-shadow);
    cursor: pointer;
    color: var(--report-ink);
}

.report-period__control i:first-child {
    color: var(--report-muted);
    font-size: 0.95rem;
}

.report-period__value {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--report-ink);
    white-space: nowrap;
}

.report-period__control .bi-chevron-down {
    color: var(--report-muted);
    font-size: 0.75rem;
}

.report-period__control input[type="month"],
.report-period__control select {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    color-scheme: light;
}

a.report-btn {
    text-decoration: none;
    box-sizing: border-box;
}

.report-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--report-font);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--report-radius-sm);
    padding: 0.62rem 1.15rem;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.report-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.report-btn--primary {
    background: var(--report-accent);
    color: #ffffff;
    min-height: 42px;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.report-btn--primary:hover:not(:disabled) {
    background: var(--report-accent-hover);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.report-btn--ghost {
    background: var(--report-surface);
    color: var(--report-body);
    border-color: var(--report-line);
    box-shadow: var(--report-shadow);
}

.report-btn--ghost:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #d7dce6;
}

.report-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: report-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.report-spinner--dark {
    border-color: var(--report-line);
    border-top-color: var(--report-accent);
}

@keyframes report-spin {
    to { transform: rotate(360deg); }
}

/* ── KPI cards ──────────────────────────────────────────────────────── */
.report-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

@media (min-width: 720px) {
    .report-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .report-kpis {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.8rem;
    }
}

.report-kpi {
    background: var(--report-surface);
    border: 1px solid var(--report-card-border);
    border-radius: var(--report-radius);
    box-shadow: var(--report-shadow);
    padding: 1.05rem 1.05rem 0.95rem;
    min-width: 0;
}

.report-kpi__label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--report-muted);
    margin-bottom: 0.45rem;
}

.report-kpi__label i {
    font-size: 0.72rem;
    opacity: 0.8;
}

.report-kpi__value {
    font-size: 1.42rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--report-ink);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

@media (min-width: 1100px) {
    .report-kpi__value {
        font-size: 1.35rem;
    }
}

.report-kpi__value--accent { color: var(--report-accent); }
.report-kpi__value--teal { color: var(--report-teal); }

.report-kpi__hint {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--report-muted);
    line-height: 1.35;
}

/* ── Callout / info banner ──────────────────────────────────────────── */
.report-callout {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--report-accent-soft);
    border-radius: var(--report-radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.15rem;
    color: #1e40af;
}

.report-callout__icon {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: #ffffff;
    color: var(--report-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    margin-top: 0.05rem;
}

.report-callout__body {
    font-size: 0.84rem;
    line-height: 1.5;
    color: #1e40af;
}

.report-callout__body p {
    margin: 0;
}

.report-warning {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--report-radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.15rem;
    color: #92400e;
    font-size: 0.84rem;
}

.report-warning p {
    margin: 0;
}

/* ── Section panels ─────────────────────────────────────────────────── */
.report-panel {
    background: var(--report-surface);
    border: 1px solid var(--report-card-border);
    border-radius: var(--report-radius);
    box-shadow: var(--report-shadow);
    padding: 1.15rem 1.2rem 1rem;
    margin-bottom: 1.15rem;
}

.report-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.report-panel__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--report-ink);
    margin: 0;
    letter-spacing: -0.015em;
}

.report-panel__title::before {
    content: '';
    width: 4px;
    height: 1.05rem;
    border-radius: 99px;
    background: var(--report-accent);
    flex-shrink: 0;
}

.report-panel__title i {
    font-size: 0.8rem;
    color: var(--report-muted);
    font-weight: 400;
}

.report-footnote {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: var(--report-muted);
    font-style: italic;
}

/* ── Tables ─────────────────────────────────────────────────────────── */
.report-table-wrap {
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.report-table th,
.report-table td {
    text-align: left;
    padding: 0.72rem 0.7rem;
    border-bottom: 1px solid #f1f3f7;
    vertical-align: middle;
}

.report-table th {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--report-muted);
    white-space: nowrap;
}

.report-table td {
    color: var(--report-ink);
    font-weight: 500;
}

.report-table tbody tr:last-child td {
    border-bottom: 1px solid #eef0f5;
}

.report-table tfoot th,
.report-table tfoot td {
    border-bottom: none;
    border-top: 1px solid #e8ecf2;
    font-weight: 700;
    color: var(--report-ink);
    padding-top: 0.8rem;
}

.report-table .is-accent,
.report-table tfoot .is-accent {
    color: var(--report-accent);
    font-weight: 700;
}

.report-table .is-return td {
    background: #fff8f8;
}

.report-table .is-muted td {
    color: var(--report-muted);
    font-weight: 400;
}

.report-table .is-missing td {
    color: var(--report-muted);
}

.report-table .is-current td {
    background: var(--report-accent-soft);
}

.report-table .cell-muted,
.report-table .cell-sub {
    display: block;
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--report-muted);
    margin-top: 0.1rem;
}

.report-link {
    color: var(--report-accent);
    font-weight: 600;
    text-decoration: none;
}

.report-link:hover {
    text-decoration: underline;
}

/* ── Pagination ─────────────────────────────────────────────────────── */
.report-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 0.85rem 0 0.15rem;
    color: var(--report-muted);
    font-size: 0.82rem;
}

.report-pager__btn {
    width: 1.7rem;
    height: 1.7rem;
    border: none;
    background: transparent;
    color: var(--report-muted);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.report-pager__btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--report-ink);
}

.report-pager__btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ── Empty / loading ────────────────────────────────────────────────── */
.report-empty {
    background: var(--report-surface);
    border: 1px dashed #d7dce6;
    border-radius: var(--report-radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--report-muted);
}

.report-empty__title {
    font-weight: 600;
    color: var(--report-body);
    margin: 0 0 0.35rem;
}

.report-empty__hint {
    margin: 0;
    font-size: 0.85rem;
}

.report-loading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--report-muted);
    font-size: 0.875rem;
    margin: 0.25rem 0 1rem;
}

/* ── Monthly order extras ───────────────────────────────────────────── */
.report-payments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.report-payment {
    background: #f8f9fc;
    border: 1px solid var(--report-card-border);
    border-radius: var(--report-radius-sm);
    padding: 0.8rem 0.9rem;
}

.report-payment__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--report-muted);
    margin-bottom: 0.3rem;
}

.report-payment__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--report-ink);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.report-payment--positive .report-payment__value { color: #059669; }
.report-payment--negative .report-payment__value { color: #dc2626; }
.report-payment--accent .report-payment__value { color: var(--report-accent); }

.report-orders {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 700px) {
    .report-dashboard {
        margin: -1.5rem -1rem 0;
        padding: 1.15rem 1rem 2rem;
    }

    .report-title {
        font-size: 1.5rem;
    }

    .report-table th,
    .report-table td {
        padding: 0.6rem 0.5rem;
    }
}
