/* Мягко и точка — CRM. Мобайл-фёрст, синевато-нейтральная палитра. Без CDN. */
:root{
  --bg:#f3f5f8; --card:#ffffff; --ink:#1c2430; --muted:#6b7688;
  --line:#dde3ec; --blue:#2f6df0; --blue-d:#1f52c4; --blue-l:#eaf1ff;
  --green:#1f9d55; --green-l:#e6f6ec; --amber:#c77700; --amber-l:#fff3e0;
  --red:#d23b3b; --red-l:#fdeaea; --gray:#9aa3b0; --gray-l:#eef1f5;
  --radius:14px; --tap:52px; --shadow:0 1px 3px rgba(20,30,50,.08),0 6px 20px rgba(20,30,50,.05);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:var(--bg); color:var(--ink); font-size:16px; line-height:1.45;
  -webkit-text-size-adjust:100%;
}
a{color:var(--blue); text-decoration:none}
h1,h2,h3{line-height:1.25; margin:0 0 .5em}
h1{font-size:1.4rem} h2{font-size:1.15rem} h3{font-size:1rem}
small{color:var(--muted)}
.muted{color:var(--muted)}

/* ─── Каркас ─── */
.app-header{
  position:sticky; top:0; z-index:20; background:var(--blue); color:#fff;
  display:flex; align-items:center; gap:10px; padding:12px 14px;
  box-shadow:0 2px 8px rgba(31,82,196,.25);
}
.app-header .brand{font-weight:700; font-size:1.05rem; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.app-header .brand a{color:#fff}
.app-header form{margin:0}
.app-header .who{font-size:.8rem; opacity:.85}
.logout-btn{background:rgba(255,255,255,.18); color:#fff; border:0; border-radius:10px;
  min-height:40px; padding:0 12px; font-size:.9rem}

.nav{
  display:flex; gap:6px; overflow-x:auto; background:var(--card); border-bottom:1px solid var(--line);
  padding:8px 10px; position:sticky; top:56px; z-index:15; -webkit-overflow-scrolling:touch;
}
.nav a{
  flex:0 0 auto; min-height:44px; display:flex; align-items:center; gap:6px;
  padding:0 16px; border-radius:22px; background:var(--gray-l); color:var(--ink);
  font-weight:600; font-size:.92rem; white-space:nowrap;
}
.nav a.active{background:var(--blue); color:#fff}

.wrap{max-width:820px; margin:0 auto; padding:14px 14px 96px}

/* ─── Карточки ─── */
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:16px; margin-bottom:14px}
.card > h2:first-child, .card > h3:first-child{margin-top:0}

/* ─── Плитки дашборда ─── */
.tiles{display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-bottom:16px}
.tile{background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:16px 14px; text-align:left; min-height:96px;
  display:flex; flex-direction:column; justify-content:space-between}
.tile .num{font-size:2rem; font-weight:800; line-height:1}
.tile .lbl{font-size:.85rem; color:var(--muted); margin-top:8px}
.tile.b{border-left:5px solid var(--blue)}
.tile.g{border-left:5px solid var(--green)}
.tile.a{border-left:5px solid var(--amber)}
.tile.r{border-left:5px solid var(--red)}
@media(min-width:560px){.tiles{grid-template-columns:repeat(4,1fr)}}

/* ─── Кнопки ─── */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:var(--tap); padding:0 20px; border-radius:12px; border:0; cursor:pointer;
  font-size:1rem; font-weight:700; background:var(--blue); color:#fff; width:100%;
  text-align:center; -webkit-appearance:none; transition:background .12s}
.btn:active{background:var(--blue-d)}
.btn.ghost{background:var(--blue-l); color:var(--blue-d)}
.btn.gray{background:var(--gray-l); color:var(--ink)}
.btn.green{background:var(--green)}
.btn.amber{background:var(--amber)}
.btn.red{background:var(--red)}
.btn.sm{min-height:42px; font-size:.9rem; padding:0 14px; width:auto}
.btn:disabled{opacity:.5}
.btn-row{display:flex; gap:10px; flex-wrap:wrap}
.btn-row .btn{flex:1 1 auto; width:auto}
.fab-new{position:fixed; left:14px; right:14px; bottom:14px; z-index:18; max-width:792px;
  margin:0 auto; box-shadow:0 6px 20px rgba(31,82,196,.35)}

/* ─── Формы ─── */
.field{margin-bottom:14px}
.field > label{display:block; font-weight:600; font-size:.9rem; margin-bottom:6px}
input[type=text],input[type=tel],input[type=password],input[type=number],
input[type=date],input[type=datetime-local],select,textarea{
  width:100%; min-height:var(--tap); padding:12px 14px; font-size:1rem;
  border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--ink);
  -webkit-appearance:none; appearance:none}
textarea{min-height:80px; resize:vertical}
input:focus,select,textarea:focus{outline:2px solid var(--blue-l); border-color:var(--blue)}
.row2{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.hint{font-size:.8rem; color:var(--muted); margin-top:4px}
.err{color:var(--red); font-size:.9rem; margin-top:4px}

/* Радио/чек как крупные тапабельные плитки */
.opt{display:flex; align-items:center; gap:10px; min-height:var(--tap);
  padding:8px 14px; border:1px solid var(--line); border-radius:12px; background:#fff; margin-bottom:8px}
.opt input{width:22px; height:22px; margin:0; flex:0 0 auto}
.opt.selected{border-color:var(--blue); background:var(--blue-l)}
.radios{display:flex; flex-direction:column; gap:0}

/* Тумблер */
.switch{display:inline-flex; align-items:center; gap:10px; cursor:pointer; min-height:var(--tap)}
.switch input{display:none}
.switch .track{width:52px; height:30px; border-radius:16px; background:var(--gray); position:relative; transition:.15s; flex:0 0 auto}
.switch .track::after{content:""; position:absolute; top:3px; left:3px; width:24px; height:24px;
  border-radius:50%; background:#fff; transition:.15s}
.switch input:checked + .track{background:var(--green)}
.switch input:checked + .track::after{left:25px}

/* ─── Плитки коек (выбор места) ─── */
.beds-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:10px}
.bed-tile{border:2px solid var(--line); border-radius:12px; padding:10px; text-align:center;
  min-height:70px; display:flex; flex-direction:column; justify-content:center; cursor:pointer; background:#fff}
.bed-tile .bt-name{font-weight:700; font-size:.9rem}
.bed-tile .bt-sub{font-size:.75rem; color:var(--muted)}
.bed-tile.occupied{background:var(--gray-l); color:var(--gray); cursor:not-allowed; opacity:.7}
.bed-tile.selected{border-color:var(--blue); background:var(--blue-l)}
.room-group{margin-bottom:12px}
.room-group .rg-title{font-size:.85rem; font-weight:700; color:var(--muted); margin:0 0 8px}

/* ─── Тариф-превью ─── */
.quote{background:var(--blue-l); border-radius:12px; padding:14px; display:grid; gap:6px}
.quote .qline{display:flex; justify-content:space-between; font-size:.95rem}
.quote .qtotal{font-size:1.5rem; font-weight:800; color:var(--blue-d)}
.badge{display:inline-block; background:var(--green-l); color:var(--green); border-radius:8px;
  padding:2px 8px; font-size:.75rem; font-weight:700}

/* ─── Списки/таблицы ─── */
.list{display:flex; flex-direction:column; gap:10px}
.list-item{display:flex; align-items:center; gap:12px; padding:12px 14px; background:var(--card);
  border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); min-height:56px}
.list-item .li-main{flex:1; min-width:0}
.list-item .li-title{font-weight:700}
.list-item .li-sub{font-size:.83rem; color:var(--muted)}
.tbl{width:100%; border-collapse:collapse; font-size:.92rem}
.tbl th,.tbl td{padding:10px 8px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle}
.tbl th{font-size:.78rem; color:var(--muted); text-transform:uppercase; letter-spacing:.03em}
.tbl-scroll{overflow-x:auto; -webkit-overflow-scrolling:touch}

/* Статус-чипы */
.chip{display:inline-block; padding:3px 10px; border-radius:20px; font-size:.78rem; font-weight:700}
.chip.active,.chip.checked_in,.chip.paid,.chip.confirmed{background:var(--green-l); color:var(--green)}
.chip.maintenance,.chip.pending,.chip.draft{background:var(--amber-l); color:var(--amber)}
.chip.disabled,.chip.cancelled,.chip.rejected,.chip.checked_out{background:var(--gray-l); color:var(--muted)}

/* Флеш-сообщения */
.flash{padding:12px 14px; border-radius:12px; margin-bottom:14px; font-weight:600}
.flash.ok{background:var(--green-l); color:var(--green)}
.flash.error{background:var(--red-l); color:var(--red)}

/* ─── Копирование по тапу ─── */
.copy{cursor:pointer; user-select:all; position:relative}
.copy.copied::after{content:"скопировано ✓"; position:absolute; left:0; top:-22px;
  font-size:.72rem; background:var(--ink); color:#fff; padding:2px 8px; border-radius:6px}

/* ─── Модалка ─── */
.modal-back{position:fixed; inset:0; background:rgba(15,22,35,.55); z-index:50;
  display:flex; align-items:flex-end; justify-content:center; padding:14px}
.modal{background:#fff; border-radius:18px 18px 12px 12px; width:100%; max-width:520px;
  padding:20px; box-shadow:0 -6px 30px rgba(0,0,0,.25)}
.modal h3{margin-top:0}
@media(min-width:560px){.modal-back{align-items:center}.modal{border-radius:18px}}

/* ─── QR ─── */
.qr-box{display:flex; flex-direction:column; align-items:center; gap:8px; padding:12px}
.qr-box canvas{width:200px; height:200px; image-rendering:pixelated; background:#fff; border-radius:12px; border:1px solid var(--line)}

/* ─── Логин ─── */
.login-screen{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; background:var(--blue)}
.login-card{background:#fff; border-radius:18px; padding:26px 22px; width:100%; max-width:380px; box-shadow:0 12px 40px rgba(0,0,0,.25)}
.login-card h1{text-align:center; margin-bottom:4px}
.login-card .sub{text-align:center; color:var(--muted); margin-bottom:20px}

/* ─── Гостевая ─── */
.guest{max-width:520px; margin:0 auto; padding:18px 16px 60px}
.guest .hero{text-align:center; padding:22px 0}
.guest .hero h1{font-size:1.6rem}
.pin-big{font-size:3rem; font-weight:900; letter-spacing:.12em; text-align:center; color:var(--blue-d);
  background:var(--blue-l); border-radius:16px; padding:18px; margin:10px 0; cursor:pointer}
.wifi-line{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line)}
.wifi-line b{font-size:1.05rem}
.rules{white-space:pre-line; line-height:1.6}

.center{text-align:center}
.mt{margin-top:14px} .mb{margin-bottom:14px}
.spread{display:flex; justify-content:space-between; align-items:center; gap:10px}
img.thumb{width:100%; max-width:100%; border-radius:12px; border:1px solid var(--line); display:block}
