/* ATS Cloud — dashboard tema (ATS Cloud share design'dan uyarlandı) */

:root {
    --bg: #fafaf8;
    --surface: #ffffff;
    --surface-2: #f4f3ef;
    --line: #ececea;
    --line-strong: #dcdbd7;
    --ink: #18171a;
    --ink-2: #4a4953;
    --ink-3: #82818a;
    --ink-4: #b3b1b8;
    --accent: oklch(0.58 0.18 252);
    --accent-soft: oklch(0.96 0.03 252);
    --accent-ink: oklch(0.42 0.18 252);
    --good: oklch(0.62 0.13 155);
    --good-soft: oklch(0.96 0.04 155);
    --warn: oklch(0.72 0.15 70);
    --warn-soft: oklch(0.97 0.05 70);
    --bad: oklch(0.60 0.18 25);
    --bad-soft: oklch(0.97 0.04 25);
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --shadow-sm: 0 1px 0 rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
}

html.dark {
    --bg: #0e0e10;
    --surface: #161618;
    --surface-2: #1d1d20;
    --line: #26262a;
    --line-strong: #34343a;
    --ink: #f3f2f0;
    --ink-2: #c8c7c4;
    --ink-3: #8a8a8e;
    --ink-4: #5a5a60;
    --accent: oklch(0.72 0.16 252);
    --accent-soft: oklch(0.28 0.08 252);
    --accent-ink: oklch(0.82 0.14 252);
    --good-soft: oklch(0.26 0.05 155);
    --warn-soft: oklch(0.28 0.07 70);
    --bad-soft: oklch(0.28 0.06 25);
    --shadow-sm: 0 1px 0 rgba(0,0,0,0.3);
}

.ats-dash {
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 96px);
}

.ats-dash .mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-feature-settings: 'zero' on, 'cv01' on;
}

.ats-dash .grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto 1fr;
    gap: 10px;
    padding: 14px 18px;
    flex: 1;
    min-height: 0;
}

.ats-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ats-card-row {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-3);
}

.ats-card-label {
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ats-card-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.ats-card-value {
    font-size: 21px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.015em;
}

.ats-card-unit {
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 500;
}

.ats-card-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    color: var(--ink-3);
}

.ats-card-trend .pos { color: var(--good); font-weight: 500; }
.ats-card-trend .neg { color: var(--bad); font-weight: 500; }

.ats-pill {
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ats-pill.good { background: var(--good-soft); color: var(--good); }
.ats-pill.warn { background: var(--warn-soft); color: var(--warn); }
.ats-pill.bad  { background: var(--bad-soft); color: var(--bad); }

.ats-chart-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.ats-chart-title { font-size: 13px; font-weight: 600; }
.ats-chart-sub { font-size: 10.5px; color: var(--ink-3); }

.ats-range-group {
    display: flex;
    gap: 0;
    padding: 2px;
    background: var(--surface-2);
    border-radius: 7px;
    border: 1px solid var(--line);
}

.ats-range-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: transparent;
    color: var(--ink-3);
    font-family: inherit;
}

.ats-range-btn.active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.ats-stat-strip {
    display: flex;
    gap: 20px;
    margin-bottom: 4px;
    align-items: center;
}

.ats-stat-label {
    font-size: 9.5px;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ats-stat-value {
    font-size: 13px;
    font-weight: 600;
}

.ats-bar-info {
    margin-top: 8px;
    padding: 7px 10px;
    background: var(--surface-2);
    border-radius: 6px;
    font-size: 10.5px;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    gap: 7px;
}

.ats-area-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 32px 1fr;
    grid-template-rows: 1fr 18px;
    column-gap: 4px;
}

.ats-y-ticks {
    grid-column: 1; grid-row: 1;
    display: flex; flex-direction: column; justify-content: space-between;
    font-size: 9px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--ink-3);
    text-align: right;
    padding-right: 4px;
}

.ats-area-host {
    grid-column: 2; grid-row: 1;
    position: relative;
    min-height: 0;
}

.ats-area-host .gridline {
    position: absolute; left: 0; right: 0;
    border-top: 1px dashed var(--line);
    pointer-events: none;
}

.ats-area-host .gridline.bottom {
    border-top: 1px solid var(--line-strong);
}

.ats-x-labels {
    grid-column: 2; grid-row: 2;
    position: relative;
    font-size: 10px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--ink-3);
}

.ats-x-labels span {
    position: absolute;
    transform: translateX(-50%);
    top: 5px;
    white-space: nowrap;
}

.ats-bar-groups { display: flex; gap: 8px; flex: 1; align-items: stretch; min-height: 0; }

.ats-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
}

.ats-bar-group .head {
    font-size: 10.5px; color: var(--ink-3); font-weight: 500;
}

.ats-bar-area {
    flex: 1;
    display: flex;
    gap: 4px;
    min-height: 0;
}

.ats-bar-area .y-ticks {
    display: flex; flex-direction: column; justify-content: space-between;
    font-size: 9px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--ink-3);
    text-align: right;
    min-width: 28px;
    padding: 1px 0;
}

.ats-bar-area .canvas {
    flex: 1; position: relative; min-width: 0;
}

.ats-bar-area .canvas .gridline {
    position: absolute; left: 0; right: 0;
    border-top: 1px dashed var(--line);
    pointer-events: none;
}

.ats-bar-area .canvas .gridline.bottom {
    border-top: 1px solid var(--line-strong);
}

.ats-bar-area .canvas .bars {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end; justify-content: space-around;
    padding-bottom: 1px;
}

.ats-bar-area .canvas .bar {
    width: 24%;
    border-radius: 3px 3px 0 0;
    opacity: 0.92;
    transition: height 400ms ease;
}

.ats-bar-group .x-labels {
    display: flex; justify-content: space-around; padding-left: 30px;
    font-size: 10px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--ink-2);
    font-weight: 500;
}

/* PowerFactor & Imbalance shared sizing matches a KPI card */
.ats-gauge-svg { width: 44px; height: 44px; }

.ats-bar-line {
    height: 4px; background: var(--surface-2);
    border-radius: 999px; overflow: hidden;
    position: relative; margin-top: 2px;
}

.ats-bar-line > .fill { height: 100%; border-radius: 999px; }
.ats-bar-line > .marker {
    position: absolute; top: -2px; width: 1.5px; height: 8px;
    background: var(--ink-4);
}

.ats-spark { display: block; }
