:root {
  --bg: #0F1A24;
  --surface: #1A2733;
  --surface-2: #213040;
  --line: #2B3A47;
  --ink: #E6EBEF;
  --muted: #8A99A6;
  --lamp: #F2B544;
  --lamp-ink: #2A1C00;
  --glow: rgba(242, 181, 68, .32);
  --ok: #5BC48A;
  --bad: #E5675C;
  --warn: #E8A33D;
  --focus: #8CC8FF;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --shadow: 0 10px 30px rgba(3, 8, 14, .45);
  --font: "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #EEF1F4;
    --surface: #FFFFFF;
    --surface-2: #F4F6F8;
    --line: #DCE2E8;
    --ink: #142130;
    --muted: #5E6E7D;
    --lamp: #B57A0C;
    --lamp-ink: #FFFFFF;
    --glow: rgba(242, 181, 68, .45);
    --ok: #1E8A52;
    --bad: #C0392B;
    --warn: #A86A06;
    --focus: #1F6FD1;
    --shadow: 0 10px 30px rgba(20, 33, 48, .12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }
h1 { font-size: 28px; letter-spacing: -.01em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Kabuk ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  padding: 22px 14px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 700; font-size: 18px; }
.brand svg { width: 28px; height: 28px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-s);
  text-decoration: none; color: var(--muted); font-weight: 500;
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.nav a .badge { margin-left: auto; }
.rail-foot { margin-top: auto; padding: 10px 12px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

main { padding: 28px 32px 60px; max-width: 1120px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { margin-top: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
section + section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; z-index: 20; inset: auto 0 0 0; height: auto;
    flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); background: var(--bg);
  }
  .brand, .rail-foot { display: none; }
  .nav { display: grid; grid-template-columns: repeat(6, 1fr); width: 100%; }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11px; justify-content: center; position: relative; }
  .nav a .badge { position: absolute; top: 2px; right: calc(50% - 20px); margin: 0; }
  main { padding: 20px 16px 96px; }
  h1 { font-size: 24px; }
}

/* ---------- Ortak öğeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 500; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; padding: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel-pad { padding: 18px; }

.badge {
  display: inline-flex; align-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--lamp); color: var(--lamp-ink); font-size: 12px; font-weight: 700; justify-content: center;
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.dot.off { background: var(--bad); }
.dot.wait { background: var(--warn); }

.field { display: flex; flex-direction: column; align-items: stretch; gap: 6px; font-size: 14px; color: var(--muted); }
.field > span { color: var(--ink); font-weight: 500; }
.field > .seg { align-self: flex-start; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=number], input[type=time], input[type=date], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--bg);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.2); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--line); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.switch input:checked + span { background: var(--lamp); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--lamp-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--bg); padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; }
.chip[aria-pressed="true"] { border-color: var(--ink); color: var(--bg); background: var(--ink); }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 20px; }
.kv div { display: flex; flex-direction: column; gap: 2px; }
.kv dt, .kv .k { font-size: 13px; color: var(--muted); }
.kv dd, .kv .v { margin: 0; font-weight: 500; word-break: break-word; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--lamp); transition: width .3s; }

.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.signal i { width: 3px; background: var(--line); border-radius: 1px; }
.signal i.lit { background: var(--ink); }

/* ---------- Işıklar ---------- */
.overview { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.overview .count { font-size: 15px; color: var(--muted); }
.overview .count b { color: var(--ink); font-size: 22px; font-weight: 600; margin-right: 4px; }
.sunline { display: inline-flex; gap: 16px; color: var(--muted); font-size: 14px; }
.sunline span { display: inline-flex; align-items: center; gap: 6px; }
.sunline svg { width: 16px; height: 16px; }

.group + .group { margin-top: 26px; }
.group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.group-head .where { color: var(--muted); font-size: 14px; }
.group-head .state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

/* Kontrol paneli: cihaz kartları */
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dcard {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; min-height: 168px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  color: inherit; text-decoration: none; transition: border-color .2s, transform .15s;
}
.dcard:hover { border-color: var(--muted); }
.dcard:active { transform: scale(.99); }
.dcard.off { opacity: .7; }
.dc-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dc-top .tag { margin-left: auto; }
.dc-name { font-size: 20px; font-weight: 600; line-height: 1.25; margin-top: 4px; }
.dc-where { font-size: 14px; color: var(--muted); min-height: 1.3em; }
.dc-lamps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.dc-lamps span { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.dc-lamps span.pulse { border-radius: 3px; }
.dc-lamps span.on { background: var(--lamp); border-color: var(--lamp); box-shadow: 0 0 8px var(--glow); }
.dc-sum { font-size: 14px; color: var(--muted); }
.dc-sum b { color: var(--ink); }

.lamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.lamp {
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  min-height: 132px; padding: 16px; border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  transition: border-color .2s, background .25s;
}
.lamp::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 33px 33px, var(--glow), transparent 120px);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.lamp .bulb { width: 34px; height: 34px; color: var(--muted); position: relative; transition: color .2s, filter .3s; }
.lamp .name { font-weight: 600; font-size: 16px; position: relative; }
.lamp .st { font-size: 13px; color: var(--muted); position: relative; }
.lamp.on { border-color: color-mix(in srgb, var(--lamp) 55%, var(--line)); }
.lamp.on::before { opacity: 1; }
.lamp.on .bulb { color: var(--lamp); filter: drop-shadow(0 0 10px var(--glow)); }
.lamp.on .st { color: var(--ink); }
.lamp:hover { border-color: var(--muted); }
.lamp.busy .bulb { animation: pulse 1s ease-in-out infinite; }
.lamp:disabled { cursor: not-allowed; opacity: .55; }
.lamp.hold { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ch-row { display: grid; grid-template-columns: auto 1fr 170px 90px auto; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ch-row:last-child { border-bottom: 0; }
.ch-row .ch-sec.hidden { display: flex !important; visibility: hidden; }   /* masaüstünde hizayı koru */
@media (max-width: 640px) {
  .ch-row { grid-template-columns: auto 1fr auto; }
  .ch-row input[name=name] { grid-column: 2 / -1; }
  .ch-row .ch-mode { grid-column: 2; } .ch-row .ch-sec { grid-column: 3; } .ch-row .ch-sec.hidden { display: none !important; }
  .ch-row button { grid-column: 2 / -1; }
}
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .lamp, .lamp::before, .lamp .bulb, .switch span, .switch span::after, .bar > i { transition: none; }
  .lamp.busy .bulb { animation: none; opacity: .6; }
}

.notice {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-m);
  border: 1px solid color-mix(in srgb, var(--lamp) 50%, var(--line)); background: color-mix(in srgb, var(--lamp) 8%, var(--surface));
  margin-bottom: 22px;
}
.notice svg { width: 20px; height: 20px; color: var(--lamp); flex: none; }
.notice .grow { flex: 1; }

/* ---------- Listeler ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none;
}
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--surface-2); }
.row .title { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.row .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); grid-column: 1; }
.row .side { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 10px; }

.sched { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sched:last-child { border-bottom: 0; }
.sched .rule { font-weight: 600; }
.sched .targets { font-size: 13px; color: var(--muted); margin-top: 3px; }
.sched .when { font-size: 13px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.sched.off .rule, .sched.off .targets { opacity: .55; }
@media (max-width: 560px) { .sched { grid-template-columns: auto 1fr; } .sched .actions { grid-column: 1 / -1; } }

/* ---------- Olaylar ---------- */
.day { font-size: 13px; color: var(--muted); padding: 16px 18px 6px; font-weight: 500; }
.ev { display: grid; grid-template-columns: 52px 28px 1fr auto; gap: 10px; align-items: start; padding: 9px 18px; }
.ev .t { font-size: 13px; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.ev .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.ev .ic svg { width: 15px; height: 15px; }
.ev .ic.lit { color: var(--lamp); }
.ev .ic.bad { color: var(--bad); }
.ev .ic.good { color: var(--ok); }
.ev .msg { padding-top: 2px; }
.ev .src { padding-top: 1px; }
@media (max-width: 560px) { .ev { grid-template-columns: 44px 26px 1fr; } .ev .src { grid-column: 3; } }
.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 820px) { .filters { grid-template-columns: 1fr 1fr; } }

/* ---------- Donanım düzenleyici ---------- */
.hw-row { display: grid; grid-template-columns: 34px 1fr 1.3fr 1fr 36px; gap: 8px; align-items: end; }
.hw-row .n { color: var(--muted); font-size: 14px; }
.hw-row { align-items: center; }
.hw-head { font-size: 13px; color: var(--muted); }
.dlg-body > .seg { align-self: flex-start; }
.btn-row { display: grid; grid-template-columns: 34px 90px 170px 1fr 36px; gap: 8px; align-items: center; }
@media (max-width: 560px) {
  .hw-row { grid-template-columns: 26px 1fr 1fr 36px; }
  .hw-row .lvl { grid-column: 2 / 4; grid-row: 2; } .hw-head .lvl { display: none; }
  .btn-row { grid-template-columns: 26px 80px 1fr 36px; } .btn-row .chips { grid-column: 2 / -1; grid-row: 2; }
}
.hint { font-size: 13px; color: var(--muted); }
.err-list { color: var(--bad); font-size: 14px; margin: 0; padding-left: 18px; }

/* ---------- Diyalog ---------- */
dialog {
  border: 1px solid var(--line); border-radius: var(--radius-l); padding: 0; width: min(560px, calc(100vw - 24px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); max-height: calc(100vh - 40px);
}
dialog::backdrop { background: rgba(5, 10, 16, .6); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 42px); }
.dlg-head { padding: 20px 22px 6px; }
.dlg-head p { margin-top: 6px; }
.dlg-body { padding: 14px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.dlg-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
dialog.wide { width: min(760px, calc(100vw - 24px)); }

.checklist { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px; background: var(--bg); }
.checklist .grp { font-size: 13px; color: var(--muted); padding: 8px 6px 2px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 6px; cursor: pointer; }
.checklist label:hover { background: var(--surface); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--lamp); }
input[type=checkbox]:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- Bildirim ---------- */
.toasts { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
@media (max-width: 820px) { .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); left: 18px; right: 18px; max-width: none; } }
.toast { padding: 12px 16px; border-radius: var(--radius-m); background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-weight: 500; }
.toast.error { background: var(--bad); color: #fff; }

/* ---------- Giriş ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .panel { width: min(400px, 100%); padding: 28px; }
.login .brand { padding: 0 0 18px; }
.login form { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; padding: 60px; }

/* ---------- Giriş / kayıt ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .panel { width: min(420px, 100%); padding: 28px; }
.auth .brand { padding: 0 0 18px; }
.auth form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth .alt { margin-top: 16px; font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.auth .alt a { color: var(--ink); }
.form-err { color: var(--bad); font-size: 14px; }
.form-ok { color: var(--ok); font-size: 14px; }

/* ---------- Rozetler ---------- */
.role { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.role.owner { color: var(--lamp); border-color: color-mix(in srgb, var(--lamp) 45%, var(--line)); }
.role.manager { color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Özet kartları ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; }
.stat .n { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 14px; margin-top: 4px; }
.stat a { text-decoration: none; }

/* ---------- Sekmeli filtre ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 7px 13px; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid transparent; font-weight: 500; font-size: 14px; }
.tabs a[aria-current="true"] { color: var(--ink); border-color: var(--line); background: var(--surface); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar .grow { flex: 1; }
/* Admin: ayarlar */
.set-row { display: flex; flex-direction: column; gap: 4px; }
.set-row + .set-row { padding-top: 14px; border-top: 1px solid var(--line); }
.set-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.set-row .hint { margin: 0; }
/* Admin: telefon listesi */
.phone { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.phone:last-child { border-bottom: 0; }
.phone input[type=checkbox] { margin-top: 3px; }
.phone .ph-ic svg { width: 20px; height: 20px; color: var(--muted); }
.phone .ph-body { flex: 1; min-width: 0; }
.phone .ph-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.phone .ph-title a { color: var(--muted); }
.phone .ph-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.phone .ph-err { font-size: 13px; color: var(--bad); margin-top: 4px; }
.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; letter-spacing: .04em; }

/* ---------- Paylaşım listesi ---------- */
.person { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .who b { display: block; font-weight: 600; }
.person .who span { font-size: 13px; color: var(--muted); }
.person select { width: auto; min-height: 34px; padding: 4px 8px; }

/* ---------- Etiket baskısı ---------- */
.labels { display: grid; grid-template-columns: repeat(auto-fill, 62mm); gap: 6mm; }
.label { width: 62mm; height: 38mm; padding: 3mm 3.5mm; border: 1px dashed var(--line); border-radius: 2mm; display: grid; grid-template-columns: 1fr 22mm; gap: 2mm; background: #fff; color: #111; font-size: 8.5pt; line-height: 1.25; }
.label .t { font-weight: 700; font-size: 10pt; }
.label .k { color: #555; font-size: 7pt; margin-top: 1.6mm; }
.label .v { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: 10pt; letter-spacing: .02em; white-space: nowrap; }
.label .v.id { font-size: 8pt; letter-spacing: 0; }
.label .qr { width: 22mm; height: 22mm; align-self: center; }
.label .qr img, .label .qr canvas { width: 22mm !important; height: 22mm !important; }
.label .u { grid-column: 1 / -1; font-size: 6.5pt; color: #555; align-self: end; }
@media print {
  body { background: #fff; }
  .rail, .page-head .actions, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .label { border-color: #bbb; break-inside: avoid; }
  @page { margin: 8mm; }
}

a.btn { text-decoration: none; }
