
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
--blue: #3a45ff;
--blue-dark: #2830cc;
--red: #ff3b3b;
--red-dark: #cc2020;
--green: #18c96a;
--green-dark: #0fa852;
--grey-bg: #f5f5f7;
--grey-border: #e2e2e8;
--grey-text: #8e8e9a;
--text: #1a1a2e;
--white: #ffffff;
--nav-h: 62px;
--topbar-h: 52px;
--safe-bottom: env(safe-area-inset-bottom, 0px);
--radius: 14px;
--radius-sm: 8px;
}

html, body {
height: 100%;
background: var(--grey-bg);
font-family: 'Roboto', sans-serif;
font-size: 15px;
color: var(--text);
-webkit-font-smoothing: antialiased;
overscroll-behavior: none;
-webkit-overscroll-behavior: none;
-webkit-user-select: none;
user-select: none;
-webkit-touch-callout: none;
touch-action: manipulation;
}


.a-app {
position: fixed;
inset: 0;
display: flex;
flex-direction: column;
}

.a-menu-toggle {
position: fixed;
top: 10px;
left: 10px;
z-index: 170;
width: 42px;
height: 42px;
border: 1.5px solid var(--grey-border);
border-radius: 10px;
background: var(--white);
color: var(--text);
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.a-nav-backdrop {
position: fixed;
inset: 0;
background: rgba(0,0,0,.35);
z-index: 140;
opacity: 0;
pointer-events: none;
transition: opacity .2s ease;
}

.a-app.a-nav-open .a-nav-backdrop {
opacity: 1;
pointer-events: auto;
}


.a-page {
position: absolute;
inset: 0;
display: none;
flex-direction: column;
background: var(--grey-bg);
overflow: hidden;
}
.a-page--active { display: flex; }


.a-topbar {
flex-shrink: 0;
height: var(--topbar-h);
background: var(--white);
border-bottom: 1px solid var(--grey-border);
display: flex;
align-items: center;
padding: 0 16px 0 60px;
}
.a-topbar__title {
font-size: 18px;
font-weight: 700;
color: var(--text);
}

.a-filters {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 8px;
padding: 10px 12px;
background: var(--white);
border-bottom: 1px solid var(--grey-border);
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.a-filters::-webkit-scrollbar { display: none; }


.a-scroll-body {
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 12px;
}

.a-scroll-body--registry {
padding: 10px;
background: var(--grey-bg);
}

.a-registry-iframe {
display: block;
width: 100%;
height: 100%;
min-height: 70vh;
border: 0;
border-radius: var(--radius);
background: var(--white);
}


.a-pagination {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
padding: 10px 12px;
background: var(--white);
border-top: 1px solid var(--grey-border);
}
.a-pagination__info {
font-size: 14px;
color: var(--grey-text);
min-width: 60px;
text-align: center;
}


.a-bottom-nav {
position: fixed;
left: 0;
top: 0;
bottom: 0;
width: min(82vw, 300px);
background: var(--white);
border-right: 1px solid var(--grey-border);
display: flex;
flex-direction: column;
align-items: stretch;
padding: 12px;
gap: 6px;
z-index: 150;
transform: translateX(-105%);
transition: transform .22s ease;
box-shadow: 8px 0 28px rgba(0,0,0,.12);
}

.a-app.a-nav-open .a-bottom-nav {
transform: translateX(0);
}

.a-side-nav__head {
height: auto;
min-height: 76px;
display: flex;
align-items: center;
padding: 0 10px;
font-size: 15px;
font-weight: 700;
color: var(--text);
margin-bottom: 10px;
}

.a-side-nav__logo {
height: 56px;
width: auto;
display: block;
}

.a-tab-btn {
flex: 0 0 auto;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
gap: 10px;
background: none;
border: none;
border-radius: 10px;
cursor: pointer;
color: #000;
font-size: 15px;
font-family: inherit;
font-weight: 500;
-webkit-tap-highlight-color: transparent;
transition: color .18s, background .18s;
padding: 10px;
text-align: left;
}
.a-tab-btn:active { opacity: .7; }
.a-tab-btn--active { color: #000; background: #eef1ff; }
.a-tab-btn__icon {
width: 22px;
height: 22px;
flex-shrink: 0;
display: none;
}


.a-order-card {
background: var(--white);
border-radius: var(--radius);
padding: 14px 16px;
margin-bottom: 10px;
cursor: pointer;
display: flex;
flex-direction: column;
gap: 6px;
box-shadow: 0 1px 4px rgba(0,0,0,.06);
-webkit-tap-highlight-color: transparent;
}
.a-order-card:active { opacity: .8; }
.a-order-card__top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.a-order-card__title {
font-weight: 700;
font-size: 15px;
color: var(--text);
font-family: 'Roboto Mono', monospace;
}
.a-order-card__station {
font-size: 14px;
font-weight: 600;
color: #2e3556;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.a-order-card__meta {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
font-size: 13px;
color: var(--grey-text);
}
.a-order-card__amount {
font-weight: 600;
color: var(--text);
}


.a-badge {
display: inline-flex;
align-items: center;
padding: 3px 8px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
white-space: nowrap;
}
.a-badge--active   { background: #e6f9ef; color: #0b8f3e; }
.a-badge--completed { background: #e6eaff; color: #2830cc; }
.a-badge--unpaid   { background: #fff0e0; color: #b05a00; }


.a-devices-list { display: flex; flex-direction: column; gap: 10px; }
.a-device-card {
background: var(--white);
border-radius: var(--radius);
padding: 14px 16px;
box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.a-device-card__top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
}
.a-device-card__code {
font-size: 18px;
font-weight: 700;
letter-spacing: .5px;
}
.a-device-card__name {
font-size: 14px;
font-weight: 600;
color: var(--text);
margin-bottom: 2px;
}
.a-device-card__addr {
font-size: 13px;
color: var(--grey-text);
margin-bottom: 10px;
}
.a-device-card__inv-btn {
width: 100%;
}


.a-user-card {
background: var(--white);
border-radius: var(--radius);
padding: 16px;
box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.a-user-card__row {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 8px 0;
border-bottom: 1px solid var(--grey-border);
font-size: 14px;
gap: 12px;
}
.a-user-card__row:last-child { border-bottom: none; }
.a-user-card__label { color: var(--grey-text); flex-shrink: 0; }
.a-user-card__val { font-weight: 500; word-break: break-all; text-align: right; }


.a-search-row {
display: flex;
gap: 8px;
margin-bottom: 14px;
}
.a-input--flex { flex: 1; min-width: 0; }


.a-input {
height: 42px;
padding: 0 14px;
border: 1.5px solid var(--grey-border);
border-radius: var(--radius-sm);
font-size: 15px;
font-family: inherit;
color: var(--text);
background: var(--white);
outline: none;
transition: border-color .18s;
}
.a-input:focus { border-color: var(--blue); }
.a-input--date { width: 140px; }

.a-select {
height: 42px;
padding: 0 10px;
border: 1.5px solid var(--grey-border);
border-radius: var(--radius-sm);
font-size: 14px;
font-family: inherit;
background: var(--white);
color: var(--text);
outline: none;
cursor: pointer;
}


.a-btn {
display: inline-flex;
align-items: center;
justify-content: center;
height: 44px;
padding: 0 20px;
border-radius: var(--radius);
font-size: 15px;
font-family: inherit;
font-weight: 600;
cursor: pointer;
border: none;
white-space: nowrap;
-webkit-tap-highlight-color: transparent;
transition: background .18s, opacity .18s;
}
.a-btn:disabled { opacity: .5; cursor: default; }
.a-btn--primary  { background: var(--blue);  color: var(--white); }
.a-btn--primary:hover:not(:disabled)  { background: var(--blue-dark); }
.a-btn--secondary { background: var(--grey-bg); color: var(--text); border: 1.5px solid var(--grey-border); }
.a-btn--secondary:hover:not(:disabled) { background: #e8e8ee; }
.a-btn--danger   { background: var(--red);   color: var(--white); }
.a-btn--danger:hover:not(:disabled)   { background: var(--red-dark); }
.a-btn--success  { background: var(--green);  color: var(--white); }
.a-btn--success:hover:not(:disabled)  { background: var(--green-dark); }
.a-btn--sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--radius-sm); }
.a-btn--full { width: 100%; }
.a-btn--tg {
background: #229ED9; color: var(--white);
display: flex; align-items: center; justify-content: center; gap: 8px;
}
.a-btn--tg:hover:not(:disabled) { background: #1a8bbf; }
.a-tg-icon { width: 18px; height: 18px; flex-shrink: 0; }

.a-icon-btn {
display: inline-flex; align-items: center; justify-content: center;
height: 36px; width: 36px;
border: 1.5px solid var(--grey-border);
background: var(--white);
border-radius: var(--radius-sm);
cursor: pointer; font-size: 14px; flex-shrink: 0;
}


.a-label {
display: block;
font-size: 13px;
font-weight: 600;
color: var(--grey-text);
margin-bottom: 6px;
text-transform: uppercase;
letter-spacing: .4px;
}
.a-hint { font-size: 12px; color: var(--grey-text); margin-top: 6px; }


.a-empty {
text-align: center;
color: var(--grey-text);
padding: 40px 16px;
font-size: 15px;
}
.a-loader {
text-align: center;
color: var(--grey-text);
padding: 24px 16px;
font-size: 14px;
}


.a-modal-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,.45);
z-index: 200;
display: flex;
align-items: flex-end;
justify-content: center;
}
.a-modal {
background: var(--white);
border-radius: 22px 22px 0 0;
width: 100%;
max-width: 600px;
max-height: 90dvh;
max-height: 90vh;
display: flex;
flex-direction: column;
overflow: hidden;
}
.a-modal--sm { max-height: 70dvh; max-height: 70vh; border-radius: 22px 22px 0 0; }
.a-modal__head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 18px 18px 14px;
border-bottom: 1px solid var(--grey-border);
flex-shrink: 0;
}
.a-modal__title { font-size: 17px; font-weight: 700; }
.a-modal__close {
background: var(--grey-bg);
border: none;
width: 32px; height: 32px;
border-radius: 50%;
cursor: pointer;
font-size: 16px;
color: var(--grey-text);
display: flex; align-items: center; justify-content: center;
}
.a-modal__body {
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 16px 18px;
}
.a-modal__foot {
flex-shrink: 0;
display: flex;
gap: 10px;
padding: 14px 18px calc(14px + var(--safe-bottom));
border-top: 1px solid var(--grey-border);
flex-wrap: wrap;
}
.a-modal__foot .a-btn { flex: 1; min-width: 0; }


.a-order-section {
font-size: 13px;
font-weight: 700;
color: var(--grey-text);
text-transform: uppercase;
letter-spacing: .5px;
margin: 16px 0 6px;
}
.a-order-row {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 9px 0;
border-bottom: 1px solid var(--grey-border);
font-size: 14px;
gap: 10px;
}
.a-order-row:last-child { border-bottom: none; }
.a-order-row__label { color: var(--grey-text); flex-shrink: 0; }
.a-order-row__val { font-weight: 500; word-break: break-all; text-align: right; }
.a-order-row__edit {
background: none; border: none; cursor: pointer;
color: var(--blue); font-size: 14px; flex-shrink: 0; padding: 0 0 0 6px;
}


.a-inv-summary {
font-size: 12px; font-weight: 600; color: var(--grey-text);
margin-bottom: 10px;
}


.a-slots-list { display: flex; flex-direction: column; gap: 6px; }
.a-slot-row {
display: grid;
grid-template-columns: 10px 56px 1fr auto auto;
align-items: center;
gap: 10px;
background: var(--grey-bg);
border-radius: var(--radius-sm);
padding: 10px 12px;
border: 1.5px solid transparent;
}
.a-slot-row--full { background: #eef1ff; border-color: #d4d9ff; }
.a-slot-row__dot {
width: 10px; height: 10px; border-radius: 50%;
background: var(--grey-border);
flex-shrink: 0;
}
.a-slot-row--full .a-slot-row__dot { background: var(--blue); }
.a-slot-row__num { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
.a-slot-row__info { font-size: 13px; font-weight: 600; color: var(--text); }
.a-slot-row--empty .a-slot-row__info { color: var(--grey-text); font-weight: 400; }
.a-slot-row__pb { font-size: 11px; color: var(--grey-text); font-family: monospace; white-space: nowrap; }
.a-slot-row__push {
height: 30px; padding: 0 14px; font-size: 12px; border-radius: 6px;
background: var(--white); border: 1.5px solid var(--grey-border);
cursor: pointer; font-family: inherit; font-weight: 600; color: var(--text);
white-space: nowrap;
}
.a-slot-row__push:disabled { opacity: .35; cursor: default; }
.a-slot-row--full .a-slot-row__push { border-color: var(--blue); color: var(--blue); }


.a-edit-btn {
display: inline-flex; align-items: center; justify-content: center;
width: 24px; height: 24px; border-radius: 6px;
background: var(--grey-bg); border: 1.5px solid var(--grey-border);
cursor: pointer; color: var(--grey-text); vertical-align: middle; margin-left: 6px;
}
.a-edit-btn:hover { color: var(--blue); border-color: var(--blue); }


.a-copy-btn {
display: inline-flex; align-items: center; justify-content: center;
width: 24px; height: 24px; border-radius: 6px;
background: var(--grey-bg); border: 1.5px solid var(--grey-border);
cursor: pointer; color: var(--grey-text); vertical-align: middle; margin-left: 6px;
transition: color .15s, border-color .15s;
}
.a-copy-btn:hover { color: var(--blue); border-color: var(--blue); }
.a-copy-btn--ok { color: var(--green) !important; border-color: var(--green) !important; }


.a-btn--xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; margin-left: 6px; }


.a-login-bolt {
width: 64px; height: 64px; border-radius: 20px;
background: var(--blue);
display: flex; align-items: center; justify-content: center;
}


.a-qr-fab {
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
z-index: 50;
display: flex;
flex-direction: row;
align-items: center;
gap: 8px;
height: 52px;
padding: 0 24px;
border-radius: 16px;
background: var(--blue);
color: #fff;
border: none;
cursor: pointer;
font-family: inherit;
font-size: 15px;
font-weight: 700;
letter-spacing: .2px;
white-space: nowrap;
}
.a-qr-fab svg { flex-shrink: 0; }
.a-qr-fab:disabled {
  background: var(--grey-border);
  color: var(--grey-text);
  cursor: not-allowed;
  pointer-events: none;
}


.a-qr-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,.7);
z-index: 600;
display: flex;
align-items: flex-end;
justify-content: center;
}
.a-qr-modal {
width: 100%;
max-width: 500px;
background: #111;
border-radius: 20px 20px 0 0;
overflow: hidden;
display: flex;
flex-direction: column;
max-height: 90vh;
}
.a-qr-modal__head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 18px 12px;
color: #fff;
}
.a-qr-modal__title { font-size: 16px; font-weight: 700; }
.a-qr-modal .a-modal__close { color: rgba(255,255,255,.7); background: rgba(255,255,255,.1); border: none; }
.a-qr-modal .a-modal__close:hover { color: #fff; background: rgba(255,255,255,.2); }
.a-qr-modal__body { flex: 1; overflow: hidden; }

.a-qr-video-wrap {
position: relative;
width: 100%;
aspect-ratio: 1;
background: #000;
overflow: hidden;
}
#qr-video {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.a-qr-frame {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
}
.a-qr-frame__corner {
position: absolute;
width: 28px;
height: 28px;
border-color: #fff;
border-style: solid;
}
.a-qr-frame__corner--tl { top: 22%; left: 15%; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.a-qr-frame__corner--tr { top: 22%; right: 15%; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.a-qr-frame__corner--bl { bottom: 22%; left: 15%; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.a-qr-frame__corner--br { bottom: 22%; right: 15%; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

.a-qr-frame__line {
position: absolute;
left: 15%;
width: 70%;
height: 2px;
background: linear-gradient(90deg, transparent, var(--blue), transparent);
animation: qr-scan 2s ease-in-out infinite;
top: 22%;
}
@keyframes qr-scan {
  0%   { top: 22%; opacity: 1; }
  50%  { top: 78%; opacity: 1; }
  100% { top: 22%; opacity: 1; }
}
.a-qr-hint {
position: absolute;
bottom: 14px;
left: 0; right: 0;
text-align: center;
color: rgba(255,255,255,.85);
font-size: 13px;
font-weight: 500;
pointer-events: none;
}

.a-qr-fallback {
padding: 28px 20px;
text-align: center;
background: #111;
}
.a-qr-fallback__text { color: rgba(255,255,255,.7); font-size: 14px; margin-bottom: 16px; }



.a-toast {
position: fixed;
bottom: 14px;
left: 50%;
transform: translateX(-50%) translateY(20px);
background: #1a1a2e;
color: var(--white);
padding: 11px 20px;
border-radius: 24px;
font-size: 14px;
font-weight: 500;
z-index: 300;
opacity: 0;
transition: opacity .25s, transform .25s;
pointer-events: none;
white-space: nowrap;
max-width: calc(100vw - 32px);
text-align: center;
}
.a-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }


.a-login-screen {
position: fixed;
inset: 0;
background: var(--grey-bg);
z-index: 500;
display: flex;
align-items: center;
justify-content: center;
padding: 20px 16px;
}
.a-login-card {
width: 100%;
max-width: 380px;
background: var(--white);
border-radius: 22px;
padding: 32px 24px;
box-shadow: 0 8px 40px rgba(0,0,0,.1);
}
.a-login-logo {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 28px;
gap: 8px;
}
.a-login-title {
font-size: 20px;
font-weight: 700;
color: var(--text);
}
.a-login-phone-row {
display: flex;
align-items: stretch;
border: 1.5px solid var(--grey-border);
border-radius: var(--radius-sm);
overflow: hidden;
transition: border-color .18s;
}
.a-login-phone-row:focus-within { border-color: var(--blue); }
.a-login-phone-prefix {
display: flex;
align-items: center;
padding: 0 12px;
background: var(--grey-bg);
font-size: 15px;
font-weight: 600;
color: var(--text);
border-right: 1.5px solid var(--grey-border);
flex-shrink: 0;
}
.a-login-phone-row .a-input {
flex: 1;
border: none;
border-radius: 0;
}
.a-login-phone-row .a-input:focus { border-color: transparent; }
.a-login-phone-hint {
font-size: 13px;
color: var(--grey-text);
margin-bottom: 14px;
}
.a-login-error {
color: var(--red);
font-size: 13px;
margin-top: 8px;
}


.a-auth-banner {
position: fixed;
inset: 0;
z-index: 500;
display: flex;
align-items: center;
justify-content: center;
background: var(--grey-bg);
padding: 20px;
}
.a-auth-banner__card {
background: var(--white);
border-radius: 22px;
padding: 32px 28px;
max-width: 360px;
width: 100%;
text-align: center;
box-shadow: 0 8px 40px rgba(0,0,0,.1);
}
.a-auth-banner__icon { font-size: 48px; margin-bottom: 12px; }
.a-auth-banner__title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.a-auth-banner__text { font-size: 14px; color: var(--grey-text); }


.a-admin-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  border: 1.5px solid var(--blue);
}
.a-admin-card__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--blue);
  margin-bottom: 6px;
}
.a-admin-card__name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.a-admin-card__row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--grey-text);
  margin-top: 5px;
}
.a-admin-card__row svg { flex-shrink: 0; opacity: .7; }


.a-voice-station { font-size: 13px; font-weight: 600; color: var(--grey-text); margin-bottom: 14px; }
.a-voice-val { font-weight: 700; color: var(--blue); margin-left: 6px; }
.a-voice-slider {
  display: block; width: 100%; height: 4px;
  margin-top: 8px; margin-bottom: 4px;
  accent-color: var(--blue);
  cursor: pointer;
}


@media (display-mode: standalone) {
  .a-bottom-nav {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }
}


@media (min-width: 640px) {
.a-modal-overlay { align-items: center; }
.a-modal {
border-radius: 22px;
max-width: 520px;
width: calc(100% - 32px);
}
.a-modal--sm { max-width: 380px; }

.a-filters { padding: 12px 20px; }
.a-scroll-body { padding: 16px 20px; }

.a-devices-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}


.a-tab-btn { font-size: 15px; }
.a-tab-btn__icon { width: 24px; height: 24px; }
}

@media (min-width: 1024px) {
.a-app { padding-left: 0; }

.a-page {
left: 260px;
}

.a-topbar {
padding: 0 16px;
}

.a-menu-toggle,
.a-nav-backdrop {
display: none;
}

.a-bottom-nav {
transform: none;
width: 260px;
box-shadow: none;
}
}
