/* GES operatör izleme ekranı. Tüm kurallar .ges altında; uygulamanın geri kalanına dokunmaz.
   Açık ve koyu tema uygulamanın :root[data-theme] anahtarını izler. */
#panel-huaweiFusionSolar { max-width: 1560px; margin: 0 auto; }
.ges {
  --g-plane: #f4f6f8; --g-surface: #ffffff; --g-surface-2: #f7f9fb; --g-line: #dfe5ec; --g-line-strong: #c5cfda;
  --g-ink: #0f1b2a; --g-ink-2: #4a5868; --g-muted: #77838f; --g-accent: #1a6fd0; --g-accent-ink: #ffffff; --g-accent-soft: #e6f0fb;
  --g-ok: #0ca30c; --g-warn: #fab219; --g-serious: #ec835a; --g-crit: #d03b3b; --g-idle: #8b96a3; --g-info: #2a78d6;
  --g-ok-bg: #e7f6e7; --g-warn-bg: #fff3d6; --g-crit-bg: #fbe6e6; --g-idle-bg: #eceff3; --g-info-bg: #e6f0fb;
  --g-ok-ink: #0a6b0a; --g-warn-ink: #7a5200; --g-crit-ink: #a02727; --g-idle-ink: #4f5b68; --g-info-ink: #1d5aa8;
  --g-series-1: #2a78d6; --g-series-2: #eb6834; --g-series-3: #1baf7a; --g-series-4: #eda100;
  --g-grid: #e6eaef; --g-axis: #c3cad3; --g-shadow: 0 1px 2px rgba(15, 27, 42, .06), 0 6px 18px rgba(15, 27, 42, .05);
  color: var(--g-ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; padding: 10px 0 40px;
}
:root[data-theme="dark"] .ges {
  --g-plane: #0d131c; --g-surface: #151d29; --g-surface-2: #1a2432; --g-line: #263345; --g-line-strong: #36465c;
  --g-ink: #edf1f6; --g-ink-2: #b9c3cf; --g-muted: #8794a3; --g-accent: #4a93ea; --g-accent-ink: #08121f; --g-accent-soft: #17293f;
  --g-ok-bg: #12301a; --g-warn-bg: #3a2c0c; --g-crit-bg: #3a1a1c; --g-idle-bg: #232e3c; --g-info-bg: #17293f;
  --g-ok-ink: #6fdc6f; --g-warn-ink: #fcc95a; --g-crit-ink: #f08c8c; --g-idle-ink: #a9b4c1; --g-info-ink: #8dbcf3;
  --g-series-1: #3987e5; --g-series-2: #d95926; --g-series-3: #199e70; --g-series-4: #c98500;
  --g-grid: #222e3e; --g-axis: #36465c; --g-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 22px rgba(0, 0, 0, .28);
}
.ges *, .ges *::before, .ges *::after { box-sizing: border-box; }
.ges button, .ges input, .ges select, .ges textarea { font: inherit; color: inherit; }
.ges h1, .ges h2, .ges h3, .ges p { margin: 0; }
.ges .num { font-variant-numeric: tabular-nums; }

/* Üst şerit: başlık, gezinme, veri yaşı, yenile */
.ges-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 16px; background: var(--g-surface); border: 1px solid var(--g-line); border-radius: 12px; box-shadow: var(--g-shadow); position: sticky; top: 8px; z-index: 5; }
.ges-brand { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.ges-brand small { font-weight: 500; color: var(--g-muted); font-size: 12px; }
.ges-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.ges-nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--g-ink-2); font-weight: 600; white-space: nowrap; }
.ges-nav a:hover { background: var(--g-surface-2); color: var(--g-ink); }
.ges-nav a[aria-current="page"] { background: var(--g-accent-soft); color: var(--g-accent); }
.ges-nav .ges-count { margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: var(--g-crit); color: #fff; font-size: 11px; font-weight: 700; }
.ges-bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ges-fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--g-ink-2); white-space: nowrap; }
.ges-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--g-idle); flex: none; }
.ges-dot.ok { background: var(--g-ok); } .ges-dot.warn { background: var(--g-warn); } .ges-dot.crit { background: var(--g-crit); } .ges-dot.info { background: var(--g-info); }

.ges-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--g-line-strong); background: var(--g-surface); color: var(--g-ink); font-weight: 600; cursor: pointer; white-space: nowrap; }
.ges-btn:hover:not(:disabled) { border-color: var(--g-accent); color: var(--g-accent); }
.ges-btn:disabled { opacity: .55; cursor: not-allowed; }
.ges-btn.primary { background: var(--g-accent); border-color: var(--g-accent); color: var(--g-accent-ink); }
.ges-btn.primary:hover:not(:disabled) { filter: brightness(1.08); color: var(--g-accent-ink); }
.ges-btn.danger { background: var(--g-crit); border-color: var(--g-crit); color: #fff; }
.ges-btn.small { padding: 4px 9px; font-size: 12px; }
.ges-btn.ghost { border-color: transparent; background: transparent; color: var(--g-accent); padding-left: 4px; padding-right: 4px; }

.ges-page { margin-top: 14px; display: grid; gap: 14px; }
.ges-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--g-muted); font-size: 13px; }
.ges-crumbs a { color: var(--g-accent); text-decoration: none; font-weight: 600; }
.ges-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ges-head h1 { font-size: 22px; line-height: 1.2; }
.ges-head .sub { color: var(--g-ink-2); font-size: 13px; }
.ges-head .spacer { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.ges-card { background: var(--g-surface); border: 1px solid var(--g-line); border-radius: 12px; box-shadow: var(--g-shadow); padding: 16px; min-width: 0; }
.ges-card > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.ges-card > header h2 { font-size: 15px; }
.ges-card > header .hint { color: var(--g-muted); font-size: 12px; }
.ges-card > header .tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ges-grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.ges-grid-eq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* KPI kutuları */
.ges-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ges-kpi { background: var(--g-surface); border: 1px solid var(--g-line); border-radius: 12px; padding: 13px 14px; box-shadow: var(--g-shadow); min-width: 0; }
.ges-kpi .label { color: var(--g-ink-2); font-size: 12px; font-weight: 600; }
.ges-kpi .value { font-size: 24px; font-weight: 700; line-height: 1.2; margin-top: 4px; white-space: nowrap; }
.ges-kpi .value small { font-size: 13px; font-weight: 600; color: var(--g-ink-2); margin-left: 3px; }
.ges-kpi .foot { color: var(--g-muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ges-meter { height: 5px; border-radius: 3px; background: var(--g-idle-bg); margin-top: 8px; overflow: hidden; }
.ges-meter > i { display: block; height: 100%; border-radius: 3px; background: var(--g-accent); }

/* Durum rozeti: ikon + etiket, yalnızca renk değil */
.ges-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--g-idle-bg); color: var(--g-idle-ink); }
.ges-badge::before { content: "●"; font-size: 9px; }
.ges-badge.ok { background: var(--g-ok-bg); color: var(--g-ok-ink); } .ges-badge.ok::before { content: "✓"; font-size: 11px; }
.ges-badge.warn { background: var(--g-warn-bg); color: var(--g-warn-ink); } .ges-badge.warn::before { content: "!"; font-weight: 800; font-size: 11px; }
.ges-badge.crit { background: var(--g-crit-bg); color: var(--g-crit-ink); } .ges-badge.crit::before { content: "✕"; font-size: 10px; }
.ges-badge.info { background: var(--g-info-bg); color: var(--g-info-ink); } .ges-badge.info::before { content: "i"; font-weight: 800; font-size: 11px; }
.ges-badge.idle::before { content: "–"; }

/* Süzgeç satırı */
.ges-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ges-input, .ges select, .ges textarea.ges-input { border: 1px solid var(--g-line-strong); border-radius: 8px; padding: 7px 10px; background: var(--g-surface); min-width: 0; }
.ges-input:focus, .ges select:focus, .ges-btn:focus-visible, .ges-nav a:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 1px; }
.ges-seg { display: inline-flex; border: 1px solid var(--g-line-strong); border-radius: 8px; overflow: hidden; }
.ges-seg button { border: 0; background: var(--g-surface); padding: 6px 11px; font-weight: 600; color: var(--g-ink-2); cursor: pointer; }
.ges-seg button + button { border-left: 1px solid var(--g-line-strong); }
.ges-seg button[aria-pressed="true"] { background: var(--g-accent-soft); color: var(--g-accent); }
.ges-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--g-line); overflow-x: auto; }
.ges-tabs a { padding: 9px 14px; text-decoration: none; color: var(--g-ink-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.ges-tabs a[aria-current="page"] { color: var(--g-accent); border-bottom-color: var(--g-accent); }

/* Tablolar */
.ges-table-wrap { overflow-x: auto; }
.ges-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ges-table th { text-align: left; font-size: 12px; color: var(--g-ink-2); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--g-line-strong); white-space: nowrap; background: var(--g-surface-2); position: sticky; top: 0; }
.ges-table td { padding: 9px 10px; border-bottom: 1px solid var(--g-line); vertical-align: middle; }
.ges-table td.r, .ges-table th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ges-table tbody tr.click { cursor: pointer; }
.ges-table tbody tr.click:hover { background: var(--g-surface-2); }
.ges-table td .t2 { display: block; color: var(--g-muted); font-size: 12px; }
.ges-table td.muted { color: var(--g-muted); }
.ges-bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.ges-bar-cell .track { flex: 1; height: 6px; border-radius: 3px; background: var(--g-idle-bg); overflow: hidden; }
.ges-bar-cell .track > i { display: block; height: 100%; border-radius: 3px; background: var(--g-series-1); }
.ges-bar-cell .track > i.weak { background: var(--g-warn); } .ges-bar-cell .track > i.open { background: var(--g-crit); }

/* Santral kartları */
.ges-plants { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.ges-plant { display: block; text-decoration: none; color: inherit; background: var(--g-surface); border: 1px solid var(--g-line); border-left: 4px solid var(--g-idle); border-radius: 12px; padding: 13px 14px; box-shadow: var(--g-shadow); }
.ges-plant:hover { border-color: var(--g-accent); border-left-color: inherit; }
.ges-plant.ok { border-left-color: var(--g-ok); } .ges-plant.warn { border-left-color: var(--g-warn); } .ges-plant.crit { border-left-color: var(--g-crit); }
.ges-plant .top { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.ges-plant .name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.ges-plant .meta { color: var(--g-muted); font-size: 12px; margin-top: 2px; }
.ges-plant .power { font-size: 22px; font-weight: 700; margin-top: 10px; }
.ges-plant .power small { font-size: 12px; font-weight: 600; color: var(--g-ink-2); margin-left: 3px; }
.ges-plant dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 10px 0 0; }
.ges-plant dt { font-size: 11px; color: var(--g-muted); } .ges-plant dd { margin: 0; font-weight: 600; font-size: 13px; white-space: nowrap; }
.ges-plant .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--g-muted); }

/* İnverter karoları */
.ges-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.ges-tile { display: block; text-decoration: none; color: inherit; border: 1px solid var(--g-line); border-top: 4px solid var(--g-idle); border-radius: 10px; padding: 9px 10px; background: var(--g-surface); }
.ges-tile:hover { border-color: var(--g-accent); }
.ges-tile.ok { border-top-color: var(--g-ok); } .ges-tile.warn { border-top-color: var(--g-warn); } .ges-tile.crit { border-top-color: var(--g-crit); background: var(--g-crit-bg); } .ges-tile.info { border-top-color: var(--g-info); }
.ges-tile .n { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ges-tile .p { font-size: 18px; font-weight: 700; margin-top: 4px; white-space: nowrap; }
.ges-tile .p small { font-size: 11px; color: var(--g-ink-2); font-weight: 600; margin-left: 2px; }
.ges-tile .s { font-size: 11px; color: var(--g-ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ges-tile .f { display: flex; justify-content: space-between; font-size: 11px; color: var(--g-muted); margin-top: 5px; }
.ges-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--g-ink-2); }
.ges-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ges-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* Grafik ve durum zaman çizelgesi */
.ges-chart { width: 100%; height: 280px; }
.ges-chart.short { height: 150px; }
.ges-timeline { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--g-idle-bg); gap: 2px; }
.ges-timeline i { display: block; min-width: 2px; background: var(--g-idle); }
.ges-timeline i.ok { background: var(--g-ok); } .ges-timeline i.warn { background: var(--g-warn); } .ges-timeline i.crit { background: var(--g-crit); } .ges-timeline i.info { background: var(--g-info); }
.ges-details { margin-top: 10px; font-size: 13px; }
.ges-details summary { cursor: pointer; color: var(--g-accent); font-weight: 600; }

/* Bilgi listeleri, formlar */
.ges-dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 7px 14px; margin: 0; font-size: 13px; }
.ges-dl dt { color: var(--g-ink-2); } .ges-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ges-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ges-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--g-ink-2); }
.ges-form label.wide { grid-column: 1 / -1; }
.ges-form .check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--g-ink); }
.ges-note { padding: 10px 12px; border-radius: 8px; background: var(--g-info-bg); color: var(--g-info-ink); font-size: 13px; }
.ges-note.warn { background: var(--g-warn-bg); color: var(--g-warn-ink); } .ges-note.crit { background: var(--g-crit-bg); color: var(--g-crit-ink); } .ges-note.ok { background: var(--g-ok-bg); color: var(--g-ok-ink); }
.ges-empty { padding: 34px 16px; text-align: center; color: var(--g-ink-2); }
.ges-empty strong { display: block; color: var(--g-ink); font-size: 15px; margin-bottom: 4px; }
.ges-loading { padding: 40px; text-align: center; color: var(--g-muted); }
.ges-toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 420px; padding: 11px 14px; border-radius: 10px; background: var(--g-ink); color: var(--g-surface); box-shadow: var(--g-shadow); font-size: 13px; }
.ges-toast.crit { background: var(--g-crit); color: #fff; }

/* Çekmece ve onay penceresi */
.ges-overlay { position: fixed; inset: 0; background: rgba(8, 14, 22, .5); z-index: 50; display: flex; justify-content: flex-end; }
.ges-overlay.center { justify-content: center; align-items: center; padding: 16px; }
.ges-drawer { width: min(520px, 100%); height: 100%; overflow-y: auto; background: var(--g-surface); padding: 18px; display: grid; gap: 14px; align-content: start; }
.ges-modal { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: var(--g-surface); border-radius: 14px; padding: 20px; display: grid; gap: 14px; }
.ges-drawer h2, .ges-modal h2 { font-size: 17px; }
.ges-code { font: 700 28px/1 ui-monospace, Consolas, monospace; letter-spacing: .18em; padding: 12px; text-align: center; border: 1px dashed var(--g-line-strong); border-radius: 10px; background: var(--g-surface-2); }
.ges-matrix td, .ges-matrix th { text-align: center; } .ges-matrix td:first-child, .ges-matrix th:first-child { text-align: left; }

@media (max-width: 1100px) { .ges-grid-2, .ges-grid-eq { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .ges-bar { position: static; } .ges-bar-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .ges-kpi .value { font-size: 20px; } .ges-head h1 { font-size: 19px; } .ges-chart { height: 230px; }
}
@media print { .ges-bar, .ges-btn, .ges-filters { display: none !important; } .ges-card, .ges-kpi { box-shadow: none; break-inside: avoid; } }

/* string raporu ilerleme çubuğu */
.ges-progress { height: 14px; overflow: hidden; background: var(--ges-idle-bg, #eef1f5); border: 1px solid var(--line, #d3dae3); border-radius: 999px; }
.ges-progress > div { height: 100%; background: linear-gradient(90deg, #1f5fb8, #12805c); border-radius: 999px; transition: width .6s ease; }
.ges-progress-line { margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }

/* rapor tabloları: sıralama, genişletme, sütun seçimi */
.ges-smart th { position: sticky; top: 0; padding-right: 14px; }
.ges-th-sort { all: unset; cursor: pointer; font: inherit; color: inherit; font-weight: 600; white-space: nowrap; }
.ges-th-sort:hover { text-decoration: underline; }
.ges-th-sort:focus-visible { outline: 2px solid var(--g-info-ink, #1f5fb8); outline-offset: 2px; }
.ges-th-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; }
.ges-th-grip:hover { background: var(--g-line-strong, #c5d0db); }
.ges-colmenu { position: relative; display: inline-block; }
.ges-colmenu > summary { list-style: none; cursor: pointer; }
.ges-colmenu > summary::-webkit-details-marker { display: none; }
.ges-colmenu-list { position: absolute; right: 0; z-index: 30; display: grid; gap: 4px; min-width: 240px; max-height: 340px; overflow: auto; margin-top: 4px; padding: 10px 12px;
  font-size: 13px; font-weight: 400; background: var(--g-surface, #fff); border: 1px solid var(--g-line-strong, #c5d0db); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 30, 50, .18); }
.ges-colmenu-list label { display: flex; gap: 8px; align-items: center; white-space: nowrap; cursor: pointer; }
