/* ASEAH Yatak Takip Sistemi — kurumsal arayüz */
:root {
  color-scheme: light;
  --navy: #14293d;
  --red: #b5121b;
  --red-dark: #8f0e15;
  --bg: #eef0f3;
  --ink: #1a2230;
  --muted: #5f6b7a;
  --line: #d5dae1;
  --line-soft: #e6e9ee;
  --head: #f5f6f8;
  --green: #1b6e4b;
  --amber: #9a5b00;
  --blue: #1f4f8f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* ---------- düğmeler, alanlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 3px; border: 1px solid #b9c0ca;
  background: #fff; font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn:hover { background: var(--head); border-color: #8f99a6; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, .06); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: #3b4656; }
.input, select.input {
  width: 100%; min-height: 38px; padding: 0 10px; border-radius: 3px;
  border: 1px solid #b9c0ca; background: #fff; outline: none;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(31, 79, 143, .18); }
.error { color: var(--red); font-size: 13px; font-weight: 600; min-height: 18px; }

/* ---------- giriş ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; background: #fff; }
.login-brand {
  background: var(--navy); color: #fff; padding: 56px 48px; display: flex; flex-direction: column; gap: 6px;
  border-right: 4px solid var(--red);
}
.login-brand .logo { width: 112px; height: 112px; margin: 0 0 28px; background: #fff; border-radius: 50%; padding: 6px; object-fit: contain; }
.login-brand .logo-fallback { margin: 0 0 28px; }
.login-org { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: #b9c6d6; font-weight: 600; }
.login-brand h1 { font-size: 25px; line-height: 1.25; font-weight: 600; max-width: 380px; }
.login-app { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: 17px; font-weight: 600; }
.login-desc { color: #b9c6d6; font-size: 13.5px; max-width: 360px; }
.login-foot { margin-top: auto; font-size: 12px; color: #9fb0c3; line-height: 1.6; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-main form { width: 100%; max-width: 340px; display: grid; gap: 16px; }
.login-main h2 { font-size: 21px; font-weight: 600; }
.login-main .sub { color: var(--muted); font-size: 13.5px; margin-top: -10px; }
.login-main .btn { min-height: 42px; font-size: 14.5px; }
.login-main .input { min-height: 42px; }

.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red);
  border-radius: 3px; padding: 28px; display: grid; gap: 16px; text-align: center;
}
.auth form { display: grid; gap: 14px; text-align: left; }
.auth h1 { font-size: 19px; font-weight: 600; }
.logo { width: 84px; height: 84px; object-fit: contain; margin: 0 auto; }
.logo-fallback {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 3px; background: var(--red);
  display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 700;
}

/* ---------- üst çubuk ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; }
.top-in { max-width: 1360px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.brand > div { min-width: 0; }
.brand img, .brand .logo-fallback { width: 40px; height: 40px; margin: 0; flex: none; background: #fff; border-radius: 50%; padding: 2px; font-size: 15px; }
.brand b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { font-size: 12px; color: #b9c6d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.live { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #cfe9dc; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #3fbf86; }
.live.off { color: #f3d08a; }
.live.off i { background: #e0a020; }
.btn.who { flex: none; color: #fff; text-align: right; line-height: 1.2; height: auto; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .25); }
.btn.who:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .45); }
.who b { font-size: 13px; font-weight: 600; display: block; }
.who span span { font-size: 11.5px; color: #b9c6d6; font-weight: 400; }
.tabs { background: #fff; color: var(--ink); border-top: 3px solid var(--red); border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 max(8px, calc((100vw - 1360px) / 2 + 8px)); }
.tabs button { border: 0; background: none; padding: 10px 14px 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--navy); border-color: var(--navy); }
main { max-width: 1360px; margin: 0 auto; padding: 16px 16px 72px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }

/* ---------- özet şeridi ---------- */
.kpis { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 3px; }
.kpi { padding: 12px 16px; min-width: 0; border-left: 1px solid var(--line-soft); }
.kpi small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi strong { display: block; font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.kpi.hero { border-left: 4px solid var(--green); }
.kpi.hero strong { font-size: 34px; color: var(--green); }
.kpi.hero.zero { border-left-color: var(--red); }
.kpi.hero.zero strong { color: var(--red); }
.chips { font-size: 12px; color: var(--muted); }
.chip + .chip::before { content: " · "; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 3px; }
.panel-pad { padding: 12px 14px; }
.duty { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 9px 14px; font-size: 13px; }
.duty > b { font-weight: 600; }
.duty .tag b { font-weight: 600; color: var(--muted); margin-right: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.duty .tag a { color: var(--blue); text-decoration: none; }
.duty .tag a:hover { text-decoration: underline; }
.acilbar { width: 100%; text-align: left; cursor: pointer; border-left: 4px solid var(--red); }
.acilbar:hover { background: var(--head); }
.acilbar .tag b { color: var(--red); font-size: 15px; letter-spacing: 0; }
.acilbar .muted { color: var(--blue); font-weight: 600; }

/* ---------- araç çubuğu ---------- */
.tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.tools .input { max-width: 280px; min-height: 34px; }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 1px solid #b9c0ca; border-radius: 3px; background: #fff; }
.seg button { border: 0; border-left: 1px solid var(--line); background: none; padding: 7px 12px; font-weight: 600; font-size: 13px; color: #3b4656; white-space: nowrap; }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--head); }
.seg button.on { background: var(--navy); color: #fff; }
.seg.scope { display: flex; }
.seg.scope button { flex: 1; padding: 9px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg.scope em { font-style: normal; font-weight: 700; color: var(--muted); }
.seg.scope em.has { color: var(--green); }
.seg.scope button.on em { color: #fff; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { width: 16px; height: 16px; accent-color: var(--navy); }

/* ---------- birim tablosu ---------- */
.units { overflow: hidden; }
.urow {
  display: grid; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--line-soft);
  grid-template-columns: minmax(200px, 2.2fr) 70px minmax(130px, 1.3fr) 64px 64px 64px minmax(160px, 2fr) 76px;
}
.urow.head, .arow.head {
  border-top: 0; border-bottom: 1px solid var(--line); background: var(--head);
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-top: 8px; padding-bottom: 8px;
}
.urow .num, .arow .num { text-align: right; font-size: 16px; font-weight: 600; }
.urow.head .num, .arow.head .num { font-size: 11.5px; }
.urow.can, .arow.can { cursor: pointer; }
.urow.can:hover, .arow.can:hover { background: #f3f6fa; }
.urow.flash { animation: flash 2s ease-out; }
@keyframes flash { from { background: #fff3c4; } }
.uname b { display: block; font-size: 14px; font-weight: 600; }
.uname > span { font-size: 12px; color: var(--muted); }
.m-only { display: none; }
.bas { display: inline-block; font-size: 12px; font-weight: 600; color: #3b4656; padding: 1px 7px; border: 1px solid #b9c0ca; border-radius: 2px; background: #fff; }
.alan { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 400; color: #3b4656; }
.alan::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: #9aa3af; }
.alan.yesil::before { background: #2f9e5b; }
.alan.mavi::before { background: #2f6fd0; }
.alan.sari::before { background: #e0b000; }
.bar { height: 6px; background: #e3e6eb; }
.bar i { display: block; height: 100%; background: #3d8b68; }
.bar i.mid { background: #c98a00; }
.bar i.full { background: var(--red); }
.barcap { font-size: 12px; color: var(--muted); margin-top: 3px; }
.num .lbl { display: none; }
.num sup { font-size: 11px; font-weight: 600; color: var(--red); margin-left: 2px; }
.pill { color: #9aa3af; }
.pill.has { color: var(--green); font-weight: 700; }
.unote { font-size: 13px; }
.unote .stale { color: var(--amber); font-weight: 600; }
.unote .when { color: var(--muted); font-size: 12px; display: block; }
.soon { display: block; color: var(--blue); font-weight: 600; font-size: 12.5px; border-left: 3px solid var(--blue); padding-left: 7px; margin-bottom: 2px; }
.soon .late { color: var(--amber); }
.c-edit { text-align: right; }
.edit-ic { border: 1px solid #b9c0ca; background: #fff; border-radius: 3px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; color: #3b4656; }
.edit-ic:hover { background: var(--head); border-color: #8f99a6; }
.urow.total { font-weight: 600; background: var(--head); border-top: 1px solid var(--line); }
.ghead { display: flex; align-items: baseline; gap: 12px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; color: var(--navy); background: #e8edf3; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ghead:first-child { border-top: 0; }
.ghead span { font-size: 12px; font-weight: 400; color: var(--muted); }
.ghead span b { color: var(--green); font-weight: 600; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

/* ---------- acil ---------- */
#alist { display: grid; gap: 12px; }
#alist .ghead span b { color: var(--red); }
.arow { display: grid; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--line-soft);
  grid-template-columns: minmax(150px, 1.3fr) repeat(5, minmax(84px, 1fr)) minmax(130px, 1.3fr) 76px; }
.arow .num { color: #9aa3af; }
.arow .num.pos { color: var(--ink); }
.arow .num small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); line-height: 1.3; }
.arow.head .num { color: var(--muted); }

/* ---------- genel tablolar ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 12px; background: var(--head); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.tbl td.nowrap { white-space: nowrap; }
.tbl tr.today td { background: #fdf3f3; }
.tbl select.input { min-height: 32px; min-width: 150px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 2px; border: 1px solid #b9c0ca; color: #3b4656; background: #fff; white-space: nowrap; }
.badge.red { border-color: #dba5a8; color: var(--red); background: #fdf3f3; }
.badge.green { border-color: #a9cdbb; color: var(--green); background: #f1f8f4; }
.badge.blue { border-color: #a9bedb; color: var(--blue); background: #f1f5fb; }
.badge.amber { border-color: #dcc08f; color: var(--amber); background: #fdf8ec; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sec-head h2 { font-size: 18px; font-weight: 600; margin-right: auto; }
.notice { background: #fdf8ec; color: #6b4200; border: 1px solid #dcc08f; border-radius: 3px; padding: 9px 12px; font-size: 13px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- pencere ---------- */
dialog {
  border: 1px solid #8f99a6; border-radius: 4px; padding: 0; width: min(500px, calc(100vw - 20px)); max-height: calc(100dvh - 20px);
  background: #fff; color: var(--ink); box-shadow: 0 12px 40px rgba(10, 20, 35, .28);
}
dialog::backdrop { background: rgba(15, 25, 40, .5); }
.dlg { padding: 0 18px 18px; display: grid; gap: 14px; }
.dlg-head { display: flex; align-items: flex-start; gap: 8px; margin: 0 -18px; padding: 12px 18px; background: var(--head); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.dlg-head h3 { font-size: 16px; font-weight: 600; margin-right: auto; }
.dlg > :not(.dlg-head):first-child { margin-top: 18px; }
.dlg-foot { display: flex; gap: 10px; flex-wrap: wrap; }
.dlg-foot .btn { flex: 1; min-height: 40px; }
.dlg .auth { border: 0; padding: 0; max-width: none; }
.steps { display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.step label { font-weight: 600; }
.step label small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.stepper { display: flex; align-items: stretch; }
.stepper button { width: 44px; height: 44px; border: 1px solid #b9c0ca; background: var(--head); font-size: 22px; font-weight: 600; line-height: 1; }
.stepper button:first-child { border-radius: 3px 0 0 3px; }
.stepper button:last-child { border-radius: 0 3px 3px 0; }
.stepper button:hover { background: #e6e9ee; }
.stepper input { width: 64px; height: 44px; border: 1px solid #b9c0ca; border-left: 0; border-right: 0; border-radius: 0; background: #fff; text-align: center; font-size: 20px; font-weight: 600; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.step.bos { border-left: 4px solid var(--green); }
.soonbox { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 3px; background: #f7f9fc; }
.soonbox #e-hazir { width: 120px; min-height: 30px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { border: 1px solid #b9c0ca; background: #fff; border-radius: 3px; padding: 4px 9px; font-size: 12.5px; font-weight: 600; color: #3b4656; }
.quick button:hover { background: var(--head); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; max-height: 240px; overflow: auto; padding: 8px 10px; border: 1px solid #b9c0ca; border-radius: 3px; font-size: 13px; }
.checks label { display: flex; gap: 6px; align-items: center; }
.checks b { grid-column: 1 / -1; margin-top: 6px; font-weight: 600; color: var(--navy); }
.secret { font: 600 20px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .05em; text-align: center; padding: 14px; border-radius: 3px; background: var(--head); border: 1px solid #b9c0ca; user-select: all; }

#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 70px); opacity: 0; transition: .2s;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 3px; font-weight: 600; font-size: 13.5px; z-index: 99; max-width: calc(100vw - 32px);
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.bad { background: var(--red); }

/* ---------- telefon ---------- */
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { padding: 24px 20px; border-right: 0; border-bottom: 4px solid var(--red); }
  .login-brand .logo { width: 64px; height: 64px; margin-bottom: 12px; }
  .login-brand h1 { font-size: 18px; }
  .login-app { margin-top: 10px; padding-top: 10px; font-size: 15px; }
  .login-desc, .login-foot { display: none; }
  .login-main { place-items: start center; padding: 28px 20px; }

  .brand span, .who span span { display: none; }
  .who b { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { border-top: 1px solid var(--line-soft); }
  .kpi.hero { grid-column: 1 / -1; border-top: 0; }
  .seg.scope button { flex: none; }
  .tools .input { max-width: none; flex: 1 1 100%; }
  .m-only { display: inline; margin-left: 4px; }

  .urow.head { display: none; }
  .urow {
    grid-template-columns: 1fr 1fr 1fr 76px;
    grid-template-areas: "name name name edit" "bar bar bar bar" "yatan entube bos bos" "note note note note";
    gap: 8px 10px; padding: 12px 14px;
  }
  .urow .uname { grid-area: name; }
  .urow .c-bas { display: none; }
  .urow .c-bar { grid-area: bar; }
  .urow .c-yatan { grid-area: yatan; }
  .urow .c-entube { grid-area: entube; }
  .urow .c-bos { grid-area: bos; }
  .urow .c-note { grid-area: note; }
  .urow .c-edit { grid-area: edit; }
  .urow .num, .arow .num { text-align: left; border: 1px solid var(--line-soft); border-radius: 3px; padding: 4px 8px; align-self: stretch; }
  .num .lbl { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .urow .num.na { visibility: hidden; }
  .urow.total { grid-template-areas: "name name name name" "yatan entube bos bos"; }
  .urow.total .c-bar, .urow.total .c-note, .urow.total .c-edit { display: none; }
  .ghead { flex-direction: column; gap: 0; }

  .arow.head { display: none; }
  .arow { grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 12px 14px; }
  .arow .uname { grid-column: 1 / 3; }
  .arow .c-edit { grid-column: 3; }
  .arow .unote { grid-column: 1 / -1; }
  .checks { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .live span { display: none; }
  .stepper input { width: 56px; }
}
@media print {
  .top, .tools, .c-edit, .seg, #toast { display: none !important; }
  body { background: #fff; }
}
