/* ReStar POS — экран входа кассира (по макету владельца, ноябрь 2026): сцена-фон, стеклянная карточка, блок состояния. */
.login { position: fixed; inset: 0; z-index: 45; display: grid; grid-template-columns: minmax(380px, 40%) 1fr; gap: 28px; padding: clamp(16px, 4vh, 36px) 40px clamp(16px, 4vh, 36px) 0;
  background: #120f0d url("img/login-bg.webp") left center / cover no-repeat; animation: fadeIn .3s ease; color: #f1f3f5; }
/* левую часть притемняем: большая «R» на фоне не спорит с логотипом и часами */
.login::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 8, 7, .62) 0%, rgba(10, 8, 7, .42) 28%, rgba(10, 8, 7, .08) 52%, rgba(10, 8, 7, .3) 100%); pointer-events: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.login > * { position: relative; z-index: 1; }

/* левая часть: бренд, время, филиал, состояние */
.login-side { display: flex; flex-direction: column; padding: 10px 0 4px 60px; min-height: 0; overflow: hidden; }
/* логотип наверху, часы и состояние — по центру колонки, на уровне карточки справа */
.login-side-in { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.login-info { margin: auto 0; padding-bottom: clamp(20px, 7vh, 72px); display: flex; flex-direction: column; }
.login-brand img { display: block; width: 300px; max-width: 100%; height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45)); }
.login-clock { margin-top: clamp(16px, 3vh, 32px); font-size: clamp(76px, 7.8vw, 124px); font-weight: 600; letter-spacing: -.045em; line-height: .95; font-variant-numeric: tabular-nums; text-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.login-date { display: flex; align-items: center; gap: 10px; font-size: 18px; color: #ced4da; margin-top: 14px; }
.login-date i { font-size: 20px; color: #adb5bd; }
.login-branch { display: inline-flex; align-items: center; gap: 8px; margin-top: clamp(18px, 4vh, 34px); font-size: 21px; font-weight: 500; color: #fff; padding: 6px 10px 6px 0; border-radius: 12px; align-self: flex-start; }
.login-branch i:first-child { font-size: 20px; color: #ffa94d; }
.login-branch i:last-child { font-size: 22px; color: #adb5bd; transition: transform .2s; }
.login-branch:hover i:last-child { transform: translateY(2px); }
.login-status { margin-top: 18px; display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 12px; max-width: 460px;
  background: linear-gradient(160deg, rgba(40, 34, 30, .72), rgba(20, 17, 15, .72)); border: 1px solid rgba(255, 255, 255, .09); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 40px -24px rgba(0, 0, 0, .7); }
.login-status .sep { width: 1px; height: 38px; background: rgba(255, 255, 255, .12); }
.st { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st b { display: block; font-size: 14.5px; font-weight: 500; color: #f8f9fa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st small { display: block; font-size: 12.5px; color: #adb5bd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st .lamp { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; background: #868e96; }
.st .lamp.ok { background: #40c057; box-shadow: 0 0 0 5px rgba(64, 192, 87, .18), 0 0 18px rgba(64, 192, 87, .6); }
.st .lamp.demo { background: #ff922b; box-shadow: 0 0 0 5px rgba(255, 146, 43, .18), 0 0 18px rgba(255, 146, 43, .6); }
.st .lamp.bad { background: #fa5252; box-shadow: 0 0 0 5px rgba(250, 82, 82, .18), 0 0 18px rgba(250, 82, 82, .55); }
.st .badge-ic { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(255, 146, 43, .16); color: #ff922b; font-size: 18px; }
.st .badge-ic.open { background: rgba(64, 192, 87, .16); color: #51cf66; }

/* правая часть: светлая стеклянная карточка */
.login-main { min-height: 0; display: flex; align-items: center; justify-content: center; }
.login-panel { flex: 0 1 860px; max-height: 100%; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(22px, 4.5vh, 40px) 44px clamp(24px, 5vh, 44px); border-radius: 12px; scrollbar-width: none; color: #212529;
  background: linear-gradient(150deg, rgba(255, 255, 255, .95) 0%, rgba(255, 250, 245, .93) 55%, rgba(255, 238, 222, .9) 100%);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .8); border: 1px solid rgba(255, 255, 255, .6); }
@supports (backdrop-filter: blur(1px)) { .login-panel { backdrop-filter: blur(14px); background: linear-gradient(150deg, rgba(255, 255, 255, .9) 0%, rgba(255, 250, 245, .86) 55%, rgba(255, 236, 218, .8) 100%); } }
.login-card { width: 100%; max-width: 780px; margin: 0 auto; animation: slideUp .3s ease; }
/* полос прокрутки на экране входа нет: всё помещается (см. fit() в pos.js), на телефоне лента листается пальцем */
.login, .login-panel { scrollbar-width: none; }
.login::-webkit-scrollbar, .login-panel::-webkit-scrollbar { display: none; }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-card h1 { font-size: clamp(24px, 2vw, 32px); margin: 0; letter-spacing: -.02em; font-weight: 600; line-height: 1.15; }
.login-card .sub { color: #868e96; font-size: 15px; margin: 6px 0 24px; }
.staff-search { position: relative; margin: -14px 0 20px; }
.staff-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #adb5bd; font-size: 18px; }
.staff-search input { width: 100%; height: 52px; border-radius: 12px; border: 1px solid #e9ecef; background: rgba(255, 255, 255, .8); padding: 0 16px 0 44px; font-size: 16px; outline: none; }
.staff-search input:focus { border-color: #ffa94d; box-shadow: 0 0 0 3px rgba(247, 103, 7, .12); }
.staff { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.staff.many { grid-template-columns: repeat(4, 1fr); max-height: 52vh; overflow-y: auto; padding: 4px; margin: -4px; }
.person { position: relative; background: rgba(255, 255, 255, .85); border: 2px solid transparent; border-radius: 12px; padding: 22px 12px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 16px 36px -26px rgba(0, 0, 0, .35); transition: transform .14s, box-shadow .2s, border-color .2s, background .2s; }
.person:hover { transform: translateY(-3px); box-shadow: 0 24px 40px -26px rgba(0, 0, 0, .45); }
.person:active { transform: scale(.98); }
.person.sel { border-color: #ff922b; background: linear-gradient(170deg, #fff 0%, #fff4e8 100%); box-shadow: 0 20px 40px -22px rgba(247, 103, 7, .55); }
.person .tick { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(160deg, #ffa94d, #f76707); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; opacity: 0; transform: scale(.5); transition: all .2s; box-shadow: 0 6px 14px -6px rgba(247, 103, 7, .8); }
.person.sel .tick { opacity: 1; transform: none; }
.ava { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 34px; letter-spacing: -.02em; position: relative; flex-shrink: 0;
  box-shadow: inset 0 -6px 14px rgba(0, 0, 0, .15), inset 0 6px 12px rgba(255, 255, 255, .25), 0 14px 26px -14px rgba(0, 0, 0, .55); }
.ava.sm { width: 60px; height: 60px; font-size: 22px; }
.staff.many .ava { width: 74px; height: 74px; font-size: 26px; }
.ava .on { position: absolute; right: 3px; bottom: 3px; width: 20px; height: 20px; border-radius: 50%; background: #40c057; border: 4px solid #fff; }
/* аватарки-картинки: свой оранжевый круг, причёска и колпак выходят за край */
.ava.pic { width: 112px; height: 112px; background: none; box-shadow: none; border-radius: 0; margin: -10px 0 -6px; }
.ava.pic img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 12px 16px rgba(140, 60, 0, .25)); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); user-select: none; -webkit-user-drag: none; }
.person:hover .ava.pic img, .person.sel .ava.pic img { transform: translateY(-4px) scale(1.04); }
.ava.pic .on { right: 11px; bottom: 11px; width: 18px; height: 18px; border-width: 3px; }
.ava.pic.sm { width: 72px; height: 72px; margin: -6px 0; }
.ava.pic.sm .on { right: 6px; bottom: 6px; width: 16px; height: 16px; border-width: 3px; }
.staff.many .ava.pic { width: 88px; height: 88px; }
.person b { font-weight: 500; font-size: 16.5px; line-height: 1.2; color: #212529; }
.person small { color: #868e96; font-size: 13.5px; margin-top: -4px; }
.person small.on { color: #2f9e44; font-weight: 400; }
.other { margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 20px; border-radius: 12px; background: rgba(255, 255, 255, .8); color: #343a40; font-size: 15.5px; font-weight: 400; text-align: left;
  box-shadow: 0 16px 36px -28px rgba(0, 0, 0, .4); transition: background .2s, transform .12s; }
.other:hover { background: #fff; }
.other:active { transform: scale(.99); }
.other i:first-child { font-size: 22px; color: #495057; }
.other span { flex: 1; }
.other i:last-child { font-size: 24px; color: #868e96; }

/* PIN и открытие смены */
.who { display: flex; align-items: center; gap: 16px; margin-bottom: clamp(12px, 2.6vh, 26px); }
.who b { font-size: 24px; display: block; font-weight: 500; }
.who small { color: #868e96; font-size: 15px; }
.back { width: 52px; height: 52px; border-radius: 12px; background: rgba(255, 255, 255, .9); border: 1px solid #e9ecef; font-size: 22px; color: #495057; flex-shrink: 0; }
.pin-wrap { max-width: 420px; margin: 0 auto; }
.pin-dots { display: flex; justify-content: center; gap: 20px; margin: clamp(4px, 1vh, 10px) 0 clamp(14px, 3vh, 30px); }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #ced4da; background: rgba(255, 255, 255, .8); transition: background .15s, border-color .15s, transform .15s; }
.pin-dots i.f { background: linear-gradient(160deg, #ffa94d, #f76707); border-color: #f76707; transform: scale(1.12); box-shadow: 0 4px 12px -4px rgba(247, 103, 7, .8); }
.pin-dots.err { animation: shake .4s; }
.pin-dots.err i { border-color: #fa5252; background: #ffe3e3; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 1.5vh, 14px); }
.key { height: clamp(52px, 8.4vh, 76px); border-radius: 12px; background: rgba(255, 255, 255, .92); border: 1px solid #eef0f2; font-size: 28px; font-weight: 500; color: #212529; transition: background .12s, transform .08s, box-shadow .2s;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .03), 0 12px 24px -20px rgba(0, 0, 0, .35); }
.key:hover { background: #fff; }
.key:active { transform: scale(.94); background: #fff4e6; }
.key.fn { font-size: 24px; color: #868e96; background: transparent; border-color: transparent; box-shadow: none; }
.key.ok { background: linear-gradient(160deg, #ffa94d, #f76707); color: #fff; border: 0; box-shadow: 0 14px 26px -14px rgba(247, 103, 7, .95); }
.pad.compact { gap: clamp(7px, 1.1vh, 10px); }
.pad.compact .key { height: clamp(46px, 6.6vh, 60px); border-radius: 12px; font-size: 24px; }
.pin-hint { text-align: center; color: #868e96; font-size: 13px; margin-top: clamp(8px, 1.8vh, 20px); }
.pin-err { text-align: center; color: #e03131; min-height: 20px; margin-top: clamp(6px, 1.2vh, 12px); font-weight: 400; }
.amount { text-align: center; font-size: clamp(44px, 7vh, 60px); font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin: 4px 0; color: #212529; }
.amount small { font-size: 32px; color: #adb5bd; font-weight: 500; }
.amount-lbl { text-align: center; color: #868e96; font-size: 15px; }
.presets { display: flex; justify-content: center; gap: 8px; margin: clamp(8px, 1.5vh, 14px) 0 clamp(10px, 2vh, 20px); flex-wrap: wrap; }
.presets button { padding: 8px 13px; border-radius: 999px; background: rgba(255, 255, 255, .9); border: 1px solid #e9ecef; font-weight: 400; font-size: 14px; color: #495057; }
.presets button:hover { border-color: #ffa94d; color: #c2410c; }
.toggle { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, .9); border: 1px solid #eef0f2; border-radius: 12px; padding: 12px 16px; margin: clamp(10px, 2vh, 20px) 0 clamp(8px, 1.4vh, 14px); cursor: pointer; text-align: left; width: 100%; }
.toggle .sw { width: 50px; height: 30px; border-radius: 999px; background: #dee2e6; position: relative; flex-shrink: 0; transition: background .2s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle.on .sw { background: #f76707; }
.toggle.on .sw::after { transform: translateX(20px); }
.toggle b { display: block; font-size: 15px; color: #212529; }
.toggle small { color: #868e96; font-size: 13px; }
.demo-note { display: flex; gap: 12px; align-items: flex-start; background: #fff4e6; color: #9c4a0c; border: 1px solid #ffe0bd; border-radius: 12px; padding: 14px 16px; font-size: 14px; margin-bottom: 18px; }
.demo-note i { font-size: 20px; }
.big-go { width: 100%; height: clamp(52px, 7.4vh, 64px); border-radius: 12px; font-size: 18px; margin-top: 6px; }
.name-inp { height: 60px; font-size: 19px; border-radius: 12px; }
.top-badge { background: rgba(247, 103, 7, .2); color: #ffc078; border: 1px solid rgba(255, 169, 77, .35); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.open-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: start; }

/* планшет и узкие экраны */
@media (max-width: 1280px) {
  .login { grid-template-columns: minmax(330px, 38%) 1fr; padding: 24px 24px 24px 0; gap: 20px; }
  .login-side { padding-left: 40px; }
  .login-panel { padding: 32px 32px 36px; border-radius: 12px; }
  .ava { width: 80px; height: 80px; font-size: 28px; }
  .ava.pic { width: 100px; height: 100px; }
  .person { padding: 20px 10px 16px; }
  .person b { font-size: 15.5px; }
  .open-grid { gap: 18px; }
  .login-status { grid-template-columns: 1fr; gap: 14px; max-width: 360px; }
  .login-status .sep { display: none; }
}
@media (max-width: 900px) and (orientation: portrait), (max-width: 700px) {
  .login { display: block; padding: 0; overflow-y: auto; background-size: auto 420px; background-position: left top; background-color: #120f0d; }
  .login-side { padding: 22px 20px 26px; }
  .login-brand img { width: min(270px, 100%); }
  .login-info { margin: 0; padding: 0; }
  .login-clock { margin-top: 26px; font-size: 64px; }
  .login-branch { margin-top: 18px; font-size: 20px; }
  .login-status { grid-template-columns: 1fr; gap: 12px; }
  .login-status .sep { display: none; }
  .login-main { display: block; }
  .login-panel { border-radius: 12px 12px 0 0; padding: 28px 18px 40px; min-height: 60vh; }
  .staff, .staff.many { grid-template-columns: repeat(2, 1fr); gap: 12px; max-height: none; }
  .key { height: 64px; }
  .open-grid { grid-template-columns: 1fr; gap: 0; }
}

/* выход в лаунчер ReStar на кассовом компьютере */
.login-restar { position: absolute; top: 16px; right: 20px; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #f1f3f5; font-size: 13px; text-decoration: none; backdrop-filter: blur(8px); }
.login-restar:hover { background: rgba(255, 255, 255, .16); }
.login-restar i { font-size: 17px; }

/* Пока касса решает, кто за ней, и пока открыт вход — саму кассу под окном входа не рисуем:
   на телефоне она просвечивала при загрузке и мелькала снизу при резкой прокрутке */
html:has(> body.booting), html:has(> body.is-login) { background: #120f0d; }
body.booting, body.is-login { background: #120f0d; overflow: hidden; }
body.booting > .top, body.booting > .pos, body.is-login > .top, body.is-login > .pos { visibility: hidden; }
.login { overscroll-behavior: contain; }
@media (max-width: 900px) and (orientation: portrait), (max-width: 700px) {
  /* белая панель входа тянется до самого низа экрана */
  .login { display: flex; flex-direction: column; }
  .login-side { flex: none; }
  .login-main { display: flex; flex: 1 0 auto; }
  .login-panel { flex: 1 0 auto; width: 100%; justify-content: flex-start; }
}
