/* RestoAI POS — kabuk ve giriş akışı sayfa stilleri (pos.css'in üstüne yüklenir).
   Kapsam: üst şerit (shell.js), giriş (login), terminal tanıtma, kullanıcı değiştirme ve servis
   modeli pencereleri, ana sayfalar. Tokenlar pos.css'ten (--ps-*, --pos-*).
   Firefox ESR 115 tabanı: :has(), @container, CSS nesting KULLANILMAZ. Font internetten gelmez. */

/* ── Ortak parçalar ──────────────────────────────────────── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .3px;
  background: #9CA3AF; user-select: none;
}
.avatar-lg { width: 50px; height: 50px; font-size: 18px; }
.avatar-xl { width: 84px; height: 84px; font-size: 30px; }

.btn-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--pos-touch); padding: 0 8px;
  border: 0; background: none; cursor: pointer;
  color: var(--ps-brand-solid); font-weight: 600; text-decoration: underline;
}
.btn-link:hover { color: #4338CA; }
.btn-link:disabled { opacity: .5; cursor: not-allowed; }
.btn-link:focus-visible { outline: 3px solid var(--ps-brand-line); outline-offset: 1px; border-radius: var(--ps-r-ctl); }

body.shell-wait, body.shell-wait .btn { cursor: wait; }

@keyframes pos-spin { to { transform: rotate(360deg); } }

/* ── Üst şerit (shell.js) ────────────────────────────────── */
.shell { flex: none; }
.shell-top { flex-wrap: wrap; }
.shell-brand { font-size: 20px; text-decoration: none; }
.shell-heading { font-weight: 700; color: var(--ps-ink); padding-left: 12px; border-left: 1px solid var(--ps-line); }
.shell-terminal { font-size: 13px; padding: 2px 8px; border: 1px solid var(--ps-line); border-radius: 999px; white-space: nowrap; }
.shell-hub { width: 10px; height: 10px; border-radius: 50%; background: var(--ps-warn); flex: none; }
.shell-hub.is-up { background: var(--ps-ok); }
.shell-hub.is-down { background: var(--ps-crit); }

.shell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shell-user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.shell-user-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.shell-user-role { font-size: 13px; color: var(--ps-ink-3); }
.shell-btn, .shell-back { padding: 0 14px; white-space: nowrap; }

.shell-license {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; font-weight: 600;
  background: #FEF3C7; color: #92400E; border-bottom: 1px solid #F6D3A1;
}
.shell-license.is-crit { background: #FEE2E2; color: #991B1B; border-bottom-color: #F5B5C3; }
.shell-license-icon { font-size: 20px; flex: none; }
.shell-license-text { flex: 1; min-width: 200px; white-space: pre-wrap; }
.shell-license-btn { flex: none; }

.shell-stale {
  padding: 10px 16px; text-align: center; font-weight: 700;
  background: var(--ps-crit-soft); color: var(--ps-crit); border-bottom: 1px solid #F5B5C3;
}

/* live.js bağlantı şeridi kabuğun içine alınır (shell.js adoptConnBanner): akışta durur, üst
   şeridin düğmelerini örtmez. İlk bağlantı kurulurken (hub-initial) hiç gösterilmez. */
.shell .conn-banner { position: static; }
.hub-initial .conn-banner { display: none; }

@media (max-width: 900px) {
  .shell-label { display: none; }
  .shell-user-role, .shell-terminal { display: none; }
  .shell-user-name { max-width: 130px; }
}
@media (max-width: 560px) {
  .shell-user-text, .shell-heading { display: none; }
}

/* ── Ana sayfalar ────────────────────────────────────────── */
/* Dikey ortalama "auto" kenar boşluğuyla: justify-content:center taşan içeriğin üstünü kaydırılamaz bırakır. */
.home-main { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.home-main > :first-child { margin-top: auto; }
.home-main > :last-child { margin-bottom: auto; }
.home-warnings { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 8px; }
.home-cards { display: grid; gap: 20px; width: 100%; max-width: 1100px; }
.home-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }
.home-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Değişken sayıda kart (çalışan + "Yakında") — Yönetici anasayfası (parite v3 özellik #235,
   "sütun sayısı görünen karta göre dengelenir"). auto-fill sabit sütun sayısı GEREKTİRMEZ. */
.home-cards-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-width: 1320px; }
.home-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 240px; padding: 28px 20px; text-align: center; text-decoration: none; color: var(--ps-ink);
  cursor: pointer; transition: box-shadow .12s ease, border-color .12s ease;
  font: inherit; background: var(--ps-surface);   /* <button> öğeleri için sıfırlama (Yakında kartları) */
}
.home-card:hover { border-color: var(--ps-brand-line); box-shadow: var(--ps-shadow-lift); }
.home-card:active { transform: translateY(1px); }
.home-card:focus-visible { outline: 3px solid var(--ps-brand-line); outline-offset: 2px; }
.home-card-icon { font-size: 54px; line-height: 1; }
.home-card-title { font-size: 26px; font-weight: 700; }
.home-card-desc { color: var(--ps-ink-3); }

/* "Yakında" kartları: hedef sayfa yok, tıklayınca bilgi kutusu açılır (data-soon, js/home.js) —
   waiter/tables.html'deki "Masaları Yönet" ipucu düğmesiyle aynı desen. Devre dışı DEĞİL
   (aria-disabled değil): tıklanabilir kalır ki garson neden çalışmadığını görsün. */
.home-card-soon { position: relative; opacity: .72; }
.home-card-soon .home-card-icon { filter: grayscale(35%); }
.home-card-soon-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  background: var(--ps-surface-sunk); color: var(--ps-ink-3);
  border: 1px solid var(--ps-line); border-radius: 999px; padding: 3px 9px;
}

.kp-box { max-width: 620px; text-align: center; padding: 32px 28px; }
.kp-icon { font-size: 56px; line-height: 1; }
.kp-title { font-size: 24px; margin: 12px 0 8px; }
.kp-text { margin: 0 0 10px; color: var(--ps-ink-2); }
.kp-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

@media (max-width: 900px) {
  .home-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .home-main > :first-child { margin-top: 0; }
  .home-cards-2, .home-cards-3, .home-cards-4 { grid-template-columns: 1fr; }
  .home-card { min-height: 150px; }
}

/* ── Giriş ekranı ────────────────────────────────────────── */
.lg-body { background: var(--ps-canvas); }
.lg-layout { display: flex; min-height: 100%; }

.lg-brand {
  flex: 0 0 38%; max-width: 520px; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 36px; color: #fff;
  background: linear-gradient(160deg, #4F46E5 0%, #6D28D9 60%, #4C1D95 100%);
}
.lg-logo { font-size: 38px; font-weight: 800; letter-spacing: .3px; }
.lg-logo-sub { margin-top: 4px; font-size: 16px; opacity: .85; }
.lg-slogan { font-size: 20px; line-height: 1.45; margin: 0 0 22px; }
.lg-points { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.lg-points li { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.lg-tick {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .18); font-size: 14px; font-weight: 700;
}
.lg-privacy { margin: 0; font-size: 14px; opacity: .9; }
.lg-brand-foot { font-size: 13px; opacity: .8; display: flex; flex-direction: column; gap: 4px; }
.lg-legal { white-space: pre-wrap; }

.lg-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; min-width: 0; }
.lg-panel { width: 100%; max-width: 860px; padding: 32px 32px 24px; }
.lg-loading { padding: 40px 0; text-align: center; }
.lg-foot { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: center; font-size: 13px; }
.lg-foot-link { color: var(--ps-ink-3); }

.lg-title { margin: 0; font-size: 28px; text-align: center; }
.lg-subtitle { margin: 6px 0 20px; text-align: center; color: var(--ps-ink-3); }
.lg-error { margin-bottom: 16px; font-weight: 600; white-space: pre-wrap; }

.lg-groups { display: flex; flex-direction: column; gap: 18px; max-height: 52vh; overflow-y: auto; padding: 2px 4px 4px; }
.lg-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lg-group-title { font-size: 13px; font-weight: 700; letter-spacing: .6px; color: var(--ps-ink-3); }
.lg-count {
  min-width: 22px; padding: 0 6px; border-radius: 999px; text-align: center;
  font-size: 12px; font-weight: 700; background: var(--ps-surface-sunk); border: 1px solid var(--ps-line); color: var(--ps-ink-3);
}
.lg-rule { flex: 1; height: 1px; background: var(--ps-line-soft); }
/* Satır başına en fazla 3 kart (WPF: 250×82). */
.lg-users { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lg-user {
  display: flex; align-items: center; gap: 12px; min-height: 82px; padding: 0 16px; text-align: left;
  border: 1px solid var(--ps-line); border-radius: var(--ps-r-card); background: var(--ps-surface);
  cursor: pointer; box-shadow: var(--ps-shadow); min-width: 0;
}
.lg-user:hover { border-color: var(--ps-brand-solid); background: var(--ps-brand-soft); }
.lg-user:active { transform: translateY(1px); }
.lg-user:focus-visible { outline: 3px solid var(--ps-brand-line); outline-offset: 1px; }
.lg-user:disabled { opacity: .6; cursor: not-allowed; }
.lg-user-name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.lg-link { display: flex; margin: 14px auto 0; }

.lg-selected { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.lg-role-badge { padding: 2px 12px; border: 1px solid; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--ps-surface); }

.lg-firstrun-hint {
  max-width: 460px; margin: 0 auto 18px; padding: 12px 14px;
  border: 1px solid var(--ps-brand-line); border-radius: var(--ps-r-panel);
  background: var(--ps-brand-soft); color: #4C1D95; font-size: 14px;
}
.lg-form { max-width: 460px; margin: 0 auto; }
.lg-form .input { width: 100%; }
.lg-submit { margin-top: 6px; }
.lg-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: pos-spin .8s linear infinite;
}

.lg-cardhint { max-width: 460px; margin: 20px auto 0; }
.lg-or { display: flex; align-items: center; gap: 12px; color: var(--ps-ink-3); font-size: 14px; }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: var(--ps-line-soft); }
.lg-cardhint-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0; color: var(--ps-ink-2); font-weight: 600; }
.lg-manual-card { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lg-card-input { flex: 1; min-width: 180px; }
.lg-manual-card .lg-link { margin: 0; }

@media (max-width: 980px) {
  .lg-brand { display: none; }
  .lg-users { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .lg-panel { padding: 22px 16px 16px; }
  .lg-users { grid-template-columns: 1fr; }
  .lg-groups { max-height: none; }
}

/* ── Terminal tanıtma ────────────────────────────────────── */
.ts-main { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.ts-panel { width: 100%; max-width: 560px; padding: 28px; }
.ts-brand { font-size: 22px; font-weight: 800; color: var(--ps-brand); }
.ts-title { margin: 6px 0 8px; font-size: 26px; }
.ts-intro { margin: 0 0 18px; color: var(--ps-ink-2); }
.ts-notice, .ts-existing, .ts-error { margin-bottom: 14px; font-weight: 600; }
.ts-existing { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ts-existing-text { flex: 1; min-width: 200px; }
.ts-form .input { width: 100%; }
.ts-modes { display: flex; gap: 0; margin-bottom: 14px; border: 1px solid var(--ps-line-strong); border-radius: var(--ps-r-ctl); overflow: hidden; }
.ts-mode {
  flex: 1; min-height: var(--pos-touch); border: 0; background: var(--ps-surface); color: var(--ps-ink-2);
  font-weight: 600; cursor: pointer;
}
.ts-mode + .ts-mode { border-left: 1px solid var(--ps-line-strong); }
.ts-mode.is-active { background: var(--ps-brand-solid); color: #fff; }
.ts-mode:focus-visible { outline: 3px solid var(--ps-brand-line); outline-offset: -3px; }
.ts-code { font-size: 20px; letter-spacing: 2px; text-transform: uppercase; }
.ts-help { margin: -4px 0 14px; font-size: 14px; }
.ts-foot { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; font-size: 13px; }

/* ── Kullanıcı değiştirme penceresi ──────────────────────── */
.us-modal { max-width: 560px; }
.us-modal.is-busy { cursor: wait; }
.us-head { display: flex; align-items: center; gap: 12px; }
.us-head-icon { font-size: 26px; flex: none; }
.us-head-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.us-sub { font-size: 14px; font-weight: 400; color: var(--ps-ink-3); }
.us-close { flex: none; }
.us-body { display: flex; flex-direction: column; gap: 12px; }

.us-cardhint { padding: 10px 12px; border: 1px solid var(--ps-line); border-radius: var(--ps-r-panel); background: var(--ps-surface-sunk); }
.us-cardhint-row { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ps-ink-2); }
.us-cardhint.is-error { border-color: #F5B5C3; background: var(--ps-crit-soft); }
.us-cardhint.is-error .us-cardhint-row { color: var(--ps-crit); }
.us-manual { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.us-manual-input { flex: 1; min-width: 160px; }
.us-error { font-weight: 600; }

.us-list { display: flex; flex-direction: column; gap: 10px; max-height: 48vh; overflow-y: auto; padding: 2px; }
.us-loading { padding: 24px 0; text-align: center; }
.us-card {
  display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 8px 14px; text-align: left; width: 100%;
  border: 2px solid var(--ps-line); border-radius: var(--ps-r-card); background: var(--ps-surface); cursor: pointer;
}
.us-card:hover { border-color: var(--ps-brand); }
.us-card:focus-visible { outline: 3px solid var(--ps-brand-line); outline-offset: 1px; }
.us-card:disabled { opacity: .6; cursor: wait; }
.us-card-text { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.us-card-name { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-role { padding: 0 10px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 700; }
.us-lock { flex: none; opacity: .6; }

.us-empty { text-align: center; padding: 20px 8px; }
.us-empty-icon { font-size: 40px; line-height: 1; }
.us-empty-title { margin-top: 10px; font-size: 18px; font-weight: 700; }
.us-empty-body { margin-top: 6px; color: var(--ps-ink-3); }

/* Ana şifre katmanı: pencerenin üstünde karartılmış ikinci kat. */
.us-overlay {
  position: fixed; inset: 0; z-index: 810; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .55);
}
.us-overlay-box { width: 100%; max-width: 440px; box-shadow: var(--ps-shadow-lift); }
.us-overlay-title { font-size: 18px; font-weight: 700; }
.us-overlay-prompt { margin: 6px 0 14px; color: var(--ps-ink-2); }
.us-pass { width: 100%; }
.us-pass-error { margin-top: 8px; color: var(--ps-crit); font-weight: 600; }
.us-overlay-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

/* ── Servis modeli penceresi ─────────────────────────────── */
.sm-modal { max-width: 720px; }
.sm-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 6px; }
.sm-head-text { flex: 1; min-width: 0; }
.sm-title { font-size: 21px; font-weight: 700; }
.sm-intro { margin-top: 6px; color: var(--ps-ink-3); }
.sm-x { flex: none; min-width: var(--pos-touch); padding: 0; font-size: 18px; }
.sm-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 24px 18px; margin: 0; }
.sm-card {
  position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; cursor: pointer;
  border: 2px solid var(--ps-line); border-radius: var(--ps-r-card); background: var(--ps-surface);
}
.sm-card:hover { border-color: var(--ps-brand-line); }
.sm-card.is-selected { border-color: var(--ps-brand); background: var(--ps-brand-soft); }
/* Radyo görünmez ama odaklanabilir kalır: ok tuşlarıyla gezinme tarayıcının kendi davranışıdır. */
.sm-card input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sm-check {
  flex: none; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%;
  border: 2px solid var(--ps-line-strong); background: var(--ps-surface);
  display: inline-flex; align-items: center; justify-content: center;
}
.sm-card.is-selected .sm-check { border-color: var(--ps-brand); background: var(--ps-brand); }
.sm-card.is-selected .sm-check::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.sm-card input:focus-visible + .sm-check { outline: 3px solid var(--ps-brand-line); outline-offset: 2px; }
.sm-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sm-card-title { font-size: 17px; font-weight: 700; }
.sm-card-desc { color: var(--ps-ink-2); font-size: 14px; }
.sm-error { font-weight: 600; }
