/* ===========================
   Tabler Pilot Layer
   Framework-backed dashboard direction for Kochler.
   =========================== */

:root[data-theme="light"] {
    --tblr-primary: #0f766e;
    --tblr-primary-rgb: 15, 118, 110;
    --tblr-body-bg: #f6f8fb;
    --tblr-body-color: #102027;
    --pilot-surface: rgba(255, 255, 255, 0.92);
    --pilot-soft-border: rgba(103, 121, 130, 0.18);
    --pilot-shadow: 0 16px 44px rgba(16, 32, 39, 0.08);
}

:root[data-theme="dark"] {
    --tblr-primary: #2dd4bf;
    --tblr-primary-rgb: 45, 212, 191;
    --tblr-body-bg: #101820;
    --tblr-body-color: #f4f7f8;
    --pilot-surface: rgba(23, 35, 44, 0.92);
    --pilot-soft-border: rgba(171, 190, 199, 0.18);
    --pilot-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.tabler-command-header {
    position: relative;
    overflow: hidden;
    min-height: 152px;
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.16), transparent 56%),
        linear-gradient(315deg, rgba(37, 99, 235, 0.08), transparent 42%),
        var(--pilot-surface);
    border-color: var(--pilot-soft-border);
    box-shadow: var(--pilot-shadow);
}

.tabler-command-header::after {
    content: "";
    position: absolute;
    right: -8rem;
    top: -10rem;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    border: 1px solid rgba(var(--primary-rgb), 0.16);
    background: rgba(var(--primary-rgb), 0.06);
    pointer-events: none;
}

.command-title-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 720px;
    flex-direction: column;
    justify-content: center;
}

.command-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    padding: 0.36rem 0.68rem;
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.command-badge .ti {
    font-size: 1rem;
}

.tabler-command-header .dash-title {
    margin-bottom: 0.45rem;
    font-size: clamp(1.8rem, 3vw, 2.85rem);
    font-weight: 850;
}

.tabler-command-header .dash-sub {
    max-width: 620px;
    font-size: 0.98rem;
}

.command-side {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 220px;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.command-health {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.72rem;
    border: 1px solid rgba(22, 163, 74, 0.18);
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 750;
}

.command-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin: -1.05rem 1rem 1.35rem;
    position: relative;
    z-index: 2;
}

.command-action {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--pilot-soft-border);
    border-radius: 10px;
    background: var(--pilot-surface);
    box-shadow: 0 12px 28px rgba(16, 32, 39, 0.07);
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.command-action:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.28);
    box-shadow: var(--pilot-shadow);
    color: var(--text-primary);
}

.command-action .ti {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 1.25rem;
}

.command-action span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 760;
}

.command-action-blue .ti { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.command-action-orange .ti { background: rgba(249, 115, 22, 0.14); color: #ea580c; }
.command-action-teal .ti { background: rgba(var(--primary-rgb), 0.12); color: var(--primary-color); }
.command-action-slate .ti { background: rgba(71, 85, 105, 0.12); color: #475569; }

.kpi-sections {
    display: grid;
    grid-template-columns: 0.95fr 1.55fr;
    gap: 1rem;
}

.kpi-group {
    min-width: 0;
}

.kpi-group:first-child,
.kpi-group:last-child {
    flex: unset;
}

.kpi-group-cards {
    grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
}

.kpi-card {
    min-height: 146px;
    padding: 1.15rem;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent),
        var(--pilot-surface);
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: currentColor;
    opacity: 0.9;
}

.kpi-card .kpi-body {
    position: relative;
    z-index: 1;
}

.kpi-icon-wrap {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    margin-bottom: 0.8rem;
    color: inherit;
}

.kpi-icon-wrap .ti {
    font-size: 1.35rem;
}

.kpi-blue { color: #2563eb; }
.kpi-yellow { color: #d97706; }
.kpi-orange { color: #ea580c; }
.kpi-red { color: #dc2626; }
.kpi-purple { color: var(--primary-color); }

.kpi-card .kpi-value {
    color: var(--text-primary);
    font-weight: 850;
}

.kpi-card .kpi-label {
    color: var(--text-secondary);
    font-weight: 650;
}

.quick-section-label {
    margin-top: 1.3rem;
    padding-left: 0.25rem;
    font-size: 0.86rem;
    font-weight: 850;
}

.quick-panel,
.metric-panel {
    border-radius: 10px;
}

.quick-panel .qp-head,
.metric-panel .mpanel-head {
    border-bottom-color: var(--pilot-soft-border);
}

.qp-count-badge,
.df-active,
.dp-apply {
    box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.12);
}

.raporlar-section {
    margin-top: 1.8rem;
}

.metric-panel {
    overflow: hidden;
}

.metric-panel .mpanel-head {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), transparent 70%);
}

.mobile-tab .ti,
.topnav-item .ti,
.topnav-dropdown-item .ti {
    font-size: 1.1rem;
}

@media (min-width: 1400px) {
    .content {
        width: min(100%, 1560px);
    }
}

@media (max-width: 1024px) {
    .command-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tabler-command-header {
        min-height: auto;
        margin-top: 0.35rem;
        border-radius: 14px;
    }

    .command-title-wrap {
        max-width: none;
    }

    .command-badge {
        margin-bottom: 0.55rem;
        font-size: 0.66rem;
    }

    .tabler-command-header .dash-title {
        font-size: 1.72rem;
    }

    .tabler-command-header .dash-sub {
        font-size: 0.88rem;
    }

    .command-side {
        min-width: 0;
        align-items: flex-start;
    }

    .command-health {
        padding: 0.36rem 0.62rem;
    }

    .command-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        margin: 0.75rem 0 1.1rem;
    }

    .command-action {
        min-height: 58px;
        padding: 0.7rem;
        gap: 0.55rem;
    }

    .command-action .ti {
        width: 34px;
        height: 34px;
        font-size: 1.12rem;
    }

    .command-action span {
        font-size: 0.78rem;
        white-space: normal;
        line-height: 1.15;
    }

    .kpi-sections,
    .kpi-group-cards,
    .kpi-group:last-child .kpi-group-cards {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        min-height: 116px;
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        column-gap: 0.9rem;
    }

    .kpi-icon-wrap {
        margin-bottom: 0;
    }

    .quick-section-label {
        margin-top: 1rem;
    }
}
