/* Только светлая схема. Дублирует meta color-scheme для тех, кто его игнорирует.
   `only light` — спец-сигнал «не переопределять»; объявлен вторым, чтобы браузер
   без поддержки `only` отбросил лишь его и остался на `light`. */
:root{color-scheme:light;color-scheme:only light}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;height:100%;overflow:hidden}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  background:#f1f5f9;color:#0f172a;font-size:17px;line-height:1.4;
}

/* Вход */
.login{position:fixed;inset:0;z-index:200;background:#0f172a;display:flex;align-items:center;justify-content:center;color:#fff}
.login-box{background:#1e293b;border-radius:16px;padding:44px 48px;box-shadow:0 20px 60px rgba(0,0,0,.5);text-align:center;min-width:440px}
.login-title{font-size:26px;font-weight:700;margin-bottom:6px;letter-spacing:.3px}
.login-sub{color:#94a3b8;font-size:15px;margin-bottom:28px}
/* Нативный type="password": точки рисует браузер, без хака -webkit-text-security
   (его не знает Firefox — пароль показывался открыто). Селектор input.login-input,
   чтобы глобальные правила для input не перебивали фон и рамку. */
input.login-input{width:100%;padding:16px 18px;font-size:22px;border:2px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;outline:none;font-family:inherit;letter-spacing:4px;-webkit-text-fill-color:#0f172a}
input.login-input:-webkit-autofill,input.login-input:-webkit-autofill:hover,input.login-input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 100px #fff inset !important;-webkit-text-fill-color:#0f172a !important}
input.login-input::placeholder{color:#94a3b8;letter-spacing:normal}
input.login-input:focus{border-color:#22c55e}
.login-btn{width:100%;padding:16px;margin-top:14px;background:#22c55e;color:#fff;border:none;border-radius:10px;font-size:18px;font-weight:600;font-family:inherit;cursor:pointer}
.login-btn:hover{background:#16a34a}
.login-err{color:#f87171;font-size:14px;margin-top:12px;height:20px}

/* Плитка */
.tiles-screen{position:fixed;inset:0;z-index:180;background:#f1f5f9;display:flex;flex-direction:column;padding:24px 40px}
.tiles-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.tiles-title{font-size:22px;font-weight:700;display:flex;align-items:baseline;gap:8px;color:#0f172a}
.tiles-hint{text-align:center;font-size:22px;color:#334155;margin-bottom:24px;font-weight:600}
.tiles-grid{display:grid;gap:18px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));align-content:start}
.tile{background:#fff;border-radius:14px;padding:32px 20px;box-shadow:0 2px 6px rgba(0,0,0,.05);cursor:pointer;text-align:center;transition:.15s;border:3px solid transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:170px}
.tile:hover{transform:translateY(-3px);box-shadow:0 10px 20px rgba(0,0,0,.08);border-color:#22c55e}
.tile-avatar{width:64px;height:64px;border-radius:50%;background:#3b82f6;color:#fff;font-size:24px;font-weight:700;display:flex;align-items:center;justify-content:center;margin-bottom:12px}
.tile-name{font-size:20px;font-weight:700;color:#0f172a}
.btn-top-light{background:#fff;border:1px solid #cbd5e1;padding:10px 16px;border-radius:10px;color:#475569;cursor:pointer;font-family:inherit;font-size:14px}
.btn-top-light:hover{background:#f8fafc}

/* Касса */
.app{display:flex;flex-direction:column;height:100vh;padding:12px 20px 16px;gap:12px;max-width:1200px;margin:0 auto;width:100%}
.topbar{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;gap:12px;background:#0f172a;color:#fff;padding:12px 20px;border-radius:14px;box-shadow:0 2px 8px rgba(15,23,42,.15)}
.brand{font-size:17px;font-weight:600;color:#e2e8f0;display:flex;align-items:baseline;gap:8px}
.shift-badge{flex:1;padding:0 20px;display:flex;align-items:center;justify-content:space-between}
.shift-name{font-size:18px;font-weight:600;color:#e2e8f0}
.shift-name .who{color:#94a3b8;font-weight:500;font-size:14px;margin-right:8px}
.stat-chip{background:#1e293b;padding:10px 18px;border-radius:10px;font-weight:600;color:#e2e8f0;cursor:pointer;border:1px solid #334155;font-size:14px}
.stat-chip:hover{background:#334155;border-color:#475569}
.stat-chip .label{color:#94a3b8;font-weight:500;margin-right:6px}
.stat-chip span:not(.label){color:#4ade80;font-weight:700}
.btn-top{background:#1e293b;border:1px solid #334155;padding:10px 16px;border-radius:10px;color:#e2e8f0;cursor:pointer;font-family:inherit;font-size:14px}
.btn-top:hover{background:#334155;border-color:#475569}

.client-bar{background:#fff;border-radius:12px;padding:14px 22px;box-shadow:0 1px 3px rgba(0,0,0,.05);display:flex;align-items:center;gap:32px;flex-shrink:0;border-left:4px solid #22c55e}
.cb-left{display:flex;align-items:baseline;gap:10px;flex-shrink:0}
.cb-label{font-size:13px;color:#64748b;text-transform:uppercase;letter-spacing:1px;font-weight:600}
.cb-name{font-size:20px;font-weight:700;color:#0f172a}
.cb-stat{display:flex;flex-direction:column;min-width:0}
.cb-stat-label{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:1px;font-weight:600;margin-bottom:2px}
.cb-stat-value{font-size:17px;font-weight:700;color:#0f172a;font-variant-numeric:tabular-nums}
.cb-highlight{color:#059669}

/* Прогресс */
.wizard-progress{display:flex;gap:8px;flex-shrink:0;background:#fff;border-radius:12px;padding:10px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.step-chip{flex:1;display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:8px;background:#f8fafc;color:#94a3b8}
.step-chip.done{background:#dcfce7;color:#166534}
.step-chip.active{background:#dbeafe;color:#1e40af;font-weight:600}
.step-num{width:26px;height:26px;border-radius:50%;background:#cbd5e1;color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;flex-shrink:0}
.step-chip.done .step-num{background:#22c55e}
.step-chip.active .step-num{background:#3b82f6}
.step-label{font-size:15px}
.step-hint{font-size:12px;opacity:.8;margin-top:1px}

/* Тело */
.wizard-body{flex:1;min-height:0;background:#fff;border-radius:14px;padding:24px 28px;box-shadow:0 1px 3px rgba(0,0,0,.05);display:flex;flex-direction:column;overflow:auto}
.step-title{font-size:24px;font-weight:700;color:#0f172a;margin-bottom:4px}
.step-sub{font-size:15px;color:#64748b;margin-bottom:24px}

label{display:block;font-size:15px;font-weight:600;margin-bottom:8px;color:#334155}
input[type=tel],input[type=number],input[type=text]{width:100%;padding:16px 18px;font-size:22px;font-family:inherit;border:2px solid #cbd5e1;border-radius:12px;background:#fff;outline:none;font-variant-numeric:tabular-nums}
input:focus{border-color:#2563eb}

.btn{display:inline-block;padding:14px 24px;font-size:16px;font-weight:600;font-family:inherit;border:none;border-radius:10px;cursor:pointer;text-align:center;transition:.15s}
.btn-primary{background:#2563eb;color:#fff}
.btn-primary:hover{background:#1d4ed8}
.btn-success{background:#16a34a;color:#fff}
.btn-success:hover{background:#15803d}
.btn-ghost{background:#f1f5f9;color:#334155;border:1px solid #cbd5e1}
.btn-ghost:hover{background:#e2e8f0}
.btn-lg{padding:18px 32px;font-size:18px}
.btn-block{display:block;width:100%}

.row-2col{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.row-2col-3-2{display:grid;grid-template-columns:3fr 2fr;gap:24px}

.info-row{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-top:1px solid #e2e8f0;font-size:15px}
.info-row:first-of-type{border-top:none;padding-top:0}
.info-row .label{color:#64748b}
.info-row .value{font-weight:700;color:#0f172a;font-variant-numeric:tabular-nums}
.info-row .value.big{font-size:18px}
.level{display:inline-block;padding:3px 10px;border-radius:999px;background:#fef3c7;color:#92400e;font-weight:700;font-size:13px}

.hint{padding:16px 18px;border-radius:12px;margin-bottom:16px;border:2px solid}
.hint-title{font-size:18px;font-weight:700;margin-bottom:6px}
.hint-body{font-size:14px;line-height:1.5}
.hint.review{background:#fef9c3;border-color:#eab308;color:#713f12}
.hint.new{background:#dbeafe;border-color:#3b82f6;color:#1e3a8a}
.hint.warn{background:#fee2e2;border-color:#ef4444;color:#7f1d1d}

.script{background:#fff;border:2px dashed #94a3b8;border-radius:10px;padding:12px 14px;margin-top:10px;font-size:14px;line-height:1.5;color:#334155;font-style:italic}
.script b{color:#0f172a;font-style:normal}

.platform-btn{padding:20px 12px;border-radius:12px;border:3px solid #cbd5e1;background:#fff;font-size:17px;font-weight:700;cursor:pointer;font-family:inherit;text-align:center;color:#334155;display:block;width:100%;margin-bottom:10px}
.platform-btn.selected{border-color:#16a34a;background:#dcfce7;color:#14532d}
.platform-btn:disabled{opacity:.5;cursor:not-allowed;background:#f8fafc}
.platform-btn .sub{display:block;font-size:13px;font-weight:400;color:#64748b;margin-top:3px}
.platform-btn.selected .sub{color:#14532d}

.review-summary{background:#f0fdf4;border:2px solid #22c55e;border-radius:12px;padding:18px 22px;display:flex;justify-content:space-between;align-items:center;gap:16px}
.review-summary-title{font-size:18px;font-weight:700;color:#14532d;margin-bottom:8px}
.review-summary-line{font-size:15px;color:#166534;line-height:1.5}
.review-summary-line b{color:#0f172a;font-weight:700}

.pay-toggle{display:grid;grid-template-columns:1fr;gap:10px}
.pay-opt{background:#fff;border:2px solid #cbd5e1;border-radius:12px;padding:16px 20px;cursor:pointer;font-family:inherit;text-align:left;transition:.15s}
.pay-opt:hover{background:#f8fafc}
.pay-opt.active{border-color:#22c55e;background:#f0fdf4;box-shadow:0 0 0 3px rgba(34,197,94,.15)}
.pay-opt-label{font-size:17px;font-weight:700;color:#0f172a;margin-bottom:4px}
.pay-opt-sub{font-size:14px;color:#64748b}
.pay-opt.active .pay-opt-sub{color:#166534;font-weight:500}

.promo-inline{font-family:monospace;color:#0f172a;padding:4px 12px;border-radius:6px;letter-spacing:6px;font-size:20px;font-weight:800;cursor:copy;user-select:all;background:#f1f5f9;border:1px dashed #94a3b8}
.promo-inline:hover{background:#e2e8f0}

.receipt-summary{background:#f8fafc;border-radius:12px;padding:16px 20px;border:1px solid #e2e8f0}

.wizard-actions{display:flex;justify-content:space-between;align-items:center;padding-top:20px;margin-top:20px;border-top:1px solid #e2e8f0;flex-shrink:0}

/* Модалки */
.modal-overlay{position:fixed;inset:0;z-index:150;background:rgba(15,23,42,.6);display:flex;align-items:center;justify-content:center}
.modal-box{background:#fff;padding:32px 40px;border-radius:16px;text-align:center;min-width:440px;max-width:640px;max-height:90vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.3);position:relative}
.modal-title{font-size:22px;font-weight:700;color:#0f172a;margin-bottom:8px}
.modal-body{font-size:16px;color:#475569;margin-bottom:20px;line-height:1.5}
.modal-timer{color:#94a3b8;font-size:13px;margin-top:10px}
.modal-close{position:absolute;top:16px;right:16px;background:none;border:none;font-size:22px;cursor:pointer;color:#94a3b8;width:32px;height:32px}


.hidden{display:none !important}

/* Админка */
.admin{display:grid;grid-template-columns:230px 1fr;height:100vh}
.admin-nav{background:#0f172a;color:#fff;padding:16px 0;display:flex;flex-direction:column}
.admin-brand{padding:0 18px 18px;font-size:16px;font-weight:700;border-bottom:1px solid #1e293b}
.admin-brand small{display:block;color:#64748b;font-weight:500;font-size:12px;margin-top:2px}
.admin-menu{display:flex;flex-direction:column;padding-top:12px;flex:1}
.admin-menu button{background:none;border:none;color:#cbd5e1;padding:12px 18px;text-align:left;cursor:pointer;font-family:inherit;font-size:14px;border-left:3px solid transparent}
.admin-menu button:hover{background:#1e293b;color:#fff}
.admin-menu button.active{background:#1e40af;color:#fff;font-weight:600;border-left-color:#22c55e}
.admin-nav-bottom{padding:14px 18px;border-top:1px solid #1e293b}
.admin-nav-bottom button{width:100%;background:#dc2626;color:#fff;border:none;padding:10px;border-radius:8px;cursor:pointer;font-family:inherit;font-size:14px}
.admin-main{padding:22px 30px;overflow:auto;background:#f8fafc}
.admin-page-title{font-size:24px;font-weight:700;margin-bottom:18px}

.period-tabs{display:flex;gap:8px;margin-bottom:20px}
.period-tab{background:#fff;border:1px solid #cbd5e1;padding:8px 16px;border-radius:8px;cursor:pointer;font-family:inherit;font-size:14px;color:#475569}
.period-tab.active{background:#2563eb;color:#fff;border-color:#2563eb}
.widgets-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.widget{background:#fff;border-radius:12px;padding:18px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.widget-title{font-size:12px;color:#64748b;text-transform:uppercase;letter-spacing:1px;margin-bottom:6px;font-weight:600}
.widget-value{font-size:28px;font-weight:800;color:#0f172a;font-variant-numeric:tabular-nums;letter-spacing:-.5px}
.widget-sub{font-size:13px;color:#64748b;margin-top:4px}
.widget-list{margin-top:8px}
.widget-list-item{display:flex;justify-content:space-between;padding:6px 0;border-top:1px solid #f1f5f9;font-size:13px}
.widget-list-item:first-child{border-top:none}

.table-wrap{background:#fff;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.05);overflow:auto}
table{width:100%;border-collapse:collapse}
/* Журнал в админке — таблица с inline-цветами; страховка, если браузер
   в auto-dark-mode игнорирует inline-стили, но уважает color-scheme. */
table,th,td{color-scheme:light !important}
th{text-align:left;padding:12px 16px;font-size:12px;text-transform:uppercase;color:#64748b;letter-spacing:1px;border-bottom:1px solid #e2e8f0;background:#f8fafc;font-weight:600}
td{padding:12px 16px;border-bottom:1px solid #f1f5f9;font-size:14px}
tr:last-child td{border-bottom:none}
tr:hover td{background:#f8fafc}
.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px}
.status-dot.on{background:#22c55e}
.status-dot.off{background:#94a3b8}
.row-actions{display:flex;gap:6px}
.row-btn{background:#f1f5f9;color:#475569;border:none;padding:6px 12px;border-radius:6px;cursor:pointer;font-family:inherit;font-size:13px}
.row-btn:hover{background:#e2e8f0}
.row-btn.pay{background:#dcfce7;color:#166534}
.row-btn.pay:hover{background:#bbf7d0}
.row-btn.danger{background:#fee2e2;color:#991b1b}
.row-btn.danger:hover{background:#fecaca}

.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;gap:12px;flex-wrap:wrap}
.btn-add{background:#22c55e;color:#fff;border:none;padding:10px 18px;border-radius:8px;font-family:inherit;font-size:14px;font-weight:600;cursor:pointer}
.btn-add:hover{background:#16a34a}


.form-row{margin-bottom:14px}
.form-row label{font-size:13px;color:#475569;font-weight:600;margin-bottom:5px}
.form-row input,.form-row select{width:100%;padding:11px 14px;font-size:15px;border:1px solid #cbd5e1;border-radius:8px;font-family:inherit}
.toggle{display:flex;align-items:center;gap:12px;font-size:14px}
.toggle input[type=checkbox]{width:auto}
.settings-section{background:#fff;padding:20px;border-radius:12px;margin-bottom:14px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.settings-section h3{margin:0 0 12px;font-size:15px}

/* Тосты и состояния загрузки */
.toast-wrap{position:fixed;top:16px;right:16px;z-index:300;display:flex;flex-direction:column;gap:8px}
.toast{background:#0f172a;color:#fff;padding:12px 18px;border-radius:10px;box-shadow:0 8px 24px rgba(15,23,42,.25);font-size:14px;max-width:380px;border-left:4px solid #22c55e;animation:toast-in .16s ease-out}
.toast.err{border-left-color:#ef4444}
.toast.warn{border-left-color:#eab308}
@keyframes toast-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}

.btn[disabled],.btn-add[disabled],.login-btn[disabled]{opacity:.6;cursor:progress}
.loading{padding:40px;text-align:center;color:#94a3b8;font-size:15px}
.queued-note{background:#fef9c3;border:2px solid #eab308;color:#713f12;border-radius:10px;padding:10px 14px;font-size:14px;margin-bottom:12px}
.empty{padding:24px;text-align:center;color:#94a3b8}
