﻿:root {
  --bg-main: #e9f2ff;
  --bg-grad-1: #bed9ff;
  --bg-grad-2: #8bb8ff;
  --card: #ffffff;
  --text: #14233a;
  --muted: #60748f;
  --line: #d5dfef;
  --accent: #1767ff;
  --accent-soft: #deebff;
  --danger: #cb4040;
  --ok: #1d8d58;
  --shadow: 0 12px 36px rgba(19, 35, 58, 0.12);
}

body[data-point="ozon"] {
  --bg-main: #d4e7ff;
  --bg-grad-1: #a8cdff;
  --bg-grad-2: #6fa9ff;
  --accent: #1767ff;
  --accent-soft: #d9e8ff;
}

body[data-point="wb"] {
  --bg-main: #ecd9ff;
  --bg-grad-1: #d2afff;
  --bg-grad-2: #b07aff;
  --accent: #8e2ef0;
  --accent-soft: #f0e2ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(900px 400px at 0% 0%, color-mix(in oklab, var(--bg-grad-1), white 16%) 0%, transparent 70%),
    radial-gradient(900px 480px at 100% 0%, color-mix(in oklab, var(--bg-grad-2), white 10%) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg-main), white 8%) 0%, var(--bg-main) 100%);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.app-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 42px) 12px calc(env(safe-area-inset-bottom) + 98px);
}

.screen {
  display: grid;
  gap: 12px;
}

.tab-screen {
  display: grid;
  gap: 12px;
}

.hidden {
  display: none !important;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
  min-width: 0;
}

.card-center {
  width: min(560px, 100%);
  margin: 14vh auto 0;
  text-align: center;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.22rem, 1vw + 1rem, 1.56rem);
  margin-bottom: 8px;
}

h2 {
  font-size: clamp(1.03rem, 0.6vw + 0.92rem, 1.18rem);
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7faff;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.header-actions {
  min-width: 0;
  flex: 0 0 172px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  min-width: 0;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
}

input,
textarea {
  caret-color: var(--text);
}

button {
  border: 0;
  background: transparent;
  color: inherit;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 9px 11px;
  cursor: pointer;
}

.btn:hover {
  border-color: color-mix(in oklab, var(--accent), white 45%);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-small {
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 0.8rem;
}

.btn-danger {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger), white 50%);
}

.stack {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row > * {
  flex: 1 1 180px;
  min-width: 0;
}

.row.two > * {
  flex-basis: 220px;
}

.row.three > * {
  flex-basis: 170px;
}

.row.no-grow > * {
  flex: 0 0 auto;
}

.point-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.top-point-card {
  padding-top: 10px;
}

.point-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 11px 8px;
  font-weight: 700;
}

.point-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: color-mix(in oklab, var(--accent), black 18%);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stats-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-cell {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  min-width: 0;
}

.stat-name {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-value {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 800;
  word-break: break-word;
}

.schedule-rows {
  display: grid;
  gap: 8px;
}

.day-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  grid-template-columns: 62px 1fr;
  overflow: hidden;
}

.day-head {
  background: color-mix(in oklab, var(--accent-soft), white 26%);
  border-right: 1px solid var(--line);
  padding: 8px 6px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
}

.day-num {
  font-size: 1.13rem;
  font-weight: 800;
}

.day-week {
  color: var(--muted);
  font-size: 0.75rem;
}

.day-content {
  padding: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.shift-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.shift-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.shift-name {
  font-weight: 700;
}

.shift-time {
  color: var(--muted);
}

.shift-money {
  color: var(--ok);
  font-weight: 700;
}

.shift-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.days-select-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
}

.days-select-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.days-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.day-toggle-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  min-height: 33px;
  font-weight: 700;
}

.day-toggle-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: color-mix(in oklab, var(--accent), black 20%);
}

.users-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.user-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.user-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.user-accordion summary {
  list-style: none;
}

.user-accordion summary::-webkit-details-marker {
  display: none;
}

.user-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  padding: 10px;
}

.user-summary strong {
  min-width: 0;
  word-break: break-word;
}

.user-accordion-body {
  border-top: 1px solid var(--line);
  padding: 10px;
}

.admin-menu {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-menu-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  text-align: center;
  font-weight: 700;
}

.admin-menu-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: color-mix(in oklab, var(--accent), black 18%);
}

.schedule-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.month-label {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
}

.profile-view {
  display: grid;
  gap: 12px;
}

.profile-hero-card {
  text-align: center;
}

.profile-hero-head {
  display: flex;
  justify-content: flex-end;
}

.profile-hero-body {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.profile-avatar-wrap {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid color-mix(in oklab, var(--accent), white 40%);
  box-shadow: 0 8px 20px rgba(20, 35, 58, 0.16);
  background: color-mix(in oklab, var(--accent-soft), white 35%);
  display: grid;
  place-items: center;
  margin-top: 4px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  font-weight: 800;
  color: color-mix(in oklab, var(--accent), black 20%);
}

.profile-name {
  margin: 2px 0 0;
}

.profile-meta {
  margin: 0;
  color: var(--muted);
}

.profile-edit-form {
  margin-top: 12px;
  text-align: left;
}

.subpage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.subpage-head h2 {
  margin: 0;
}

input[type="date"],
input[type="month"],
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: block;
}

input[type="month"] {
  width: min(250px, 100%);
}

#scheduleCard,
#profileStatsView .card {
  overflow: hidden;
}

#scheduleCard .month-label,
#adminStatsForm label {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#scheduleCard input[type="month"],
#adminStatsForm input[type="date"],
#adminStatsForm select {
  width: calc(100% - 8px);
  max-width: calc(100% - 8px);
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 8px);
  transform: translateX(-50%);
  width: min(960px, calc(100vw - 16px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  z-index: 1000;
}

.tab-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 11px 8px;
  font-weight: 700;
}

.tab-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: color-mix(in oklab, var(--accent), black 18%);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 78px);
  transform: translateX(-50%);
  max-width: min(92vw, 680px);
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 0.84rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  z-index: 1100;
}

@media (max-width: 760px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
    padding-top: calc(env(safe-area-inset-top) + 48px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 92px);
  }

  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    flex: 1 1 auto;
  }

  .stats-grid,
  .admin-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day-row {
    grid-template-columns: 54px 1fr;
  }
}

@media (max-width: 480px) {
  .card {
    border-radius: 14px;
    padding: 10px;
  }

  .row,
  .row.two,
  .row.three {
    display: grid;
    grid-template-columns: 1fr;
  }

  .row.no-grow {
    display: flex;
    flex-wrap: wrap;
  }

  .stats-grid,
  .admin-menu {
    grid-template-columns: 1fr;
  }

  #basicStatsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .days-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .shift-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .shift-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .bottom-tabs {
    width: calc(100vw - 12px);
  }

  .month-label {
    width: 100%;
  }

  input[type="month"] {
    width: 100%;
  }

  #scheduleCard input[type="month"],
  #adminStatsForm input[type="date"],
  #adminStatsForm select {
    width: calc(100% - 12px);
    max-width: calc(100% - 12px);
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .btn,
  input,
  select,
  .tab-btn,
  .point-btn {
    font-size: 0.88rem;
    padding: 8px 9px;
  }

  .days-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .day-row {
    grid-template-columns: 48px 1fr;
  }
}
