/* SpineLab — дизайн-система: світлий iOS-стиль, «скло», біло-сині тони */
:root {
  --blue: #0a84ff; --blue-2: #3d9dff; --blue-3: #6fb6ff; --blue-deep: #0060df;
  --ink: #0b1b33; --ink-2: #2b3c57; --muted: #6b7a92; --line: rgba(20, 60, 140, .10);
  --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .82); --glass-3: rgba(255, 255, 255, .42);
  --ok: #30c46b; --warn: #ff9f0a; --bad: #ff453a; --violet: #7a5cff;
  --r: 22px; --r-sm: 14px; --shadow: 0 10px 40px rgba(16, 66, 160, .10), 0 1px 0 rgba(255,255,255,.9) inset;
  --shadow-sm: 0 4px 18px rgba(16, 66, 160, .08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink); font-size: 15px; line-height: 1.45;
  background: #eef4ff; min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 45% at 8% 6%, rgba(10, 132, 255, .22), transparent 70%),
    radial-gradient(45% 40% at 95% 12%, rgba(120, 190, 255, .28), transparent 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(170, 215, 255, .35), transparent 70%),
    linear-gradient(165deg, #eaf2ff 0%, #f7faff 45%, #edf6ff 100%);
}
body::after {
  content: ""; position: fixed; z-index: -1; width: 420px; height: 420px; right: -140px; top: 30%;
  border-radius: 50%; filter: blur(70px); opacity: .55;
  background: radial-gradient(circle at 30% 30%, #bfe0ff, #7cc0ff 60%, transparent 75%);
  pointer-events: none;
}
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt { margin-top: 12px; } .mt-l { margin-top: 20px; } .mb { margin-bottom: 12px; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Скло --- */
.glass, .card {
  background: var(--glass); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .78); border-radius: var(--r); box-shadow: var(--shadow);
}
.card { padding: 16px; }
.card.pad-s { padding: 12px 14px; }
.card.flat { box-shadow: var(--shadow-sm); }
.card.solid { background: var(--glass-2); }
.card.blue {
  background: linear-gradient(135deg, #0a84ff 0%, #3d9dff 55%, #62b3ff 100%); color: #fff; border-color: rgba(255,255,255,.35);
  box-shadow: 0 14px 40px rgba(10, 132, 255, .35);
}
.card.blue .muted { color: rgba(255,255,255,.8); }
.card.clickable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.card.clickable:active { transform: scale(.985); }
.list { display: flex; flex-direction: column; gap: 10px; }
.tile { border-radius: var(--r-sm); padding: 12px 14px; background: var(--glass-2); border: 1px solid rgba(255,255,255,.8); box-shadow: var(--shadow-sm); }
.tile .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.tile .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tiles.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .tiles.four { grid-template-columns: repeat(2, 1fr); } }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px; padding: 12px 18px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-2) 100%); box-shadow: 0 8px 22px rgba(10, 132, 255, .32);
  transition: transform .12s, box-shadow .12s, opacity .12s; white-space: nowrap;
}
.btn:active { transform: scale(.97); box-shadow: 0 4px 12px rgba(10, 132, 255, .3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.xs { padding: 6px 11px; font-size: 12px; }
.btn.ghost { background: var(--glass-2); color: var(--blue); box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,.9); }
.btn.soft { background: rgba(10, 132, 255, .10); color: var(--blue-deep); box-shadow: none; }
.btn.ok { background: linear-gradient(135deg, #2bbf62, #45d67d); box-shadow: 0 8px 22px rgba(48, 196, 107, .3); }
.btn.warn { background: linear-gradient(135deg, #ff9f0a, #ffb84d); box-shadow: 0 8px 22px rgba(255, 159, 10, .3); }
.btn.bad { background: rgba(255, 69, 58, .10); color: var(--bad); box-shadow: none; }
.btn.icon { padding: 10px; width: 42px; height: 42px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(10, 132, 255, .10); color: var(--blue-deep);
}
.chip.ok { background: rgba(48, 196, 107, .14); color: #1a8f47; }
.chip.warn { background: rgba(255, 159, 10, .16); color: #b46a00; }
.chip.bad { background: rgba(255, 69, 58, .12); color: #c62c22; }
.chip.grey { background: rgba(107, 122, 146, .14); color: var(--muted); }
.chip.violet { background: rgba(122, 92, 255, .12); color: #5a3fd6; }
.badge { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; }

/* --- Поля --- */
.input, textarea.input, select.input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); padding: 12px 14px; border-radius: var(--r-sm);
  border: 1px solid rgba(20, 60, 140, .14); background: rgba(255,255,255,.85); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10,132,255,.15); }
textarea.input { min-height: 90px; resize: vertical; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: .04em; }
.field { margin-bottom: 12px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; background: rgba(120,130,150,.35); cursor: pointer; transition: background .2s; flex: none; }
.switch::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: left .2s; }
.switch.on { background: var(--ok); } .switch.on::after { left: 23px; }

/* --- Сегменти / таби --- */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(20, 60, 140, .08); gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(16,66,160,.12); }

/* --- Прогрес --- */
.bar { height: 10px; border-radius: 5px; background: rgba(20, 60, 140, .10); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--blue), var(--blue-3)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--blue), var(--violet)); flex: none; font-size: 15px; }

/* --- Тост / модалка --- */
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: rgba(11, 27, 51, .92); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 92vw; text-align: center; }
.modal-bg { position: fixed; inset: 0; background: rgba(11, 27, 51, .35); backdrop-filter: blur(6px); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 720px) { .modal-bg { align-items: center; } }
.modal { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: rgba(255,255,255,.92); backdrop-filter: blur(30px); border-radius: 26px 26px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(16,66,160,.2); }
@media (min-width: 720px) { .modal { border-radius: 26px; } }
.modal .grip { width: 40px; height: 5px; border-radius: 3px; background: rgba(20,60,140,.2); margin: -6px auto 12px; }
.stars { display: flex; gap: 6px; }
.stars button { border: 0; background: transparent; font-size: 30px; cursor: pointer; filter: grayscale(1); opacity: .5; transition: transform .1s; padding: 2px; }
.stars button.on { filter: none; opacity: 1; transform: scale(1.1); }
.range { width: 100%; accent-color: var(--blue); }
.skeleton { background: linear-gradient(90deg, rgba(20,60,140,.06), rgba(20,60,140,.12), rgba(20,60,140,.06)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-sm); min-height: 60px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fade { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); } .dot.grey { background: #b8c2d3; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: rgba(10,132,255,.05); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; } .scroll-x::-webkit-scrollbar { display: none; }
::selection { background: rgba(10,132,255,.2); }

/* Бренд SpineLab: кольори логотипа */
:root { --brand-dark: #1d5f81; --brand-light: #6ec4e5; }
.bn-1 { color: var(--brand-dark); } .bn-2 { color: var(--brand-light); }
