.wrap-wide { max-width: 1040px; }

/* ---------- Вход ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
}
.login-card {
  width: 100%; max-width: 410px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 30px; padding: 38px 28px 26px;
}
.logo-lg { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 20px; }
.logo-lg svg { width: 34px; height: 34px; }
.login h1 { margin: 10px 0 8px; font-family: var(--serif); font-size: 36px; font-weight: 500; }
.login p { margin: 0 0 26px; }
.login .btn + .btn { margin-top: 10px; }
.login-wait { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); font-size: 15px; }
.login-err { color: var(--warn); margin: 16px 0 0 !important; font-size: 15px; font-weight: 600; }
.login-steps { list-style: none; text-align: left; margin: 24px 0 0; padding: 6px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.login-steps li { display: flex; gap: 12px; align-items: center; padding: 10px 10px; color: var(--muted); font-size: 14.5px; font-weight: 600; }
.login-steps li span { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 800; }
.login-steps b { color: var(--text); }
.back-link { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 14.5px; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--text); }

/* ---------- Вкладки ---------- */
.tabs { display: flex; gap: 4px; padding-bottom: 12px; }
.tab {
  appearance: none; border: 0; cursor: pointer; background: transparent; color: var(--muted);
  padding: 9px 16px; border-radius: 12px; font-weight: 700; font-size: 15px;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--cream); color: var(--ink); }

/* ---------- Статистика ---------- */
main { padding-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.stat b { display: block; font-family: var(--serif); font-size: 36px; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.stat.accent b { color: var(--accent); }
.stat.warn b { color: var(--warn); }

/* ---------- Фильтры ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.input {
  border: 1px solid var(--line); background: var(--surface); border-radius: 14px;
  min-height: 48px; padding: 0 15px; outline: none; font-size: 16px; font-weight: 600; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--line-strong); }
.input::placeholder { color: var(--faint); }
.search { flex: 1 1 220px; }
.date-f { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.date-f .input { min-width: 150px; }
@media (max-width: 600px) {
  .date-f { flex: 1 1 140px; } .date-f .input { min-width: 0; width: 100%; }
  #csvBtn, #delAllBtn { flex: 1 1 40%; }
}

/* ---------- Список ---------- */
.list { display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 12px 12px 12px 16px; transition: border-color .15s, background .15s;
}
.row.clickable { cursor: pointer; }
.row.clickable:hover { border-color: var(--line-strong); background: var(--surface-2); }
.day { flex: none; width: 54px; height: 54px; border-radius: 16px; background: var(--surface-2); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.day b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.day span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.row-main { flex: 1; min-width: 0; }
.nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--muted); font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 750; }
.badge.late { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.me { background: var(--surface-3); color: var(--text); }

.ring { flex: none; position: relative; width: 50px; height: 50px; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; }
.ring.partial .fg { stroke: var(--warn); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }

.icon-btn {
  flex: none; width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; color: var(--muted);
  display: grid; place-items: center; transition: color .15s, background .15s, border-color .15s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn.del:hover { color: var(--warn); background: var(--warn-soft); border-color: rgba(248, 113, 113, .25); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-weight: 600; }

.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent); font-family: var(--serif); font-weight: 500; font-size: 20px;
  border: 1px solid var(--line);
}

/* ---------- Добавление админа ---------- */
.add-admin {
  display: grid; gap: 14px; margin-bottom: 16px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
}
.add-admin h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 24px; font-weight: 500; }
.add-admin p { margin: 0; font-size: 14.5px; }
.add-row { display: flex; gap: 10px; }
.add-row .input { flex: 1; min-width: 0; }

/* ---------- Детали ---------- */
.detail-dialog { max-width: min(680px, calc(100vw - 24px)); }
.detail { text-align: left; padding: 24px 24px 20px; max-height: calc(100dvh - 40px); overflow: auto; }
.detail-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.detail-head h3 { margin: 0 0 4px !important; }
.detail-head p { margin: 0 !important; font-size: 14.5px; font-weight: 600; }
.d-sec { margin-top: 20px; }
.d-sec h4 { margin: 0 0 6px; font-family: var(--serif); font-size: 19px; color: var(--text); font-weight: 500; }
.d-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; font-weight: 600; }
.d-item:last-child, .d-text:last-child { border-bottom: 0; }
.mark { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 900; margin-top: 1px; }
.mark.y { background: var(--accent); color: var(--accent-ink); }
.mark.n { background: var(--warn-soft); color: var(--warn); }
.d-item.n .lbl { color: var(--warn); }
.d-text { padding: 10px 0; border-bottom: 1px solid var(--line); }
.d-text .lbl { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.d-text .val { white-space: pre-wrap; font-size: 15.5px; font-weight: 600; margin-top: 2px; }
.d-text .val.none { color: var(--faint); }
.detail-foot { margin-top: 22px; display: flex; justify-content: flex-end; }

/* Зона и смена */
.badge.z-bar { background: rgba(217, 173, 124, .12); color: #d9ad7c; }
.badge.z-hookah { background: rgba(185, 176, 216, .13); color: #b9b0d8; }
.badge.sh { background: var(--surface-3); color: var(--muted); }
select.input { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e98' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
select.input option { background: #18181c; }

/* Заголовки админки — Onest */
.login h1, .stat b, .add-admin h2, .day b, .avatar { font-weight: 700; letter-spacing: -.03em; }
.d-sec h4 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }

/* Длинные слова и строки без пробелов переносятся, а не уходят вправо */
.d-text .val, .d-item .lbl, .nm, .detail-head h3, .detail-head p { overflow-wrap: anywhere; word-break: break-word; }
.detail { overflow-x: hidden; }
.detail-head > div { min-width: 0; }

/* Главный админ */
.badge.owner-badge { background: rgba(217, 173, 124, .14); color: #d9ad7c; }
.row.owner { border-color: rgba(217, 173, 124, .25); }
.row.owner .avatar { background: #d9ad7c; color: #1a140d; border-color: transparent; }
.icon-btn.lock { cursor: default; color: #d9ad7c; border-color: rgba(217, 173, 124, .25); background: transparent; }
