:root {
  --bg: #f4f5f7;
  --bg-soft: #eef0f3;
  --card: #ffffff;
  --text: #141414;
  --muted: #8b8f98;
  --line: #eceef2;
  --green: #1b4332;
  --green-2: #2d6a4f;
  --green-soft: #95d5b2;
  --green-soft-2: #d8f3dc;
  --green-chip: #ebf7ef;
  --warn-bg: #fff4e5;
  --warn-text: #c47a12;
  --danger-bg: #fdeceb;
  --danger-text: #d6453d;
  --shadow: 0 10px 30px rgba(20, 20, 20, 0.04);
  --shadow-sm: 0 4px 14px rgba(20, 20, 20, 0.03);
  --radius: 24px;
  --radius-sm: 16px;
  --sidebar: 248px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.error { color: var(--danger-text); min-height: 1.1em; font-size: 13px; margin: 10px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.45; }

/* ========== LOGIN ========== */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(149, 213, 178, 0.28), transparent 60%),
    radial-gradient(700px 480px at 100% 100%, rgba(27, 67, 50, 0.08), transparent 55%),
    var(--bg);
}
.login-box {
  width: min(400px, 100%);
  background: var(--card);
  border-radius: 28px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  border: 1px solid #eceff3;
  display: flex;
  flex-direction: column;
}
.login-logo {
  justify-content: center;
  padding: 0 0 18px;
}
.login-box h2 {
  margin: 0 0 20px;
  font-size: 26px;
  letter-spacing: -0.03em;
  text-align: center;
}
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field input {
  width: 100%;
  padding-right: 48px;
}
.eye-btn {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.eye-btn:hover { color: var(--text); background: #f3f4f6; }
.eye-btn svg { width: 20px; height: 20px; }
.login-credit {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
}

/* ========== SHELL ========== */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  background: var(--bg);
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green);
  color: #fff;
  flex: 0 0 auto;
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-text { font-weight: 800; font-size: 20px; letter-spacing: -0.04em; }

.nav-group { display: grid; gap: 4px; margin-bottom: 14px; }
.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #b0b4bc;
  padding: 8px 12px 6px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #f3f4f6; color: var(--text); }
.nav-item.active {
  background: transparent;
  color: var(--text);
  font-weight: 700;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px; bottom: 8px;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: var(--green);
}
.nav-ico {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  color: inherit;
}
.nav-ico svg { width: 18px; height: 18px; }
.nav-badge {
  margin-left: auto;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
}

.sidebar-promo {
  margin-top: auto;
  border-radius: 22px;
  padding: 20px 18px;
  background: linear-gradient(160deg, #0f2a22, #1b4332 55%, #245c44);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.promo-waves, .dark-waves {
  position: absolute; inset: 0;
  background:
    radial-gradient(120px 80px at 80% 20%, rgba(149,213,178,.35), transparent 70%),
    radial-gradient(140px 100px at 20% 90%, rgba(45,106,79,.55), transparent 70%),
    repeating-linear-gradient(115deg, transparent 0 10px, rgba(255,255,255,.03) 10px 12px);
  pointer-events: none;
}
.sidebar-promo strong, .sidebar-promo p, .sidebar-promo .btn { position: relative; z-index: 1; }
.sidebar-promo strong { display: block; font-size: 15px; margin-bottom: 6px; }
.sidebar-promo p { margin: 0 0 14px; font-size: 12px; color: rgba(255,255,255,.7); line-height: 1.4; }

.main-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 8px;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eceff3;
  border-radius: 999px;
  padding: 11px 16px;
  color: var(--muted);
}
.search svg { width: 18px; height: 18px; flex: 0 0 auto; }
.search input {
  border: 0; outline: 0; background: transparent;
  width: 100%; color: var(--text); font-size: 14px;
}
.search kbd {
  font-size: 11px;
  color: #9aa0a8;
  background: #fff;
  border-radius: 8px;
  padding: 4px 7px;
  border: 1px solid #e4e7ec;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  z-index: 40;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(20, 20, 20, 0.1);
  padding: 8px;
  max-height: 340px;
  overflow: auto;
}
.search-hit {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.search-hit:hover, .search-hit:focus {
  background: #f3f5f7;
  outline: none;
}
.search-hit strong { display: block; font-size: 13px; margin-bottom: 2px; }
.search-hit span { display: block; font-size: 11px; color: var(--muted); }
.search-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid #e7e9ee;
  background: #fff;
  display: grid; place-items: center;
  cursor: pointer; color: #5b616b;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: #cfe3d7; color: var(--green); }
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c1121f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid #fff;
  line-height: 1;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  z-index: 50;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(20, 20, 20, 0.12);
  overflow: hidden;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #eef1f4;
}
.notif-head strong { font-size: 13px; }
.notif-head-actions { display: flex; gap: 10px; }
.link-btn {
  border: 0; background: transparent;
  color: var(--green);
  font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 0;
}
.link-btn:hover { text-decoration: underline; }
.notif-list {
  max-height: 340px;
  overflow: auto;
  padding: 8px;
}
.notif-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  border: 0;
  width: 100%;
  text-align: left;
  background: transparent;
  font: inherit;
  color: var(--text);
}
.notif-item:hover { background: #f3f7f4; }
.notif-item.unread { background: #eef7f1; }
.notif-item .notif-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
}
.notif-item strong { font-size: 13px; display: block; }
.notif-item p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.notif-item .notif-time {
  font-size: 11px;
  color: #9aa0a8;
}
.profile {
  display: flex; align-items: center; gap: 10px;
  padding-left: 6px;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(145deg, #95d5b2, #1b4332);
  color: #fff; font-weight: 800;
  display: grid; place-items: center;
}
.profile strong { display: block; font-size: 13px; line-height: 1.2; }
.profile span { display: block; font-size: 11px; color: var(--muted); }
.profile-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.content { padding: 8px 28px 28px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 8px 0 18px;
}
.page-head h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.045em;
  font-weight: 800;
}
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* buttons */
.btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 11px 18px;
  transition: transform .12s ease, opacity .12s ease, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--green); color: #fff; }
.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid #e3e6ec;
}
.btn-light { background: #fff; color: var(--green); }
.btn-sm { padding: 8px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-ok { background: var(--green-chip); color: var(--green); }
.btn-danger { background: var(--danger-bg); color: var(--danger-text); }

/* cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid #f0f1f4;
  padding: 20px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.card-head.light h3 { color: #fff; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f0f1f4;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-card--primary {
  background: linear-gradient(160deg, #16382c, #1b4332 60%, #245c44);
  color: #fff;
  border: 0;
}
.stat-card--primary .stat-foot { color: rgba(255,255,255,.75); }
.stat-card--primary .stat-top span { color: rgba(255,255,255,.75); }
.stat-top {
  display: flex; justify-content: space-between; gap: 10px;
}
.stat-top span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
}
.stat-top strong {
  font-size: 34px;
  letter-spacing: -0.05em;
  font-weight: 800;
  line-height: 1;
}
.stat-arrow {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.7);
  cursor: default;
  color: var(--text);
}
.stat-card--primary .stat-arrow {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.18);
  color: #fff;
}
.stat-foot {
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.stat-foot.up { color: var(--green-2); font-weight: 600; }
.stat-foot .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-soft);
  display: inline-block;
}

.grid-mid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr 0.95fr;
  gap: 14px;
  margin-bottom: 14px;
}
.grid-bot {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 0.9fr;
  gap: 14px;
}

.bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 10px;
  height: 190px;
  padding: 8px 4px 0;
}
.bars.tall { height: 260px; }
.bar-col {
  display: grid;
  gap: 8px;
  align-content: end;
  height: 100%;
}
.bar {
  width: 100%;
  border-radius: 999px;
  min-height: 18px;
  background: var(--green);
}
.bar.soft { background: var(--green-soft); }
.bar.stripe {
  background: repeating-linear-gradient(
    -45deg,
    #d7dbe3,
    #d7dbe3 4px,
    #eef0f4 4px,
    #eef0f4 8px
  );
}
.bar-day {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.bars-legend, .gauge-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.lg {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: 6px; vertical-align: middle;
}
.lg.dark { background: var(--green); }
.lg.soft { background: var(--green-soft); }
.lg.stripe {
  background: repeating-linear-gradient(-45deg, #cfd4dc, #cfd4dc 2px, #e8ebf0 2px, #e8ebf0 4px);
}

.reminder {
  display: flex; gap: 12px; align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: #f7f8fa;
  margin-bottom: 16px;
}
.reminder-ico {
  width: 44px; height: 44px; border-radius: 14px;
  background: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-sm); font-size: 18px;
}
.reminder strong { display: block; font-size: 14px; margin-bottom: 4px; }
.reminder p { margin: 0; color: var(--muted); font-size: 12px; }

.mini-list, .team-list, .data-list { display: grid; gap: 10px; }
.mini-item, .team-item, .data-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
}
.mini-item:hover, .team-item:hover, .data-item:hover { background: #f7f8fa; }
.mini-ico, .team-ava {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 13px;
}
.mini-item strong, .team-item strong, .data-item strong {
  display: block; font-size: 13px; margin-bottom: 2px;
}
.mini-item span, .team-item span, .data-item span {
  display: block; font-size: 11px; color: var(--muted);
}
.badge {
  display: inline-flex; align-items: center;
  padding: 6px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge.ok { background: var(--green-chip); color: var(--green); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.bad { background: var(--danger-bg); color: var(--danger-text); }
.badge.muted { background: #f1f2f5; color: #6b7280; }
.badge.blue { background: #e8f1ff; color: #2f6fed; }

.progress-card { text-align: center; }
.gauge-wrap { position: relative; margin: 8px auto 0; width: 220px; }
.gauge { width: 220px; height: 130px; overflow: visible; }
.gauge-track {
  fill: none; stroke: #e8ebf0; stroke-width: 18;
  stroke-linecap: round;
}
.gauge-fill {
  fill: none; stroke: var(--green); stroke-width: 18;
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  transition: stroke-dashoffset .6s ease;
}
.gauge-mid {
  fill: none; stroke: var(--green-soft); stroke-width: 18;
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  transition: stroke-dashoffset .6s ease;
}
.gauge-label {
  position: absolute; left: 0; right: 0; bottom: 8px;
}
.gauge-label strong {
  display: block; font-size: 28px; letter-spacing: -0.04em;
}
.gauge-label span { color: var(--muted); font-size: 12px; }
.gauge-legend { justify-content: center; }

.dark-card {
  background: linear-gradient(160deg, #0f2a22, #1b4332 55%, #245c44);
  color: #fff;
  border: 0;
  position: relative;
  overflow: hidden;
  min-height: 260px;
  transition: background .35s ease, box-shadow .35s ease;
}
.dark-card--off {
  background: linear-gradient(160deg, #5c1010, #a61b1b 50%, #c62828);
  box-shadow: 0 12px 36px rgba(166, 27, 27, 0.28);
}
.dark-card--off .dark-waves {
  background:
    radial-gradient(120px 80px at 80% 20%, rgba(255, 180, 180, .28), transparent 70%),
    radial-gradient(140px 100px at 20% 90%, rgba(80, 10, 10, .5), transparent 70%),
    repeating-linear-gradient(115deg, transparent 0 10px, rgba(255,255,255,.04) 10px 12px);
}
.dark-card > *:not(.dark-waves) { position: relative; z-index: 1; }
.circle-btn.play-start {
  background: #30d158;
  color: #0b2a14;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(48, 209, 88, 0.45);
}
.circle-btn.play-start:hover {
  background: #3de06a;
}
.timer-value {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin: 18px 0 8px;
}
.timer-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  color: rgba(255,255,255,.72); font-size: 12px; margin-bottom: 22px;
}
.timer-controls { display: flex; gap: 12px; }
.circle-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: rgba(255,255,255,.14);
  color: #fff; font-size: 14px;
}
.circle-btn.danger { background: #ff4d4f; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.thread {
  display: grid; gap: 10px;
  max-height: 560px; overflow: auto;
}
.bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13px; line-height: 1.45;
  background: #f3f4f6;
}
.bubble.in { justify-self: start; border-bottom-left-radius: 6px; }
.bubble.out {
  justify-self: end;
  background: var(--green-chip);
  color: var(--green);
  border-bottom-right-radius: 6px;
}
.bubble .meta {
  display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 14px;
}
.field {
  display: grid; gap: 8px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.field input, .field textarea {
  width: 100%;
  border: 1px solid #e4e7ec;
  background: #fafbfc;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  font-weight: 500;
}
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus {
  border-color: var(--green-soft);
  box-shadow: 0 0 0 4px rgba(149, 213, 178, 0.25);
}
.switch-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
}
.switch-row input { width: 18px; height: 18px; accent-color: var(--green); }
.settings-actions {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
}

.data-item {
  grid-template-columns: 1.2fr 1fr 1fr auto;
  background: #fff;
  border: 1px solid #f0f1f4;
  padding: 12px 14px;
}
.data-item .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* credits */
.dev-credit, .mobile-credit, .login-credit {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.dev-credit a, .mobile-credit a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(27, 67, 50, 0.18);
}
.dev-credit a:hover, .mobile-credit a:hover {
  border-bottom-color: var(--green);
}
.sidebar-credit {
  padding: 12px 8px 4px;
  text-align: left;
  font-size: 11px;
}
.mobile-credit { display: none; }

/* confirm modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal.hidden { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 25, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 24px 22px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  border: 1px solid #eef0f3;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.modal-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-actions .btn { min-width: 110px; }
.modal-card.danger-mode #confirm-ok {
  background: #d6453d;
}
.circle-btn.play {
  background: rgba(149, 213, 178, 0.35);
}

/* mobile tabbar — hidden on desktop */
.mobile-tabbar { display: none; }

@media (max-width: 1200px) {
  .stat-row, .grid-mid, .grid-bot { grid-template-columns: 1fr 1fr; }
  .grid-mid .card:first-child, .grid-bot .card:first-child { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar { display: none; }

  .mobile-credit {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    z-index: 49;
    text-align: center;
    font-size: 11px;
    pointer-events: auto;
  }

  .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    height: 64px;
    padding: 6px 4px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(228, 231, 236, 0.95);
    box-shadow: 0 12px 40px rgba(20, 20, 20, 0.12);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
  }

  .tab-item {
    position: relative;
    border: 0;
    background: transparent;
    color: #9aa0a8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: color .15s, background .15s, transform .12s;
  }
  .tab-item:active { transform: scale(0.96); }
  .tab-item.active {
    color: var(--green);
    background: var(--green-chip);
  }
  .tab-ico {
    width: 22px; height: 22px;
    display: grid; place-items: center;
  }
  .tab-ico svg { width: 20px; height: 20px; }
  .tab-dot {
    position: absolute;
    top: 6px; right: 18%;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #ff4d4f;
    border: 2px solid #fff;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 14px 14px 6px;
    gap: 10px;
  }
  .search-wrap {
    order: 2;
    max-width: none;
    width: 100%;
  }
  .search { padding: 10px 14px; }
  .search kbd { display: none; }
  .search-results { max-height: 260px; }
  .topbar-right {
    margin-left: auto;
    gap: 8px;
  }
  .icon-btn { width: 38px; height: 38px; }
  .profile strong { font-size: 12px; }
  .profile span { display: none; }
  .avatar { width: 36px; height: 36px; }

  .content {
    padding: 6px 14px 18px;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }
  .page-head h1 { font-size: 28px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }

  .login-screen { padding: 16px; }
  .login-box { padding: 28px 22px 22px; }

  .split, .settings-layout, .stat-row, .grid-mid, .grid-bot {
    grid-template-columns: 1fr;
  }
  .stat-card { min-height: 118px; }
  .stat-top strong { font-size: 30px; }
  .data-item { grid-template-columns: 1fr; }
  .data-item .actions { justify-content: flex-start; }
  .bars { height: 160px; gap: 6px; }
  .dark-card { min-height: 220px; }
  .timer-value { font-size: 34px; }
}

@media (max-width: 420px) {
  .mobile-tabbar {
    left: 8px; right: 8px;
    height: 62px;
    border-radius: 20px;
  }
  .tab-item { font-size: 9px; gap: 2px; }
  .page-head h1 { font-size: 24px; }
  .btn { padding: 10px 14px; }
}
