/* ========================================================================
   ozim.qilaman · дизайн-система 2026 (Apple-inspired, светлая тема)

   Тональность: белые solid карточки на приглушённом фоне #EFF0F3,
   волосяные бордеры, лёгкие тени. Стекло — только в chrome (навбар,
   модалки). Одна акцентная краска #2962FF. Кнопки-пилюли.
======================================================================== */

:root {
  color-scheme: light only;

  /* Палитра */
  --accent:        #2962FF;
  --accent-dark:   #1E4FE0;
  --accent-soft:   rgba(41, 98, 255, 0.12);
  --accent-tint:   rgba(41, 98, 255, 0.08);

  --ink:           #1C1C1E;
  --ink-2:         #5B5D66;
  --ink-3:         #9A9CA3;
  --ink-4:         #B7BAC2;

  --line:          rgba(0, 0, 0, 0.07);
  --line-strong:   rgba(0, 0, 0, 0.12);
  --hairline:      #F0F1F3;

  --card:          #FFFFFF;
  --page-bg:       #EFF0F3;
  --surface-2:     #F7F8FA;
  --surface-3:     #F1F2F4;

  /* Статусы */
  --status-pending:   #C08A2E;
  --status-progress:  #2962FF;
  --status-done:      #2E9B57;
  --status-cancelled: #9A9CA3;
  --status-danger:    #B54B41;

  /* Роли */
  --role-owner-bg:  rgba(41, 98, 255, 0.12);
  --role-owner-fg:  #2962FF;
  --role-remote-bg: #EFE6F9;
  --role-remote-fg: #7A4FC9;
  --role-onsite-bg: #F1F2F4;
  --role-onsite-fg: #5B5D66;

  /* Тени */
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:   0 1px 2px rgba(20, 20, 30, 0.04), 0 10px 30px rgba(20, 20, 30, 0.08);
  --shadow-lg:   0 4px 12px rgba(20, 20, 30, 0.06), 0 20px 60px rgba(20, 20, 30, 0.12);
  --shadow-glow: 0 6px 16px rgba(41, 98, 255, 0.28);
  --shadow-glow-lg: 0 8px 22px rgba(41, 98, 255, 0.30);

  /* Радиусы */
  --radius-sm:   12px;
  --radius-md:   20px;
  --radius-lg:   28px;
  --radius-xl:   32px;
  --radius-pill: 100px;
}

/* -------- База -------- */

html {
  color-scheme: light only;
  background-color: var(--page-bg);
  color: var(--ink);
}

body {
  margin: 0;
  background-color: var(--page-bg) !important;
  color: var(--ink) !important;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
  html, body {
    background-color: var(--page-bg) !important;
    color: var(--ink) !important;
  }
}

::selection { background: rgba(41, 98, 255, 0.18); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

.font-mono, .tabular {
  font-variant-numeric: tabular-nums;
}

/* -------- Карточки -------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-lg {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.card-dim {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.card-tint {
  background: var(--surface-3);
  border-radius: var(--radius-md);
}

/* Legacy-псевдонимы старого дизайна — чтобы шаблоны не сыпались */
.glass         { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.glass-strong  { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.glass-dim     { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); }

a.card, a.card-lg, a.card-dim,
a.glass, a.glass-strong, a.glass-dim,
button.card, button.card-lg, button.card-dim,
button.glass, button.glass-strong, button.glass-dim {
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
a.card:hover, a.card-lg:hover, a.card-dim:hover,
a.glass:hover, a.glass-strong:hover, a.glass-dim:hover,
button.card:hover, button.card-lg:hover, button.card-dim:hover,
button.glass:hover, button.glass-strong:hover, button.glass-dim:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* -------- Layout: сайдбар слева + контент -------- */

.app-shell {
  display: flex;
  min-height: 100vh;
  gap: 0;
}

.app-sidebar {
  width: 240px;
  flex: none;
  position: sticky;
  top: 16px;
  align-self: flex-start;
  height: calc(100vh - 32px);
  margin: 16px 0 16px 16px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(20, 20, 30, 0.08);
  border-radius: 24px;
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  z-index: 20;
}

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 0 12px 8px;
  display: flex;
  align-items: center;
}

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 12px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  cursor: pointer;
}
.sidebar-item:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); text-decoration: none; }
.sidebar-item svg { width: 18px; height: 18px; flex: none; }
.sidebar-item.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 14px -4px rgba(41, 98, 255, 0.35);
}
.sidebar-item.is-active:hover { color: #fff; background: var(--accent); }
.sidebar-item.is-active svg { color: #fff; }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  scrollbar-width: none;
}
.sidebar-scroll::-webkit-scrollbar { display: none; }

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .avatar { flex: none; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.sidebar-user-role { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

.sidebar-logout {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  flex: none;
}
.sidebar-logout:hover { background: var(--surface-3); color: var(--status-danger); }

/* -------- Мобильный топ-бар (при ширине < 1024px) -------- */

.app-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  align-items: center;
  gap: 12px;
}
.app-topbar-brand { display: flex; align-items: center; flex: 1; }

.mobile-menu-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 20, 24, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: 280px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 1023px) {
  .app-sidebar { display: none; }
  .app-topbar { display: flex; }
  .app-shell { flex-direction: column; }
}

/* Legacy — старый navbar-shell больше не используется, но пусть будет для совместимости */
.nav-shell {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(20, 20, 30, 0.08);
  border-radius: 100px;
}
.nav-item, .nav-more { display: inline-flex; align-items: center; padding: 8px 16px; font-size: 14px; color: var(--ink-2); text-decoration: none; border-radius: 100px; }
.nav-item.is-active, .nav-more.is-active { background: var(--accent); color: #fff; font-weight: 700; }

/* -------- Аватар -------- */

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter Tight', Inter, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex: none;
}
.avatar.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.avatar-md { width: 40px; height: 40px; }
.avatar.avatar-sm { width: 28px; height: 28px; font-size: 12px; }

.avatar-owner  { background: var(--accent); }
.avatar-remote { background: var(--role-remote-fg); }
.avatar-onsite { background: var(--ink-3); }
.avatar-neutral { background: var(--ink-4); }

/* -------- Кнопки -------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 20px 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(41, 98, 255, 0.25); }

.btn-primary-block {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 700;
  box-shadow: var(--shadow-glow-lg);
}

/* Псевдоним старого класса */
.btn-accent { }
.btn-accent { /* Fallback: если в старых шаблонах есть свой padding — оставляем базу */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: background 0.15s ease;
  text-decoration: none;
}
.btn-accent:hover { background: var(--accent-dark); text-decoration: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}
.btn-ghost:hover { background: rgba(0, 0, 0, 0.03); border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.btn-ghost-sm { padding: 6px 14px; font-size: 12.5px; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--status-danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  font-family: inherit;
}
.btn-danger:hover { background: #A03D34; color: #fff; text-decoration: none; }

.btn-success-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(46, 155, 87, 0.14);
  color: var(--status-done);
  border: none;
  border-radius: 18px;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  font-family: inherit;
  width: 100%;
}
.btn-success-soft:hover { background: rgba(46, 155, 87, 0.20); color: var(--status-done); text-decoration: none; }

/* Круглая иконочная кнопка */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.icon-btn-sm { width: 28px; height: 28px; }
.icon-btn.icon-btn-square { border-radius: 8px; }

/* -------- Инпуты -------- */

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  color-scheme: light;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
}

textarea { min-height: 4.5rem; resize: vertical; line-height: 1.5; }

/* -------- Select с нашим единственным chevron -------- */
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B5D66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}
select::-ms-expand { display: none; }

input:hover:not(:focus), textarea:hover:not(:focus), select:hover:not(:focus) {
  border-color: var(--line-strong);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[disabled], textarea[disabled], select[disabled] {
  background: var(--surface-3);
  color: var(--ink-3);
  cursor: not-allowed;
}

::placeholder {
  color: var(--ink-4) !important;
  font-weight: 400 !important;
  opacity: 1 !important;
  font-style: normal;
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* -------- Date / Time / Datetime — стилизация нативной иконки -------- */

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  cursor: pointer;
  font-family: 'Inter Tight', Inter, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-right: 40px;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B5D66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='17' rx='2.5'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M8 3v3M16 3v3'/%3E%3C/svg%3E");
}
input[type="time"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B5D66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

/* Прячем нативный picker-indicator — он открывает popup при клике по всему полю */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  position: absolute;
  right: 0;
  width: 40px;
  height: 100%;
}
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], input[type="week"] {
  position: relative;
}

/* Убираем IE/Edge spinners для number */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

.input-tint {
  background: var(--surface-3);
  border-color: transparent;
}

/* Search-инпут с иконкой */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-3);
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search-wrap:focus-within { border-color: var(--accent); background: var(--card); }
.search-wrap svg { color: var(--ink-3); flex: none; }
.search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.search-wrap input:focus { box-shadow: none; }

/* -------- Утилиты формы -------- */

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0;
  text-transform: none;
}

.field-readonly {
  padding: 12px 14px;
  background: var(--surface-3);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  font-size: 14px;
  color: var(--ink-2);
}

/* -------- KPI-плитки -------- */

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}
.kpi-label { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.kpi-value {
  font-family: 'Inter Tight', Inter, sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi-trend { margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.kpi-trend-up { color: var(--status-done); font-weight: 600; }
.kpi-trend-down { color: var(--status-danger); font-weight: 600; }
.kpi-sub { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

/* -------- Чипы / бейджи -------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-lg { padding: 6px 12px; font-size: 12.5px; }

.chip-accent   { background: var(--accent-soft); color: var(--accent); }
.chip-pending  { background: rgba(192, 138, 46, 0.14); color: var(--status-pending); }
.chip-progress { background: var(--accent-soft); color: var(--accent); }
.chip-done     { background: rgba(46, 155, 87, 0.14); color: var(--status-done); }
.chip-cancelled { background: var(--surface-3); color: var(--ink-3); }
.chip-danger   { background: rgba(181, 75, 65, 0.12); color: var(--status-danger); }

.chip-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip-role-owner  { background: var(--role-owner-bg);  color: var(--role-owner-fg); }
.chip-role-remote { background: var(--role-remote-bg); color: var(--role-remote-fg); }
.chip-role-onsite { background: var(--role-onsite-bg); color: var(--role-onsite-fg); }

/* Фильтр-пилюля (кликабельный чип с chevron) */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}
.filter-pill:hover { background: #E4E5E9; color: var(--ink); text-decoration: none; }
.filter-pill.is-active {
  background: var(--accent);
  color: #fff;
}

/* Select как pill-фильтр (chevron встроен, единственный) */
select.select-pill {
  width: auto;
  min-width: 180px;
  padding: 9px 36px 9px 16px;
  background-color: var(--surface-3);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B5D66' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}
select.select-pill:hover { background-color: #E4E5E9; }
select.select-pill:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); border: none; }

/* -------- Toggle-switch -------- */

.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: #E4E5E9;
  flex: none;
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  padding: 0;
  display: inline-block;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.15s ease;
}
.toggle.is-on { background: var(--accent); }
.toggle.is-on::after { left: 18px; }

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* -------- Прогресс-бар (склад) -------- */

.bar {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--hairline);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition: width 0.3s ease;
}
.bar-fill.is-ok   { background: var(--status-done); }
.bar-fill.is-low  { background: var(--status-pending); }
.bar-fill.is-out  { background: var(--status-danger); }

/* -------- Info-плашка / уведомление -------- */

.notice {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--accent-tint);
  border-radius: 16px;
  padding: 16px 20px;
  color: var(--ink);
}
.notice-warn   { background: rgba(192, 138, 46, 0.10); }
.notice-danger { background: rgba(181, 75, 65, 0.08); }

/* -------- Timeline -------- */

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.tl-dot.is-inactive { background: rgba(0, 0, 0, 0.15); }
.tl-dot.is-done     { background: var(--status-done); }

.tl-line {
  flex: 1;
  height: 2px;
  background: var(--accent);
  margin: 0 8px;
}
.tl-line.is-inactive { background: rgba(0, 0, 0, 0.1); }

/* -------- Модалки -------- */

dialog {
  padding: 0;
  border: none;
  background: transparent;
}
dialog::backdrop {
  background: rgba(20, 20, 24, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 24px 26px 22px;
}

.dialog-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 80px rgba(10, 10, 20, 0.35);
}

/* -------- Пустое состояние -------- */

.empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 420px;
  padding: 44px 32px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}
.empty-state-title {
  font-family: 'Inter Tight', Inter, sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}
.empty-state-text {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* -------- Sparkline -------- */

.sparkline { display: block; }

/* -------- Ряд метода оплаты (метка + сумма) -------- */

.pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pay-row:focus-within { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px var(--accent-soft); }

.pay-row.is-primary {
  background: rgba(46, 155, 87, 0.08);
  border-color: rgba(46, 155, 87, 0.22);
}
.pay-row.is-primary:focus-within {
  background: var(--card);
  border-color: var(--status-done);
  box-shadow: 0 0 0 3px rgba(46, 155, 87, 0.15);
}

.pay-row-icon { display: none; }

.pay-row-label {
  flex: 1;
  min-width: 0;
}
.pay-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.pay-row.is-primary .pay-row-title { color: var(--status-done); }
.pay-row-sub {
  display: none;
}

input.pay-row-input {
  width: 120px;
  text-align: right;
  font-family: 'Inter Tight', Inter, sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  flex: none;
  color: var(--ink);
}
input.pay-row-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* -------- Утилиты -------- */

.text-display { font-family: 'Inter Tight', Inter, sans-serif; font-weight: 700; letter-spacing: -0.015em; }
.text-num     { font-family: 'Inter Tight', Inter, sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; }
.font-display { font-family: 'Inter Tight', Inter, sans-serif; }
.font-num     { font-family: 'Inter Tight', Inter, sans-serif; font-variant-numeric: tabular-nums; }

/* -------- Скроллбары -------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 100px;
  border: 2px solid var(--page-bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.22); }

/* -------- Flatpickr — переопределяем под наш дизайн -------- */

.flatpickr-calendar {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 20px !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: 'Inter', sans-serif !important;
  padding: 10px !important;
  width: 320px !important;
}
.flatpickr-calendar::before, .flatpickr-calendar::after { display: none !important; }

.flatpickr-months {
  padding: 6px 4px 12px !important;
  align-items: center;
}
.flatpickr-month {
  color: var(--ink) !important;
  height: auto !important;
}
.flatpickr-current-month {
  font-family: 'Inter Tight', Inter, sans-serif !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  padding: 0 !important;
  height: auto !important;
  color: var(--ink) !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-family: inherit !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  font-size: 15px !important;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  padding: 0 4px !important;
  padding-right: 4px !important;
  width: auto !important;
  height: auto !important;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.flatpickr-current-month input.cur-year {
  font-family: inherit !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  font-size: 15px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 4px !important;
  width: 60px !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
}
.flatpickr-current-month input.cur-year:focus { box-shadow: none !important; }
.flatpickr-monthDropdown-months option { color: var(--ink) !important; background: var(--card) !important; }
.flatpickr-current-month .numInputWrapper { width: auto !important; }
.flatpickr-current-month .numInputWrapper span { display: none !important; }

.flatpickr-prev-month, .flatpickr-next-month {
  color: var(--ink-2) !important;
  fill: var(--ink-2) !important;
  padding: 6px !important;
  border-radius: 10px !important;
  transition: background 0.12s ease;
}
.flatpickr-prev-month:hover, .flatpickr-next-month:hover {
  background: var(--surface-3) !important;
  color: var(--ink) !important;
}
.flatpickr-prev-month svg, .flatpickr-next-month svg { width: 12px; height: 12px; }

.flatpickr-weekdays {
  height: auto !important;
  margin-bottom: 4px;
}
.flatpickr-weekday {
  color: var(--ink-3) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: transparent !important;
}

.dayContainer { padding: 0 !important; width: 300px !important; min-width: 300px !important; }
.flatpickr-day {
  color: var(--ink) !important;
  border: none !important;
  border-radius: 10px !important;
  font-family: 'Inter Tight', Inter, sans-serif !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  max-width: 40px;
  height: 38px;
  line-height: 38px;
  margin: 1px;
}
.flatpickr-day:hover { background: var(--surface-3) !important; }
.flatpickr-day.today { color: var(--accent) !important; font-weight: 800 !important; }
.flatpickr-day.today:hover { background: var(--surface-3) !important; color: var(--accent) !important; }
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 12px -2px rgba(41, 98, 255, 0.35) !important;
}
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--ink-4) !important; }
.flatpickr-day.flatpickr-disabled { color: var(--ink-4) !important; opacity: 0.4 !important; }

.flatpickr-time {
  border-top: 1px solid var(--line) !important;
  padding-top: 8px !important;
}
.flatpickr-time input {
  font-family: 'Inter Tight', Inter, sans-serif !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  font-size: 16px !important;
  background: transparent !important;
  border: none !important;
}
.flatpickr-time input:focus { background: var(--surface-3) !important; }
.flatpickr-time .flatpickr-time-separator { color: var(--ink-2) !important; font-weight: 700; }
.flatpickr-time .numInputWrapper span.arrowUp:after { border-bottom-color: var(--ink-2) !important; }
.flatpickr-time .numInputWrapper span.arrowDown:after { border-top-color: var(--ink-2) !important; }

/* -------- Пульс -------- */

@keyframes pulse {
  0%   { transform: scale(0.8); opacity: 0.6; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
.pulse-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex: none;
}
.pulse-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.25;
  animation: pulse 1.8s ease-out infinite;
}

/* ============ UZ-phone widget ============ */
input[data-uz-phone] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
input[data-uz-phone].uz-invalid {
  border-color: var(--status-danger, #B54B41) !important;
  background: rgba(181, 75, 65, 0.05) !important;
}
[data-uz-error] {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: var(--status-danger, #B54B41);
  font-weight: 600;
}
.uz-lookup-status {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  min-height: 16px;
  color: var(--ink-2);
  transition: color 0.15s ease;
}
.uz-lookup-status.uz-lookup-found {
  color: var(--status-done, #2E9B57);
  font-weight: 600;
}
.uz-lookup-status.uz-lookup-new {
  color: var(--ink-2);
  font-weight: 500;
}

/* ============ Emoji picker ============ */
#emoji-picker-dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
}
#emoji-picker-dialog::backdrop {
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
}
.ep-shell {
  width: min(480px, 94vw);
  max-height: 80vh;
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.20);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ep-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.ep-title {
  font-family: 'Inter Tight', Inter, sans-serif;
  font-weight: 700; font-size: 16px; color: var(--ink);
}
.ep-close {
  width: 32px; height: 32px; border-radius: 100px;
  background: var(--surface-2); border: none;
  color: var(--ink-2); cursor: pointer; font-size: 20px; line-height: 1;
  padding: 0;
}
.ep-close:hover { background: var(--surface-3); color: var(--ink); }
.ep-body {
  overflow-y: auto;
  padding: 12px 20px 20px;
}
.ep-group { margin-top: 12px; }
.ep-group:first-child { margin-top: 4px; }
.ep-group-title {
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 8px;
}
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 4px;
}
.ep-cell {
  aspect-ratio: 1;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s ease, transform 0.1s ease;
  padding: 0;
}
.ep-cell:hover {
  background: var(--surface-2);
  transform: scale(1.15);
}
.ep-cell:active { transform: scale(0.95); }

/* Кнопка-триггер эмодзи (в формах) */
button[data-emoji-picker] {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  cursor: pointer;
  font-size: 28px;
  transition: border-color 0.12s ease, background 0.12s ease;
  padding: 0;
  line-height: 1;
}
button[data-emoji-picker]:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}
