:root {
  --master-bg: #090d16;
  --master-card: #121826;
  --master-border: #1e293b;
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --green: #10b981;
  --blue: #3b82f6;
  --red: #ef4444;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

a, button, input, select, textarea {
  touch-action: manipulation;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

body {
  background-color: var(--master-bg);
  color: var(--text-main);
  font-family: 'Montserrat', sans-serif;
  line-height: 1.5;
}

.gold { color: var(--gold); }

@keyframes goldPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
  50% { transform: scale(1.18); filter: drop-shadow(0 0 16px #f59e0b) drop-shadow(0 0 25px #10b981); color: #fff; }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
}

.kpi-glow-pulse {
  animation: goldPulse 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
}

/* ШАПКА КАБИНЕТА */
.master-header {
  background: var(--master-card);
  border-bottom: 1px solid var(--master-border);
  padding: 16px 24px;
  width: 100%;
  box-sizing: border-box;
}

.header-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.master-logo {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-role {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid #3b82f6;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.header-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  border: 1px solid var(--master-border);
  padding: 7px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.master-switcher-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-wrap: wrap;
  width: 100%;
}

.master-switcher-box label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.master-select {
  background: #090d16;
  border: 1px solid var(--gold);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  flex: 1;
  min-width: 260px;
  max-width: 100%;
}

.master-main {
  padding: 24px 0;
}

.master-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* KPI КАРТОЧКИ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--master-card);
  border: 1px solid var(--master-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-icon {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: 10px;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

/* ВКЛАДКИ */
.tab-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #0d121f;
  border: 1px solid var(--master-border);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
  background: var(--master-card);
  border-color: var(--gold);
  color: #fff;
}

.tab-pane {
  display: block;
}

/* СЕКЦИИ И КАРТОЧКИ */
.section-card {
  background: var(--master-card);
  border: 1px solid var(--master-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  box-sizing: border-box;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* КНОПКИ ПЕРИОДОВ ГРАФИКА */
.period-button-group {
  display: inline-flex;
  background: #090d16;
  border: 1px solid var(--master-border);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.btn-period {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-period.active {
  background: var(--gold) !important;
  color: #000 !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-period:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.chart-summary-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid #10b981;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* КОНТЕЙНЕР ГРАФИКА */
.chart-container {
  background: #090d16;
  border: 1px solid var(--master-border);
  border-radius: 12px;
  padding: 30px 16px 36px 16px;
  position: relative;
  overflow-x: auto;
  margin-top: 14px;
  box-sizing: border-box;
}

.chart-grid-bg {
  position: absolute;
  top: 30px;
  left: 16px;
  right: 16px;
  bottom: 36px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.grid-line {
  width: 100%;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.chart-bars-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  height: 220px;
  min-height: 220px;
  position: relative;
  z-index: 2;
  min-width: 100%;
  box-sizing: border-box;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 36px;
  max-width: 64px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.bar-val {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.bar-track {
  width: 100%;
  height: 100%;
  max-height: 160px;
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px 8px 3px 3px;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #f59e0b 0%, rgba(245, 158, 11, 0.35) 100%);
  border-radius: 8px 8px 3px 3px;
  min-height: 4px;
  transition: height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.chart-bar-item:hover .bar-fill {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

.chart-bar-item:hover .bar-val {
  transform: scale(1.15);
  color: #fff;
}

.chart-bar-item.is-today .bar-fill {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.chart-bar-item.is-today .bar-val {
  color: #34d399;
}

.bar-label {
  position: absolute;
  bottom: -28px;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
  font-weight: 600;
}

.chart-bar-item.is-today .bar-label {
  color: #fff;
  font-weight: 700;
}

/* ФИЛЬТРЫ РАСПИСАНИЯ */
.schedule-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0d121f;
  border: 1px solid var(--master-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-btn-group {
  display: flex;
  gap: 8px;
}

.btn-chip {
  background: #1e293b;
  border: 1px solid var(--master-border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-chip.active, .btn-chip:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.modal-cat-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-date-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-date-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.master-input-date {
  background: #090d16;
  border: 1px solid var(--master-border);
  color: #fff;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
}

/* ТАБЛИЦА РАСПИСАНИЯ */
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.master-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.master-table th {
  background: #0d121f;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--master-border);
  white-space: nowrap;
}

.master-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #1a2336;
  vertical-align: middle;
}

.master-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.table-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

/* НАТИВНЫЕ КАРТОЧКИ ЗАПИСЕЙ МАСТЕРА (APP-STYLE) */
.master-schedule-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

@media (min-width: 901px) {
  .master-schedule-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
  }
}

.m-booking-card {
  background: #0d1220;
  border: 1px solid var(--master-border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, transform 0.2s ease;
  box-sizing: border-box;
}

.m-booking-card:hover {
  border-color: rgba(245, 158, 11, 0.45);
}

/* Строка 1: Время + Дата слева, Статус справа */
.m-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  line-height: 1.25;
}

.m-time-date-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-card-time {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.2;
}

.m-card-dot {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.m-card-date {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-weight: 600;
  line-height: 1.2;
}

.m-card-status {
  display: flex;
  align-items: center;
}

.m-card-status .status-pill {
  padding: 2px 8px;
  font-size: 0.72rem;
  line-height: 1.2;
}

/* Строка 2: Клиент слева, Телефон справа */
.m-card-client-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  line-height: 1.25;
}

.m-card-client-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  line-height: 1.2;
}

.m-card-phone {
  color: #60a5fa;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.m-card-phone:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* Строка 3: Услуга слева, Стоимость справа */
.m-card-service-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  line-height: 1.25;
}

.m-card-service-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
  line-height: 1.2;
}

.m-card-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold);
  white-space: nowrap;
  line-height: 1.2;
}

/* Строка 4: Компактные кнопки действий */
.m-card-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 1px;
}

.m-card-actions .btn-action {
  flex: 1;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.76rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: none;
  line-height: 1.2;
}

.btn-complete-master {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid #10b981 !important;
}

.btn-complete-master:hover {
  background: #10b981 !important;
  color: #000 !important;
}

.btn-cancel-master {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid #ef4444 !important;
}

.btn-cancel-master:hover {
  background: #ef4444 !important;
  color: #fff !important;
}

.btn-restore-master {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.btn-restore-master:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #fff !important;
}

.m-card-done-msg {
  width: 100%;
  text-align: center;
  color: #10b981;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 0;
}

/* ПОРТФОЛИО */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.portfolio-card {
  background: #0d121f;
  border: 1px solid var(--master-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.portfolio-images {
  display: flex;
  height: 180px;
  position: relative;
}

.work-img-col {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.work-img-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.tag-after {
  color: var(--gold);
  border: 1px solid var(--gold);
}

.portfolio-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.portfolio-title { font-weight: 700; color: #fff; margin-bottom: 4px; }
.portfolio-cat { font-size: 0.78rem; color: var(--gold); margin-bottom: 8px; }
.portfolio-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 12px; }

.portfolio-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--master-border);
}

.btn-del-work {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

/* ФОРМЫ */
.profile-form {
  max-width: 680px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #090d16;
  border: 1px solid var(--master-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

.avatar-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.avatar-preview-box span { font-size: 0.82rem; color: var(--text-muted); }
.avatar-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }

.preview-mini {
  margin-top: 8px;
}
.preview-mini img {
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--gold);
}

/* КНОПКИ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover { opacity: 0.9; }

.btn-outline { background: transparent; border: 1px solid var(--master-border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* МОДАЛКА */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(6px); }

.modal-card {
  position: relative;
  z-index: 2;
  background: var(--master-card);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  box-sizing: border-box;
}

.modal-card h3 { margin-bottom: 18px; color: #fff; }
.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

/* АДАПТАЦИЯ ДЛЯ СМАРТФОНОВ (ПОЛНАЯ ОПТИМИЗАЦИЯ БЕЗ ГОРИЗОНТАЛЬНОГО СКРОЛЛА) */
@media (max-width: 768px) {
  .master-container {
    padding: 0 12px;
    margin: 12px auto;
  }

  .master-header {
    padding: 12px 14px;
  }

  .header-main-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .header-nav-actions .btn {
    width: 100%;
    padding: 10px 8px;
    font-size: 0.8rem;
    text-align: center;
    justify-content: center;
  }

  .header-nav-actions .nav-btn {
    text-align: center;
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  .master-switcher-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .master-select {
    width: 100%;
    min-width: 100%;
    font-size: 0.88rem;
    padding: 10px 12px;
  }

  /* 2+1 LAYOUT KPI НА ПЕРВОМ ЭКРАНЕ */
  .kpi-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
    margin-bottom: 16px;
  }

  .kpi-card:first-child {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(17, 23, 38, 0.9));
    border: 1px solid rgba(245, 158, 11, 0.4);
  }

  .kpi-card:first-child .kpi-icon {
    display: flex;
    font-size: 2rem;
    flex-shrink: 0;
  }

  .kpi-card:first-child .kpi-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.1;
  }

  .kpi-card:first-child .kpi-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
  }

  .kpi-card:first-child .kpi-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
  }

  .kpi-card:not(:first-child) {
    padding: 12px 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
  }

  .kpi-card:not(:first-child) .kpi-icon {
    display: none;
  }

  .kpi-card:not(:first-child) .kpi-value {
    font-size: 1.15rem;
    font-weight: 800;
  }

  .kpi-card:not(:first-child) .kpi-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.2;
  }

  .kpi-card:not(:first-child) .kpi-sub {
    font-size: 0.68rem;
    color: #64748b;
  }

  .section-card {
    padding: 14px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .card-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .tab-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    flex-wrap: nowrap;
  }

  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  /* ТАБЛИЦЫ РАСПИСАНИЯ И УСЛУГ ПРЕВРАЩАЮТСЯ В НАГЛЯДНЫЕ КАРТОЧКИ */
  .table-responsive {
    overflow-x: visible !important;
  }

  .master-table {
    display: block;
    width: 100%;
  }

  .master-table thead {
    display: none !important;
  }

  .master-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .master-table tr {
    display: flex;
    flex-direction: column;
    background: #090e18;
    border: 1px solid var(--master-border);
    border-radius: 12px;
    padding: 14px 16px;
    gap: 8px;
    box-sizing: border-box;
  }

  .master-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
  }

  .master-table td:first-child {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  }

  .master-table td:last-child {
    border-bottom: none;
    padding-top: 8px;
  }

  .master-table td::before {
    content: attr(data-label);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .master-table td:first-child::before {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .schedule-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-btn-group {
    display: flex;
    gap: 6px;
    width: 100%;
  }

  .filter-btn-group .btn-chip {
    flex: 1;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }

  .filter-date-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .filter-date-group label {
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .master-input-date {
    min-height: 44px;
    font-size: 0.85rem;
    padding: 8px 12px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
  }

  .master-switcher-box .master-select {
    min-height: 46px;
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: 8px;
    width: 100%;
    border-color: rgba(245, 158, 11, 0.4);
    box-sizing: border-box;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .chart-container {
    padding: 20px 10px 30px 10px;
  }

  .chart-bars-wrap {
    gap: 4px;
  }

  .chart-bar-item {
    min-width: 22px;
  }

  .bar-val {
    font-size: 0.68rem;
  }

  .bar-label {
    font-size: 0.65rem;
    bottom: -24px;
  }

  /* МОДАЛЬНЫЕ ОКНА ДЛЯ СМАРТФОНОВ */
  .modal {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-card {
    padding: 20px 14px;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
  }

  .modal-actions {
    position: sticky;
    bottom: -14px;
    background: #121826;
    padding-top: 10px;
    padding-bottom: 6px;
    border-top: 1px solid var(--master-border);
    margin-top: 16px;
    display: flex;
    gap: 8px;
  }

  .modal-actions .btn {
    flex: 1;
    min-height: 44px;
  }

  /* 44px touch targets on mobile */
  .btn,
  .btn-gold,
  .btn-outline,
  .btn-chip,
  .master-nav-item {
    min-height: 44px;
    font-size: 0.9rem;
  }

  .modal-close-btn {
    min-width: 38px;
    min-height: 38px;
  }

  /* iOS Zoom Prevention */
  input, select, textarea,
  .form-input, .form-select, .form-textarea,
  .master-input-date, .master-select {
    font-size: 16px !important;
  }
}

/* ПАГИНАЦИЯ (App-Style) */
.crm-pagination {
  margin-top: 14px;
  width: 100%;
}

.crm-pagination-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: #090e17;
  border: 1px solid var(--master-border);
  border-radius: 12px;
}

.page-numbers-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 42px;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.page-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--gold);
  color: #fff;
}

.page-btn.active {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #000 !important;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.page-btn-arrow {
  padding: 6px 14px;
}

.page-dots {
  color: var(--text-muted);
  padding: 0 4px;
  font-weight: 700;
}

.page-counter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 8px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .crm-pagination-box {
    justify-content: space-between;
  }
  .page-counter-label {
    width: 100%;
    text-align: center;
    margin: 4px 0 0 0;
  }
}
