/* Omego Reports — modern SaaS dashboard styling */

.reports-shell {
    max-width: 80rem;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.reports-card {
    background: var(--reports-surface, #fff);
    border: 1px solid var(--reports-border, #e5e7eb);
    border-radius: 0.875rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 16px rgb(15 23 42 / 0.03);
}

.dark .reports-card {
    --reports-surface: rgb(17 24 39);
    --reports-border: rgb(55 65 81);
}

.reports-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0;
}

.reports-card__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--reports-heading, #111827);
    letter-spacing: -0.01em;
}

.dark .reports-card__title {
    --reports-heading: #f9fafb;
}

.reports-card__body {
    padding: 1rem 1.25rem 1.25rem;
}

.reports-card__body--flush {
    padding: 0;
}

/* Filter bar */
.reports-filter {
    padding: 1rem 1.25rem;
}

.reports-filter__grid {
    display: grid;
    gap: 0.875rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .reports-filter__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .reports-filter__grid {
        grid-template-columns: 1.2fr 1fr 1fr auto;
        align-items: end;
    }
}

.reports-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.reports-field select,
.reports-field input[type="date"],
.reports-field input[type="text"],
.reports-field input[type="search"] {
    width: 100%;
    border-radius: 0.625rem;
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dark .reports-field select,
.dark .reports-field input[type="date"],
.dark .reports-field input[type="text"],
.dark .reports-field input[type="search"] {
    border-color: #4b5563;
    background: #111827;
    color: #f9fafb;
}

.reports-field select:focus,
.reports-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}

.reports-preset-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reports-preset-btn {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    border-radius: 9999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.reports-preset-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.reports-preset-btn.is-active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.dark .reports-preset-btn {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

.reports-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 0.625rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.reports-btn--primary {
    background: #2563eb;
    color: #fff;
}

.reports-btn--primary:hover {
    background: #1d4ed8;
}

.reports-btn--ghost {
    background: #fff;
    border-color: #e5e7eb;
    color: #374151;
}

.reports-btn--ghost:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.dark .reports-btn--ghost {
    background: #111827;
    border-color: #4b5563;
    color: #e5e7eb;
}

.reports-filter__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.reports-filter__footer {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.dark .reports-filter__footer {
    border-top-color: #374151;
}

/* Segmented tabs */
.reports-tabs-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.125rem;
}

.reports-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f3f4f6;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    min-width: min-content;
}

.dark .reports-tabs {
    background: #1f2937;
    border-color: #374151;
}

.reports-tab {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.reports-tab:hover {
    color: #374151;
    background: rgb(255 255 255 / 0.6);
}

.reports-tab.is-active {
    background: #fff;
    color: #1d4ed8;
    box-shadow: 0 1px 3px rgb(15 23 42 / 0.08);
}

.dark .reports-tab.is-active {
    background: #111827;
    color: #93c5fd;
}

/* Toolbar */
.reports-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.reports-export-group {
    display: inline-flex;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    overflow: hidden;
    background: #fff;
}

.dark .reports-export-group {
    border-color: #4b5563;
    background: #111827;
}

.reports-export-btn {
    border: none;
    border-right: 1px solid #e5e7eb;
    background: transparent;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.reports-export-btn:last-child {
    border-right: none;
}

.reports-export-btn:hover {
    background: #f9fafb;
    color: #111827;
}

.dark .reports-export-btn {
    border-right-color: #4b5563;
    color: #9ca3af;
}

/* KPI cards */
.reports-kpi-grid {
    display: grid;
    gap: 0.875rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .reports-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .reports-kpi-grid--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .reports-kpi-grid--6 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.reports-kpi {
    padding: 1rem 1.125rem;
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

.reports-kpi__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reports-kpi__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.reports-kpi__icon--blue { background: #eff6ff; color: #2563eb; }
.reports-kpi__icon--green { background: #ecfdf5; color: #059669; }
.reports-kpi__icon--red { background: #fef2f2; color: #dc2626; }
.reports-kpi__icon--amber { background: #fffbeb; color: #d97706; }
.reports-kpi__icon--violet { background: #f5f3ff; color: #7c3aed; }
.reports-kpi__icon--slate { background: #f8fafc; color: #475569; }

.reports-kpi__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.reports-kpi__value {
    margin-top: 0.125rem;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
    line-height: 1.2;
}

.dark .reports-kpi__value {
    color: #f9fafb;
}

.reports-kpi__value--negative {
    color: #dc2626;
}

.reports-kpi__value--positive {
    color: #059669;
}

.reports-kpi__hint {
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    color: #9ca3af;
}

/* Data table */
.reports-table-wrap {
    overflow: auto;
    border-radius: 0 0 0.875rem 0.875rem;
    max-height: 32rem;
}

.reports-table-search {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.dark .reports-table-search {
    border-bottom-color: #374151;
}

.reports-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}

.reports-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #475569;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.dark .reports-table thead th {
    background: #1f2937;
    color: #9ca3af;
    border-bottom-color: #374151;
}

.reports-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
    vertical-align: middle;
}

.dark .reports-table tbody td {
    border-bottom-color: #1f2937;
    color: #e5e7eb;
}

.reports-table tbody tr:nth-child(even) td {
    background: #fcfcfd;
}

.dark .reports-table tbody tr:nth-child(even) td {
    background: rgb(17 24 39 / 0.5);
}

.reports-table tbody tr:hover td {
    background: #f8fafc;
}

.dark .reports-table tbody tr:hover td {
    background: #1f2937;
}

.reports-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.reports-table .num--negative {
    color: #dc2626;
    font-weight: 600;
}

.reports-table .num--positive {
    color: #059669;
    font-weight: 600;
}

.reports-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.reports-badge--ok {
    background: #ecfdf5;
    color: #047857;
}

.reports-badge--warn {
    background: #fffbeb;
    color: #b45309;
}

.reports-badge--danger {
    background: #fef2f2;
    color: #b91c1c;
}

/* Empty state */
.reports-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.reports-empty__icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reports-empty__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
}

.reports-empty__text {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* Charts */
.reports-chart-card {
    padding: 1.25rem;
}

.reports-chart-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.dark .reports-chart-title {
    color: #f9fafb;
}

.reports-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    min-height: 10rem;
    padding-top: 0.5rem;
}

.reports-bar-chart__item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.reports-bar-chart__bar-wrap {
    width: 100%;
    height: 8rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.reports-bar-chart__bar {
    width: min(100%, 2.5rem);
    border-radius: 0.375rem 0.375rem 0 0;
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    min-height: 4px;
    transition: height 0.3s ease;
}

.reports-bar-chart__bar--secondary {
    background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%);
}

.reports-bar-chart__bar--muted {
    background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
}

.reports-bar-chart__label {
    font-size: 0.625rem;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.reports-bar-chart__value {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #374151;
}

.reports-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.reports-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.reports-legend__dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
}

/* Progress ring */
.reports-ring-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.reports-ring {
    position: relative;
    width: 7rem;
    height: 7rem;
}

.reports-ring svg {
    transform: rotate(-90deg);
}

.reports-ring__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reports-ring__pct {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.reports-ring__sub {
    font-size: 0.625rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Lodge layout */
.reports-split {
    display: grid;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .reports-split--2 {
        grid-template-columns: 1fr 1fr;
    }
}

.reports-progress {
    height: 0.5rem;
    border-radius: 9999px;
    background: #e5e7eb;
    overflow: hidden;
}

.reports-progress__fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.4s ease;
}

a.reports-export-btn {
    display: inline-block;
    text-decoration: none;
    line-height: 1.25;
}

@media print {
    .fi-sidebar,
    .fi-topbar,
    .fi-header,
    .reports-filter,
    .reports-toolbar,
    .reports-tabs-wrap,
    .fi-page-header-actions,
    .fi-tabs,
    nav,
    aside {
        display: none !important;
    }

    .reports-shell,
    .fi-main,
    .fi-page,
    .fi-page-content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .reports-card,
    .reports-data-table {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
    }

    body {
        background: #fff !important;
        color: #111827 !important;
    }
}
