/* DWC Control Center — çekirdek stiller. Renk ve ölçüler Godot sahnelerinden (Main.tscn, modal.tscn, ModalTheme.cs). */
@font-face { font-family: "Red Hat Display"; font-weight: 400; font-display: swap; src: url("../assets/fonts/red-hat-display-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Red Hat Display"; font-weight: 400; font-display: swap; src: url("../assets/fonts/red-hat-display-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Red Hat Display"; font-weight: 600; font-display: swap; src: url("../assets/fonts/red-hat-display-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Red Hat Display"; font-weight: 600; font-display: swap; src: url("../assets/fonts/red-hat-display-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Red Hat Display"; font-weight: 700; font-display: swap; src: url("../assets/fonts/red-hat-display-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Red Hat Display"; font-weight: 700; font-display: swap; src: url("../assets/fonts/red-hat-display-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #1a1a18;
  --bg-login: #16191b;
  --card: #1f2326;
  --card-border: #343a3e;
  --border: #25292c;
  --text: #f7f7f7;
  --muted: #8f989c;
  --title: #888e8a;
  --barely: #5c5c5c;
  --green: #1fc466;
  --green-dark: #16994c;
  --red: #e23b3b;
  --yellow: #e8952b;
  --blue: #1e90ff;
  --purple: #9370db;
  --field-bg: #15181a;
  --field-border: #30373b;
  --field-border-hover: #4a5358;
  --stripe: rgba(255, 255, 255, 0.04);
  --font-ui: "Red Hat Display", system-ui, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --ui-scale: 1;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 15px; overflow: hidden; }
#app { height: 100%; zoom: var(--ui-scale); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #0f6b35; }
* { scrollbar-width: thin; scrollbar-color: #3a4145 transparent; }

/* ---------- ortak yerleşim ---------- */
.hbox { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vbox { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.spacer { flex: 1 1 auto; }
.grow { flex: 1 1 0; min-width: 0; }
.wrap { flex-wrap: wrap; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-yellow { color: var(--yellow); } .text-blue { color: var(--blue); }
.sep { border: 0; border-top: 1px solid var(--card-border); margin: 0; width: 100%; }
.icon { display: inline-block; flex: none; background: currentColor; mask: center / contain no-repeat; -webkit-mask: center / contain no-repeat; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- form öğeleri (ModalTheme) ---------- */
.form-label { color: var(--muted); font-size: 13px; }
.field { background: var(--field-bg); border: 1px solid var(--field-border); border-radius: 6px; padding: 6px 10px; min-height: 32px; color: var(--text); outline: none; min-width: 0; }
.field::placeholder { color: #646b6d; }
.field:hover { border-color: var(--field-border-hover); }
.field:focus { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.field[readonly], .field:disabled { background: #101213; border-color: #262c2f; color: var(--muted); }
select.field { padding-right: 6px; cursor: pointer; text-overflow: ellipsis; }
select.field option { background: var(--field-bg); color: var(--text); }
/* SelectionChain: sıradaki seçim mavi, seçilmiş yeşil, bekleyen kırmızı */
select.chain-done { border: 2px solid var(--green); }
select.chain-next { border: 2px solid var(--blue); }
select.chain-wait { border: 2px solid var(--red); }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
textarea.field { resize: vertical; min-height: 80px; font-family: var(--font-mono); font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 6px; padding: 6px 12px; min-height: 32px; cursor: pointer; background: transparent; color: var(--text); white-space: nowrap; user-select: none; }
.btn:disabled { cursor: default; opacity: 0.45; }
.btn:focus-visible { outline: 2px solid var(--field-border-hover); outline-offset: 1px; }
.btn-primary { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #32a561; border-color: #32a561; }
.btn-primary:active:not(:disabled) { background: #138241; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #e65353; border-color: #e65353; }
.btn-danger:active:not(:disabled) { background: #c03232; }
.btn-secondary { border-color: var(--field-border); }
.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); border-color: var(--field-border-hover); }
.btn-flat, .btn-link { color: var(--muted); padding: 4px 8px; }
.btn-flat:hover:not(:disabled), .btn-link:hover:not(:disabled) { color: var(--green); }
.btn-small { font-size: 12px; min-height: 24px; }
.btn-wide { width: 100%; min-height: 38px; }
.btn-page { min-width: 34px; min-height: 30px; padding: 2px 8px; }
/* tablo satırı düğmeleri (btn-edit.tscn): mono 13, saydam, üzerine gelince yeşil */
.btn-row { font-family: var(--font-mono); font-size: 13px; padding: 2px 8px; min-height: 24px; border-radius: 4px; }
.btn-row:hover:not(:disabled) { color: var(--green); background: rgba(31, 196, 102, 0.08); }
.btn-row[data-name="DeleteBtn"]:hover:not(:disabled) { color: var(--red); background: rgba(226, 59, 59, 0.1); }
/* içerik üst çubuğu düğmeleri (sidebarButton.tscn, 16px) */
.btn-top { font-weight: 600; font-size: 16px; padding: 0 8px; min-height: 40px; border-radius: 0; }
.btn-top:hover { color: var(--green); }
.btn-top:active { color: #00963f; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 16px; height: 16px; margin: 0; border: 2px solid #a0a8ab; border-radius: 3px; flex: none; cursor: pointer; }
.check input:checked { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 2px var(--field-bg); }
.check input:disabled { border-color: var(--field-border); cursor: default; }
.check:hover span { color: var(--green); }
.check.is-disabled { cursor: default; color: #5d6365; }
.check.is-disabled:hover span { color: inherit; }
/* StyleToggleTile */
.check-tile { background: var(--field-bg); border: 1px solid var(--field-border); border-radius: 6px; padding: 6px 10px; min-height: 38px; }
.check-tile:hover { border-color: var(--field-border-hover); }
.check-tile.is-checked { background: #0a4522; border-color: var(--green); color: #fff; }
.check-tile.is-disabled { background: #0f1112; border-color: #22272a; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 0 8px; }
.toolbar-status { flex: 1 1 200px; color: var(--muted); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 10px; padding: 18px 24px; }
.section-title { font-weight: 600; font-size: 17px; color: var(--text); }
.badge-demo { font-family: var(--font-mono); font-size: 11px; color: #1a1a18; background: var(--yellow); border-radius: 4px; padding: 1px 6px; }

/* ---------- giriş ---------- */
.login { height: 100%; display: flex; align-items: center; justify-content: center; background: var(--bg-login); overflow: auto; padding: 16px; }
.login-card { width: 400px; max-width: 100%; background: var(--card); border: 1px solid var(--card-border); border-radius: 10px; padding: 28px 32px 24px; display: flex; flex-direction: column; gap: 10px; }
.login-logo { height: 56px; display: flex; justify-content: center; }
.login-logo img { height: 100%; object-fit: contain; }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form .field { min-height: 34px; }
.login-title { font-weight: 600; font-size: 19px; }
.login-note { color: var(--muted); font-size: 13px; }
.login-message { min-height: 18px; font-size: 14px; }
.login-server { flex: 1 1 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login .hbox .field { flex: 1 1 0; }
.login-version { color: var(--muted); font-size: 11px; text-align: right; }

/* ---------- ana kabuk (Main.tscn) ---------- */
.shell { height: 100%; display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); }
.logo { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 20px; display: flex; align-items: center; justify-content: center; }
.logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.navbar { border-bottom: 1px solid var(--border); display: flex; align-items: stretch; min-width: 0; }
.nav-hbox { display: flex; gap: 4px; }
.nav-btn { display: flex; align-items: center; gap: 6px; min-width: 160px; padding: 0 15px; background: none; border: 0; border-bottom: 1px solid transparent; font-weight: 600; font-size: 18px; color: var(--text); cursor: pointer; justify-content: center; }
.nav-btn:hover, .nav-btn.is-active { color: var(--green); border-bottom-color: var(--green-dark); }
.nav-btn:active { color: #00963f; }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.nav-logout { background: none; border: 1px solid var(--field-border); border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--text); }
.nav-logout:hover { border-color: var(--red); color: var(--red); }
.sidebar { border-right: 1px solid var(--border); padding: 16px 0 8px; overflow-y: auto; min-height: 0; }
.menu-container { padding: 0 24px 0 8px; }
.side-menu, .acc-children { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.side-menu > .accordion { margin-bottom: 4px; }
.side-btn, .acc-title { background: none; border: 0; padding: 2px 4px; text-align: left; font-weight: 600; color: var(--text); cursor: pointer; }
.side-btn { font-size: 15px; }
.acc-title { font-size: 16px; padding-left: 8px; width: 100%; white-space: nowrap; }
.side-btn:hover, .acc-title:hover, .side-btn.is-active { color: var(--green); }
.side-btn:active, .acc-title:active { color: #00963f; }
.side-btn:disabled { color: var(--barely); cursor: default; }
.accordion { display: flex; flex-direction: column; gap: 8px; }
.acc-margin { padding-left: 16px; }
.acc-margin:has(> .acc-children[hidden]) { display: none; }

.content { display: grid; grid-template-rows: 40px minmax(0, 1fr); min-width: 0; min-height: 0; }
.content-top { border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 32px; padding: 0 16px; min-width: 0; }
.top-title { font-family: var(--font-mono); font-size: 14px; color: var(--title); white-space: nowrap; }
.top-notification { flex: 1 1 0; min-width: 0; font-family: var(--font-mono); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-body { padding: 8px; min-height: 0; min-width: 0; position: relative; }
.content-main { height: 100%; position: relative; min-height: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.screen-message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9a9a9a; }
.screen-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }

/* ---------- tablo (tableHeader.tscn, tableBodyLabel.tscn) ---------- */
.table-screen { gap: 0; }
.t-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
.t-grid { display: grid; column-gap: 4px; align-content: start; width: 100%; }
.t-head, .t-filter, .t-body, .t-row { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; }
.t-head { position: sticky; top: 0; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--border); min-height: 24px; align-items: center; }
.t-hcell { font-family: var(--font-mono); font-weight: 500; font-size: 15px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-hcell.is-sortable { cursor: pointer; }
.t-hcell.is-sortable:hover { color: var(--green); }
.t-filter { position: sticky; top: 25px; z-index: 2; background: var(--bg); }
.t-fcell { padding: 2px 4px 4px; min-width: 0; }
.t-fcell .field { width: 100%; min-height: 28px; font-size: 13px; padding: 3px 8px; }
.t-body { row-gap: 8px; padding-top: 4px; }
.t-row { min-height: 28px; align-items: center; }
.t-row.stripe { background: var(--stripe); }
.t-row.is-clickable { cursor: pointer; }
.t-row.is-clickable:hover { background: rgba(255, 255, 255, 0.07); }
.t-cell { font-family: var(--font-mono); font-size: 14px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-buttons { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding-right: 4px; }
.t-detail { grid-column: 1 / -1; padding: 4px 8px 8px 24px; margin-top: -4px; }
.pager { display: flex; align-items: center; gap: 16px; padding-top: 8px; }
.pager-buttons { display: flex; align-items: center; gap: 4px; }
.pager-info { min-width: 170px; text-align: right; color: var(--muted); font-size: 13px; }
.pager-gap { color: var(--muted); }
.pager .field { min-width: 80px; }

/* ---------- modal (modal.tscn) ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); zoom: var(--ui-scale); }
.modal-center { position: absolute; inset: 0 0 120px 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: 480px; max-width: 100%; background: var(--card); border: 1px solid var(--card-border); border-radius: 10px; padding: 18px 24px 20px; box-shadow: 0 0 24px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; gap: 14px; }
.modal-header { display: flex; align-items: center; }
.modal-title { flex: 1 1 0; font-weight: 600; font-size: 19px; }
.modal-close { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; padding: 2px 6px; }
.modal-close:hover { color: var(--text); }
.modal-scroll { max-height: 70vh; overflow-y: auto; overflow-x: hidden; }
.modal-form { display: flex; flex-direction: column; gap: 6px; padding: 1px; }
.modal-form > .field { width: 100%; }
.modal-text { white-space: pre-wrap; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }
.modal-footer .btn { min-width: 110px; min-height: 36px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 160px minmax(0, 1fr); }
  .nav-btn { min-width: 0; font-size: 15px; padding: 0 10px; }
  .content-top { gap: 12px; }
}

/* ---------- kamera penceresi (core/camera.js) ---------- */
.cam-window { position: fixed; z-index: 60; width: 520px; max-width: calc(100vw - 16px); background: var(--card); border: 1px solid var(--card-border); border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55); overflow: hidden; resize: both; min-width: 280px; min-height: 180px; display: flex; flex-direction: column; }
.cam-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; cursor: move; user-select: none; border-bottom: 1px solid var(--card-border); touch-action: none; }
.cam-title { flex: 1 1 0; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-tag { max-width: 45%; font-size: 12px; color: var(--yellow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-body { position: relative; flex: 1 1 auto; min-height: 0; background: #0d1012; display: flex; }
.cam-canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-note { position: absolute; left: 12px; right: 12px; top: 40px; color: var(--muted); font-size: 13px; }
