/*
 * Донастройки на панела.
 *
 * Filament е разчетен за широки екрани с много въздух; на гише се работи
 * по цял ден в един прозорец, затова отстоянията са свити и на екрана
 * влизат повече редове.
 */

/* ------------------------------------------------------------------ */
/* Отстояния                                                           */
/* ------------------------------------------------------------------ */

/* Табовете - компактни и подравнени вляво, а не разлети по средата */
.fi-tabs {
    justify-content: flex-start;
    padding: 0.25rem;
    gap: 0.125rem;
}

.fi-tabs-item {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

/* Лентата с търсене над таблицата */
.fi-ta-header-toolbar {
    padding: 0.5rem 0.75rem;
}

/* Трохите над заглавието */
.fi-breadcrumbs {
    margin-bottom: 0.25rem;
}

.fi-main {
    padding-block: 0.5rem;
    padding-inline: 0.75rem;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .fi-main {
        padding-block: 0.75rem;
        padding-inline: 1rem;
    }
}

.fi-main-ctn {
    gap: 0.5rem;
}

.fi-topbar nav {
    padding-block: 0.5rem;
}

.fi-header {
    margin-bottom: 0.5rem;
    gap: 0.375rem;
}

.fi-header-heading {
    font-size: 1.25rem;
    line-height: 1.7rem;
}

.fi-page {
    gap: 0.5rem;
}

.fi-wi {
    gap: 0.75rem;
}

/* Форми */
.fi-section-content {
    padding: 0.875rem;
}

.fi-section-header {
    padding: 0.75rem 0.875rem;
}

.fi-fo-field-wrp-label,
.fi-fo-field-wrp-hint {
    font-size: 0.8125rem;
}

/* Таблици - по-нисък ред */
.fi-ta-header-cell,
.fi-ta-cell {
    padding-block: 0.375rem;
}

.fi-ta-text {
    padding-block: 0.25rem;
}

.fi-ta-header {
    padding: 0.625rem 0.875rem;
}

.fi-ta-content {
    font-size: 0.875rem;
}

/* Съдържанието да не изкарва хоризонтален плъзгач, ако може да се пренесе */
.fi-ta-cell .fi-ta-text-item-label {
    white-space: normal;
}

/* ------------------------------------------------------------------ */
/* Кутийките на таблото                                                */
/* ------------------------------------------------------------------ */

.stat-tile {
    --tile: #6b7280;
    --tile-dark: #4b5563;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--tile) 0%, var(--tile-dark) 100%) !important;
    border: 0 !important;
    border-radius: 1rem;
    padding: 1.25rem 1.375rem;
    min-height: 8.25rem;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.12), 0 8px 24px -12px var(--tile);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.stat-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.14), 0 16px 32px -14px var(--tile);
}

/* Голямата бледа иконка в ъгъла - дава характер, без да пречи на четенето */
.stat-tile::after {
    content: '';
    position: absolute;
    inset-inline-end: -1.5rem;
    inset-block-start: -1.5rem;
    width: 9rem;
    height: 9rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.08);
    pointer-events: none;
}

.stat-tile .fi-wi-stats-overview-stat-content {
    position: relative;
    z-index: 1;
    gap: 0.5rem;
}

.stat-tile .fi-wi-stats-overview-stat-label,
.stat-tile .fi-wi-stats-overview-stat-value,
.stat-tile .fi-wi-stats-overview-stat-description,
.stat-tile .fi-wi-stats-overview-stat-description span {
    color: #fff !important;
}

.stat-tile .fi-wi-stats-overview-stat-label-ctn {
    align-items: center;
    gap: 0.75rem;
}

.stat-tile .fi-wi-stats-overview-stat-label {
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    opacity: 0.95;
}

/* Иконката в собствено полупрозрачно квадратче */
.stat-tile .fi-wi-stats-overview-stat-label-ctn .fi-icon {
    flex: 0 0 auto;
    box-sizing: content-box;
    width: 1.875rem;
    height: 1.875rem;
    padding: 0.625rem;
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.2);
    color: #fff !important;
    stroke-width: 1.75;
}

.stat-tile .fi-wi-stats-overview-stat-value {
    font-size: 2.5rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-tile .fi-wi-stats-overview-stat-description,
.stat-tile .fi-wi-stats-overview-stat-description span {
    font-size: 0.8125rem;
    opacity: 0.78;
}

.stat-tile--info { --tile: #3b82f6; --tile-dark: #2563eb; }
.stat-tile--success { --tile: #22a565; --tile-dark: #15803d; }
.stat-tile--primary { --tile: #7367f0; --tile-dark: #5b4fd6; }
.stat-tile--teal { --tile: #14b8a6; --tile-dark: #0d9488; }
.stat-tile--danger { --tile: #ef4444; --tile-dark: #dc2626; }
.stat-tile--warning { --tile: #f59e0b; --tile-dark: #d97706; }
.stat-tile--muted { --tile: #94a3b8; --tile-dark: #64748b; }

@media (max-width: 640px) {
    .stat-tile {
        min-height: 7rem;
        padding: 1rem;
    }

    .stat-tile .fi-wi-stats-overview-stat-value {
        font-size: 2rem;
    }
}

/* ------------------------------------------------------------------ */
/* Сборове над справките                                               */
/* ------------------------------------------------------------------ */

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 1px;
    margin-bottom: 0.75rem;
    background: #e4e4e7;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    overflow: hidden;
}

.report-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
    background: #ffffff;
}

.report-summary-item--strong {
    background: #fafafa;
}

.report-summary-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #71717a;
}

.report-summary-value {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: #09090b;
}

.report-summary-value--success { color: #16a34a; }
.report-summary-value--danger { color: #dc2626; }

.report-summary-item--strong .report-summary-value {
    font-size: 1.4rem;
}

.dark .report-summary {
    background: #3f3f46;
    border-color: #3f3f46;
}

.dark .report-summary-item { background: #18181b; }
.dark .report-summary-item--strong { background: #27272a; }
.dark .report-summary-value { color: #fafafa; }
.dark .report-summary-value--success { color: #4ade80; }
.dark .report-summary-value--danger { color: #f87171; }

/* ------------------------------------------------------------------ */
/* Абонамент                                                           */
/* ------------------------------------------------------------------ */

.billing-trial {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.billing-trial-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
    color: #f59e0b;
}

/* Текущо състояние - три клетки в обща рамка */
.billing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1px;
    background: #e4e4e7;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    overflow: hidden;
}

.billing-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
    background: #fff;
}

.billing-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #71717a;
}

.billing-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #09090b;
}

/* Използване */
.billing-usage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.5rem;
}

.billing-usage-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #52525b;
}

.billing-usage-head strong {
    font-size: 1rem;
    color: #09090b;
    font-variant-numeric: tabular-nums;
}

.billing-bar {
    height: 0.5rem;
    border-radius: 999px;
    background: #e4e4e7;
    overflow: hidden;
}

.billing-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7367f0, #5b4fd6);
    transition: width 200ms ease;
}

/* Планове */
.billing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.billing-plan {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 1.25rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.875rem;
    background: #fff;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.billing-plan:hover {
    border-color: #c7c2f8;
    box-shadow: 0 4px 14px -8px rgb(115 103 240 / 0.5);
}

.billing-plan--current {
    border-color: #7367f0;
    box-shadow: 0 0 0 1px #7367f0, 0 8px 22px -14px #7367f0;
}

.billing-plan-name {
    font-weight: 600;
    font-size: 1.0625rem;
    color: #09090b;
}

.billing-plan-price {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #09090b;
    font-variant-numeric: tabular-nums;
}

.billing-plan-price span {
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0;
    color: #71717a;
}

.billing-plan-features {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0 0;
    border-top: 1px solid #f4f4f5;
    font-size: 0.875rem;
    color: #52525b;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

.billing-plan-features strong { color: #09090b; }

.billing-plan-button {
    width: 100%;
    justify-content: center;
}

/* Фактури */
.billing-invoices {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.billing-invoices td {
    padding: 0.625rem 0;
    border-bottom: 1px solid #f4f4f5;
}

.billing-invoices tr:last-child td { border-bottom: 0; }

.billing-invoices-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.billing-invoices-action {
    text-align: right;
    width: 1%;
    white-space: nowrap;
    padding-left: 1rem;
}

/* Тъмна тема */
.dark .billing-grid { background: #3f3f46; border-color: #3f3f46; }
.dark .billing-grid > div { background: #18181b; }
.dark .billing-label { color: #a1a1aa; }
.dark .billing-value,
.dark .billing-usage-head strong,
.dark .billing-plan-name,
.dark .billing-plan-price,
.dark .billing-plan-features strong { color: #fafafa; }
.dark .billing-usage-head,
.dark .billing-plan-features { color: #a1a1aa; }
.dark .billing-bar { background: #3f3f46; }
.dark .billing-plan { background: #18181b; border-color: #3f3f46; }
.dark .billing-plan-features { border-color: #27272a; }
.dark .billing-invoices td { border-color: #27272a; }
