:root {
  color-scheme: light;
  --page: #efebe3;
  --surface: #fffdf9;
  --surface-2: #f5f1e8;
  --ink: #1d1c1a;
  --ink-2: #55524b;
  --muted: #736f66;
  --border: rgba(40, 30, 10, 0.12);
  --accent: #2b2a27;
  --accent-ink: #fffdf9;
  --focus: #1f63b8;
  --note: #fff6cc;
  --note-pinned: #ffefa3;
  --paper-line: #e9e3d3;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --warning-text: #8a5a00;
  --critical: #d03b3b;
  --critical-text: #b42828;
  --info: #8a877d;
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.06), 0 6px 18px rgba(40, 30, 10, 0.05);
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #121110;
    --surface: #1c1b19;
    --surface-2: #26241f;
    --ink: #f0ece3;
    --ink-2: #c9c4b8;
    --muted: #9a958a;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #f0ece3;
    --accent-ink: #1d1c1a;
    --focus: #6aa6f0;
    --note: #2c2918;
    --note-pinned: #3a3415;
    --paper-line: #2e2c27;
    --good-text: #2fc42f;
    --warning-text: #fab219;
    --critical-text: #ef7373;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121110;
  --surface: #1c1b19;
  --surface-2: #26241f;
  --ink: #f0ece3;
  --ink-2: #c9c4b8;
  --muted: #9a958a;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #f0ece3;
  --accent-ink: #1d1c1a;
  --focus: #6aa6f0;
  --note: #2c2918;
  --note-pinned: #3a3415;
  --paper-line: #2e2c27;
  --good-text: #2fc42f;
  --warning-text: #fab219;
  --critical-text: #ef7373;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Division colours: solid band + light tint. Same solid in both themes. */
.div-otomotiv { --div: #1f63b8; --div-tint: #e9f1fc; }
.div-maden { --div: #c2531f; --div-tint: #fcefe7; }
.div-teker { --div: #0f8a5f; --div-tint: #e4f5ee; }
.div-none, .div-genel { --div: #8a877d; --div-tint: var(--surface-2); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .div-otomotiv { --div-tint: #172338; }
  :root:where(:not([data-theme="light"])) .div-maden { --div-tint: #2e1d15; }
  :root:where(:not([data-theme="light"])) .div-teker { --div-tint: #132a21; }
}
:root[data-theme="dark"] .div-otomotiv { --div-tint: #172338; }
:root[data-theme="dark"] .div-maden { --div-tint: #2e1d15; }
:root[data-theme="dark"] .div-teker { --div-tint: #132a21; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 650; }
a { color: inherit; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  min-width: 0;
}
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
input[type="range"] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--border); font-weight: 500; }
.btn.danger { background: transparent; color: var(--critical-text); border: 1px solid currentColor; font-weight: 500; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--ink-2);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; text-decoration: none; }
.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  white-space: nowrap;
}
.mainnav a[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.topbar-actions { display: flex; gap: 8px; }

/* ---------- page layout ---------- */
main { outline: none; }
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px 110px;
  display: grid;
  gap: 16px;
  min-width: 0;
}
.page.narrow { max-width: 860px; }
.page > * { min-width: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.section-head .actions { display: flex; gap: 6px; }
.section-sub { margin: -4px 0 10px; font-size: 13px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-foot { display: flex; justify-content: flex-end; }
.footer { text-align: center; font-size: 13px; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.split { display: grid; gap: 16px; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.empty { color: var(--muted); margin: 6px 0; font-size: 14px; }
.back { text-decoration: none; color: var(--ink-2); font-size: 14px; }
.save-status { font-size: 13px; color: var(--muted); min-height: 1em; }
.save-status[data-state="error"] { color: var(--critical-text); }

/* ---------- home ---------- */
.hero p { margin: 4px 0 0; }

/* ---------- division page ---------- */
.division-banner {
  background: var(--div);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow);
}
.division-banner .back { color: rgba(255, 255, 255, 0.85); }
.division-banner h1 { font-size: 30px; }
.division-banner p { margin: 0; opacity: 0.9; }

/* ---------- list items (tasks, replies) ---------- */
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.items .item:first-child { border-top: 0; }
.item input[type="checkbox"] { margin-top: 1px; }
.item-body { display: grid; gap: 2px; min-width: 0; }
.item-title { overflow-wrap: anywhere; font-weight: 500; }
.item.done .item-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.item-note { font-size: 13px; color: var(--ink-2); }
.star { color: #d08700; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 12.5px; color: var(--muted); }
.meta a { color: var(--ink-2); }
.due.overdue { color: var(--critical-text); font-weight: 600; }
.due.today { color: var(--warning-text); font-weight: 600; }
.due.soon { color: var(--ink-2); font-weight: 600; }
.x-btn {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
  opacity: 0.6;
}
.x-btn:hover { opacity: 1; color: var(--critical-text); }
.more { font-size: 13px; margin: 4px 0 0; }
.done-list { margin-top: 8px; }
.done-list summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }

.chip { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.chip .dot, .chip-link .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--div); flex: none; }

/* add forms */
.add-form { display: grid; gap: 6px; margin-bottom: 8px; }
.add-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.add-row input[type="date"] { flex: 0 1 150px; }
.add-row input:not([type]) { flex: 1 1 120px; }
.add-row select { flex: 0 1 120px; }
.add-row .btn { margin-left: auto; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }

/* status chips: icon + label */
.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px;
}
.status.good { color: var(--good-text); }
.status.good::before {
  background-color: var(--good);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2 2 4-4.4' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.status.warning { color: var(--warning-text); }
.status.warning::before {
  background-color: var(--warning);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.6 2.6v4.8M6.4 2.6v4.8' stroke='%230b0b0b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.status.critical { color: var(--critical-text); }
.status.critical::before {
  background-color: var(--critical);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2.2v3.4' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='5' cy='7.7' r='0.9' fill='white'/%3E%3C/svg%3E");
}
.status.info { color: var(--ink-2); }
.status.info::before {
  background-color: var(--info);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2.5l3 2.5-3 2.5' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- meetings ---------- */
.meetings { display: grid; gap: 4px; }
.meeting-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  margin: 0 -8px;
  border-radius: 10px;
  text-decoration: none;
}
.meeting-row:hover { background: var(--surface-2); }
.meeting-row.past { opacity: 0.75; }
.date-block {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  line-height: 1.05;
}
.date-block b { font-size: 18px; }
.date-block small { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.meeting-row.today .date-block { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.meeting-row.today .date-block small { color: inherit; opacity: 0.8; }
.meeting-main { display: grid; gap: 2px; min-width: 0; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* ---------- projects ---------- */
.project-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.project-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--div);
  background: var(--surface);
  text-decoration: none;
  align-content: start;
}
.project-card:hover { background: var(--surface-2); }
.project-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.progress { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress span { display: block; height: 100%; background: var(--div); border-radius: 999px; }
.next-step { font-size: 13px; color: var(--ink-2); }
.add-project { margin-top: 10px; }

/* ---------- detail pages ---------- */
.detail { display: grid; gap: 14px; border-top: 5px solid var(--div, var(--border)); }
.note-detail { border-top: 5px solid #e2c84a; }
.title-input {
  font-size: 24px;
  font-weight: 700;
  border: 0;
  border-bottom: 1px dashed transparent;
  border-radius: 0;
  padding: 4px 0;
  background: transparent;
  width: 100%;
}
.title-input:hover, .title-input:focus { border-bottom-color: var(--border); }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.fields.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.field input, .field select, .field textarea { font-size: 15px; color: var(--ink); width: 100%; }
.field textarea { resize: vertical; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input { flex: 1; }

.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: grid; gap: 12px; }
.timeline li { position: relative; font-size: 14px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--muted);
}
.timeline p { margin: 2px 0 0; white-space: pre-wrap; }
.timeline .muted { font-size: 12.5px; }

/* ---------- segmented switch ---------- */
.segmented {
  display: inline-flex;
  justify-self: start;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 10px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--ink-2);
}
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- list pages ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-2);
}
.chip-link[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; display: grid; gap: 10px; }
.login h1 { font-size: 22px; margin-bottom: 8px; }
.login label { font-size: 13px; color: var(--ink-2); }
.error { color: var(--critical-text); min-height: 1em; margin: 0; font-size: 14px; }

/* ---------- mills ---------- */
.banner-link { color: #fff; font-size: 14px; font-weight: 600; justify-self: start; margin-top: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input[type="search"] { flex: 1 1 240px; }
.toolbar select { flex: 0 1 180px; }
.split.even { align-items: start; }
@media (min-width: 960px) {
  .split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split.form-first { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
}
.hint { font-size: 12px; color: var(--muted); }
.fields .field { align-content: start; }
.card > textarea { width: 100%; resize: vertical; }
.with-hint { display: grid; gap: 4px; }

/* Tables scroll sideways inside their card, never the page. */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 8px; border-top: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table.links tbody tr { cursor: pointer; }
.data-table.links tbody tr:hover { background: var(--surface-2); }
.data-table.links a { text-decoration: none; font-weight: 600; }
.data-table.links td:first-child { min-width: 170px; }
.data-table tr.ours td { font-weight: 650; background: var(--surface-2); }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.data-table.edit td { padding: 4px; vertical-align: middle; }
.data-table.edit input { width: 100%; min-width: 96px; padding: 6px 8px; }
.data-table.edit input[type="date"] { min-width: 140px; }
.data-table.edit select { width: 100%; min-width: 160px; max-width: 280px; padding: 6px 8px; }
.data-table.edit .num input { text-align: right; }
.data-table.edit output { display: block; padding: 0 6px; color: var(--ink-2); }
.add-row-btn { margin-top: 8px; }

.list-rows { display: grid; gap: 2px; }
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  margin: 0 -8px;
  border-radius: 10px;
  text-decoration: none;
}
.list-row:hover { background: var(--surface-2); }
.list-main { display: grid; gap: 2px; min-width: 0; }
.list-side { display: grid; gap: 1px; justify-items: end; align-content: start; text-align: right; font-size: 13px; color: var(--ink-2); }
.list-side b { font-size: 14px; color: var(--ink); white-space: nowrap; }
.stale { color: var(--warning-text); font-weight: 600; }

.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat b { font-size: 19px; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); }

.row-cards { display: grid; gap: 10px; }
.row-card { border: 1px solid var(--border); border-left: 4px solid var(--div); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.row-card output { font-size: 15px; font-weight: 600; color: var(--ink); padding: 8px 0; }
.row-card-foot { display: flex; justify-content: flex-end; }

.summary { margin: 0 0 10px; font-weight: 600; }
.summary.good { color: var(--good-text); }
.summary.warn { color: var(--warning-text); }

.query-group { display: grid; gap: 8px; margin-top: 14px; }
.query-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.query-group + .btn { margin-top: 16px; }
.query-group .fields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }

.matches { display: grid; gap: 8px; }
.match {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
}
.match:hover { background: var(--surface-2); }
.match-score { display: grid; gap: 6px; align-content: start; text-align: center; }
.match-score b { font-size: 20px; font-variant-numeric: tabular-nums; }
.match-body { display: grid; gap: 3px; min-width: 0; }
.diffs { font-size: 13px; color: var(--warning-text); }
.refs { font-size: 13px; color: var(--ink-2); }

.life-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.life { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 3px; align-content: start; }
.life h3 { font-size: 13px; color: var(--ink-2); }
.life p { margin: 0; font-size: 13.5px; }
.life .big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- page head actions ---------- */
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- section tabs ---------- */
.section-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.section-tabs a {
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 14px;
}
.section-tabs a[aria-current="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--div); }

/* ---------- product portfolio ---------- */
.product-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.product-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  align-items: start;
}
.product-card:hover { background: var(--surface-2); }
.product-thumb {
  width: 96px;
  height: 72px;
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: contain;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-thumb svg { width: 100%; height: 100%; }
.product-thumb.placeholder { font-weight: 700; color: var(--muted); font-size: 14px; }
.product-body { display: grid; gap: 3px; min-width: 0; }
.product-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; align-items: start; }
.product-top .item-title { overflow-wrap: normal; }
.clip-2 { font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dims { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dims-split { align-items: start; }
@media (min-width: 960px) { .dims-split { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.profile-preview { background: var(--surface-2); border-radius: 12px; padding: 12px; min-height: 160px; display: grid; place-items: center; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}
.drop-zone p { margin: 0; }
.drop-zone.over { border-color: var(--div); background: var(--div-tint); }
.files { display: grid; gap: 12px; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.file-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.file-list li:first-child { border-top: 0; }
.file-ext, .file-thumb {
  width: 48px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  object-fit: cover;
}
.file-main { display: grid; min-width: 0; font-size: 14px; }
.file-main a { overflow-wrap: anywhere; font-weight: 500; }
.file-main .muted { font-size: 12.5px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
}
.tag a { text-decoration: none; font-weight: 600; }
.tags select { flex: 0 1 240px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* ---------- liner design ---------- */
@media (min-width: 1100px) { .split.design-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
.headline { margin: 0 0 6px; font-size: 18px; font-weight: 650; }
.design-table td.strong { font-weight: 700; }
.design-table td.why { font-size: 13px; color: var(--ink-2); min-width: 220px; }
.notes { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.notes li.warn { color: var(--warning-text); font-weight: 600; }
.traj-wrap { display: grid; gap: 10px; }
@media (min-width: 720px) { .traj-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } }
.trajectory-svg, .profile-svg { width: 100%; height: auto; max-height: 360px; }
.svg-shell { fill: none; stroke: var(--ink-2); stroke-width: 2px; }
.svg-liner { fill: none; stroke: var(--border); stroke-width: 1px; }
.svg-charge { fill: color-mix(in srgb, var(--div) 16%, transparent); }
.svg-toe { stroke: var(--div); stroke-width: 2px; }
.svg-label { fill: var(--ink-2); }
.svg-part { fill: color-mix(in srgb, var(--div) 22%, var(--surface)); stroke: var(--div); stroke-width: 2px; }
.svg-current { fill: none; stroke: var(--muted); stroke-width: 2px; stroke-dasharray: 6 4; }
.traj { fill: none; stroke-width: 2.5px; }
.traj.current { stroke: var(--muted); stroke-dasharray: 6 4; }
.traj.proposed { stroke: var(--div); }
.traj.final { stroke: var(--good); }
.hit.current { fill: var(--muted); }
.hit.proposed { fill: var(--div); }
.hit.final { fill: var(--good); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.legend li.bad { color: var(--warning-text); }
.legend .key { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 8px; }
.legend .key.current { border-top-style: dashed; border-color: var(--muted); }
.legend .key.proposed { border-color: var(--div); }
.legend .key.final { border-color: var(--good); }
.match-block { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }
.match-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.match-block h3 { font-size: 15px; }
.match-block .summary { margin: 0; }
.new-design { display: grid; gap: 6px; justify-items: start; }
.new-design p { margin: 0; }
.data-table td.over { color: var(--warning-text); }
.cell-sub.ok { color: var(--good-text); font-weight: 600; }
.result-list { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 6px; }
.rules summary { cursor: pointer; font-weight: 600; }
.rules ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.field .checks input[type="checkbox"] { width: 18px; }
.field .checks .toggle { font-size: 14px; }
@media (min-width: 1100px) { .narrow-only { display: none; } }

/* ---------- FKK Mining Division ---------- */
.brand small { font-weight: 500; color: var(--div); }
.me-link {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  align-self: center;
}
.me-link[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.me-link { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
/* Eleven menu items: tighter on mid-size screens, and below the width they
   need on one line every section stays in sight on its own wrapping row
   under the brand and account buttons. */
@media (max-width: 1499px) { .mainnav a { padding: 6px 8px; } }
@media (max-width: 1399px) {
  .topbar { flex-wrap: wrap; gap: 6px 8px; }
  .brand span { display: inline; }
  .topbar-actions { margin-left: auto; align-items: center; }
  .mainnav { order: 3; flex-basis: 100%; flex-wrap: wrap; overflow: visible; }
}
/* Phones: the taller bar scrolls away with the page. */
@media (max-width: 720px) {
  .topbar { position: static; padding-left: 12px; padding-right: 12px; }
  .mainnav a { padding: 6px 9px; }
  .me-link { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 480px) { .brand span { display: none; } }

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.kpi {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--div);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.kpi:hover { background: var(--surface-2); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 13px; color: var(--ink-2); }
.kpi small.alert { color: var(--critical-text); font-weight: 600; }

a.item-title { text-decoration: none; }
a.item-title:hover { text-decoration: underline; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.activity li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
.activity li > .muted { font-size: 12.5px; padding-top: 1px; }
.activity a { color: var(--ink); }
@media (max-width: 560px) { .activity li { grid-template-columns: 1fr; gap: 0; } }
.audit { font-size: 12.5px; text-align: right; margin: 0; }

.stat.bad b { color: var(--critical-text); }
.data-table tr.late td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.data-table tr.inactive td { opacity: 0.55; }
.steps-bar { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.steps-bar li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border-top: 3px solid var(--border); font-size: 13px; }
.steps-bar li.done { border-top-color: var(--good); }
.steps-bar li.planned { border-top-color: var(--warning); }
.steps-bar li span { color: var(--muted); }
@media (max-width: 640px) { .steps-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Viewers: nothing to change, so the change controls go. */
body.readonly .edit-only { display: none !important; }
body.readonly main button:disabled { display: none; }

/* ---------- service ---------- */
.page.wide { max-width: 1480px; }
.page.mid { max-width: 1060px; }
.doc-no { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: 0.02em; }
.doc-title { font-size: 24px; margin: 0 0 12px; }
.field-value { margin: 0; padding: 9px 0; font-size: 15px; }
.sub-head { font-size: 15px; margin: 16px 0 8px; }
.late-text { color: var(--critical-text); font-weight: 600; }
.warn-text { color: var(--warning-text); font-weight: 600; }
.spacer { flex: 1; }
.prio { display: inline-block; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 999px; }
.prio.acil { background: var(--critical); color: #fff; }
.prio.yuksek { background: var(--warning); color: #1d1c1a; }

.check-group { display: flex; flex-wrap: wrap; gap: 8px; }
.field .toggle input[type="checkbox"] { width: 18px; height: 18px; flex: none; }
.field-toggle { padding: 9px 0; font-size: 14px; }
.check-option { display: inline-flex; align-items: flex-start; gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 14px; }
.check-option input { width: 17px; height: 17px; margin: 2px 0 0; flex: none; }
.check-option small { display: block; font-size: 12px; color: var(--muted); }
.check-option:has(input:checked) { border-color: var(--div); background: var(--div-tint); }
.data-table th.check, .data-table td.check { width: 64px; text-align: center; }
.data-table.edit td.check input { width: 20px; min-width: 0; height: 20px; }

.alert-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.alert-list li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--info); }
.alert-list li.warning { border-left-color: var(--warning); }
.alert-list li.critical { border-left-color: var(--critical); }
.clash-text { display: block; font-size: 13px; color: var(--critical-text); }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); border-left: 4px solid var(--info); font-size: 14px; }
.banner.good { border-left-color: var(--good); }
.locked .edit-only { display: none !important; }
.form-foot { gap: 10px; flex-wrap: wrap; }

.avail { font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; text-decoration: none; }
.avail.free { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-text); }
.avail.busy { background: var(--div-tint); color: var(--div); }
.avail.away { background: var(--surface-2); color: var(--muted); }
.team-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.member-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 2px; }
.member-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.member-list li:first-child { border-top: 0; }
.member-list li > a:first-child { font-weight: 600; }
.member-list li .btn { margin-left: auto; }
.util-list { display: grid; gap: 8px; }
.util-row { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr 48px; gap: 10px; align-items: center; text-decoration: none; font-size: 14px; }
.util-row b { text-align: right; font-variant-numeric: tabular-nums; }
.util-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.util-bar span { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.util-bar span.over { background: var(--critical); }
.util-bar span.under { background: var(--warning); }

/* Plan board: a label column and one column per day; bars are placed on a
   grid of their own inside each row's track, one lane per overlap. */
.plan-card { padding: 0; overflow: hidden; }
.plan-scroll { overflow-x: auto; }
.plan-grid { --plan-label: 190px; --plan-day: 34px; --plan-lane: 30px; display: grid; font-size: 13px; }
.plan-toolbar .plan-range { font-size: 15px; }
.plan-corner, .plan-label { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); }
.plan-week { padding: 8px 6px 2px; font-size: 12px; font-weight: 650; color: var(--muted); border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.plan-day { display: grid; justify-items: center; padding: 2px 0 6px; border-bottom: 1px solid var(--border); border-left: 1px solid transparent; }
.plan-day small { font-size: 10.5px; color: var(--muted); }
.plan-day b { font-size: 13px; font-variant-numeric: tabular-nums; }
.plan-day.off { color: var(--muted); }
.plan-day.today b { background: var(--div); color: #fff; border-radius: 999px; padding: 0 6px; }
.plan-group { padding: 10px 12px 4px; font-weight: 700; font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); position: sticky; left: 0; }
.plan-label { padding: 6px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; }
.plan-label a, .plan-label > span { text-decoration: none; display: grid; gap: 1px; min-width: 0; }
.plan-label b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-label small { font-size: 12px; color: var(--muted); }
.plan-track { display: grid; border-top: 1px solid var(--border); padding: 4px 0; row-gap: 3px; }
.plan-track.requests { background: var(--surface-2); }
.plan-cell { border-left: 1px solid var(--border); margin: -4px 0; }
.plan-cell.off { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.plan-cell.today { background: color-mix(in srgb, var(--div) 12%, transparent); }
.bar { --bar: #6f6a60; position: relative; z-index: 1; margin: 0 2px; padding: 0 7px; border-radius: 7px; background: var(--bar); color: #fff; font-size: 12px; line-height: 27px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; min-width: 0; }
.bar b { font-weight: 700; }
.bar.type-montaj { --bar: #c2531f; }
.bar.type-sokum { --bar: #8a5a2b; }
.bar.type-revizyon { --bar: #7a4fb8; }
.bar.type-kontrol { --bar: #1f63b8; }
.bar.type-ariza { --bar: #c0352f; }
.bar.type-egitim { --bar: #0f8a5f; }
.bar.type-diger { --bar: #6f6a60; }
.bar.st-tamamlandi, .bar.st-kapandi { opacity: 0.5; }
.bar.st-beklemede { background: repeating-linear-gradient(135deg, var(--bar) 0 8px, color-mix(in srgb, var(--bar) 70%, #fff) 8px 16px); }
.bar.request { background: transparent; color: var(--bar); border: 2px dashed var(--bar); line-height: 23px; font-weight: 600; }
.bar.urgent::before { content: "!"; font-weight: 800; margin-right: 4px; }
.bar.clash { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--critical); }
.bar.absence { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, color-mix(in srgb, var(--ink) 12%, var(--surface-2)) 6px 12px); color: var(--ink-2); border: 1px solid var(--border); line-height: 25px; }
.plan-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--ink-2); }
.plan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plan-legend i.bar { display: inline-block; width: 22px; height: 12px; padding: 0; margin: 0; line-height: 0; border-radius: 4px; }
.plan-legend i.bar.request { border-width: 2px; --bar: var(--ink-2); }
.plan-legend i.bar.clash { background: var(--surface); }
@media (max-width: 720px) {
  .plan-grid { --plan-label: 130px; --plan-day: 26px; }
}

/* Service form: photos and signatures. */
.photo-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 12px; border: 2px dashed var(--border); border-radius: 12px; }
.photo-actions .field { flex: 0 1 220px; }
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.photo { margin: 0; display: grid; gap: 6px; align-content: start; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--surface-2); display: block; }
.photo figcaption { display: grid; gap: 6px; }
.photo figcaption input { width: 100%; }
.photo-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.photo-meta select { flex: 1 1 120px; padding: 4px 6px; font-size: 13px; }
.photo-meta small { flex: 1 1 100%; }
.signatures { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-top: 8px; }
.signature { display: grid; gap: 8px; justify-items: start; }
.signature img { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.signature-pad { width: 100%; max-width: 420px; aspect-ratio: 3 / 1; background: #fff; border: 1px solid var(--border); border-radius: 10px; touch-action: none; cursor: crosshair; }

/* Printable service form. */
.sheet { background: #fff; color: #1d1c1a; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; font-size: 13.5px; }
.sheet h3 { font-size: 14px; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px solid #c2531f; }
.sheet .pre { white-space: pre-wrap; margin: 0; }
.sheet h3 { break-after: avoid; }
.sheet-table tr, .sheet-signs { break-inside: avoid; }
.sheet .muted { color: #736f66; }
.sheet-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid #ddd5c6; }
.sheet-head div { display: grid; }
.sheet-head b { font-size: 17px; }
.sheet-no { text-align: right; }
.sheet-info { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 14px 0 0; }
.sheet-info dt { color: #736f66; }
.sheet-info dd { margin: 0; font-weight: 600; }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th, .sheet-table td { border: 1px solid #ddd5c6; padding: 5px 7px; text-align: left; vertical-align: top; }
.sheet-table th { background: #f5f1e8; font-size: 12px; }
.sheet-photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sheet-photo-grid figure { margin: 0; break-inside: avoid; }
.sheet-photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.sheet-photo-grid figcaption { font-size: 12px; color: #55524b; margin-top: 3px; }
.sheet-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
.sheet-sign { display: grid; gap: 4px; align-content: start; }
.sheet-sign img { width: 100%; max-width: 280px; border-bottom: 1px solid #1d1c1a; }
.sign-line { display: block; height: 70px; border-bottom: 1px solid #1d1c1a; max-width: 280px; }
@media (max-width: 560px) {
  .sheet { padding: 18px; }
  .sheet-signs, .sheet-photo-grid { grid-template-columns: 1fr; }
}

/* Guide. */
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-section { scroll-margin-top: 80px; }
.guide-section h2 { font-size: 20px; margin: 0 0 8px; }
.guide-section p, .guide-list li, .guide-steps li { line-height: 1.55; }
.guide-list { margin: 6px 0; padding-left: 20px; display: grid; gap: 6px; }
.guide-steps { list-style: none; counter-reset: step; margin: 6px 0; padding: 0; display: grid; gap: 10px; }
.guide-steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; }
.guide-steps li::before { content: counter(step); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--div); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.guide-table td:first-child { font-weight: 600; min-width: 150px; }

@media print {
  :root, :root[data-theme="dark"], :root:where(:not([data-theme="light"])) {
    color-scheme: light;
    --page: #fff; --surface: #fff; --surface-2: #f5f1e8; --ink: #1d1c1a; --ink-2: #55524b; --muted: #736f66; --border: rgba(40, 30, 10, 0.18);
  }
  body { background: #fff; }
  .topbar, .no-print, .section-tabs, .save-status, .audit { display: none !important; }
  .page { padding: 0; max-width: none; }
  .sheet { box-shadow: none; padding: 0; border-radius: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Save bar: stays at the bottom of record pages while scrolling. */
.save-bar {
  position: sticky;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--good);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(40, 30, 10, 0.18);
}
.save-bar-text { font-size: 14px; font-weight: 600; color: var(--good-text); }
.save-bar[data-state="dirty"], .save-bar[data-state="saving"] { border-left-color: var(--warning); }
.save-bar[data-state="dirty"] .save-bar-text, .save-bar[data-state="saving"] .save-bar-text { color: var(--warning-text); }
.save-bar[data-state="failed"] { border-left-color: var(--critical); }
.save-bar[data-state="failed"] .save-bar-text { color: var(--critical-text); }
.save-bar .btn { flex: none; min-width: 96px; }
@media print { .save-bar { display: none !important; } }

/* ---------- warranties ---------- */
/* Chart series, one per measuring point, in a fixed order (checked for
   colour-blind separation in both themes). */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9;
  }
}
:root[data-theme="dark"] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9;
}
.series-1 { --c: var(--series-1); } .series-2 { --c: var(--series-2); } .series-3 { --c: var(--series-3); } .series-4 { --c: var(--series-4); }
.series-5 { --c: var(--series-5); } .series-6 { --c: var(--series-6); } .series-7 { --c: var(--series-7); }

.meter { display: block; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; margin: 4px 0 2px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.meter span.warn { background: var(--warning); }
.meter span.done { background: var(--info); }
.usage { display: inline-grid; grid-template-columns: 64px auto; gap: 8px; align-items: center; }
.usage .meter { margin: 0; }
.cell-sub.alert { color: var(--critical-text); font-weight: 600; }

.wear-chart { width: 100%; min-height: 220px; }
.wear-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-limit { stroke: var(--ink-2); stroke-width: 1.5; }
.chart-axis { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart-note { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.chart-mark { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-now { stroke: var(--muted); stroke-width: 1; }
.chart-fit { stroke: var(--c); stroke-width: 2; stroke-dasharray: 6 5; stroke-linecap: round; }
.chart-dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.chart-legend { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

/* ---------- service Gantt ---------- */
.gantt { --g-label: 280px; --g-row: 44px; position: relative; overflow-x: auto; font-size: 13px; }
.g-row { display: flex; width: calc(var(--g-label) + var(--w)); border-top: 1px solid var(--border); }
.g-label { flex: none; width: var(--g-label); position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--border); padding: 5px 12px; display: flex; align-items: center; min-width: 0; }
.g-track { flex: none; width: var(--w); position: relative; min-height: var(--g-row); }
/* Sundays shaded, a line between days (weeks when zoomed out). The window starts on a Monday. */
.g-job-row .g-track, .g-group .g-track, .g-empty .g-track {
  background-image: linear-gradient(90deg, transparent calc(var(--day) * 6), color-mix(in srgb, var(--ink) 5%, transparent) calc(var(--day) * 6)), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: calc(var(--day) * 7) 100%, var(--day) 100%;
}
.zoom-hafta .g-job-row .g-track, .zoom-hafta .g-group .g-track, .zoom-hafta .g-empty .g-track { background-size: calc(var(--day) * 7) 100%, calc(var(--day) * 7) 100%; }
.zoom-ay .g-job-row .g-track, .zoom-ay .g-group .g-track, .zoom-ay .g-empty .g-track { background-image: linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: calc(var(--day) * 7) 100%; }

.g-head { border-top: 0; }
.g-head .g-track { min-height: 52px; }
.g-scale { position: relative; height: 24px; }
.g-scale span { position: absolute; top: 0; bottom: 0; padding: 5px 6px 0; border-left: 1px solid var(--border); font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-scale.days { height: 28px; }
.g-scale.days span { display: grid; justify-items: center; align-content: center; padding: 0; gap: 0; line-height: 1.1; }
.g-scale.days small { font-size: 10px; font-weight: 500; }
.g-scale.days b { font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.g-scale.days span.today b { background: var(--div); color: #fff; border-radius: 999px; padding: 0 5px; }

.g-group .g-label { background: var(--surface-2); }
.g-group .g-track { min-height: 30px; background-color: var(--surface-2); }
.g-group .g-label a, .g-group .g-label > span { display: grid; gap: 1px; text-decoration: none; min-width: 0; }
.g-group .g-label b { font-size: 13.5px; }
.g-group .g-label small, .g-empty .g-label { font-size: 12px; color: var(--muted); }
.g-empty .g-track { min-height: 30px; }
.g-away { position: absolute; top: 7px; height: 16px; border-radius: 5px; font-size: 10.5px; line-height: 16px; padding: 0 5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--border); background: repeating-linear-gradient(135deg, var(--surface) 0 5px, color-mix(in srgb, var(--ink) 10%, var(--surface)) 5px 10px); }

.g-job { display: grid; gap: 2px; min-width: 0; }
.g-job a { text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-job .meta { flex-wrap: nowrap; overflow: hidden; }
.g-bar { --bar: #6f6a60; position: absolute; top: 6px; height: 22px; z-index: 2; border-radius: 6px; background: var(--bar); color: #fff; text-decoration: none; overflow: hidden; display: flex; align-items: center; cursor: pointer; }
.g-bar.type-montaj { --bar: #c2531f; }
.g-bar.type-sokum { --bar: #8a5a2b; }
.g-bar.type-revizyon { --bar: #7a4fb8; }
.g-bar.type-kontrol { --bar: #1f63b8; }
.g-bar.type-ariza { --bar: #c0352f; }
.g-bar.type-egitim { --bar: #0f8a5f; }
.g-bar.type-diger { --bar: #6f6a60; }
.g-bar.st-tamamlandi, .g-bar.st-kapandi { opacity: 0.55; }
.g-bar.st-beklemede { background: repeating-linear-gradient(135deg, var(--bar) 0 8px, color-mix(in srgb, var(--bar) 70%, #fff) 8px 16px); }
.g-bar.request { background: transparent; color: var(--bar); border: 2px dashed var(--bar); font-weight: 600; }
.g-bar.clash { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--critical); }
.g-bar.late { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--critical); }
.g-bar.urgent .g-text::before { content: "! "; font-weight: 800; }
.g-bar.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g-bar.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-progress { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, 0.28); }
.g-text { position: relative; padding: 0 7px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.g-handle::after { content: ""; position: absolute; right: 2px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.6); }
.g-bar.request .g-handle::after { background: var(--bar); }
.g-bar.dragging { opacity: 0.85; outline: 2px solid var(--focus); outline-offset: 1px; z-index: 5; }
.g-drag-tip { position: absolute; top: -18px; z-index: 6; white-space: nowrap; font-size: 11.5px; font-weight: 650; background: var(--ink); color: var(--surface); border-radius: 6px; padding: 1px 6px; pointer-events: none; }
.g-drag-tip:empty { display: none; }
.g-actual { position: absolute; top: 32px; height: 6px; border-radius: 3px; background: var(--ink-2); z-index: 1; }
.g-actual.over { background: var(--critical); }
.g-actual.missing { background: repeating-linear-gradient(90deg, var(--critical) 0 4px, transparent 4px 7px); }
.g-actual.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g-actual.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-forecast { position: absolute; top: 32px; height: 6px; border-radius: 3px; border: 1.5px dashed var(--ink-2); box-sizing: border-box; z-index: 1; }
.g-forecast.over { border-color: var(--critical); }
.g-deadline { position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: var(--critical); border: 2px solid var(--surface); z-index: 3; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--div); opacity: 0.7; z-index: 3; pointer-events: none; }

.g-key { display: inline-block; width: 22px; height: 12px; border-radius: 4px; }
.g-key.bar { --bar: #6f6a60; background: var(--bar); }
.g-key.type-montaj { --bar: #c2531f; } .g-key.type-sokum { --bar: #8a5a2b; } .g-key.type-revizyon { --bar: #7a4fb8; } .g-key.type-kontrol { --bar: #1f63b8; }
.g-key.type-ariza { --bar: #c0352f; } .g-key.type-egitim { --bar: #0f8a5f; } .g-key.type-diger { --bar: #6f6a60; }
.g-key.progress { background: linear-gradient(90deg, color-mix(in srgb, #1f63b8 72%, #000) 55%, #1f63b8 55%); }
.g-key.actual { height: 6px; background: var(--ink-2); }
.g-key.actual.over { background: var(--critical); }
.g-key.forecast { height: 6px; border: 1.5px dashed var(--ink-2); box-sizing: border-box; }
.g-key.deadline { width: 10px; height: 10px; transform: rotate(45deg); background: var(--critical); border-radius: 1px; }
.g-key.request { border: 2px dashed var(--ink-2); box-sizing: border-box; }
.g-key.away { border: 1px solid var(--border); background: repeating-linear-gradient(135deg, var(--surface) 0 4px, color-mix(in srgb, var(--ink) 14%, var(--surface)) 4px 8px); }

@media (max-width: 720px) {
  .gantt { --g-label: 150px; }
  .g-label { padding: 5px 8px; }
  .g-job .meta span:not(.status) { display: none; }
}
