:root {
  color-scheme: dark;
  /* Светлее и ближе к палитре лендинга */
  --bg: linear-gradient(135deg, #0f1822 0%, #182535 35%, #223146 65%, #0f1822 100%);
  --surface: rgba(28, 40, 55, 0.82);
  --surface-alt: rgba(38, 54, 72, 0.7);
  --border: rgba(79, 209, 197, 0.28);
  --border-strong: rgba(79, 209, 197, 0.5);
  --accent: #4fd1c5;
  --accent-strong: #38b2ac;
  --text: #f1fbfb;
  --muted: rgba(241, 251, 251, 0.6);
  --danger: #f56565;
  --radius: 16px;
  --shadow: 0 24px 68px rgba(0, 0, 0, 0.38);
  --blur: blur(40px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tg-viewport-h: 100vh;
  --content-gap: clamp(16px, 4vw, 28px);
  font-family: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@supports (height: 100dvh) {
  :root {
    --tg-viewport-h: 100dvh;
  }
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  z-index: 10000;
  padding: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.loading-screen--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: auto;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: loadingCardIn 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes loadingCardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.loading-screen__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

/* По запросу: без логотипа/бренда на загрузке */
.loading-screen__logo {
  display: none;
}

.loading-screen__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: radial-gradient(circle at 20% 20%, rgba(79, 209, 197, 0.9), rgba(25, 83, 108, 0.95));
  border: 1px solid rgba(79, 209, 197, 0.5);
  color: #0b1419;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.loading-screen__spinner {
  position: relative;
  width: 48px;
  height: 48px;
  margin-left: -10px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.35));
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-screen__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.loading-screen__title {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-screen__subtitle {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.loading-screen__status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* По запросу: без надписи "Загрузка..." */
.loading-screen__status {
  display: none;
}

.loading-screen__status::after {
  content: "";
  display: inline-block;
  width: 18px;
  text-align: left;
  animation: loadingDots 1.2s steps(4, end) infinite;
}

@keyframes loadingDots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-screen__content {
    animation: none;
  }
  .spinner {
    animation-duration: 1.6s;
  }
  .loading-screen__status::after {
    animation: none;
    content: "";
  }
}

/* ===== BASE STYLES ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Скрытие скроллбара */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

html,
body {
  height: 100%;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
  text-rendering: geometricPrecision;
  min-height: var(--tg-viewport-h);
  height: var(--tg-viewport-h);
  width: 100%;
  display: flex;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: var(--tg-viewport-h);
  height: var(--tg-viewport-h);
  width: 100%;
  padding: 0;
  position: relative;
  background: var(--bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 209, 197, 0.12), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(56, 178, 172, 0.1), transparent 38%),
    radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.04), transparent 45%);
  filter: blur(70px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.app-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 0),
    radial-gradient(rgba(0, 0, 0, 0.028) 1px, transparent 0);
  background-size: 120px 120px, 96px 96px;
  background-position: 0 0, 48px 32px;
  mix-blend-mode: soft-light;
  opacity: 0.5;
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 24px);
  padding: 16px clamp(16px, 3vw, 24px) 12px;
  padding-top: calc(16px + var(--safe-top, 0px));
  margin: 0;
  border-radius: 0;
  background: rgba(12, 22, 28, 0.65);
  border: none;
  border-bottom: 1px solid rgba(79, 209, 197, 0.25);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  isolation: isolate;
  width: 100%;
}

/* Уменьшенные отступы для Android */
body.platform-android .topbar {
  padding-top: calc(10px + var(--safe-top, 0px));
  padding-bottom: 8px;
}

/* Убираем медиа-запрос - safe-top теперь устанавливается из JS для всех устройств */

.topbar__brand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.topbar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: radial-gradient(circle at 20% 20%, rgba(79, 209, 197, 0.9), rgba(25, 83, 108, 0.95));
  border: 1px solid rgba(79, 209, 197, 0.5);
  color: #0b1419;
  font-weight: 700;
  font-size: 18px;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  overflow: hidden;
}

.topbar__badge--logo {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.topbar__badge--logo img {
  border-radius: 0;
}

.topbar__badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Иконка чата в топбаре */
.topbar__badge span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar__logo-img {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.topbar__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  position: relative;
}

.topbar__title-btn {
  display: none;
  flex-direction: column;
  gap: 2px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
}

/* Hover только для устройств с мышью */
@media (hover: hover) and (pointer: fine) {
  .topbar__title-btn:hover {
    opacity: 0.8;
  }
}

.topbar__title-btn:active {
  opacity: 0.7;
}

.topbar__text-static {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar__title {
  display: block;
  font-size: clamp(18px, 2vw, 22px);
  letter-spacing: 0.02em;
  margin: 0;
  font-weight: 700;
  background: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__subtitle {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  color: var(--muted);
  flex: 1;
  min-width: 120px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__user--profile {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: none;
}

.topbar__avatar-btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid rgba(79, 209, 197, 0.25);
  background: rgba(12, 22, 28, 0.2);
  color: var(--muted);
}

.topbar__avatar-btn:hover {
  opacity: 0.9;
}

.topbar__avatar-btn--change {
  border-color: rgba(79, 209, 197, 0.4);
  background: rgba(79, 209, 197, 0.12);
  color: var(--accent);
}

.topbar__avatar-btn--tg {
  border-color: rgba(36, 161, 222, 0.4);
  background: rgba(36, 161, 222, 0.12);
  color: #24a1de;
}

/* Photo rows with caption */
.photos-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  position: relative;
}

.photo-row__image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.photo-row__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-row__caption {
  flex: 1;
  min-width: 0;
}

.photo-caption-input {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
}

.photo-caption-input::placeholder {
  color: var(--muted);
}

.photo-caption-input:focus {
  border-color: var(--accent);
  outline: none;
}

.photo-caption-input:disabled {
  opacity: 0.6;
}

.photo-row__delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  color: var(--danger);
  border: 1px solid var(--border);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-row__delete:hover {
  background: rgba(245, 101, 101, 0.14);
  border-color: rgba(245, 101, 101, 0.35);
  color: var(--text);
}

/* Document card actions */
.document-card__actions {
  display: flex;
  gap: 6px;
}

.document-card__controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.schedule-link-input {
  display: flex;
  gap: 6px;
  width: 100%;
}

.schedule-link-input input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.schedule-link-input input:focus {
  border-color: var(--accent);
  outline: none;
}

.schedule-link-btn {
  flex: 0 0 auto;
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
}

.document-card .schedule-link-btn.btn--sm {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

.document-card--schedule {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.document-card--schedule .document-card__icon {
  position: absolute;
  top: 16px;
  left: 16px;
}

.document-card--schedule .document-card__info {
  text-align: left;
  width: 100%;
  padding-left: 44px;
}

.document-card--schedule .document-card__info h3 {
  text-align: left;
}

.document-card--schedule .document-card__controls {
  width: 100%;
  align-items: flex-start;
}

/* Field row (side by side fields) */
.field-row {
  display: flex;
  gap: 4px;
  width: 100%;
}

.field-row .field {
  flex: 1 1 0;
  min-width: 0;
  max-width: 50%;
  overflow: hidden;
}

.field-row .field span {
  font-size: 10px;
  display: block;
  margin-bottom: 2px;
}

.field-row .field input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  box-sizing: border-box;
  min-width: 0;
  height: 39px;
  min-height: 39px;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2;
  margin: 0;
}

.field-row .field input[type="date"]::-webkit-date-and-time-value {
  min-height: 0;
}

.field-row .field input[type="date"]::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
}

.topbar__user strong {
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__user span {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 3vw, 28px);
  min-width: 220px;
}

.topbar__profile-btn {
  min-height: 42px;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 14px;
  border: 1px solid rgba(79, 209, 197, 0.4);
  background: rgba(79, 209, 197, 0.12);
  color: var(--accent);
}

.topbar__subscription-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.15), rgba(79, 209, 197, 0.05));
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar__subscription-btn:hover {
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.25), rgba(79, 209, 197, 0.1));
  transform: scale(1.05);
}

.topbar__subscription-btn svg {
  width: 20px;
  height: 20px;
}

.topbar__subscription-btn.has-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0a0f14;
  transform: translateY(20%);
}

.profile-header .btn {
  min-height: 40px;
}

.profile-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(15, 23, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-summary__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-summary__value {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  word-break: break-word;
}

.profile-role-select {
  display: none; /* По умолчанию скрыт, показывается через JS для разработчика */
  background: rgba(79, 209, 197, 0.12);
  border: 1px solid rgba(79, 209, 197, 0.35);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.profile-role-select:hover,
.profile-role-select:focus {
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.2);
}

.profile-role-select option {
  background: var(--surface);
  color: var(--text);
}

.profile-logout {
  align-self: flex-start;
}


.app-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(12px, 4vw, 32px);
  padding-bottom: 0;
  background: transparent;
}

.view {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(16px + var(--safe-bottom));
  animation: fade 0.35s ease forwards;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.view::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.view--active {
  display: flex;
  flex-direction: column;
  gap: var(--content-gap);
}

/* ===== DASHBOARD TILES ===== */
.dashboard-header {
  padding: clamp(20px, 5vw, 32px) clamp(16px, 4vw, 24px) 0;
  text-align: left;
}

.dashboard-title {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  margin: 0 0 6px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Task Statistics Cards */
.task-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 clamp(16px, 4vw, 24px);
  margin-bottom: 8px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.stat-card__value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card__label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card--pending .stat-card__value { color: #f39c12; }
.stat-card--progress .stat-card__value { color: #3498db; }
.stat-card--done .stat-card__value { color: #27ae60; }
.stat-card--overdue .stat-card__value { color: #e74c3c; }

/* Crew Info Card (Worker) */
.crew-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin: 0 clamp(16px, 4vw, 24px) 12px;
}

.crew-info-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.crew-info-card__icon {
  font-size: 32px;
}

.crew-info-card__name {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.crew-info-card__speciality {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.crew-info-card__brigadier {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.crew-info-card__brigadier strong {
  color: var(--text);
}

/* Task Filters */
.task-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.task-filters .select {
  flex: 1;
  min-width: 120px;
}

/* File Upload Zone */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.file-upload-zone:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.file-upload-zone p {
  margin: 0;
  color: var(--muted);
}

/* File Filters */
.file-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.file-filters .select {
  flex: 1;
}

/* Dashboard Progress */
.dashboard-progress {
  padding: 0 clamp(16px, 4vw, 24px);
  margin-top: 16px;
}

.dashboard-progress .section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.progress-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-item__name {
  font-size: 14px;
  font-weight: 500;
}

.progress-item__percent {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.progress-item__bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-item__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Field Row */
.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
}

/* ===== WORKER TASK STATS ===== */
.task-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 clamp(16px, 4vw, 24px) clamp(16px, 4vw, 24px);
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-card__label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}

.stat-card--pending {
  border-color: rgba(241, 196, 15, 0.4);
}

.stat-card--pending .stat-card__value {
  color: #f1c40f;
}

.stat-card--progress {
  border-color: rgba(52, 152, 219, 0.4);
}

.stat-card--progress .stat-card__value {
  color: #3498db;
}

.stat-card--done {
  border-color: rgba(46, 204, 113, 0.4);
}

.stat-card--done .stat-card__value {
  color: #2ecc71;
}

.stat-card--overdue {
  border-color: rgba(231, 76, 60, 0.4);
}

.stat-card--overdue .stat-card__value {
  color: #e74c3c;
}

.tiles-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(16px, 4vw, 24px);
}

.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.tile:hover::before,
.tile:active::before {
  opacity: 1;
}

.tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.tile:active {
  transform: translateY(0);
  background: var(--surface-alt);
}

.tile__icon {
  font-size: 32px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 209, 197, 0.12);
  border-radius: 14px;
  flex-shrink: 0;
}

.tile--primary .tile__icon {
  background: rgba(79, 209, 197, 0.2);
}

.tile__content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.tile__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--text);
}

.tile__desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.tile__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--accent);
  color: #0a0f14;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}

.tile__badge--notification {
  background: #e74c3c;
  color: white;
}

.tile__badge--danger {
  background: #e74c3c;
  color: white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.tile--danger {
  border-color: rgba(231, 76, 60, 0.4);
}

.tile--danger .tile__icon {
  background: rgba(231, 76, 60, 0.2);
}

.tile__arrow {
  font-size: 20px;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
  position: relative;
  z-index: 1;
}

.tile:hover .tile__arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* Section Panels */
.sections-container {
  padding: clamp(16px, 4vw, 24px) 0 0;
}

.section-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(79, 209, 197, 0.05);
}

.section-panel__header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.section-panel__back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  margin: -6px -12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.section-panel__back:hover {
  background: rgba(79, 209, 197, 0.1);
}

.section-panel__body {
  padding: 20px;
}

.section-panel[hidden] {
  display: none;
}

.card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(18px, 4vw, 26px);
  min-width: 0;
  overflow: visible;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 8px;
}

.auth-card > p {
  text-align: center;
}

.auth-card {
  position: relative;
}

/* Формы авторизации: статический поток, плавное появление */
.auth-card form {
  width: 100%;
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.auth-card form.auth-form--active {
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 1;
  transform: translateY(0);
}

/* Контейнер форм: фиксированная высота корректируется JS без анимации */
/* Обертка без принудительной высоты */
.auth-card .auth-forms-wrapper {
  position: relative;
}

/* Подсказка под полем */
.field-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Блок кода подтверждения */
.auth-code-block {
  margin: 8px 0;
  padding: 16px;
  background: rgba(79, 209, 197, 0.08);
  border: 1px solid rgba(79, 209, 197, 0.2);
  border-radius: 12px;
}

.auth-code-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-code-notice--success {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.auth-code-notice--info {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.auth-code-notice__icon {
  font-size: 24px;
  flex-shrink: 0;
}

.auth-code-notice__text {
  flex: 1;
}

.auth-code-notice__text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.auth-code-notice__text p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.auth-code-resend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-code-resend .btn {
  padding: 6px 12px;
  min-height: 32px;
}

/* Поле ввода кода */
#loginAuthCode,
#registerAuthCode {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 8px;
  font-family: monospace;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  min-width: 0;
  overflow: hidden;
}

.card__header[data-toggle="collapse"] {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.card__header[data-toggle="collapse"]:hover {
  opacity: 0.85;
}

.card__header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card__toggle {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.card--collapsed .card__toggle {
  transform: rotate(-90deg);
}

.card--collapsed .card__header {
  margin-bottom: 0;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  box-sizing: border-box;
}

.card__body--collapsible {
  max-height: var(--collapse-h, 5000px);
  opacity: 1;
  transform: translateY(0);
  overflow: hidden;
  will-change: max-height, opacity, transform;
  transition:
    max-height 420ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 220ms ease,
    transform 220ms ease;
}

.card--collapsed .card__body--collapsible {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .card__body--collapsible {
    transition: none;
  }
  .card__toggle {
    transition: none;
  }
}

.grid {
  display: grid;
  gap: var(--content-gap);
  min-width: 0;
}

@media (min-width: 960px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.stack--tight {
  gap: 12px;
}

.split {
  display: flex;
  gap: 4px;
  width: 100%;
}

.split > * {
  flex: 1 1 0;
  min-width: 0;
  max-width: 50%;
  overflow: hidden;
}

.split .field span {
  font-size: 10px;
}

.split .field input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  box-sizing: border-box;
  min-width: 0;
  height: 39px;
  min-height: 39px;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2;
  margin: 0;
}

.split .field input[type="date"]::-webkit-date-and-time-value {
  min-height: 0;
}

.split .field input[type="date"]::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.field--checkbox input[type="checkbox"] {
  /* Скрываем стандартный чекбокс */
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  border: 2px solid rgba(79, 209, 197, 0.4);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.field--checkbox input[type="checkbox"]:hover {
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.1);
}

.field--checkbox input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.2);
}

.field--checkbox input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: var(--accent);
}

.field--checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid #0a0f14;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.field--checkbox span {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  padding-top: 1px;
}

.auth-agreement {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
}

.link--accent {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(79, 209, 197, 0.4);
  transition: all 0.2s;
}

.link--accent:hover {
  border-bottom-color: var(--accent);
  opacity: 0.9;
}

.field span {
  font-size: 12px;
  color: var(--muted);
}

input,
textarea,
select {
  font: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  transition: border 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px rgba(79, 209, 197, 0.25);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  min-height: 48px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #0b1419;
  box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.4), 0 8px 20px rgba(79, 209, 197, 0.26);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.35), 0 8px 20px rgba(79, 209, 197, 0.26);
}

.btn--secondary {
  border-color: var(--border-strong);
  background: rgba(79, 209, 197, 0.12);
  color: var(--text);
}

.btn--team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--team:hover {
  background: rgba(79, 209, 197, 0.25);
}

.btn--team-primary {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 12px;
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid var(--accent);
  border-radius: 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--team-primary:hover {
  background: rgba(79, 209, 197, 0.25);
  transform: translateY(-2px);
}

.btn--ghost {
  border: none;
  background: transparent;
  color: var(--muted);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--small {
  padding: 8px 12px;
  min-height: 36px;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(79, 209, 197, 0.18);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.badge--success {
  background: rgba(39, 174, 96, 0.2);
  color: #27ae60;
}

.badge--muted {
  background: rgba(127, 140, 141, 0.2);
  color: var(--text-muted);
}

.badge--warning {
  background: rgba(230, 126, 34, 0.2);
  color: #e67e22;
}

.item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 30, 0.78);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.item h3 {
  margin: 0;
  font-size: 15px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  line-height: 1.3;
}

.item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.item__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 0;
  min-width: 0;
  font-size: 13px;
}

.meta div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.meta dt {
  color: var(--muted);
  font-size: 11px;
}

.meta dd {
  margin: 0;
  font-size: 13px;
  word-break: break-word;
}

/* Цветной статус в карточке проекта */
.meta__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(79, 209, 197, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.meta__status--active {
  color: var(--accent);
  /* accent (бирюзовый) → зелёный */
  filter: hue-rotate(-45deg) saturate(1.25) brightness(1.05);
}

.meta__status--paused {
  /* accent (бирюзовый) → жёлтый */
  filter: hue-rotate(68deg) saturate(1.6) brightness(1.15);
}

.meta__status--completed {
  /* accent (бирюзовый) → синий */
  filter: hue-rotate(38deg) saturate(1.25) brightness(1.05);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: visible;
}

.estimate-table {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(6, 12, 16, 0.55);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.estimate-row {
  display: grid;
  grid-template-columns: 2.2fr 0.8fr 0.8fr 0.8fr 1fr auto;
  gap: 0;
  align-items: stretch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 52px;
  min-width: min-content;
}

.estimate-row:last-child {
  border-bottom: 0;
}

.estimate-row__input {
  border-radius: 0;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.estimate-row__input:last-of-type {
  border-right: none;
}

.estimate-row__total {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.estimate-row__remove {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 20px;
  cursor: pointer;
  padding: 0 12px;
}

.tag {
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(79, 209, 197, 0.14);
  color: var(--accent);
  font-size: 12px;
}

.status-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-chip[data-status="submitted"] {
  background: rgba(245, 158, 11, 0.2);
  color: #f6ad55;
}

.status-chip[data-status="draft"] {
  background: rgba(66, 153, 225, 0.22);
  color: #90cdf4;
}

.status-chip[data-status="approved"] {
  background: rgba(72, 187, 120, 0.25);
  color: #9ae6b4;
}

.status-chip[data-status="rejected"] {
  background: rgba(245, 101, 101, 0.22);
  color: #feb2b2;
}

.toast {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  right: 16px;
  left: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(12, 20, 26, 0.9);
  border: 1px solid rgba(79, 209, 197, 0.28);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  display: none;
}

.toast--visible {
  display: block;
}

/* Баннер ограниченного режима */
.restricted-banner {
  position: sticky;
  top: 0;
  z-index: 19;
  background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.restricted-banner__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  text-align: center;
}

.restricted-banner__icon {
  font-size: 16px;
}

.restricted-banner__text {
  color: #fff;
  font-size: 13px;
}

.restricted-banner__text strong {
  font-weight: 600;
}

.restricted-banner__btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.restricted-banner__btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    padding-top: calc(40px + var(--safe-top, 0px));
  }

  .topbar__badge,
  .topbar__text {
    transform: none;
  }
  
  .topbar__badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
  }

  .topbar__badge--logo {
    border-radius: 0;
  }

  .topbar__badge--logo img {
    border-radius: 0;
  }

  .topbar__logo-img {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
  }
  
  .topbar__title {
    font-size: 14px;
  }
  
  .topbar__subtitle {
    font-size: 11px;
  }

  .topbar__actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: auto;
  }
  
  .topbar__subscription-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .topbar__profile-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .topbar__user {
    text-align: left;
    max-width: 100%;
  }

  .topbar__brand {
    flex: 1;
    min-width: 0;
  }

  .profile-summary {
    padding: 16px;
  }

  .profile-logout {
    width: 100%;
  }

  .topbar__subtitle {
    font-size: 13px;
  }

  .app-main {
    padding-left: clamp(10px, 4vw, 18px);
    padding-right: clamp(10px, 4vw, 18px);
  }

  .view--active {
    gap: 18px;
  }

  .card {
    padding: 18px;
    border-radius: 16px;
  }

  .btn {
    width: 100%;
  }

  .item {
    padding: 14px;
  }

  .item h3 {
    font-size: 14px;
  }

  .item__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .estimate-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .estimate-row {
    grid-template-columns: 1.8fr 0.7fr 0.7fr 0.7fr 0.9fr 40px;
    font-size: 12px;
    min-width: min-content;
  }

  .estimate-row__input {
    padding: 8px 10px;
    font-size: 12px;
  }

  .toast {
    right: 12px;
    left: 12px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .meta {
    font-size: 13px;
  }

  .meta dt {
    font-size: 11px;
  }

  .meta dd {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .topbar__badge,
  .topbar__text {
    transform: translateY(4px);
  }

  .topbar__badge {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .topbar__badge--logo {
    border-radius: 0;
  }

  .topbar__badge--logo img {
    border-radius: 0;
  }

  .topbar__logo-img {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
  }

  .topbar__title {
    font-size: 20px;
  }

  .stack {
    gap: 14px;
  }

  .field span {
    font-size: 12px;
  }

  .card {
    padding: 14px;
  }

  .card__header {
    margin-bottom: 12px;
  }

  .card h2 {
    font-size: 16px;
    margin: 0;
  }

  .estimate-row {
    min-height: 44px;
    grid-template-columns: 1.5fr 0.6fr 0.6fr 0.6fr 0.8fr 36px;
  }

  .estimate-row__input {
    padding: 6px 8px;
    font-size: 11px;
  }

  .estimate-row__total {
    font-size: 11px;
  }

  .estimate-row__remove {
    padding: 0 8px;
    font-size: 18px;
  }

  .item {
    padding: 12px;
    gap: 8px;
    border-radius: 12px;
  }

  .item header {
    gap: 6px;
    flex-wrap: wrap;
  }

  .item h3 {
    font-size: 14px;
    line-height: 1.2;
  }

  .item p {
    font-size: 12px;
    line-height: 1.3;
  }
  
  .meta {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .meta dt {
    font-size: 10px;
  }
  
  .meta dd {
    font-size: 12px;
  }

  .badge {
    font-size: 11px;
    padding: 2px 8px;
  }

  .btn {
    padding: 12px 14px;
    font-size: 13px;
  }

  input,
  textarea,
  select {
    padding: 10px 12px;
    font-size: 14px;
  }

  .muted {
    font-size: 13px;
  }

  .meta {
    font-size: 12px;
  }
}

/* === ДЕТАЛЬНАЯ СТРАНИЦА ПРОЕКТА === */

.item--clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.item--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 209, 197, 0.15);
}

.item--clickable:active {
  transform: translateY(0);
}

.project-detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
  background: transparent;
}

/* Навигация детальной страницы */
.project-detail__nav {
  margin-bottom: 4px;
}

/* Главная вкладка - единая карточка */
.project-main-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.project-main-info__header {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.project-main-info__header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}

.project-main-info__header .muted {
  margin: 0;
  font-size: 14px;
}

/* Мета-информация внутри карточки */
.project-main-info .project-detail__meta {
  gap: 8px;
}

.project-main-info .meta-card {
  background: var(--bg);
  border: 1px solid var(--border);
}

/* Этапы внутри общей карточки */
.project-main-info .stages-progress {
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.project-detail__header {
  --project-detail-side: clamp(72px, 18vw, 120px);
  display: grid;
  grid-template-columns: var(--project-detail-side) 1fr var(--project-detail-side);
  align-items: center;
  gap: 10px;
}

.project-detail__info {
  min-width: 0;
  justify-self: center;
  text-align: center;
  padding: 0 6px;
  margin-top: 8px;
}

.project-detail__info h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.project-detail__info .muted {
  margin: 0;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.btn--back {
  display: inline-flex;
  padding: 8px 12px;
  font-size: 14px;
  flex-shrink: 0;
  justify-self: start;
}

.project-detail__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.meta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.meta-card__label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.meta-card__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.meta-card__select {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}

.meta-card__select--active {
  color: var(--accent);
  border-color: var(--accent);
  /* accent (бирюзовый) → зелёный */
  filter: hue-rotate(-45deg) saturate(1.25) brightness(1.05);
}

.meta-card__select--paused {
  color: var(--accent);
  border-color: var(--accent);
  /* accent (бирюзовый) → жёлтый */
  filter: hue-rotate(68deg) saturate(1.6) brightness(1.15);
}

.meta-card__select--completed {
  color: var(--accent);
  border-color: var(--accent);
  /* accent (бирюзовый) → синий */
  filter: hue-rotate(38deg) saturate(1.25) brightness(1.05);
}

.meta-card__select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Табы */
.project-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 12px;
  padding: 4px;
  overflow-x: auto;
}

.tab {
  flex: 1;
  min-width: fit-content;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab--active {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content--active {
  display: block;
}

/* Документы */
.documents-grid {
  display: grid;
  gap: 12px;
}

.document-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.document-card__icon {
  font-size: 28px;
  flex-shrink: 0;
}

.document-card__info {
  flex: 1;
  min-width: 100px;
}

.document-card__info h3 {
  font-size: 14px;
  margin: 0 0 2px;
}

.document-card__info .muted {
  font-size: 12px;
}

.document-card__file {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.document-card__file a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  flex: 1;
  word-break: break-all;
}

.document-card__delete {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.document-card__delete:hover {
  color: #ef4444;
}

.btn--sm {
  padding: 8px 12px;
  font-size: 12px;
  flex-shrink: 0;
}

/* Компактная кнопка "→" для ссылки графика (после базовых .btn правил) */
.schedule-link-input .schedule-link-btn.btn {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

.documents-list {
  margin-top: 16px;
}

/* Чат */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-message--own {
  align-self: flex-end;
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 4px;
}

.chat-message--other {
  align-self: flex-start;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-message__header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  opacity: 0.7;
}

.chat-message__author {
  font-weight: 600;
}

.chat-message__mention {
  color: var(--accent-strong);
  font-weight: 600;
}

.chat-message--own .chat-message__mention {
  color: #065f46;
}

.chat-message__image {
  max-width: 200px;
  border-radius: 8px;
  margin-top: 8px;
  cursor: pointer;
}

.chat-message--own .chat-message__image {
  margin-left: auto;
}

/* Контекстное меню сообщения */
.message-context-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 21000;
  min-width: 150px;
  overflow: hidden;
}

.message-context-menu__item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.message-context-menu__item:hover {
  background: rgba(79, 209, 197, 0.15);
}

.message-context-menu__item--danger {
  color: #ef4444;
}

.chat-input-container {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  resize: none;
  min-height: 40px;
  max-height: 100px;
}

.chat-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-photo-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
}

.chat-photo-btn:hover {
  background: rgba(79, 209, 197, 0.15);
  color: var(--accent);
}

/* Dropdown для @-упоминаний */
.mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.mention-item:hover,
.mention-item--active {
  background: rgba(79, 209, 197, 0.15);
}

.mention-item__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.mention-item__info {
  flex: 1;
}

.mention-item__name {
  font-size: 14px;
  font-weight: 500;
}

.mention-item__role {
  font-size: 11px;
  color: var(--muted);
}

/* === НОВАЯ СИСТЕМА ЧАТОВ === */

/* Вкладка Чаты должна быть flex, чтобы панели корректно тянулись по высоте */
#tab-chats.tab-content--active {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Панели должны иметь предсказуемую высоту, а не зависеть от контента */
#tab-chats .chats-list-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  height: clamp(420px, 70vh, 760px);
}

/* chatDialogPanel теперь полноэкранный overlay */
#chatDialogPanel {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 19000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  margin: 0 !important;
}

/* Убираем padding у app-main когда чат открыт на весь экран */
body:has(#chatDialogPanel:not([hidden])) .app-main {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#chatDialogPanel[hidden] {
  display: none !important;
}

#chatDialogPanel .chat-dialog-header {
  display: none; /* Скрываем внутренний хедер, используем топбар */
}

#chatDialogPanel .chat-messages {
  flex: 1;
  background: var(--bg);
  overflow-y: auto;
  padding: 12px 16px;
}

#chatDialogPanel .chat-input-container {
  background: var(--surface);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
}

/* Скрывать панели когда hidden */
#tab-chats .chats-list-panel[hidden] {
  display: none !important;
}

/* Список чатов */
.chats-list-panel {
  display: flex;
  flex-direction: column;
}

.chats-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chats-list-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

/* Кнопка создания чата - компактная на мобильных */
.chats-list-header .btn {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: fit-content !important;
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 12px;
  min-height: 36px;
}

.chats-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 4px;
}

.chat-item:hover {
  background: rgba(79, 209, 197, 0.1);
}

.chat-item--active {
  background: rgba(79, 209, 197, 0.15);
}

.chat-item__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.chat-item__avatar--private {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.chat-item__info {
  flex: 1;
  min-width: 0;
}

.chat-item__name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item__preview {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.chat-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.chat-item__time {
  font-size: 11px;
  color: var(--muted);
}

.chat-item__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Диалог чата */
.chat-dialog-panel {
  display: flex;
  flex-direction: column;
}

.chat-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px 16px 0 0;
}

.chat-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.chat-back-btn:hover {
  background: rgba(79, 209, 197, 0.15);
}

.chat-dialog-info {
  flex: 1;
  min-width: 0;
}

.chat-dialog-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dialog-members {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.chat-dialog-actions {
  display: flex;
  gap: 4px;
}

.chat-settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.chat-settings-btn:hover {
  background: rgba(79, 209, 197, 0.15);
  color: var(--accent);
}

/* Модальные окна создания/настройки чата */
.chat-type-selector {
  display: flex;
  gap: 12px;
}

.radio-card {
  flex: 1;
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}

.radio-card input:checked + .radio-card__content {
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.1);
}

.radio-card__icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.radio-card__title {
  font-size: 14px;
  font-weight: 600;
}

.radio-card__desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.role-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.checkbox-card:hover {
  border-color: rgba(79, 209, 197, 0.5);
  background: rgba(79, 209, 197, 0.05);
}

.checkbox-card:active {
  transform: scale(0.98);
}

.checkbox-card input[type="checkbox"] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  flex-grow: 0;
  cursor: pointer;
  border: 2px solid var(--border) !important;
  border-radius: 6px;
  background: var(--surface);
  position: relative;
  transition: all 0.2s;
  box-sizing: border-box !important;
  -webkit-box-sizing: border-box !important;
  line-height: 1 !important;
  font-size: 0 !important;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.checkbox-card input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-card input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #0a0f14;
  font-size: 14px;
  font-weight: 700;
}

.checkbox-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.15);
}

.checkbox-card span {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.chat-settings-danger {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Пустое состояние списка чатов */
.chats-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.chats-empty__icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.chats-empty__text {
  font-size: 14px;
  color: var(--muted);
  max-width: 240px;
}

/* Модалки чатов должны быть поверх fullscreen */
#createChatModal,
#chatSettingsModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21010;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Делаем modal-overlay совместимым с hidden (в проекте эти оверлеи используются только тут) */
.modal-overlay[hidden] {
  display: none !important;
}

.modal-overlay:not([hidden]) {
  display: flex;
}

/* Адаптивность для модалей чата на мобильных */
@media (max-width: 480px) {
  #tab-chats .chats-list-panel {
    height: calc(100svh - 320px);
    min-height: 360px;
  }

  .chats-list-header {
    padding: 12px 14px;
  }

  .chats-list-header h3 {
    font-size: 15px;
  }

  .chat-type-selector {
    flex-direction: column;
  }

  .role-checkboxes {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  .checkbox-card {
    padding: 12px;
    font-size: 14px;
    min-height: 52px;
  }

  .checkbox-card input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    aspect-ratio: 1 / 1;
  }
  
  .chat-item {
    padding: 12px;
  }
  
  .chat-item__avatar {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  
  .chat-dialog-header {
    padding: 10px 12px;
  }
}

/* Фото */
.photos-header {
  margin-bottom: 16px;
}

/* === ПАПКИ для фото и заметок === */
.folders-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.folders-view[hidden] {
  display: none !important;
}

.folders-header {
  margin-left: calc(-1 * clamp(12px, 4vw, 32px));
  margin-right: calc(-1 * clamp(12px, 4vw, 32px));
  padding-left: clamp(12px, 4vw, 32px);
  padding-right: clamp(12px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.folders-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.folders-header .btn {
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.folder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
}

.folder-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.folder-card__icon {
  font-size: 40px;
  line-height: 1;
}

.folder-card__name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

.folder-card__count {
  font-size: 11px;
  color: var(--muted);
}

.folder-card__stage {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  /* Цвет задается inline через style */
}

.folder-content-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.folder-content-separator::before,
.folder-content-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.folder-content-separator span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Просмотр содержимого папки */
.folder-content-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.folder-content-view[hidden] {
  display: none !important;
}

.folder-content-header {
  margin-left: calc(-1 * clamp(12px, 4vw, 32px));
  margin-right: calc(-1 * clamp(12px, 4vw, 32px));
  padding-left: clamp(12px, 4vw, 32px);
  padding-right: clamp(12px, 4vw, 32px);
  padding-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.folder-content-info {
  flex: 1;
  min-width: 0;
}

.folder-content-info h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.folder-content-info .muted {
  margin: 0;
  font-size: 13px;
}

.folder-content-header .btn {
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px !important;
  min-width: auto !important;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-content-header .btn svg {
  display: block;
}

.folder-content-actions {
  display: flex;
  gap: 10px;
}

.folder-content-actions .btn {
  box-shadow: none !important;
}

/* Модалка папки - цвета и доступ */
.folder-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.folder-color-option {
  display: block;
  cursor: pointer;
}

.folder-color-option input {
  display: none;
}

.folder-color-swatch {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}

.folder-color-option input:checked + .folder-color-swatch {
  border-color: var(--text);
  transform: scale(1.1);
}

.folder-color-option:hover .folder-color-swatch {
  transform: scale(1.1);
}

.folder-access-options {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.folder-access-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.folder-access-option input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
}

.folder-roles-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
}

.folder-roles-select[hidden] {
  display: none !important;
}

.folder-roles-select label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.folder-roles-select label:hover {
  border-color: rgba(79, 209, 197, 0.5);
  background: rgba(79, 209, 197, 0.05);
}

.folder-roles-select input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  position: relative;
  transition: all 0.2s;
}

.folder-roles-select input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.folder-roles-select input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
}

.folder-roles-select label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.08);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item__delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-item:hover .photo-item__delete {
  opacity: 1;
}

.photo-item--add {
  background: var(--surface);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--muted);
}

/* Lightbox для фото */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  touch-action: none;
}

.lightbox__wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: default;
  user-select: none;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
}

/* Широкая meta-карточка */
.meta-card--wide {
  grid-column: 1 / -1;
}

.meta-card--wide .meta-card__value {
  font-size: 13px;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Заголовок чата с кнопкой полноэкранного режима */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.chat-header__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.chat-fullscreen-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-fullscreen-btn:hover {
  background: rgba(79, 209, 197, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}

/* Полноэкранный чат */
.chat-container--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  height: 100% !important;
  border-radius: 0;
  border: none;
  background: var(--surface);
}

.chat-container--fullscreen .chat-header {
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  justify-content: center;
  position: relative;
}

.chat-container--fullscreen .chat-header__title {
  text-align: center;
}

.chat-container--fullscreen .chat-fullscreen-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: env(safe-area-inset-top, 0px);
}

.chat-container--fullscreen .chat-messages {
  padding: 16px 14px;
}

.chat-container--fullscreen .chat-input-container {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

body.has-chat-fullscreen {
  overflow: hidden;
}

/* Заметки */
.notes-header {
  margin-bottom: 12px;
  display: flex;
  justify-content: flex-end;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
}

.note-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.note-item__header:hover {
  background: transparent;
}

.note-item__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.note-item__toggle {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s;
}

.note-item--expanded .note-item__toggle {
  transform: rotate(180deg);
}

.note-item__content {
  display: none;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.note-item__body {
  white-space: pre-wrap;
  word-break: break-word;
}

.note-item__text {
  cursor: text;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s;
}

.note-item__text:hover {
  background: rgba(79, 209, 197, 0.1);
}

.note-item__text:focus {
  outline: none;
  background: rgba(79, 209, 197, 0.15);
}

.note-item--expanded .note-item__content {
  display: block;
}

.note-item__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.note-item__photos {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.note-item__add-photos {
  margin-top: 10px;
}

.note-add-photo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.note-add-photo__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.note-photo {
  position: relative;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}

.note-photo__open {
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
  width: 100%;
  cursor: pointer;
}

.note-photo__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.note-photo__remove:hover {
  color: var(--text);
}

.note-photo__img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  display: block;
}

.note-item__date {
  font-size: 11px;
  color: var(--muted);
  white-space: normal;
  text-align: right;
  flex-shrink: 0;
  max-width: 45%;
  line-height: 1.2;
}

/* Кнопка редактирования в карточке описания */
.meta-card--wide {
  position: relative;
}

.meta-card__edit {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.meta-card__edit:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* Прогресс по срокам (шкала завершения) */
.project-progress {
  margin-top: 8px;
}

.project-progress__track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}

.project-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

/* === Шкала этапов проекта === */
.stages-progress {
  padding: 12px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.stages-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stages-progress__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.stages-progress__add {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 22px;
  font-weight: 300;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: none;
  color: var(--accent);
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.stages-progress__add:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

.stages-progress__add:focus {
  outline: none;
  box-shadow: none;
}

.stages-progress__track {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  overflow: hidden;
  position: relative;
}

.stages-progress__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--text-muted);
  font-size: 13px;
  padding: 10px;
}

.stage-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 8px 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.6;
}

.stage-segment.completed {
  opacity: 1;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4), 0 2px 8px rgba(0,0,0,0.2);
}

.stage-segment:hover {
  opacity: 0.9;
}

.stage-segment.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.stage-segment.drag-over {
  box-shadow: inset 0 0 0 2px #fff;
}

.stage-segment__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Цвета для выбора этапа */
.stage-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

/* Поле даты в модалке этапа */
#stageEndDate {
  width: calc(100% - 2px);
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: block;
}

.stage-color-option {
  display: block;
  cursor: pointer;
}

.stage-color-option input {
  display: none;
}

.stage-color-swatch {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}

.stage-color-option input:checked + .stage-color-swatch {
  border-color: var(--text);
  transform: scale(1.1);
}

.stage-color-option:hover .stage-color-swatch {
  transform: scale(1.1);
}

/* Универсальное модальное окно */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal--active {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal__content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__body {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

.modal__body .field {
  margin-bottom: 14px;
}

.modal__body .field > span {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal__body input[type="text"],
.modal__body input[type="email"],
.modal__body textarea,
.modal__body select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 15px;
  box-sizing: border-box;
}

.modal__body textarea {
  resize: vertical;
  min-height: 60px;
}

.modal__body .field input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.modal__body .btn {
  padding: 12px 16px;
  min-height: 44px;
  font-size: 14px;
}

.modal__body .btn--block {
  width: 100%;
}

.modal__footer {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__footer .btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 15px;
}

/* Модальное окно подтверждения */
.modal__content--confirm {
  max-width: 360px;
  text-align: center;
}

.modal__content--confirm .modal__body {
  padding: 20px 24px;
}

.modal__content--confirm .modal__body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Адаптация модалок для мобильных */
@media (max-width: 480px) {
  .modal {
    padding: 12px;
    align-items: flex-end;
  }
  
  .modal__content {
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    margin-bottom: 0;
  }
  
  .modal__body {
    padding: 14px;
  }
  
  .modal__footer .btn {
    padding: 14px 16px;
  }
}

/* Модальное окно для добавления заметки */
.note-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.note-modal__content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.note-modal__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.note-modal__actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.note-modal__actions .btn {
  flex: 1;
}

@media (max-width: 600px) {
  .project-detail__meta {
    grid-template-columns: 1fr;
  }
  
  .project-tabs {
    gap: 2px;
    padding: 3px;
  }
  
  .tab {
    padding: 8px 10px;
    font-size: 11px;
  }
  
  .photos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  
  /* Главная вкладка */
  .project-main-info__header {
    padding: 16px 12px;
  }
  
  .project-main-info__header h2 {
    font-size: 20px;
  }
  
  .project-detail__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  .project-detail__header .btn--back {
    align-self: flex-start;
  }
  
  .project-detail__info {
    width: 100%;
  }
  
  .project-detail__info h1 {
    font-size: 24px;
  }
  
  .btn--back {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .chat-input-container {
    padding: 8px;
    gap: 6px;
  }
  
  .chat-input {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 36px;
  }
  
  .chat-send,
  .chat-photo-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 16px;
  }
  
  .chat-message {
    max-width: 85%;
    padding: 10px 12px;
  }
  
  .chat-message__text {
    font-size: 14px;
  }
  
  .chat-message__image {
    max-width: 160px;
  }
  
  /* Документы на мобильных */
  .documents-grid {
    gap: 8px;
  }
  
  .document-card {
    padding: 12px;
    gap: 8px;
  }
  
  .document-card__icon {
    font-size: 24px;
  }
  
  .document-card__info h3 {
    font-size: 13px;
  }
  
  .document-card .btn--sm {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .document-card__file {
    padding: 6px 0;
  }
  
  .document-card__file a {
    font-size: 12px;
  }
}

/* === DEVELOPER PANEL STYLES === */
.developer-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.developer-warning p {
  margin: 0;
  font-size: 13px;
  color: #f6ad55;
}

.developer-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.developer-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.developer-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.developer-stat-label {
  font-size: 12px;
  color: var(--muted);
}

.developer-roles {
  margin-bottom: 20px;
}

.developer-roles h3 {
  font-size: 14px;
  margin: 0 0 10px;
}

.developer-roles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.developer-roles-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.developer-roles-list li strong {
  color: var(--accent);
}

.developer-users h3 {
  font-size: 14px;
  margin: 0 0 10px;
}

.developer-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.developer-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.developer-user-item--clickable {
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.developer-user-item--clickable:hover {
  background: var(--surface-hover, rgba(0,0,0,0.05));
  border-color: var(--primary);
}

.developer-user-item--clickable:active {
  transform: scale(0.98);
}

.developer-user-item--blocked {
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.3);
}

.developer-user-item--blocked:hover {
  background: rgba(244, 67, 54, 0.15);
  border-color: rgba(244, 67, 54, 0.5);
}

.developer-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.developer-user-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.developer-user-arrow {
  color: var(--muted);
  font-size: 16px;
}

.developer-user-item strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.developer-user-item .muted {
  font-size: 12px;
}

.developer-user-item .badge {
  flex-shrink: 0;
}

/* Select для роли пользователя в панели разработчика */
.developer-user-role-select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  max-width: 100px;
}

.developer-user-role-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Кнопки действий с пользователем */
.developer-user-item .btn--small {
  padding: 4px 8px;
  font-size: 16px;
  min-width: 32px;
}

/* Переключатель режима техработ */
.developer-maintenance-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.maintenance-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.maintenance-status.active {
  color: #e67e22;
}

.maintenance-icon {
  font-size: 24px;
}

.maintenance-text {
  font-weight: 600;
}

/* Модальное окно */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

.modal-close:active {
  transform: scale(0.95);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
  max-width: 100%;
  box-sizing: border-box;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Список команды проекта */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.team-member__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.team-member__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-member__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.team-member__role {
  font-size: 12px;
  color: var(--muted);
}

/* Список проектов в модалке */
.developer-projects-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.developer-project-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.developer-project-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.developer-project-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Секция подписки в модалке пользователя */
.developer-subscription-section,
.developer-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.developer-subscription-section h4,
.developer-section h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: var(--text);
}

/* Управление ролью */
.developer-role-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.developer-role-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.developer-role-row > span:first-child {
  color: var(--text-muted);
  font-size: 14px;
  min-width: 150px;
}

/* Блокировка аккаунта */
.developer-block-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.developer-block-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.developer-block-status > span:first-child {
  color: var(--text-muted);
  font-size: 14px;
}

.developer-block-status--blocked {
  background: rgba(244, 67, 54, 0.15);
  border-color: rgba(244, 67, 54, 0.4);
}

.developer-block-status--blocked strong {
  color: #f44336;
}

.developer-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.developer-sub-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.developer-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.developer-sub-row span:first-child {
  color: var(--text-muted);
  min-width: 100px;
}

.developer-sub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.developer-sub-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.developer-sub-action-group label {
  font-size: 13px;
  color: var(--text-muted);
}

/* IP секция в панели разработчика */
.developer-ip-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.developer-ip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.developer-ip-row span:first-child {
  color: var(--text-muted);
  min-width: 100px;
}

.developer-ip-code {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* Секция пароля */
.developer-password-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.developer-reset-link-show {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(52, 152, 219, 0.1);
  border: 1px solid rgba(52, 152, 219, 0.3);
  padding: 12px 14px;
  border-radius: 10px;
}

.developer-reset-link-code {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
  max-width: 100%;
  text-decoration: none;
}

.developer-reset-link-code:hover {
  background: rgba(52, 152, 219, 0.3);
}

.developer-ip-blocked {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 4px;
}

.developer-ip-blocked small {
  color: var(--text-muted);
}

/* Список IP адресов */
.developer-ip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.developer-ip-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.developer-ip-item--blocked {
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.3);
}

.developer-ip-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.developer-ip-item-dates {
  display: flex;
  gap: 16px;
  font-size: 11px;
  margin-top: 6px;
}

.developer-ip-block-info {
  font-size: 11px;
  color: #e74c3c;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(231, 76, 60, 0.2);
}

.developer-ip-last-login {
  font-size: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn--icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 6px;
  flex-shrink: 0;
}

.badge--small {
  font-size: 10px;
  padding: 2px 6px;
}

.badge--accent {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
}

.badge--danger {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.developer-projects-section {
  margin-top: 16px;
}

.developer-projects-section h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: var(--text);
}

.input--small {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
}

.btn--small {
  padding: 6px 10px;
  font-size: 13px;
  flex-shrink: 0;
  width: auto;
}

.btn--danger {
  background: #e74c3c;
  color: white;
  border: none;
}

.btn--danger:hover {
  background: #c0392b;
}

.btn--warning {
  background: #e67e22;
  color: white;
  border: none;
}

.btn--warning:hover {
  background: #d35400;
}

.btn--success {
  background: #27ae60;
  color: white;
  border: none;
}

.btn--success:hover {
  background: #219a52;
}

/* Страница техработ */
.maintenance-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 10000;
}

.maintenance-container {
  text-align: center;
  padding: 40px;
  max-width: 400px;
}

.maintenance-icon-large {
  font-size: 80px;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.maintenance-container h1 {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 600;
}

.maintenance-container p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.5;
  opacity: 0.9;
}

.maintenance-container .muted {
  opacity: 0.6;
  font-size: 14px;
}

.maintenance-container .btn {
  margin-top: 24px;
}

@media (max-width: 600px) {
  .developer-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .developer-stat-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .developer-stat-value {
    font-size: 22px;
  }
}
/* ===== SUBSCRIPTION SECTION ===== */
.subscription-container {
  padding: var(--content-gap);
  max-width: 900px;
  margin: 0 auto;
}

.subscription-back-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 16px;
  transition: opacity 0.2s;
}

.subscription-back-btn:hover {
  opacity: 0.8;
}

.subscription-header {
  text-align: center;
  margin-bottom: 24px;
}

.subscription-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px;
}

.subscription-current {
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.subscription-current.active {
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.08);
}

.subscription-current__icon {
  font-size: 40px;
  line-height: 1;
}

.subscription-current__info {
  flex: 1;
}

.subscription-current__plan {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.subscription-current__expires {
  font-size: 14px;
  color: var(--muted);
}

.subscription-current__days {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(79, 209, 197, 0.15);
  border-radius: 100px;
  font-size: 13px;
  color: var(--accent);
  margin-top: 10px;
}

.subscription-current__days-count {
  font-size: 20px;
  font-weight: 700;
}

.subscription-current__days-label {
  font-weight: 500;
}

.subscription-current__days.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.subscription-current__days.danger {
  background: rgba(245, 101, 101, 0.15);
  color: var(--danger);
}

.subscription-current__renewal {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.subscription-current__renewal-status {
  font-size: 13px;
  color: var(--muted);
}

.subscription-current__renewal-status.active {
  color: var(--accent);
}

.subscription-current__renewal-status.cancelled {
  color: #f59e0b;
}

.subscription-current__trial-notice {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 8px;
  font-size: 13px;
  color: #f59e0b;
}

.subscription-current__shared {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.subscription-current__shared strong {
  color: var(--accent);
}

/* Переключатель периода */
.subscription-period-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.subscription-period-btn {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.subscription-period-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.subscription-period-btn.active {
  background: var(--accent);
  color: #0a0f14;
}

.subscription-period-btn .discount {
  padding: 2px 6px;
  background: rgba(79, 209, 197, 0.2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
}

.subscription-period-btn.active .discount {
  background: rgba(0,0,0,0.2);
  color: #0a0f14;
}

.subscription-plans-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.subscription-plans {
  max-width: 600px;
  margin: 0 auto;
}

.subscription-plan {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
  min-height: auto;
}

.subscription-plan:hover {
  border-color: rgba(79, 209, 197, 0.4);
  transform: translateY(-4px);
}

.subscription-plan.popular {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(79, 209, 197, 0.06) 0%, var(--surface) 100%);
}

.subscription-plan__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: #0a0f14;
  white-space: nowrap;
}

.subscription-plan.current {
  border-color: var(--accent);
  opacity: 0.7;
}

.subscription-plan__header {
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.subscription-plan__name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.subscription-plan__description {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.subscription-plan__price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.subscription-plan__amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.subscription-plan__period {
  font-size: 12px;
  color: var(--muted);
}

.subscription-plan__savings {
  padding: 2px 8px;
  background: rgba(79, 209, 197, 0.15);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 2px;
}

.subscription-plan__monthly {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.subscription-plan__features {
  flex: 1;
  margin-bottom: 12px;
}

.subscription-plan__features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subscription-plan__features li {
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.subscription-plan__features .feature-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.subscription-plan__btn {
  width: 100%;
}

.subscription-plan__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .subscription-container {
    padding: 16px 12px;
  }
  
  .subscription-header h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .subscription-current {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 12px;
  }
  
  .subscription-current__icon {
    font-size: 32px;
  }
  
  .subscription-current__plan {
    font-size: 16px;
  }
  
  .subscription-current__days {
    padding: 8px 16px;
  }
  
  .subscription-current__days-count {
    font-size: 18px;
  }
  
  .subscription-current__renewal {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  
  .subscription-current__trial-notice {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .subscription-period-selector {
    padding: 4px;
    gap: 4px;
  }
  
  .subscription-period-btn {
    padding: 10px 8px;
    font-size: 12px;
    min-width: 0;
  }
  
  .subscription-period-btn .discount {
    font-size: 9px;
    padding: 1px 4px;
  }
  
  .subscription-plans-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .subscription-plan {
    padding: 12px 10px;
  }
  
  .subscription-plan__amount {
    font-size: 18px;
  }
  
  .subscription-plan__name {
    font-size: 13px;
  }
  
  .subscription-plan__description {
    font-size: 10px;
    margin-bottom: 6px;
  }
  
  .subscription-plan__features li {
    font-size: 10px;
    gap: 4px;
  }
  
  .subscription-plan__features .feature-icon {
    font-size: 12px;
    width: 16px;
  }
  
  .subscription-plan__header {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  
  .subscription-plan__features {
    margin-bottom: 12px;
  }
  
  .subscription-plan__features ul {
    gap: 3px;
  }
  
  .subscription-plan__badge {
    font-size: 9px;
    padding: 2px 8px;
    top: -8px;
  }
  
  .subscription-plan__period {
    font-size: 10px;
  }
  
  .subscription-plan__savings {
    font-size: 9px;
    padding: 1px 6px;
  }
  
  .subscription-plan__monthly {
    font-size: 9px;
  }
  
  .subscription-plan__btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .subscription-period-selector {
    flex-direction: column;
    gap: 6px;
  }
  
  .subscription-period-btn {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    font-size: 14px;
  }
  
  .subscription-plan__amount {
    font-size: 24px;
  }
}

@media (max-width: 600px) {
  .subscription-plans {
    grid-template-columns: 1fr;
  }
}

/* ===== ONBOARDING PLAN SELECTION ===== */
.onboarding-plan {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-plan__header {
  text-align: center;
  margin-bottom: 32px;
}

.onboarding-plan__icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.onboarding-plan__header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.onboarding-plan__header p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.onboarding-plan__trial {
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.15) 0%, rgba(79, 209, 197, 0.05) 100%);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.onboarding-plan__trial::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong), var(--accent));
}

.onboarding-plan__trial-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent);
  color: #0a0f14;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.onboarding-plan__trial-days {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.onboarding-plan__trial-features {
  font-size: 15px;
  color: var(--muted);
}

.onboarding-plan__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.onboarding-plan__divider::before,
.onboarding-plan__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.onboarding-plan__divider span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.onboarding-plan__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.onboarding-plan-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.onboarding-plan-card:hover {
  border-color: rgba(79, 209, 197, 0.5);
  transform: translateY(-4px);
}

.onboarding-plan-card.selected {
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.08);
}

.onboarding-plan-card.popular {
  border-color: var(--accent);
}

.onboarding-plan-card__badge {
  position: absolute;
  top: -12px;
  right: 20px;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: #0a0f14;
}

.onboarding-plan-card__check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.onboarding-plan-card.selected .onboarding-plan-card__check {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0f14;
}

.onboarding-plan-card__name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.onboarding-plan-card__desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.onboarding-plan-card__price {
  margin-bottom: 16px;
}

.onboarding-plan-card__amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

.onboarding-plan-card__period {
  font-size: 14px;
  color: var(--muted);
}

.onboarding-plan-card__prices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.onboarding-plan-card__prices span {
  font-size: 12px;
  color: var(--muted);
}

.onboarding-plan-card__prices .discount {
  color: var(--accent);
  font-weight: 600;
}

.onboarding-plan-card__features {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.onboarding-plan-card__features li {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.onboarding-plan-card__features .icon {
  font-size: 14px;
}

.onboarding-plan__footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.onboarding-plan__footer .btn {
  min-width: 200px;
}

.onboarding-plan__note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .onboarding-plan {
    padding: 20px 16px;
  }
  
  .onboarding-plan__header {
    margin-bottom: 20px;
  }
  
  .onboarding-plan__icon {
    font-size: 48px;
  }
  
  .onboarding-plan__header h1 {
    font-size: 22px;
  }
  
  .onboarding-plan__header p {
    font-size: 14px;
  }
  
  .onboarding-plan__trial {
    padding: 16px;
    margin-bottom: 24px;
  }
  
  .onboarding-plan__trial-days {
    font-size: 24px;
  }
  
  .onboarding-plan__trial-features {
    font-size: 13px;
  }
  
  .onboarding-plan__divider {
    margin-bottom: 20px;
  }
  
  .onboarding-plan__cards {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }
  
  .onboarding-plan-card {
    padding: 20px 16px;
  }
  
  .onboarding-plan-card__name {
    font-size: 18px;
  }
  
  .onboarding-plan-card__amount {
    font-size: 24px;
  }
  
  .onboarding-plan-card__prices {
    gap: 4px;
  }
  
  .onboarding-plan-card__prices span {
    font-size: 11px;
  }
  
  .onboarding-plan-card__features li {
    font-size: 12px;
    gap: 6px;
  }
}

/* ===== SUBSCRIPTION EXPIRED MODAL ===== */
.subscription-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.subscription-modal.visible {
  opacity: 1;
  visibility: visible;
}

.subscription-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.subscription-modal__content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.subscription-modal.visible .subscription-modal__content {
  transform: translateY(0);
}

.subscription-modal__icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.subscription-modal__content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.subscription-modal__content p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 24px;
}

.subscription-modal__plans {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.subscription-modal__plan {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.subscription-modal__plan:hover {
  border-color: rgba(79, 209, 197, 0.5);
}

.subscription-modal__plan.popular {
  border-color: var(--accent);
}

.subscription-modal__plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  background: var(--accent);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  color: #0a0f14;
  white-space: nowrap;
}

.subscription-modal__plan-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.subscription-modal__plan-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
}

.subscription-modal__plan-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.subscription-modal__close {
  color: var(--muted);
}

/* ===== TRIAL ENDING REMINDER ===== */
.trial-reminder {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 500px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.trial-reminder.visible {
  opacity: 1;
  transform: translateY(0);
}

.trial-reminder__icon {
  font-size: 32px;
}

.trial-reminder__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trial-reminder__text strong {
  font-size: 14px;
  font-weight: 600;
  color: #f59e0b;
}

.trial-reminder__text span {
  font-size: 13px;
  color: var(--muted);
}

.trial-reminder__close {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.trial-reminder__close:hover {
  background: rgba(255,255,255,0.2);
  color: var(--text);
}

@media (max-width: 600px) {
  .subscription-modal__plans {
    flex-direction: column;
  }
  
  .trial-reminder {
    flex-wrap: wrap;
  }
  
  .trial-reminder__text {
    min-width: 100%;
    order: 1;
  }
  
  .trial-reminder__icon {
    order: 0;
  }
  
  .trial-reminder__close {
    order: 0;
    margin-left: auto;
  }
  
  .trial-reminder .btn {
    order: 2;
    width: 100%;
    margin-top: 8px;
  }
}

/* ===== Design Files ===== */
.design-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.design-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.design-header .btn {
  align-self: flex-start;
  box-shadow: none;
}

.design-files-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.design-file-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
}

.design-file-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.design-file-card__preview {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.design-file-card__preview--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-secondary);
}

.design-file-card__info {
  flex: 1;
  min-width: 0;
}

.design-file-card__name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-word;
}

.design-file-card__meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.design-file-card__status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.design-file-card__status--pending {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.design-file-card__status--approved {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}

.design-file-card__status--rejected {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
}

.design-file-card__comment {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.design-file-card__comments-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.design-file-card__comments-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.design-file-card__comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.design-comment {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 10px 12px;
}

.design-comment__author {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.design-comment__text {
  font-size: 13px;
  line-height: 1.4;
}

.design-comment__time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.design-file-card__add-comment {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  align-items: end;
}

.design-file-card__add-comment textarea {
  width: 100%;
  min-height: 32px;
  max-height: 80px;
  resize: none;
}

.design-add-comment-btn {
  width: 44px;
  height: 32px;
  padding: 0;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #0b1419;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.design-file-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.design-file-card__actions .btn {
  flex: 1;
}

.design-file-card__description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.design-file-card__changes {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(79, 209, 197, 0.1);
  border-radius: 8px;
}

.design-file-card__link {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
}

.design-file-card__link:hover {
  text-decoration: underline;
}

.design-file-card__stage {
  display: inline-block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.design-file-card__version {
  display: inline-block;
  padding: 2px 6px;
  background: var(--accent);
  color: #0b1419;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.design-file-card__edit {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  margin-left: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.design-file-card__edit:hover {
  opacity: 1;
}

.design-file-card__footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Members ===== */
.members-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.invite-section {
  margin-bottom: 20px;
}

.invite-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
}

.invite-card .form-label {
  margin-bottom: 8px;
}

.invite-card .form-input {
  margin-bottom: 12px;
}

.invite-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.invite-link-box .form-input {
  flex: 1;
  margin-bottom: 0;
  font-size: 12px;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
}

.member-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.member-card__info {
  flex: 1;
  min-width: 0;
}

.member-card__name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.member-card__role {
  font-size: 12px;
  color: var(--text-secondary);
}

.member-card__badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}

.member-card__badge--designer {
  background: #9c27b0;
}

.member-card__badge--brigadier {
  background: #2196f3;
}

.member-card__badge--owner {
  background: #ff9800;
}

/* Invite Result */
.invite-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.invite-result .invite-link-box {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.invite-result .invite-link-box .form-input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}

.invite-result .invite-link-box .btn {
  flex-shrink: 0;
  width: 44px;
  min-width: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Invite Item */
.invite-item {
  padding: 12px 16px !important;
}

.invite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invite-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.invite-info .muted {
  margin: 4px 0 0 0;
  font-size: 13px;
}

.copy-invite-btn {
  white-space: nowrap;
  font-size: 13px !important;
  padding: 8px 12px !important;
}

/* Pending Members Section */
.pending-members-section {
  margin-top: 24px;
  padding: 16px;
  background: rgba(79, 209, 197, 0.08);
  border-radius: 12px;
  border: 1px dashed rgba(79, 209, 197, 0.4);
}

.pending-members-section .section-subtitle {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}

.pending-members-section .muted {
  margin-bottom: 12px;
  font-size: 13px;
}

.pending-member-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.pending-member-item:last-child {
  margin-bottom: 0;
}

.pending-member-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pending-member-info p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pending-member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-member-actions select {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.pending-member-actions .btn {
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
}

.section-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

/* ===== Referral Program ===== */
.referral-card {
  margin-bottom: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.12) 0%, rgba(56, 178, 172, 0.08) 100%);
  border: 1px solid rgba(79, 209, 197, 0.3);
  overflow: hidden;
  transition: all 0.3s ease;
}

.referral-card:hover {
  border-color: rgba(79, 209, 197, 0.5);
  box-shadow: 0 4px 20px rgba(79, 209, 197, 0.15);
}

.referral-card--open {
  background: var(--surface);
  border-color: var(--accent);
}

.referral-card__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: all 0.2s;
}

.referral-card__toggle:active {
  transform: scale(0.99);
}

.referral-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-radius: 12px;
  flex-shrink: 0;
}

.referral-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.referral-card__title {
  font-size: 15px;
  font-weight: 600;
}

.referral-card__subtitle {
  font-size: 13px;
  color: var(--muted);
}

.referral-card__arrow {
  font-size: 24px;
  color: var(--accent);
  transition: transform 0.3s ease;
  font-weight: 300;
}

.referral-card--open .referral-card__arrow {
  transform: rotate(90deg);
}

.referral-card__content {
  padding: 0 20px 20px;
  animation: slideDown 0.3s ease;
}

.referral-card__loading {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.referral-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.referral-bonus-info {
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.15) 0%, rgba(56, 178, 172, 0.08) 100%);
  border: 1px solid rgba(79, 209, 197, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

.referral-bonus-info strong {
  color: var(--accent);
}

.referral-link-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  border-radius: 12px;
}

.referral-link-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.referral-link-icon {
  font-size: 16px;
}

.referral-link-input {
  margin-bottom: 12px;
}

.referral-link-input input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  font-family: monospace;
}

.referral-link-actions {
  display: flex;
  gap: 10px;
}

.referral-link-actions .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.referral-stats {
  display: flex;
  gap: 10px;
}

.referral-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  text-align: center;
}

.referral-stat--highlight {
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.2), rgba(56, 178, 172, 0.1));
  border: 1px solid rgba(79, 209, 197, 0.3);
}

.referral-stat__icon {
  font-size: 18px;
}

.referral-stat__value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.referral-stat__label {
  font-size: 11px;
  color: var(--muted);
}

.referral-list {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.referral-list__header {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.referral-list__items {
  max-height: 180px;
  overflow-y: auto;
}

.referral-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.referral-item:last-child {
  border-bottom: none;
}

.referral-item--paid {
  background: rgba(79, 209, 197, 0.08);
}

.referral-item__avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 13px;
  border-radius: 50%;
  flex-shrink: 0;
}

.referral-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.referral-item__name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.referral-item__date {
  font-size: 11px;
  color: var(--muted);
}

.referral-item__status {
  font-size: 16px;
  flex-shrink: 0;
}

.referral-how {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  border-radius: 12px;
}

.referral-how__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.referral-how__steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.referral-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.referral-step__num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.referral-step__text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 400px) {
  .referral-link-actions {
    flex-direction: column;
  }
  
  .referral-stats {
    flex-wrap: wrap;
  }
  
  .referral-stat {
    min-width: calc(50% - 5px);
  }
}

/* ========== TASK CARDS ========== */
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.task-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.task-card--priority-high {
  border-left: 3px solid #e74c3c;
}

.task-card--priority-medium {
  border-left: 3px solid #f39c12;
}

.task-card--priority-low {
  border-left: 3px solid #27ae60;
}

.task-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.task-card__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.task-card__priority {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.task-card__priority--high {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.task-card__priority--medium {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.task-card__priority--low {
  background: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

.task-card__description {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.task-card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-card__status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.task-card__status--pending {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.task-card__status--in_progress {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}

.task-card__status--completed {
  background: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

.task-card__status--overdue {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.task-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.task-card__btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-card__btn--start {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}

.task-card__btn--start:hover {
  background: rgba(52, 152, 219, 0.25);
}

.task-card__btn--complete {
  background: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

.task-card__btn--complete:hover {
  background: rgba(39, 174, 96, 0.25);
}

/* ===== WORKER TASK CARD ENHANCED ===== */
.worker-task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  transition: all 0.25s ease;
}

.worker-task-card:hover {
  border-color: var(--border-strong);
}

.worker-task-card--pending {
  border-left: 4px solid #f1c40f;
}

.worker-task-card--in_progress {
  border-left: 4px solid #3498db;
}

.worker-task-card--completed {
  border-left: 4px solid #2ecc71;
  opacity: 0.8;
}

.worker-task-card--overdue {
  border-left: 4px solid #e74c3c;
  background: rgba(231, 76, 60, 0.05);
}

.worker-task-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.worker-task-card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  flex: 1;
}

.worker-task-card__priority {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
}

.worker-task-card__priority--high {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.worker-task-card__priority--medium {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}

.worker-task-card__priority--low {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.worker-task-card__desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.worker-task-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.worker-task-card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.worker-task-card__deadline {
  color: var(--text);
  font-weight: 500;
}

.worker-task-card__deadline--overdue {
  color: #e74c3c;
}

/* Report Slots */
.worker-task-card__reports {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.worker-task-card__reports-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-slot:hover {
  border-color: var(--accent);
  background: rgba(79, 209, 197, 0.05);
}

.report-slot--filled {
  border-style: solid;
  background: rgba(46, 204, 113, 0.08);
  border-color: rgba(46, 204, 113, 0.3);
  cursor: default;
}

.report-slot__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.report-slot--filled .report-slot__icon {
  background: rgba(46, 204, 113, 0.15);
}

.report-slot__content {
  flex: 1;
  min-width: 0;
}

.report-slot__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 2px;
}

.report-slot__status {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.report-slot--filled .report-slot__status {
  color: #2ecc71;
}

.report-slot__arrow {
  font-size: 16px;
  color: var(--muted);
}

/* Start Task Button */
.btn-start-task {
  width: 100%;
  padding: 14px 20px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.btn-start-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(52, 152, 219, 0.4);
}

.btn-start-task:active {
  transform: translateY(0);
}

/* Finish Task Button */
.btn-finish-task {
  width: 100%;
  padding: 14px 20px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
}

.btn-finish-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(39, 174, 96, 0.4);
}

.btn-finish-task:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Report Modal */
.report-form {
  padding: 20px;
}

.report-form__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px;
  text-align: center;
}

.report-form__slot-name {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  text-align: center;
}

.report-form__field {
  margin-bottom: 16px;
}

.report-form__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--muted);
}

.report-form__input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  transition: border-color 0.2s ease;
}

.report-form__input:focus {
  outline: none;
  border-color: var(--accent);
}

.report-form__textarea {
  resize: vertical;
  min-height: 100px;
}

.report-form__files {
  margin-top: 16px;
}

.report-form__file-input {
  display: none;
}

.report-form__file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: rgba(79, 209, 197, 0.1);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-form__file-btn:hover {
  background: rgba(79, 209, 197, 0.15);
}

.report-form__file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-form__file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  font-size: 13px;
}

.report-form__file-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  padding: 4px;
}

.report-form__submit {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: #0a0f14;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-form__submit:hover {
  background: var(--accent-strong);
}

/* ========== NOTIFICATION ITEMS ========== */
.notification-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-item:hover {
  border-color: var(--accent);
}

.notification-item--unread {
  background: rgba(var(--accent-rgb), 0.05);
  border-left: 3px solid var(--accent);
}

.notification-item__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.notification-item__icon {
  font-size: 20px;
}

.notification-item__type {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}

.notification-item__time {
  font-size: 11px;
  color: var(--muted);
}

.notification-item__text {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ========== FILE CARDS ========== */
.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-card:hover {
  border-color: var(--accent);
}

.file-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.file-card__icon {
  font-size: 28px;
}

.file-card__info {
  flex: 1;
  min-width: 0;
}

.file-card__name {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card__meta {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.file-card__status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.file-card__status--pending {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.file-card__status--approved {
  background: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

.file-card__status--rejected {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.file-card__version {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.file-card__version-badge {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* ========== FILE DETAIL VIEW ========== */
.file-detail {
  padding: 0;
}

.file-detail__preview {
  background: var(--bg);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.file-detail__preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
}

.file-detail__info {
  margin-bottom: 20px;
}

.file-detail__row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.file-detail__label {
  color: var(--muted);
}

.file-detail__value {
  font-weight: 500;
}

.file-detail__section {
  margin-bottom: 20px;
}

.file-detail__section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Version List */
.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.version-item:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.version-item--current {
  border: 1px solid var(--accent);
}

.version-item__number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}

.version-item__info {
  flex: 1;
}

.version-item__date {
  font-size: 13px;
  font-weight: 500;
}

.version-item__author {
  font-size: 12px;
  color: var(--muted);
}

.version-item__badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #0a0f14;
  font-weight: 600;
}

/* Comments Section */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.comment-item {
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
}

.comment-item__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-item__author {
  font-size: 13px;
  font-weight: 600;
}

.comment-item__role {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
}

.comment-item__time {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.comment-item__text {
  font-size: 13px;
  margin: 0;
  color: var(--text);
}

/* Comment Form */
.comment-form {
  display: flex;
  gap: 10px;
}

.comment-form__input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  resize: none;
}

.comment-form__input:focus {
  outline: none;
  border-color: var(--accent);
}

.comment-form__btn {
  padding: 10px 16px;
  background: var(--accent);
  color: #0a0f14;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-form__btn:hover {
  opacity: 0.9;
}

/* Compare View (Before/After) */
.compare-view {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.compare-view__side {
  flex: 1;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.compare-view__label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.compare-view__image {
  max-width: 100%;
  border-radius: 6px;
}

/* Task Detail View */
.task-detail__header {
  margin-bottom: 16px;
}

.task-detail__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.task-detail__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.task-detail__description {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.task-detail__description-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.task-detail__description-text {
  font-size: 14px;
  margin: 0;
}

.task-detail__info {
  margin-bottom: 20px;
}

.task-detail__assignees {
  margin-bottom: 16px;
}

.task-detail__assignees-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.task-detail__assignee-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-detail__assignee {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
}

.task-detail__attachments {
  margin-bottom: 20px;
}

.task-detail__attachments-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.attachment-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.attachment-item:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.attachment-item__preview {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
}

.attachment-item__name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-detail__actions {
  display: flex;
  gap: 10px;
}

.task-detail__actions .btn {
  flex: 1;
}

/* ===== Pending Status View ===== */
.pending-status-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 20px;
}

.pending-status-card {
  text-align: center;
  padding: 40px 24px;
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border);
  max-width: 360px;
  width: 100%;
}

.pending-status-card__icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
}

.pending-status-card__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
}

.pending-status-card__text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.pending-status-card__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(79, 209, 197, 0.1);
  border-radius: 12px;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 24px;
}

.pending-status-card .btn {
  width: 100%;
}

/* Pending Projects Section */
.pending-projects-section {
  margin-top: 24px;
  width: 100%;
  max-width: 360px;
}

.pending-projects-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.pending-projects-section .item {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.pending-projects-section .item header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pending-projects-section .item h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pending-projects-section .item .badge {
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(79, 209, 197, 0.15);
  color: var(--accent);
  border-radius: 6px;
}

.pending-projects-section .item .muted {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ========================================
   SUPPORT CHAT STYLES
   ======================================== */

/* Support tile */
.tile--support {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

.tile--warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
  border-color: rgba(245, 158, 11, 0.3);
}

.tile--success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(79, 209, 197, 0.1) 100%);
  border-color: rgba(34, 197, 94, 0.3);
}

/* Support Chat View */
.support-chat-view {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--bg);
}

.support-chat-view[hidden] {
  display: none;
}

.support-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Header как topbar для support chat */
.support-chat__header.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 24px);
  padding: 16px clamp(16px, 3vw, 24px) 12px;
  padding-top: calc(16px + var(--safe-top, 0px));
  margin: 0;
  border-radius: 0;
  background: rgba(12, 22, 28, 0.65);
  border: none;
  border-bottom: 1px solid rgba(79, 209, 197, 0.25);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  isolation: isolate;
  width: 100%;
  flex-shrink: 0;
}

body.platform-android .support-chat__header.topbar {
  padding-top: calc(10px + var(--safe-top, 0px));
  padding-bottom: 8px;
}

.support-chat__header .topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.support-chat__header .topbar__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.support-chat__header .topbar__title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-chat__header .topbar__subtitle {
  font-size: 12px;
  color: var(--muted);
}

.support-chat__back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s;
}

.support-chat__back:active {
  background: rgba(79, 209, 197, 0.1);
}

.support-chat__status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.support-chat__status.resolved {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.support-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-chat__welcome {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.support-chat__welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.support-chat__welcome h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--text);
}

.support-chat__welcome p {
  margin: 0;
  font-size: 14px;
}

.support-chat__message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.support-chat__message--user {
  align-self: flex-end;
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 4px;
}

.support-chat__message--support {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.support-chat__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
}

.support-chat__divider::before,
.support-chat__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.support-chat__divider span {
  white-space: nowrap;
}

.support-chat__message-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.support-chat__message--user .support-chat__message-time {
  color: rgba(0, 0, 0, 0.5);
}

.support-chat__message-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 4px;
}

.support-chat__form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.support-chat__photo-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.support-chat__photo-btn:active {
  background: rgba(79, 209, 197, 0.1);
  border-color: var(--accent);
}

.support-chat__input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.support-chat__input:focus {
  border-color: var(--accent);
}

.support-chat__send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #000;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.support-chat__send:active {
  transform: scale(0.95);
}

/* Support Panel Styles */
.support-tickets-container {
  margin-top: 24px;
}

.support-ticket-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.support-ticket-item:hover {
  background: var(--surface);
}

.support-ticket-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #000;
  font-weight: 600;
}

.support-ticket-item__info {
  flex: 1;
  min-width: 0;
}

.support-ticket-item__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-ticket-item__preview {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-ticket-item__meta {
  text-align: right;
}

.support-ticket-item__time {
  font-size: 12px;
  color: var(--muted);
  display: block;
}

.support-ticket-item__unread {
  display: inline-block;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent);
  color: #000;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  margin-top: 4px;
}

/* Support Tickets List */
.support-tickets-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-tickets-list .muted {
  text-align: center;
  padding: 40px 20px;
}

.support-chat__status-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.support-user-info-card {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-shrink: 0;
}

.support-user-info-card__row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.support-user-info-card__row span:first-child {
  color: var(--muted);
}

.support-user-info-card__row span:last-child {
  color: var(--text);
}

/* ===== DOCUMENT SECTIONS ===== */
/* Header с кнопкой - расширяем за пределы padding для box-shadow */
.doc-sections-header,
.doc-section-header {
  margin-left: calc(-1 * clamp(12px, 4vw, 32px));
  margin-right: calc(-1 * clamp(12px, 4vw, 32px));
  padding-left: clamp(12px, 4vw, 32px);
  padding-right: clamp(12px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Убираем box-shadow у кнопок в разделе документов */
.doc-sections-header .btn,
.doc-section-header .btn {
  box-shadow: none !important;
}

.doc-sections-header h3,
.doc-section-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.doc-section-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.doc-section-info {
  flex: 1;
  min-width: 0;
}

.doc-section-info h3 {
  margin: 0 0 4px;
}

.doc-section-info .muted {
  margin: 0;
  font-size: 13px;
}

.doc-sections-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.doc-sections-header .btn,
.doc-section-header .btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.doc-section-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.doc-section-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 209, 197, 0.15);
  border-radius: 12px;
  font-size: 24px;
  flex-shrink: 0;
}

.doc-section-card__info {
  flex: 1;
  min-width: 0;
}

.doc-section-card__name {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.doc-section-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.doc-section-card__count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.doc-section-card__access {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 11px;
}

.doc-section-card__arrow {
  color: var(--muted);
  font-size: 18px;
}

.doc-section-card__actions {
  display: flex;
  gap: 8px;
}

/* Document Items in Section */
.doc-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.doc-item:hover {
  border-color: rgba(79, 209, 197, 0.5);
}

.doc-item__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.doc-item__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  font-size: 20px;
  flex-shrink: 0;
}

.doc-item__info {
  flex: 1;
  min-width: 0;
}

.doc-item__name {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  word-break: break-word;
}

.doc-item__version {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(79, 209, 197, 0.15);
  color: var(--accent);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 8px;
}

.doc-item__stage {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(147, 112, 219, 0.15);
  color: #9370db;
  border-radius: 4px;
  font-size: 11px;
}

.doc-item__description {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0;
  line-height: 1.4;
}

.doc-item__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.doc-item__actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.doc-item__actions .btn {
  flex: 1;
}

/* Document Source Tabs */
.doc-source-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.doc-source-tab {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.doc-source-tab:hover {
  border-color: rgba(79, 209, 197, 0.5);
}

.doc-source-tab.active {
  background: rgba(79, 209, 197, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.doc-source-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Empty state */
.doc-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.doc-empty-state__icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.doc-empty-state__text {
  font-size: 14px;
  margin: 0;
}