/* ITKapocs v40.9 - Admin enterprise polish */

.itk-dashboard,
.subAutoPage,
.adminBillingHero,
.adminBillingFilter,
.adminBillingMetrics,
.adminBillingGrid,
body:has(.dashboardHead.proHero) main,
body:has(.securityDashboard) main {
    --admin-bg: #eef6ff;
    --admin-card: rgba(255, 255, 255, .96);
    --admin-text: #0f172a;
    --admin-muted: #64748b;
    --admin-border: #dbeafe;
    --admin-blue: #2563eb;
    --admin-cyan: #38bdf8;
    --admin-green: #16a34a;
    --admin-red: #dc2626;
    --admin-amber: #f59e0b;
}

.itk-dashboard,
.subAutoPage {
    background:
        linear-gradient(135deg, rgba(219, 234, 254, .88), rgba(248, 250, 252, .98) 38%, rgba(236, 253, 245, .62));
    overflow-x: clip;
}

.itk-dashboard-wrap,
.subAutoPage,
.adminBillingHero,
.adminBillingFilter,
.adminBillingMetrics,
.adminBillingGrid,
.billingCard {
    width: min(1280px, calc(100% - 32px));
    margin-inline: auto;
}

.itk-hero,
.subAutoHero,
.adminBillingHero,
.dashboardHead.proHero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(147, 197, 253, .7);
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,251,255,.96) 52%, rgba(236,253,245,.78));
    box-shadow: 0 30px 84px rgba(15, 23, 42, .12);
}

.itk-hero::before,
.subAutoHero::before,
.adminBillingHero::before,
.dashboardHead.proHero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 8px;
    background: linear-gradient(90deg, var(--admin-blue), var(--admin-cyan), #0f172a);
}

.itk-hero h1,
.subAutoHero h1,
.adminBillingHero h1,
.dashboardHead.proHero h1 {
    color: var(--admin-text);
    letter-spacing: -0.045em;
    line-height: .98;
}

.itk-hero p,
.subAutoHero p,
.adminBillingHero p,
.dashboardHead.proHero p,
.tableCard p,
.billingCard p {
    color: var(--admin-muted);
    line-height: 1.55;
}

.itk-eyebrow,
.subEyebrow,
.adminBillingEyebrow,
.dashboardHead.proHero .eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid rgba(147, 197, 253, .5);
    border-radius: 999px;
    background: linear-gradient(135deg, #dbeafe, #eef2ff);
    color: #1d4ed8;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .08);
}

.itk-actions .itk-btn,
.itk-actions .btn,
.adminBillingHeroActions .btn,
.subPrimaryBtn,
.tableCard .btn,
.billingCard .btn {
    border-radius: 16px;
    min-height: 48px;
    white-space: nowrap;
}

.itk-btn-primary,
.subPrimaryBtn,
.adminBillingHeroActions .btn:not(.ghost),
.tableCard .btn:not(.ghost),
.billingCard .btn:not(.ghost) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 18px 36px rgba(37, 99, 235, .24);
}

.itk-kpi,
.subMetricCard,
.adminBillingMetrics article,
.statGrid .statCard {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(191, 219, 254, .9);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.94));
    box-shadow: 0 22px 58px rgba(15, 23, 42, .09);
}

.itk-kpi::before,
.subMetricCard::before,
.adminBillingMetrics article::before,
.statGrid .statCard::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--admin-blue), var(--admin-cyan), #0f172a);
}

.itk-kpi.primary {
    background: linear-gradient(135deg, #172554, #2563eb 58%, #14b8a6);
}

.itk-chart-card,
.itk-table-card,
.subPanel,
.billingCard,
.tableCard,
.securityCard {
    border: 1px solid rgba(191, 219, 254, .88);
    border-radius: 28px;
    background: var(--admin-card);
    box-shadow: 0 24px 64px rgba(15, 23, 42, .09);
}

.itk-chart-card,
.subPanel,
.billingCard,
.tableCard {
    overflow: hidden;
}

.itk-chart-card::before,
.itk-table-card::before,
.subPanel::before,
.billingCard::before,
.tableCard::before {
    content: "";
    display: block;
    height: 5px;
    background: linear-gradient(90deg, var(--admin-blue), var(--admin-cyan), #0f172a);
}

.itk-table-card .itk-table-head,
.tableCard > h2,
.tableCard .sectionHead,
.billingCard .sectionHead,
.subPanelHeader {
    padding-top: 24px;
}

.itk-table,
.tableCard table,
.billingCard table,
.subEnterpriseTable,
.securityTable,
.aiTable,
.contractTable {
    border-collapse: separate;
    border-spacing: 0;
}

.itk-table th,
.tableCard th,
.billingCard th,
.subEnterpriseTable th,
.securityTable th,
.aiTable th,
.contractTable th {
    color: #5b6f8e;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.itk-table td,
.tableCard td,
.billingCard td,
.subEnterpriseTable td,
.securityTable td,
.aiTable td,
.contractTable td {
    color: #142033;
    border-bottom-color: #e2e8f0;
    overflow-wrap: anywhere;
}

.itk-table tbody tr,
.tableCard tbody tr,
.billingCard tbody tr,
.subEnterpriseTable tbody tr,
.securityTable tbody tr,
.aiTable tbody tr,
.contractTable tbody tr {
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

@media (min-width: 721px) {
    .itk-table tbody tr:hover,
    .tableCard tbody tr:hover,
    .billingCard tbody tr:hover,
    .subEnterpriseTable tbody tr:hover,
    .securityTable tbody tr:hover,
    .aiTable tbody tr:hover,
    .contractTable tbody tr:hover {
        background: #f8fbff;
        box-shadow: 0 16px 38px rgba(15, 23, 42, .06);
    }
}

.adminBillingHero {
    margin-top: 34px;
    padding: 34px;
}

.adminBillingFilter,
.adminBillingMetrics,
.adminBillingGrid,
.billingCard {
    margin-top: 22px;
}

.adminBillingFilter form,
.adminBillingQuickRanges,
.adminBillingMetrics,
.adminBillingGrid {
    gap: 18px;
}

.adminBillingMetrics article.isWarning {
    border-color: #fed7aa;
    background: linear-gradient(180deg, #fff7ed, #fff);
}

.adminBillingIssue {
    border-radius: 22px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #fff, #f8fbff);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .07);
}

.subAutoPage {
    width: 100%;
    max-width: none;
    padding: 34px 18px 72px;
}

.subAutoPage > * {
    width: min(1280px, 100%);
    margin-inline: auto;
}

.subTimelineItem,
.subEventItem,
.subQuickBtn {
    border-radius: 22px;
}

.subEnterpriseTable {
    width: 100%;
}

@media (max-width: 980px) {
    .itk-hero,
    .subAutoHero,
    .adminBillingHero,
    .dashboardHead.proHero {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .itk-actions,
    .adminBillingHeroActions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        justify-content: stretch;
    }

    .itk-actions .itk-btn,
    .itk-actions .btn,
    .adminBillingHeroActions .btn {
        width: 100%;
    }

    .adminBillingGrid,
    .subDashboardGrid,
    .subLowerGrid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .itk-dashboard-wrap,
    .subAutoPage > *,
    .adminBillingHero,
    .adminBillingFilter,
    .adminBillingMetrics,
    .adminBillingGrid,
    .billingCard,
    .tableCard,
    .dashboardHead.proHero {
        width: min(100% - 20px, 560px);
    }

    .itk-dashboard,
    .subAutoPage {
        padding: 18px 0 52px;
    }

    .itk-hero,
    .subAutoHero,
    .adminBillingHero,
    .dashboardHead.proHero {
        padding: 24px 20px;
        border-radius: 26px;
    }

    .itk-hero h1,
    .subAutoHero h1,
    .adminBillingHero h1,
    .dashboardHead.proHero h1 {
        font-size: clamp(32px, 10vw, 44px);
        overflow-wrap: anywhere;
    }

    .itk-hero p,
    .subAutoHero p,
    .adminBillingHero p,
    .dashboardHead.proHero p {
        font-size: 17px;
    }

    .itk-actions,
    .adminBillingHeroActions,
    .adminBillingFilter form,
    .adminBillingMetrics {
        grid-template-columns: 1fr;
    }

    .adminBillingQuickRanges {
        display: grid;
        grid-template-columns: 1fr;
    }

    .itk-kpi-grid,
    .subMetricGrid,
    .statGrid {
        grid-template-columns: 1fr;
        width: min(100% - 20px, 560px);
        margin-inline: auto;
    }

    .itk-chart-grid,
    .itk-chart-grid.three {
        width: min(100% - 20px, 560px);
        margin-inline: auto;
    }

    .itk-chart-card,
    .itk-table-card,
    .subPanel,
    .billingCard,
    .tableCard {
        border-radius: 26px;
    }

    .tableCard,
    .billingCard {
        padding: 22px 18px;
    }

    .tableCard .sectionHead,
    .billingCard .sectionHead,
    .itk-table-head,
    .subPanelHeader {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .tableCard table:not(.invoiceTable),
    .billingCard table:not(.invoiceTable),
    .subEnterpriseTable,
    .securityTable,
    .aiTable,
    .contractTable {
        min-width: 0 !important;
        width: 100% !important;
    }

    .tableCard table:not(.invoiceTable) thead,
    .billingCard table:not(.invoiceTable) thead,
    .subEnterpriseTable thead,
    .securityTable thead,
    .aiTable thead,
    .contractTable thead {
        display: none !important;
    }

    .tableCard table:not(.invoiceTable),
    .tableCard table:not(.invoiceTable) tbody,
    .tableCard table:not(.invoiceTable) tr,
    .tableCard table:not(.invoiceTable) td,
    .billingCard table:not(.invoiceTable),
    .billingCard table:not(.invoiceTable) tbody,
    .billingCard table:not(.invoiceTable) tr,
    .billingCard table:not(.invoiceTable) td,
    .subEnterpriseTable,
    .subEnterpriseTable tbody,
    .subEnterpriseTable tr,
    .subEnterpriseTable td,
    .securityTable,
    .securityTable tbody,
    .securityTable tr,
    .securityTable td,
    .aiTable,
    .aiTable tbody,
    .aiTable tr,
    .aiTable td,
    .contractTable,
    .contractTable tbody,
    .contractTable tr,
    .contractTable td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .tableCard table:not(.invoiceTable) tbody,
    .billingCard table:not(.invoiceTable) tbody,
    .subEnterpriseTable tbody,
    .securityTable tbody,
    .aiTable tbody,
    .contractTable tbody {
        display: grid !important;
        gap: 18px;
    }

    .tableCard table:not(.invoiceTable) tr,
    .billingCard table:not(.invoiceTable) tr,
    .subEnterpriseTable tr,
    .securityTable tr,
    .aiTable tr,
    .contractTable tr {
        position: relative;
        overflow: hidden;
        padding: 24px;
        border: 1px solid #bfdbfe;
        border-radius: 26px;
        background:
            linear-gradient(180deg, rgba(255,255,255,.98), #f8fbff);
        box-shadow: 0 24px 58px rgba(30, 64, 175, .12);
    }

    .tableCard table:not(.invoiceTable) tr::before,
    .billingCard table:not(.invoiceTable) tr::before,
    .subEnterpriseTable tr::before,
    .securityTable tr::before,
    .aiTable tr::before,
    .contractTable tr::before {
        content: "";
        position: absolute;
        inset: 0 0 auto;
        height: 7px;
        background: linear-gradient(90deg, var(--admin-blue), var(--admin-cyan), #172554);
    }

    .tableCard table:not(.invoiceTable) td,
    .billingCard table:not(.invoiceTable) td,
    .subEnterpriseTable td,
    .securityTable td,
    .aiTable td,
    .contractTable td {
        padding: 14px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid #dbeafe !important;
        text-align: left !important;
        overflow-wrap: anywhere;
    }

    .tableCard table:not(.invoiceTable) td::before,
    .billingCard table:not(.invoiceTable) td::before,
    .subEnterpriseTable td::before,
    .securityTable td::before,
    .aiTable td::before,
    .contractTable td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 8px;
        color: #64748b;
        font-size: 12px;
        font-weight: 950;
        letter-spacing: .055em;
        text-transform: uppercase;
    }

    .tableCard table:not(.invoiceTable) td:last-child,
    .billingCard table:not(.invoiceTable) td:last-child,
    .subEnterpriseTable td:last-child,
    .securityTable td:last-child,
    .aiTable td:last-child,
    .contractTable td:last-child {
        border-bottom: 0 !important;
    }

    .tableCard table:not(.invoiceTable) .btn,
    .billingCard table:not(.invoiceTable) .btn,
    .subEnterpriseTable .btn,
    .securityTable .btn,
    .aiTable .btn,
    .contractTable .btn {
        width: 100%;
        min-height: 54px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 420px) {
    .itk-dashboard-wrap,
    .subAutoPage > *,
    .adminBillingHero,
    .adminBillingFilter,
    .adminBillingMetrics,
    .adminBillingGrid,
    .billingCard,
    .tableCard,
    .dashboardHead.proHero {
        width: min(100% - 16px, 390px);
    }

    .itk-chart-box,
    .itk-chart-box.large {
        height: 240px;
    }
}
