:root {
  color-scheme: light;
  --ink: #10231f;
  --muted: #697771;
  --paper: #f3f2ec;
  --surface: #fffdf8;
  --line: #dce0da;
  --green: #126f59;
  --green-dark: #0c2a23;
  --green-soft: #deeee8;
  --gold: #bd8f40;
  --red: #a33d35;
  --amber: #a66d12;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: Inter, "Segoe UI", Arial, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; width: 248px; flex-direction: column; color: #f8f6ef; background: var(--green-dark); border-right: 1px solid #25463e; }
.brand { display: flex; align-items: center; gap: 13px; padding: 27px 24px; border-bottom: 1px solid #25463e; }
.brand > span { display: grid; place-items: center; width: 39px; height: 39px; color: var(--green-dark); background: var(--gold); font-family: Georgia, serif; font-size: 17px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: .08em; }
.brand small { margin-top: 4px; color: #9db3ac; font-size: 9px; letter-spacing: .13em; }
.sidebar nav { display: grid; gap: 5px; padding: 24px 14px; }
.sidebar nav a { padding: 12px 14px; color: #afc1bb; border-left: 2px solid transparent; text-decoration: none; font-size: 14px; font-weight: 600; transition: .15s ease; }
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: #183a31; border-left-color: var(--gold); }
.sidebar-foot { margin-top: auto; padding: 19px; border-top: 1px solid #25463e; }
.service-pill { display: flex; align-items: center; gap: 11px; }
.service-pill > span { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.service-pill.live > span { background: #62d3aa; box-shadow: 0 0 0 5px #62d3aa1f; }
.service-pill strong, .service-pill small { display: block; }
.service-pill strong { font-size: 13px; }
.service-pill small { margin-top: 3px; color: #8fa59e; font-size: 11px; }

.workspace { margin-left: 248px; }
.workspace-header { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px clamp(24px, 4vw, 58px); background: #f3f2ecef; border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.eyebrow, .section-label { margin: 0 0 6px; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: 23px; font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.last-update { margin-right: 7px; color: var(--muted); font-size: 11px; }
.last-update strong { color: var(--ink); }
.button { min-height: 39px; padding: 0 16px; border: 1px solid transparent; border-radius: 3px; font-size: 13px; font-weight: 750; }
.button:disabled { cursor: wait; opacity: .55; }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: #0e5c49; }
.button.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button.secondary:hover { border-color: #aeb8b1; }

main { padding: 0 clamp(24px, 4vw, 58px) 80px; }
.section { scroll-margin-top: 100px; margin-top: 24px; }
.hero-section { display: flex; align-items: end; justify-content: space-between; gap: 36px; padding: 48px 0 14px; }
.hero-copy h2 { max-width: 720px; margin: 0; font-family: Georgia, serif; font-size: clamp(36px, 5vw, 58px); line-height: 1.03; font-weight: 500; letter-spacing: -.025em; }
.hero-copy > p:last-child { max-width: 690px; margin: 17px 0 0; color: var(--muted); line-height: 1.65; }
.clock-card { min-width: 210px; padding: 20px; text-align: right; border: 1px solid var(--line); background: var(--surface); }
.clock-card span, .clock-card small { display: block; color: var(--muted); font-size: 11px; }
.clock-card strong { display: block; margin: 10px 0 6px; font-size: 17px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 25px; border: 1px solid var(--line); background: var(--surface); }
.metrics article { min-width: 0; min-height: 139px; padding: 23px; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics article > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.metrics strong { display: block; overflow: hidden; margin: 23px 0 7px; font-size: clamp(22px, 2.5vw, 32px); font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.metrics .metric-value-row { display: flex; align-items: center; gap: 9px; margin: 23px 0 7px; }
.metrics .metric-value-row strong { min-width: 0; margin: 0; text-transform: none; }
.tip-mark.tip-warning { flex: none; color: #fff; background: var(--red); }
.tip-mark.tip-warning:hover, .tip-mark.tip-warning:focus-visible { color: #fff; background: #a5271b; }
.metrics small { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.metrics .accent { color: white; background: var(--green); }
.metrics .accent > span, .metrics .accent small { color: #cce4dd; }

.system-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 24px; }
.panel { border: 1px solid var(--line); background: var(--surface); }
.wide-panel { padding: 29px; }
.system-grid .panel { padding: 28px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.panel h3 { margin: 0; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.badge { padding: 7px 10px; color: var(--green); background: var(--green-soft); border-radius: 3px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.badge.muted { color: var(--muted); background: #eceee9; }
.subtle { color: var(--muted); font-size: 12px; }
.facts { margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 24px; padding: 15px 0; border-bottom: 1px solid #eaebe7; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { overflow: hidden; max-width: 60%; margin: 0; text-align: right; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.health-list > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid #eaebe7; }
.health-list > div:last-child { border-bottom: 0; }
.health-list strong, .health-list small { display: block; }
.health-list strong { font-size: 14px; }
.health-list small { margin-top: 4px; color: var(--muted); }
.health-list b { color: var(--green); font-size: 11px; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: #a9b1ac; }
.health-dot.ready { background: #3db489; box-shadow: 0 0 0 4px #3db48918; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 12px; color: var(--muted); font-size: 10px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 12px; border-top: 1px solid #e6e9e3; font-size: 13px; vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); }
.table-empty { padding: 28px; color: var(--muted); text-align: center; }
.delivery-strip { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 17px; border-top: 1px solid var(--line); }
.delivery-strip:empty { display: none; }
.delivery-item { padding: 8px 11px; color: var(--muted); background: #f0f2ed; font-size: 11px; }
.delivery-item b { color: var(--ink); }
.responsive-heading { align-items: center; }
.filters { display: flex; gap: 9px; }
.filters input, .filters select { min-height: 38px; padding: 0 11px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; }
.filters input { min-width: 230px; }

.realtime-panel { padding: 28px; }
.quote-grid { display: grid; gap: 10px; padding-top: 18px; }
.quote-card { padding: 16px; background: #f0f4ef; border-left: 3px solid var(--green); }
.quote-card span, .quote-card small { display: block; color: var(--muted); }
.quote-card span { font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.quote-card strong { display: block; margin: 8px 0 5px; font-size: 25px; }
.quote-card small { font-size: 11px; }
.alert-list { display: grid; max-height: 420px; overflow-y: auto; }
.alert-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: 0; }
.alert-item > div { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.alert-item p { margin: 8px 0; color: #40504b; font-size: 12px; line-height: 1.5; }
.alert-item small { color: var(--muted); font-size: 10px; }
.alert-sources { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-top: 8px; }
.alert-sources-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.alert-sources a { font-size: 12px; }

.reports-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); min-height: 480px; }
.report-list-col { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.report-list { flex: 1; max-height: 560px; overflow-y: auto; }
.report-list-col .table-pager { justify-content: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.report-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 0 12px 0 0; color: var(--ink); background: transparent; border-bottom: 1px solid #e7e9e4; text-align: left; }
.report-item:hover, .report-item.active { background: #f2f6f3; }
.report-preview-button { display: grid; grid-template-columns: auto 1fr; gap: 13px; min-width: 0; width: 100%; padding: 15px 0; color: inherit; background: transparent; border: 0; text-align: left; }
.report-actions { display: flex; flex-direction: column; gap: 6px; }
.report-download-button { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 8px; font-size: 10px; white-space: nowrap; }
.dl-icon { flex: 0 0 auto; display: block; }
.report-format-toggle { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7f8f5; }
.report-format-toggle button { min-height: 30px; padding: 0 12px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 3px; font-size: 11px; font-weight: 700; }
.report-format-toggle button.active { color: white; background: var(--green); border-color: var(--green); }
.report-format-toggle button:disabled { opacity: .4; cursor: not-allowed; }
.message-subject-link { display: inline; padding: 0; color: var(--green); background: transparent; border: 0; text-align: left; font: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: #9fc4b8; cursor: pointer; }
.message-subject-link:hover { color: var(--green-dark); text-decoration-color: var(--green-dark); }
.message-subject-plain { font-weight: 700; }
.flow-tabs { display: flex; gap: 4px; margin: 16px 0 14px; border-bottom: 1px solid var(--line); }
.flow-tab { padding: 8px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 650; }
.flow-tab:hover { color: var(--ink); }
.flow-tab.is-active { color: var(--ink); border-bottom-color: var(--green); }
.chat-cell { max-width: 520px; white-space: normal; vertical-align: top; line-height: 1.5; }

.table-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 14px; }
.table-pager span { color: var(--muted); font-size: 12px; font-weight: 650; }
.table-pager .button { min-height: 32px; padding: 0 12px; font-size: 12px; }
.file-type { display: grid; place-items: center; width: 42px; height: 42px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 800; }
.report-item strong, .report-item small { display: block; }
.report-item strong { overflow: hidden; margin-top: 2px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.report-item small { margin-top: 5px; color: var(--muted); }
.report-preview { min-width: 0; background: white; }
.report-preview iframe { width: 100%; min-height: 610px; border: 0; }
.report-preview pre { min-height: 480px; max-height: 610px; overflow: auto; margin: 0; padding: 25px; color: #273a34; white-space: pre-wrap; font: 13px/1.6 Consolas, monospace; }
.preview-placeholder { display: grid; place-items: center; align-content: center; min-height: 480px; color: var(--muted); }
.preview-placeholder strong, .preview-placeholder span { display: block; }
.preview-placeholder strong { margin-bottom: 8px; color: var(--ink); font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.empty { padding: 20px; color: var(--muted); }

.tip-label { display: inline-flex; align-items: center; gap: 6px; }
h3.tip-label { display: inline-flex; }
.clock-card .tip-label { display: inline-flex; }
.tip-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  padding: 0;
  color: #6e7f78;
  background: #e7ebe6;
  border: 0;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}
.tip-mark:hover, .tip-mark:focus-visible { color: white; background: var(--green); outline: none; }
th .tip-mark { width: 13px; height: 13px; font-size: 9px; }
.metrics .accent .tip-mark { color: #d7ebe4; background: #1a7a63; }
.metrics .accent .tip-mark:hover, .metrics .accent .tip-mark:focus-visible { color: var(--green-dark); background: white; }
.label-tip { display: inline-flex; align-items: center; gap: 5px; }
.floating-tip {
  position: fixed;
  z-index: 80;
  max-width: min(280px, calc(100vw - 16px));
  padding: 8px 10px;
  color: #f7faf8;
  background: #0f2b25;
  border-radius: 4px;
  box-shadow: 0 10px 28px #0c2a2340;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.floating-tip.show { opacity: 1; transform: translateY(0); }
.floating-tip::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 5px solid transparent;
}
.floating-tip.below::after { left: var(--arrow-x, 50%); top: -10px; border-bottom-color: #0f2b25; transform: translateX(-50%); }
.floating-tip.above::after { left: var(--arrow-x, 50%); bottom: -10px; border-top-color: #0f2b25; transform: translateX(-50%); }

.energy-panel { margin-top: 24px; }
.energy-layout { display: grid; grid-template-columns: minmax(180px, .28fr) minmax(0, 1fr); gap: 18px; padding-top: 18px; }
.energy-kpis { display: grid; gap: 10px; align-content: start; }
.energy-kpi { padding: 14px 15px; background: #f0f4ef; border-left: 3px solid var(--green); }
.energy-kpi span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.energy-kpi strong { display: block; margin: 7px 0 4px; font-size: 22px; font-weight: 620; }
.energy-kpi small { display: block; color: var(--muted); font-size: 11px; }
.energy-kpi .up { color: #1a7a63; }
.energy-kpi .down { color: var(--red); }
.energy-chart-wrap { min-width: 0; padding: 8px 4px 0; background: linear-gradient(180deg, #f7faf8 0%, #fffdf8 100%); border: 1px solid var(--line); }
.energy-chart-wrap svg { display: block; width: 100%; height: auto; }
.energy-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 12px 12px; }
.energy-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
/* Çizgi rengi artık enstrümana değil, her segmentin kendi yönüne (artış/düşüş) göre —
   tek bir çizgi hem yeşil hem kırmızı olabilir. Legend bu yüzden nötr renkte (var(--muted));
   enstrümanlar birbirinden çizgi stiliyle (düz/kesikli/noktalı) ayrılır. */
.energy-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid currentColor; }
.energy-legend .legend-ttf i { border-top-style: dashed; }
.energy-legend .legend-hh i { border-top-style: dotted; }
.energy-kpi .energy-mode { display: inline; letter-spacing: 0; }

.sim-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-top: 18px; }
.sim-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: #f3f5f0; border-left: 3px solid var(--green); }
.sim-card h4 { margin: 0; font-size: 14px; }
.sim-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 650; }
.sim-card input:not([type="checkbox"]), .sim-card select, .sim-card textarea { padding: 8px 9px; color: var(--ink); background: white; border: 1px solid #cfd6cf; border-radius: 3px; }
.sim-card .toggle-line { flex-direction: row; align-items: center; gap: 8px; }
.sim-card button { align-self: flex-start; margin-top: 4px; }
.sim-result { margin: 4px 0 0; font-size: 12px; color: var(--green-dark); min-height: 16px; }
@media (max-width: 820px) { .sim-grid { grid-template-columns: 1fr; } }
.energy-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.configuration-panel { padding-bottom: 0; }
.config-block { display: grid; grid-template-columns: minmax(220px, .42fr) minmax(0, 1fr); gap: 35px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.config-title { display: flex; gap: 13px; }
.config-title > span { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 800; }
.config-title h4 { margin: 2px 0 6px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.config-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid label { display: grid; gap: 7px; color: #40504b; font-size: 12px; font-weight: 700; }
.form-grid input:not([type="checkbox"]), .form-grid textarea, .form-grid select { width: 100%; padding: 10px 11px; color: var(--ink); background: white; border: 1px solid #cfd6cf; border-radius: 3px; outline: none; }
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { border-color: var(--green); box-shadow: 0 0 0 3px #126f5912; }
.form-grid small { color: var(--muted); font-weight: 400; }
.span-two { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; color: #40504b; font-size: 12px; font-weight: 700; }
.day-list { display: flex; flex-wrap: wrap; gap: 7px; }
.day-list label { display: flex; align-items: center; gap: 7px; padding: 8px 10px; background: #f0f2ed; border-radius: 3px; font-size: 11px; }
.toggle-line { display: flex !important; align-items: center; gap: 9px !important; align-self: center; flex-wrap: wrap; }
.toggle-line .label-tip { font-weight: 700; }
.toggle-line input, .source-row > input[type="checkbox"], .category-row > input[type="checkbox"], .instrument-row > input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green); }
.source-list { display: grid; gap: 8px; }
.source-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 12px; background: #f3f5f0; }
.source-row strong, .source-row small { display: block; }
.source-row strong { font-size: 12px; }
.source-row small { overflow: hidden; max-width: 520px; margin-top: 4px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.source-row a { color: var(--green); font-size: 11px; }
.source-config-row { align-items: start; }
.source-fields { display: grid; grid-template-columns: .8fr 1.2fr 1.2fr; gap: 9px; }
.source-fields label, .instrument-row label, .movement-rule-row label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.source-fields input, .instrument-row input:not([type="checkbox"]), .movement-rule-row input { min-width: 0; width: 100%; padding: 8px 9px; color: var(--ink); background: white; border: 1px solid #cfd6cf; border-radius: 3px; }
.gdelt-fields { grid-template-columns: 1fr 1fr 1fr 1fr; }
.gdelt-fields strong { grid-column: 1 / -1; }
.gdelt-fields textarea { min-width: 0; width: 100%; padding: 8px 9px; color: var(--ink); background: white; border: 1px solid #cfd6cf; border-radius: 3px; font: inherit; resize: vertical; }
.google-news-query-field { grid-column: 1 / -1; }
.instrument-settings { display: grid; gap: 10px; }
.instrument-row { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; padding: 12px; background: #f3f5f0; }
.category-settings { display: grid; gap: 9px; }
.movement-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.movement-rule-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 11px; background: #f3f5f0; }
.category-row { display: grid; grid-template-columns: auto minmax(150px, .65fr) minmax(220px, 1.35fr) auto; align-items: end; gap: 10px; padding: 12px; background: #f3f5f0; }
.category-row label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.remove-category-button { min-height: 39px; padding: 0 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.remove-category-button:hover { color: white; background: var(--red); border-color: var(--red); }
/* .config-block iki kolonlu bir grid (sol: başlık, sağ: içerik) — bu buton .category-settings'in
   ardından üçüncü çocuk olarak grid'in otomatik akışıyla sol (dar) kolona düşerdi;
   grid-column ile açıkça sağ kolona (içerik sütununa) sabitliyoruz. */
.add-category-button { grid-column: 2; justify-self: start; min-height: 30px; margin-top: 10px; padding: 0 12px; font-size: 11px; font-weight: 700; }
.category-row input[type="text"] { min-width: 0; width: 100%; padding: 8px 9px; color: var(--ink); background: white; border: 1px solid #cfd6cf; border-radius: 3px; }
.protected-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; padding: 24px 0; }
.protected-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px; background: #f0f2ed; }
.protected-item span { color: var(--muted); font-size: 11px; }
.protected-item b { color: var(--green); font-size: 10px; text-transform: uppercase; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 -29px; padding: 19px 29px; background: #eef1eb; }
.form-actions p { margin: 0; color: var(--muted); font-size: 11px; }

.form-grid input[readonly], .form-grid textarea[readonly], .form-grid select:disabled, .form-grid select[disabled] { background: #eef1eb; color: var(--muted); cursor: not-allowed; }
.add-email-button { justify-self: start; min-height: 30px; margin-top: 4px; padding: 0 12px; font-size: 11px; font-weight: 700; }

/* !important: bu bir "screen-reader-only" yardımcı class'ı — .form-grid textarea gibi daha
   özgül (specific) bileşen kurallarının width/height'ı ezmesini önlemek için kasıtlı.
   2026-09-11: config-senders/config-recipients textarea'ları bunsuz 100% genişlik alıp
   sayfayı sağa doğru 600px+ taşırıyordu. */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.email-list { display: flex; flex-wrap: wrap; gap: 7px; min-height: 39px; padding: 8px 9px; background: #eef1eb; border: 1px solid #cfd6cf; border-radius: 3px; }
.email-list-empty { margin: 0; padding: 3px 1px; color: var(--muted); font-size: 12px; }
.email-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.email-chip-remove { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; color: var(--muted); background: transparent; border: none; border-radius: 50%; font-size: 13px; line-height: 1; cursor: pointer; }
.email-chip-remove:hover { color: white; background: var(--red); }

.email-dialog { width: min(92vw, 360px); padding: 20px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 22px 60px #0c2a2333; }
.email-dialog::backdrop { background: #0c2a2359; }
.email-dialog h4 { margin: 0 0 14px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.email-dialog label { display: grid; gap: 6px; color: #40504b; font-size: 12px; font-weight: 700; }
.email-dialog input { width: 100%; padding: 9px 10px; color: var(--ink); background: white; border: 1px solid #cfd6cf; border-radius: 3px; outline: none; }
.email-dialog input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #126f5912; }
.email-dialog-error { margin: 8px 0 0; color: var(--red); font-size: 11px; font-weight: 700; }
.email-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.email-dialog-actions .button { min-height: 34px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 420px; padding: 13px 17px; color: white; background: var(--green-dark); border-left: 4px solid #4bc095; box-shadow: 0 12px 35px #0c2a2330; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-left-color: #da6b61; }

.login-page { display: grid; min-height: 100vh; background: radial-gradient(circle at top left, #deeee8 0, transparent 34%), var(--paper); }
.login-shell { display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 430px); padding: 32px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 22px 60px #0c2a2317; }
.login-brand { margin: -32px -32px 28px; color: #f8f6ef; background: var(--green-dark); }
.login-brand strong { color: white; }
.login-panel h1 { margin: 0 0 24px; font-family: Georgia, serif; font-size: 32px; font-weight: 500; }
.login-form { display: grid; gap: 16px; }
.login-form label { display: grid; gap: 7px; color: #40504b; font-size: 12px; font-weight: 750; }
.login-form input { width: 100%; min-height: 43px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #cfd6cf; border-radius: 3px; outline: none; }
.login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #126f5912; }
.login-form .button { width: 100%; margin-top: 4px; }
.login-error { min-height: 18px; margin: 0; color: var(--red); font-size: 12px; font-weight: 700; }

@media (max-width: 1100px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .brand { padding: 17px 24px; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 8px 16px; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar-foot { display: none; }
  .workspace { margin-left: 0; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .workspace-header, .hero-section, .responsive-heading { align-items: flex-start; flex-direction: column; }
  .workspace-header { position: static; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .last-update { width: 100%; }
  .hero-section { padding-top: 34px; }
  .clock-card { width: 100%; text-align: left; }
  .system-grid, .reports-layout, .energy-layout { grid-template-columns: 1fr; }
  .report-list-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .report-list { max-height: 330px; }
  .report-item { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  .report-actions { flex-direction: row; flex-wrap: wrap; padding: 0 12px 12px; }
  .config-block { grid-template-columns: 1fr; }
  .protected-grid { grid-template-columns: 1fr; }
  .table-pager { justify-content: space-between; }
}

@media (max-width: 580px) {
  main { padding-inline: 15px; }
  .workspace-header { padding-inline: 15px; }
  .metrics { grid-template-columns: 1fr; }
  .metrics article { border-right: 0; border-bottom: 1px solid var(--line); }
  .metrics article:last-child { border-bottom: 0; }
  .system-grid .panel, .wide-panel { padding: 20px; }
  .filters { width: 100%; flex-direction: column; }
  .filters input { min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .movement-settings { grid-template-columns: 1fr; }
  .source-fields, .gdelt-fields, .instrument-row { grid-template-columns: 1fr; }
  .instrument-row > input[type="checkbox"] { align-self: center; }
  .category-row { grid-template-columns: auto 1fr; }
  .category-row > input[type="checkbox"] { align-self: center; }
  .category-row label:last-child { grid-column: 2; }
  .form-actions { align-items: stretch; flex-direction: column; margin-inline: -20px; padding-inline: 20px; }
}
