/* Açık, sade tema: düz renkler, ince kenarlık, hafif gölge. Tek vurgu rengi: kurumsal mavi. */
:root {
  --bg: #f5f6f8; --card: #ffffff; --line: #dfe3e8; --line-strong: #c5ccd5;
  --text: #1f2933; --muted: #5b6573; --soft: #eef1f5;
  --brand: #1f5fbf; --brand-2: #184d9c; --brand-soft: #e8f0fb;
  --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --focus: 0 0 0 3px rgba(31, 95, 191, .35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }
[hidden] { display: none !important; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
p { margin: 6px 0; line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--bad); font-size: 13px; }
.warn { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 16px; }

.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
  padding: 9px 14px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--soft); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { background: var(--card); border-color: #f0b4b4; color: var(--bad); }
.btn.danger:hover { background: #fdf0f0; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.wide { width: 100%; margin-top: 10px; }
body:not(.indicator) .btn:focus-visible { outline: none; box-shadow: var(--focus); }

input[type=text], input:not([type]), input[type=password], select {
  background: #fff; border: 1px solid var(--line-strong); color: var(--text); border-radius: 8px;
  padding: 9px 11px; font: inherit; outline: none; min-width: 0;
}
input::placeholder { color: #8a94a3; }
input:focus, select:focus { border-color: var(--brand); box-shadow: var(--focus); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.field span { font-size: 12.5px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0 4px; cursor: pointer; }

.logo {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.lite-badge { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; }

/* ---------- Alt bilgi (her ekranda) ---------- */
.app-foot {
  flex: none; text-align: center; padding: 8px 12px; border-top: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 12px; line-height: 1.5;
}
.app-foot b { color: var(--text); font-weight: 600; }
.app-foot .sub { font-size: 11.5px; }

/* ---------- Ana pencere ---------- */
body.home { display: flex; flex-direction: column; overflow: hidden; }
.top { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--card); }
.status { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.status.online .dot { background: var(--ok); }
.status.offline .dot { background: var(--bad); }
.page { flex: 1; min-height: 0; overflow-y: auto; display: flex; padding: 20px 16px; }
.wrap { margin: auto; width: 100%; max-width: 480px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card:last-child { margin-bottom: 0; }
.big-id { font-size: 32px; font-weight: 700; letter-spacing: 2px; color: var(--text); font-variant-numeric: tabular-nums; user-select: all; overflow-wrap: anywhere; }
#connectForm input { flex: 1 1 160px; font-size: 17px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.perm-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
.sessions { list-style: none; margin: 0; padding: 0; }
.sessions li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.sessions li:first-child { border-top: 0; }
a.btn { display: inline-block; text-align: center; text-decoration: none; }
a.btn.wide { display: block; }
.link { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--brand-2); }
.link:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.center { text-align: center; }
.steps { margin: 10px 0; padding-left: 20px; line-height: 1.5; }
.steps li { margin: 3px 0; }
#unsignedNote p { margin: 2px 0; }

.modal { position: fixed; inset: 0; background: rgba(31, 41, 51, .45); display: flex; overflow-y: auto; z-index: 10; padding: 16px; }
.dialog { margin: auto; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: 100%; max-width: 420px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); }
.sas { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--brand-soft); border: 1px solid #c3d6f2; border-radius: 8px; padding: 10px 14px; margin: 12px 0 6px; }
.sas b { font-size: 24px; letter-spacing: 3px; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.toast { position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); background: #1f2933; color: #fff; padding: 10px 14px; border-radius: 8px; max-width: 90%; z-index: 20; box-shadow: 0 4px 12px rgba(16, 24, 40, .15); }

/* ---------- İzleme penceresi ---------- */
body.viewer { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.toolbar .brand { margin-right: auto; font-size: 14px; }
.sas-mini { font-size: 12.5px; color: var(--muted); }
.sas-mini b { color: var(--brand-2); letter-spacing: 1px; }
.pill { font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 20px; border: 1px solid transparent; }
.pill.on { background: #ecfdf3; color: #166534; border-color: #bbe5c8; }
.pill.off { background: var(--soft); color: #3f4752; border-color: var(--line); }
.toolbar select { padding: 4px 8px; font-size: 12.5px; }
.toolbar .check { margin: 0; }
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.stage.actual { overflow: auto; }
#video { width: 100%; height: 100%; object-fit: contain; display: block; outline: none; background: #000; }
.stage.actual #video { width: auto; height: auto; max-width: none; }
#video.control { cursor: crosshair; }
.overlay { position: absolute; inset: 0; display: flex; overflow-y: auto; background: var(--bg); padding: 16px; }

/* ---------- Oturum göstergesi ---------- */
body.indicator {
  background: #b91c1c; display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 100%;
  -webkit-app-region: drag; user-select: none; overflow: hidden;
}
body.indicator .text { flex: 1; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.indicator .btn { -webkit-app-region: no-drag; }
.btn.light { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.35); color: #fff; }
.btn.light.strong { background: #fff; color: #b91c1c; font-weight: 700; }
.rec { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; flex: none; }
@keyframes blink { 50% { opacity: .25; } }
