/* ========================================

   ADMIN PANEL — МедведьМа

   Mobile-First

   ======================================== */

/* === ADMIN LAYOUT === */

.admin-body {
  background: #f0ebe3;

  padding-bottom: calc(
    var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px)
  );
}

.admin-login {
  min-height: 100vh;

  display: flex;

  align-items: center;

  justify-content: center;

  background: linear-gradient(135deg, var(--color-bg-dark), #5a3828);

  padding: var(--space-lg);
}

.login-card {
  background: var(--color-bg-card);

  border-radius: var(--radius-lg);

  padding: var(--space-xl);

  width: 100%;

  max-width: 380px;

  box-shadow: var(--shadow-xl);

  text-align: center;
}

.login-logo {
  width: 80px;

  height: 80px;

  border-radius: var(--radius-full);

  margin: 0 auto var(--space-md);

  object-fit: cover;
}

.login-title {
  font-family: var(--font-heading);

  font-size: var(--font-size-xl);

  margin-bottom: var(--space-xs);
}

.login-subtitle {
  font-size: var(--font-size-sm);

  color: var(--color-text-muted);

  margin-bottom: var(--space-xl);
}

.login-error {
  color: var(--color-error);

  font-size: var(--font-size-sm);

  margin-bottom: var(--space-md);

  display: none;
}

.login-error.show {
  display: block;
}

/* === ADMIN HEADER === */

.admin-header {
  position: fixed;

  top: 0;

  left: 0;

  right: 0;

  height: 56px;

  background: var(--color-bg-dark);

  color: var(--color-text-on-dark);

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 0 var(--space-md);

  z-index: 1000;

  box-shadow: var(--shadow-md);
}

.admin-header-title {
  font-family: var(--font-heading);

  font-size: var(--font-size-lg);

  color: var(--color-accent);

  display: flex;

  align-items: center;

  gap: var(--space-sm);
}

.admin-header-title img {
  width: 32px;

  height: 32px;

  border-radius: var(--radius-full);
}

.admin-header-actions {
  display: flex;

  gap: var(--space-sm);
}

.admin-header-btn {
  width: 40px;

  height: 40px;

  display: flex;

  align-items: center;

  justify-content: center;

  color: var(--color-text-on-dark);

  border-radius: var(--radius-sm);

  font-size: 1.2rem;

  transition: background var(--transition-fast);

  position: relative;
}

.admin-header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-header-btn .notif-dot {
  position: absolute;

  top: 6px;

  right: 6px;

  width: 8px;

  height: 8px;

  background: var(--color-error);

  border-radius: var(--radius-full);
}

/* === ADMIN BOTTOM TAB BAR === */

.admin-tabs {
  position: fixed;

  bottom: 0;

  left: 0;

  right: 0;

  height: calc(60px + env(safe-area-inset-bottom, 0px));

  padding-bottom: env(safe-area-inset-bottom, 0px);

  background: var(--color-bg-dark);

  display: flex;

  align-items: stretch;

  z-index: 1000;

  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.admin-tab {
  flex: 1;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 2px;

  color: rgba(245, 230, 211, 0.5);

  font-size: 0.65rem;

  font-weight: 500;

  text-decoration: none;

  transition: color var(--transition-fast);

  position: relative;

  cursor: pointer;

  border: none;

  background: none;
}

.admin-tab.active {
  color: var(--color-accent);
}

.admin-tab:hover {
  color: var(--color-text-on-dark);
}

.admin-tab-icon {
  font-size: 1.3rem;
}

.admin-tab-badge {
  position: absolute;

  top: 4px;

  right: 50%;

  transform: translateX(14px);

  background: var(--color-error);

  color: #fff;

  font-size: 0.55rem;

  font-weight: 700;

  width: 16px;

  height: 16px;

  border-radius: var(--radius-full);

  display: flex;

  align-items: center;

  justify-content: center;
}

/* === ADMIN MAIN CONTENT === */

.admin-main {
  margin-top: 56px;

  padding: var(--space-md);

  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));

  min-height: calc(100vh - 56px);
}

/* === ADMIN SECTIONS (views) === */

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;

  animation: fadeIn 0.3s ease;
}

/* === DASHBOARD WIDGETS === */

.dash-widgets {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: var(--space-sm);

  margin-bottom: var(--space-lg);
}

.dash-widget {
  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  padding: var(--space-md);

  box-shadow: var(--shadow-sm);

  text-align: center;
}

.dash-widget-icon {
  font-size: 1.5rem;

  margin-bottom: var(--space-xs);
}

.dash-widget-value {
  font-size: var(--font-size-xl);

  font-weight: 700;

  color: var(--color-primary-dark);
}

.dash-widget-label {
  font-size: var(--font-size-xs);

  color: var(--color-text-muted);

  margin-top: 2px;
}

.dash-section {
  margin-bottom: var(--space-xl);
}

.dash-section-title {
  font-family: var(--font-heading);

  font-size: var(--font-size-lg);

  color: var(--color-primary-dark);

  margin-bottom: var(--space-md);

  display: flex;

  align-items: center;

  gap: var(--space-sm);
}

/* Mini chart placeholder */

.dash-chart {
  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  padding: var(--space-md);

  box-shadow: var(--shadow-sm);

  min-height: 200px;

  display: flex;

  flex-direction: column;
}

.chart-bars {
  display: flex;

  align-items: flex-end;

  gap: 4px;

  flex: 1;

  padding-top: var(--space-md);
}

.chart-bar {
  flex: 1;

  background: var(--color-primary);

  border-radius: 4px 4px 0 0;

  min-height: 10px;

  opacity: 0.8;

  transition: opacity var(--transition-fast);
}

.chart-bar:hover {
  opacity: 1;
}

.chart-labels {
  display: flex;

  gap: 4px;

  margin-top: var(--space-xs);
}

.chart-label {
  flex: 1;

  text-align: center;

  font-size: 0.6rem;

  color: var(--color-text-muted);
}

/* === ADMIN LIST CARDS === */

.admin-list {
  display: flex;

  flex-direction: column;

  gap: var(--space-sm);
}

.admin-card {
  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  padding: var(--space-md);

  box-shadow: var(--shadow-sm);

  transition: box-shadow var(--transition-fast);
}

.admin-card:active {
  box-shadow: var(--shadow-md);
}

.admin-card-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: var(--space-sm);
}

.admin-card-id {
  font-size: var(--font-size-xs);

  color: var(--color-text-muted);

  font-weight: 600;
}

.admin-card-date {
  font-size: var(--font-size-xs);

  color: var(--color-text-muted);
}

.admin-card-body {
  margin-bottom: var(--space-sm);
}

.admin-card-title {
  font-weight: 600;

  font-size: var(--font-size-base);

  margin-bottom: 2px;
}

.admin-card-subtitle {
  font-size: var(--font-size-sm);

  color: var(--color-text-light);
}

.admin-card-detail {
  font-size: var(--font-size-sm);

  color: var(--color-text-light);

  margin-top: 4px;
}

.admin-card-footer {
  display: flex;

  align-items: center;

  justify-content: space-between;

  padding-top: var(--space-sm);

  border-top: 1px solid var(--color-border);
}

.admin-card-amount {
  font-weight: 700;

  color: var(--color-primary-dark);
}

.admin-card-actions {
  display: flex;

  gap: var(--space-xs);
}

.admin-action-btn {
  padding: 8px 14px;

  border-radius: var(--radius-sm);

  font-size: var(--font-size-xs);

  font-weight: 600;

  transition: all var(--transition-fast);

  display: flex;

  align-items: center;

  gap: 4px;

  min-height: 36px;
}

.admin-action-btn.approve {
  background: #e8f5e9;

  color: #2e7d32;
}

.admin-action-btn.approve:hover {
  background: #c8e6c9;
}

.admin-action-btn.reject {
  background: #ffebee;

  color: #c62828;
}

.admin-action-btn.reject:hover {
  background: #ffcdd2;
}

.admin-action-btn.edit {
  background: #e3f2fd;

  color: #1565c0;
}

.admin-action-btn.edit:hover {
  background: #bbdefb;
}

.admin-action-btn.delete {
  background: #ffebee;

  color: #c62828;
}

.admin-action-btn.delete:hover {
  background: #ffcdd2;
}

.admin-action-btn.telegram-btn {
  background: #e1f5fe;

  color: #0277bd;
}

/* === STATUS SELECT === */

.status-select {
  padding: 8px 12px;

  border: 2px solid var(--color-border);

  border-radius: var(--radius-sm);

  font-size: var(--font-size-sm);

  font-weight: 600;

  background: var(--color-bg-card);

  min-height: 40px;

  -webkit-appearance: none;
  appearance: none;

  cursor: pointer;
}

/* === ADMIN FILTERS === */

.admin-filters {
  display: flex;

  gap: var(--space-sm);

  overflow-x: auto;

  padding: var(--space-sm) 0 var(--space-md);

  scrollbar-width: none;
}

.admin-filters::-webkit-scrollbar {
  display: none;
}

.admin-filter-btn {
  padding: 8px 16px;

  border-radius: 20px;

  font-size: var(--font-size-sm);

  font-weight: 500;

  white-space: nowrap;

  background: var(--color-bg-card);

  color: var(--color-text-light);

  border: 1px solid var(--color-border);

  transition: all var(--transition-fast);

  min-height: 36px;

  cursor: pointer;
}

.admin-filter-btn.active {
  background: var(--color-primary);

  color: #fff;

  border-color: var(--color-primary);
}

/* === FAB (Floating Action Button) === */

.fab {
  position: fixed;

  bottom: calc(70px + env(safe-area-inset-bottom, 0px));

  right: var(--space-md);

  width: 56px;

  height: 56px;

  border-radius: var(--radius-full);

  background: var(--color-primary);

  color: #fff;

  font-size: 1.5rem;

  display: flex;

  align-items: center;

  justify-content: center;

  box-shadow: 0 4px 16px rgba(139, 94, 60, 0.4);

  z-index: 900;

  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);

  cursor: pointer;

  border: none;
}

.fab:hover {
  transform: scale(1.1);

  box-shadow: 0 6px 24px rgba(139, 94, 60, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

/* === ADMIN PRODUCT ITEM === */

.admin-product-item {
  display: flex;

  gap: var(--space-md);

  align-items: center;

  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  padding: var(--space-md);

  box-shadow: var(--shadow-sm);
}

.admin-product-thumb {
  width: 60px;

  height: 60px;

  border-radius: var(--radius-sm);

  background: var(--color-bg-alt);

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 1.5rem;

  flex-shrink: 0;
}

.admin-product-info {
  flex: 1;

  min-width: 0;
}

.admin-product-name {
  font-weight: 600;

  font-size: var(--font-size-sm);

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;
}

.admin-product-cat {
  font-size: var(--font-size-xs);

  color: var(--color-text-muted);
}

.admin-product-price {
  font-weight: 700;

  color: var(--color-primary-dark);

  font-size: var(--font-size-sm);
}

.admin-product-toggle {
  width: 48px;

  height: 28px;

  border-radius: 14px;

  background: var(--color-border);

  position: relative;

  transition: background var(--transition-fast);

  cursor: pointer;

  flex-shrink: 0;

  border: none;
}

.admin-product-toggle.active {
  background: var(--color-green);
}

.admin-product-toggle::after {
  content: "";

  position: absolute;

  top: 3px;

  left: 3px;

  width: 22px;

  height: 22px;

  border-radius: var(--radius-full);

  background: #fff;

  transition: transform var(--transition-fast);

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-product-toggle.active::after {
  transform: translateX(20px);
}

/* === ADMIN FORM MODAL === */

.admin-modal {
  position: fixed;

  inset: 0;

  background: var(--color-bg);

  z-index: 2000;

  transform: translateX(100%);

  transition: transform var(--transition-base);

  overflow-y: auto;

  -webkit-overflow-scrolling: touch;
}

.admin-modal.open {
  transform: translateX(0);
}

.admin-modal-header {
  position: sticky;

  top: 0;

  background: var(--color-bg-dark);

  color: var(--color-text-on-dark);

  padding: var(--space-md);

  display: flex;

  align-items: center;

  gap: var(--space-md);

  z-index: 1;
}

.admin-modal-back {
  width: 40px;

  height: 40px;

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 1.3rem;

  color: var(--color-text-on-dark);

  border-radius: var(--radius-sm);

  cursor: pointer;

  border: none;

  background: none;
}

.admin-modal-title {
  font-family: var(--font-heading);

  font-size: var(--font-size-lg);

  color: var(--color-accent);

  flex: 1;
}

.admin-modal-save {
  padding: 8px 20px;

  background: var(--color-accent);

  color: var(--color-bg-dark);

  border-radius: var(--radius-sm);

  font-weight: 600;

  font-size: var(--font-size-sm);

  cursor: pointer;

  border: none;

  min-height: 40px;
}

.admin-modal-body {
  padding: var(--space-lg);
}

/* === SETTINGS GROUPS === */

.settings-group {
  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  padding: var(--space-lg);

  margin-bottom: var(--space-md);

  box-shadow: var(--shadow-sm);
}

.settings-group-title {
  font-family: var(--font-heading);

  font-size: var(--font-size-lg);

  color: var(--color-primary-dark);

  margin-bottom: var(--space-md);

  display: flex;

  align-items: center;

  gap: var(--space-sm);
}

.settings-row {
  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: var(--space-sm) 0;

  border-bottom: 1px solid var(--color-border);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-label {
  font-size: var(--font-size-sm);

  font-weight: 500;
}

.settings-row-value {
  font-size: var(--font-size-sm);

  color: var(--color-text-light);
}

/* Toggle switch */

.toggle-switch {
  width: 48px;

  height: 28px;

  border-radius: 14px;

  background: var(--color-border);

  position: relative;

  transition: background var(--transition-fast);

  cursor: pointer;

  border: none;
}

.toggle-switch.on {
  background: var(--color-green);
}

.toggle-switch::after {
  content: "";

  position: absolute;

  top: 3px;

  left: 3px;

  width: 22px;

  height: 22px;

  border-radius: var(--radius-full);

  background: #fff;

  transition: transform var(--transition-fast);

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.on::after {
  transform: translateX(20px);
}

/* === ADMIN CALENDAR (simple) === */

.calendar-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: var(--space-md);
}

.calendar-nav-btn {
  width: 40px;

  height: 40px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: var(--radius-full);

  border: 1px solid var(--color-border);

  font-size: 1rem;

  cursor: pointer;

  background: var(--color-bg-card);
}

.calendar-month {
  font-weight: 600;

  font-size: var(--font-size-base);
}

.calendar-grid {
  display: grid;

  grid-template-columns: repeat(7, 1fr);

  gap: 2px;

  text-align: center;
}

.calendar-day-name {
  font-size: var(--font-size-xs);

  color: var(--color-text-muted);

  padding: var(--space-xs);

  font-weight: 600;
}

.calendar-day {
  aspect-ratio: 1;

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: var(--font-size-sm);

  border-radius: var(--radius-sm);

  cursor: pointer;

  transition: all var(--transition-fast);

  position: relative;
}

.calendar-day:hover {
  background: var(--color-bg-alt);
}

.calendar-day.today {
  font-weight: 700;

  color: var(--color-primary);
}

.calendar-day.has-booking::after {
  content: "";

  position: absolute;

  bottom: 4px;

  width: 6px;

  height: 6px;

  border-radius: var(--radius-full);

  background: var(--color-accent);
}

.calendar-day.other-month {
  color: var(--color-text-muted);

  opacity: 0.4;
}

/* === ADMIN LIST CARD (new) === */

.admin-list-card {
  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  padding: var(--space-md);

  box-shadow: var(--shadow-sm);

  transition: box-shadow var(--transition-fast);
}

.admin-list-card:hover {
  box-shadow: var(--shadow-md);
}

.admin-list-card-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: var(--space-xs);
}

.admin-list-card-title {
  font-weight: 600;

  font-size: var(--font-size-base);
}

.admin-list-card-meta {
  font-size: var(--font-size-xs);

  color: var(--color-text-muted);

  margin-top: 2px;
}

/* === ADMIN BADGES === */

.admin-badge {
  display: inline-block;

  padding: 2px 10px;

  border-radius: 12px;

  font-size: 0.7rem;

  font-weight: 600;

  white-space: nowrap;
}

.admin-badge-new,
.admin-badge-pending {
  background: #fff3e0;

  color: #e65100;
}

.admin-badge-processing,
.admin-badge-confirmed {
  background: #e3f2fd;

  color: #1565c0;
}

.admin-badge-shipped {
  background: #e8f5e9;

  color: #2e7d32;
}

.admin-badge-completed {
  background: #e8f5e9;

  color: #1b5e20;
}

.admin-badge-cancelled,
.admin-badge-rejected {
  background: #ffebee;

  color: #c62828;
}

.admin-badge-approved {
  background: #e8f5e9;

  color: #2e7d32;
}

/* === ADMIN WIDGETS (dashboard) === */

.admin-widgets {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: var(--space-sm);
}

.admin-widget {
  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  padding: var(--space-md);

  box-shadow: var(--shadow-sm);

  text-align: center;
}

.admin-widget-value {
  font-size: var(--font-size-xl);

  font-weight: 700;

  color: var(--color-primary-dark);
}

.admin-widget-label {
  font-size: var(--font-size-xs);

  color: var(--color-text-muted);

  margin-top: 2px;
}

.admin-widget-note {
  font-size: 0.65rem;

  color: var(--color-text-muted);

  margin-top: 2px;
}

/* === ADMIN CHART (simple bars) === */

/* === SVG AREA CHART === */
.admin-chart {
  position: relative;
  min-height: 180px;
  padding: 0;
  user-select: none;
}
.admin-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}
.admin-chart .chart-grid-line {
  stroke: var(--color-border-light, #eee);
  stroke-width: 1;
}
.admin-chart .chart-axis-label {
  fill: var(--color-text-muted, #999);
  font-size: 10px;
  font-family: inherit;
}
.admin-chart .chart-area {
  transition: opacity 0.3s;
}
.admin-chart .chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-chart .chart-dot {
  transition:
    r 0.15s,
    opacity 0.15s;
  cursor: pointer;
}
.admin-chart .chart-dot:hover {
  r: 5.5;
}
.chart-tooltip {
  position: absolute;
  background: var(--color-bg-dark, #2c2017);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  transform: translate(-50%, -100%);
  margin-top: -8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.15s;
}
.chart-tooltip.show {
  opacity: 1;
}
.chart-summary {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 0 0.25rem;
  flex-wrap: wrap;
}
.chart-summary-item {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
.chart-summary-item strong {
  color: var(--color-primary-dark);
  font-weight: 700;
}

/* === DASHBOARD ANALYTICS === */
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.dash-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.dash-period-filter {
  display: flex;
  gap: 4px;
  background: var(--color-bg-card, #fff);
  border-radius: 8px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.dash-period-btn {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.dash-period-btn:hover {
  color: var(--color-primary-dark);
  background: var(--color-bg-alt, #f5f3f0);
}
.dash-period-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* KPI Cards */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.dash-kpi {
  background: var(--color-bg-card, #fff);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border-left: 4px solid var(--kpi-color, var(--color-primary));
}
.dash-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.dash-kpi-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.dash-kpi-delta {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.dash-kpi-delta.up {
  color: #2e7d32;
  background: #e8f5e9;
}
.dash-kpi-delta.down {
  color: #c62828;
  background: #ffebee;
}
.dash-kpi-delta.neutral {
  color: #6b5d50;
  background: #f5f3f0;
}
.dash-kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1.2;
}
.dash-kpi-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.dash-kpi-sub {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Charts Row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dash-chart-card {
  min-height: 0;
}

/* Status Bars */
.dash-status-bars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.5rem 0;
}
.dash-status-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.25rem 0;
  border-radius: 6px;
  transition: background 0.15s;
}
.dash-status-row:hover {
  background: var(--color-bg-alt, #f5f3f0);
}
.dash-status-label {
  min-width: 120px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}
.dash-status-bar-track {
  flex: 1;
  height: 22px;
  background: var(--color-bg-alt, #f0ebe3);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.dash-status-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  min-width: 2px;
}
.dash-status-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  min-width: 32px;
  text-align: right;
}

/* Top List */
.dash-top-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dash-top-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.dash-top-item:hover {
  background: var(--color-bg-alt, #f5f3f0);
}
.dash-top-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  flex-shrink: 0;
}
.dash-top-rank.gold {
  background: #f9a825;
}
.dash-top-rank.silver {
  background: #9e9e9e;
}
.dash-top-rank.bronze {
  background: #bf8040;
}
.dash-top-info {
  flex: 1;
  min-width: 0;
}
.dash-top-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-top-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}
.dash-top-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  white-space: nowrap;
}

/* Dashboard Table */
.dash-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.dash-table-header .admin-card-title {
  margin-bottom: 0;
}
.dash-table-wrap {
  overflow-x: auto;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.dash-table th {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 2px solid var(--color-border, #e8e0d6);
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.dash-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--color-border-light, #f0ebe5);
  vertical-align: middle;
}
.dash-table tr {
  cursor: pointer;
  transition: background 0.15s;
}
.dash-table tbody tr:hover {
  background: var(--color-bg-alt, #faf8f5);
}
.dash-table .admin-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
}
.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s;
}
.btn-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}
.btn-outline {
  background: var(--color-bg-card, #fff);
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}
.dash-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .dash-charts-row {
    grid-template-columns: 1fr;
  }
  .dash-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .dash-kpis {
    grid-template-columns: 1fr;
  }
  .dash-period-filter {
    flex-wrap: wrap;
  }
  .dash-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* === ADMIN SECTION TITLE === */

.admin-section-title {
  font-family: var(--font-heading);

  font-size: var(--font-size-xl);

  color: var(--color-primary-dark);

  margin-bottom: var(--space-md);
}

/* === ADMIN FILTER BAR === */

.admin-filter-bar {
  display: flex;

  gap: var(--space-sm);

  overflow-x: auto;

  padding: var(--space-sm) 0 var(--space-md);

  scrollbar-width: none;

  -ms-overflow-style: none;
}

.admin-filter-bar::-webkit-scrollbar {
  display: none;
}

/* Generic filter button (used in admin + catalog) */

.filter-btn {
  padding: 8px 16px;

  border-radius: 20px;

  font-size: var(--font-size-sm);

  font-weight: 500;

  white-space: nowrap;

  background: var(--color-bg-card);

  color: var(--color-text-light);

  border: 1px solid var(--color-border);

  transition: all var(--transition-fast);

  min-height: 36px;

  cursor: pointer;
}

.filter-btn.active {
  background: var(--color-primary);

  color: #fff;

  border-color: var(--color-primary);
}

/* === ADMIN LOGIN CARD (aliased) === */

.admin-login-card {
  background: var(--color-bg-card);

  border-radius: var(--radius-lg);

  padding: var(--space-xl);

  width: 100%;

  max-width: 380px;

  box-shadow: var(--shadow-xl);

  text-align: center;
}

.admin-login-logo {
  font-size: 4rem;

  margin-bottom: var(--space-md);
}

.admin-login-title {
  font-family: var(--font-heading);

  font-size: var(--font-size-xl);

  margin-bottom: var(--space-xs);
}

.admin-login-subtitle {
  font-size: var(--font-size-sm);

  color: var(--color-text-muted);

  margin-bottom: var(--space-xl);
}

.admin-login-error {
  color: #fff;

  font-size: var(--font-size-sm);

  margin-bottom: var(--space-md);

  background: var(--color-error, #e74c3c);

  padding: 0.6rem 1rem;

  border-radius: var(--radius-sm, 6px);

  text-align: center;

  animation: shakeError 0.4s ease;
}

@keyframes shakeError {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

/* === ADMIN HEADER INNER === */

.admin-header-inner {
  display: flex;

  align-items: center;

  justify-content: space-between;

  width: 100%;

  gap: var(--space-md);
}

.admin-header-user {
  font-size: var(--font-size-sm);

  color: rgba(255, 255, 255, 0.6);
}

.admin-header-logout {
  background: none;

  border: 1px solid rgba(255, 255, 255, 0.2);

  color: rgba(255, 255, 255, 0.7);

  padding: 4px 12px;

  border-radius: var(--radius-sm);

  font-size: var(--font-size-xs);

  cursor: pointer;

  transition: all var(--transition-fast);
}

.admin-header-logout:hover {
  border-color: rgba(255, 255, 255, 0.5);

  color: #fff;
}

/* === ADMIN PANEL LAYOUT === */

.admin-panel {
  padding-top: 56px;
}

.admin-content {
  padding: var(--space-md);

  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));

  min-height: calc(100vh - 56px);
}

/* === ADMIN TABS (data-tab system) === */

.admin-tab[data-tab] {
  display: none;
}

.admin-tab[data-tab].active {
  display: block;

  animation: fadeIn 0.3s ease;
}

/* === ADMIN BOTTOM TABS (new) === */

.admin-bottom-tabs {
  position: fixed;

  bottom: 0;

  left: 0;

  right: 0;

  height: calc(60px + env(safe-area-inset-bottom, 0px));

  padding-bottom: env(safe-area-inset-bottom, 0px);

  background: var(--color-bg-dark);

  display: flex;

  align-items: stretch;

  z-index: 1000;

  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);

  overflow-x: auto;

  overflow-y: hidden;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
}

.admin-bottom-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab-btn {
  flex: 0 0 auto;

  min-width: 64px;

  padding: 4px 6px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 2px;

  color: rgba(245, 230, 211, 0.5);

  font-size: 0.6rem;

  font-weight: 500;

  cursor: pointer;

  border: none;

  background: none;

  transition: color var(--transition-fast);

  white-space: nowrap;
}

.admin-tab-btn.active {
  color: var(--color-accent);
}

.admin-tab-btn:hover {
  color: var(--color-text-on-dark);
}

.admin-tab-btn span:first-child {
  font-size: 1.2rem;
}

/* === ADMIN SIDEBAR (new) === */

.admin-sidebar {
  display: none;
}

.admin-sidebar-item {
  display: flex;

  align-items: center;

  gap: var(--space-sm);

  padding: var(--space-sm) var(--space-md);

  color: rgba(245, 230, 211, 0.7);

  border-radius: var(--radius-sm);

  font-size: var(--font-size-sm);

  cursor: pointer;

  border: none;

  background: none;

  width: 100%;

  text-align: left;

  transition: all var(--transition-fast);
}

.admin-sidebar-item:hover {
  color: var(--color-text-on-dark);

  background: rgba(255, 255, 255, 0.05);
}

.admin-sidebar-item.active {
  color: var(--color-accent);

  background: rgba(212, 168, 71, 0.1);
}

/* === MODAL OVERLAY === */

.modal-overlay {
  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, 0.5);

  z-index: 2000;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: var(--space-md);

  overflow-y: auto;
}

.modal-content {
  background: var(--color-bg-card);

  border-radius: var(--radius-lg);

  max-width: 560px;

  width: 100%;

  max-height: 90vh;

  overflow-y: auto;

  box-shadow: var(--shadow-xl);
}

/* === TOGGLE SWITCH (generic) === */

.toggle {
  position: relative;

  display: inline-block;

  width: 44px;

  height: 24px;
}

.toggle input {
  opacity: 0;

  width: 0;

  height: 0;
}

.toggle-slider {
  position: absolute;

  inset: 0;

  background: var(--color-border);

  border-radius: 12px;

  cursor: pointer;

  transition: background var(--transition-fast);
}

.toggle-slider::after {
  content: "";

  position: absolute;

  top: 2px;

  left: 2px;

  width: 20px;

  height: 20px;

  border-radius: var(--radius-full);

  background: #fff;

  transition: transform var(--transition-fast);

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--color-green, #4caf50);
}

.toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-sm {
  width: 36px;

  height: 20px;
}

.toggle-sm .toggle-slider::after {
  width: 16px;

  height: 16px;
}

.toggle-sm input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

/* === RESPONSIVE ADMIN === */

@media (min-width: 600px) {
  .admin-widgets {
    grid-template-columns: repeat(4, 1fr);
  }

  .admin-content {
    padding: var(--space-lg);
  }
}

@media (min-width: 1025px) {
  .admin-body {
    padding-bottom: 0;
  }

  .admin-tabs,
  .admin-bottom-tabs {
    display: none;
  }

  .admin-sidebar {
    display: flex;

    flex-direction: column;

    position: fixed;

    top: 56px;

    left: 0;

    bottom: 0;

    width: 240px;

    background: var(--color-bg-dark);

    padding: var(--space-md);

    z-index: 999;

    overflow-y: auto;
  }

  .admin-sidebar-nav {
    display: flex;

    flex-direction: column;

    gap: var(--space-xs);
  }

  .admin-content {
    margin-left: 240px;

    padding: var(--space-xl);
  }
}

@media (max-width: 1024px) {
  .admin-sidebar {
    display: none;
  }
}

/* ============================================================

   ADMIN вЂ” MEDIA EDITOR

   ============================================================ */

.media-upload-zone {
  border: 2px dashed var(--color-border);

  border-radius: var(--radius-md);

  padding: 1.25rem 1rem;

  text-align: center;

  cursor: pointer;

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 0.2rem;

  transition:
    border-color 0.2s,
    background 0.2s;

  user-select: none;
}

.media-upload-zone:hover,
.media-upload-zone.dragging {
  border-color: var(--color-primary);

  background: rgba(123, 94, 70, 0.05);
}

.media-upload-zone-icon {
  font-size: 1.75rem;

  line-height: 1;

  margin-bottom: 0.2rem;
}

/* Thumbnails grid */

.media-thumbs {
  display: flex;

  flex-wrap: wrap;

  gap: 0.5rem;

  margin-top: 0.75rem;
}

.media-thumb {
  position: relative;

  width: 76px;

  height: 76px;

  border-radius: var(--radius-sm);

  overflow: hidden;

  border: 2px solid var(--color-border);

  flex-shrink: 0;

  transition: border-color 0.2s;
}

.media-thumb img {
  width: 100%;

  height: 100%;

  object-fit: cover;

  display: block;
}

.media-thumb-cover {
  border-color: var(--color-primary);

  box-shadow: 0 0 0 2px rgba(123, 94, 70, 0.25);
}

.media-thumb-actions {
  position: absolute;

  top: 2px;

  right: 2px;

  display: none;

  flex-direction: column;

  gap: 2px;
}

.media-thumb:hover .media-thumb-actions {
  display: flex;
}

.media-thumb-btn {
  width: 22px;

  height: 22px;

  border: none;

  border-radius: 3px;

  cursor: pointer;

  font-size: 0.68rem;

  display: flex;

  align-items: center;

  justify-content: center;

  line-height: 1;

  padding: 0;
}

.media-cover-btn {
  background: #e6ac00;

  color: #fff;
}

.media-remove-btn {
  background: #c0392b;

  color: #fff;
}

.media-cover-label {
  position: absolute;

  bottom: 0;

  left: 0;

  right: 0;

  background: var(--color-primary);

  color: #fff;

  font-size: 0.58rem;

  text-align: center;

  padding: 2px 0;

  text-transform: uppercase;

  letter-spacing: 0.06em;
}

.media-video-preview video {
  border-radius: var(--radius-md);
}

/* ========================================

   DESIGN MANAGEMENT PANEL

   ======================================== */

/* Top actions bar */

.design-actions-top {
  display: flex;

  justify-content: space-between;

  align-items: center;

  flex-wrap: wrap;

  gap: 0.75rem;

  margin-bottom: 1rem;

  padding: 0.75rem 1rem;

  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  box-shadow: var(--shadow-sm);
}

.design-status {
  font-size: 0.9rem;

  font-weight: 600;

  color: var(--color-primary);
}

.design-actions-btns {
  display: flex;

  gap: 0.5rem;
}

/* Design cards */

.design-card {
  margin-bottom: 1rem;
}

.design-hint {
  font-size: 0.82rem;

  color: var(--color-text-muted);

  margin-bottom: 1rem;

  line-height: 1.4;
}

.design-section-subtitle {
  font-family: var(--font-heading);

  font-size: 1rem;

  font-weight: 600;

  color: var(--color-primary-dark);

  margin: 1.25rem 0 0.75rem;

  padding-bottom: 0.35rem;

  border-bottom: 1px solid var(--color-border-light);
}

/* === Color Groups (Accordion) === */
.design-color-groups {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.design-color-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
}
.design-color-group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  background: var(--color-bg-alt);
  transition: background 0.2s;
  user-select: none;
}
.design-color-group-header:hover {
  background: var(--color-bg-warm);
}
.design-color-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  flex: 1;
}
.design-color-group-icon {
  font-size: 1rem;
}
.design-color-group-swatches {
  display: flex;
  gap: 3px;
}
.mini-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.design-color-group-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s;
  color: var(--color-text-muted);
}
.design-color-group.open .design-color-group-arrow {
  transform: rotate(180deg);
}
.design-color-group-body {
  display: none;
  padding: 0.85rem;
  border-top: 1px solid var(--color-border-light);
}
.design-color-group.open .design-color-group-body {
  display: block;
}
.design-color-group-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

/* Compact color grid inside groups */
.design-color-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.5rem;
}
.design-color-item-compact {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.design-color-item-compact:hover {
  background: var(--color-bg-alt);
}
.design-color-info-compact {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

/* === Color Picker Grid (legacy) === */

.design-color-grid {
  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));

  gap: 0.75rem;
}

.design-color-item {
  display: flex;

  align-items: center;

  gap: 0.75rem;

  padding: 0.5rem;

  border-radius: var(--radius-sm);

  transition: background var(--transition-fast);
}

.design-color-item:hover {
  background: var(--color-bg-alt);
}

.design-color-picker-wrap {
  position: relative;

  flex-shrink: 0;
}

.design-color-input {
  position: absolute;

  inset: 0;

  width: 100%;

  height: 100%;

  opacity: 0;

  cursor: pointer;

  z-index: 2;
}

.design-color-swatch {
  width: 40px;

  height: 40px;

  border-radius: var(--radius-sm);

  border: 2px solid var(--color-border);

  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);

  transition: transform var(--transition-fast);
}

.design-color-item:hover .design-color-swatch {
  transform: scale(1.1);
}

.design-color-info {
  display: flex;

  flex-direction: column;

  gap: 1px;

  min-width: 0;
}

.design-color-label {
  font-size: 0.82rem;

  font-weight: 600;

  color: var(--color-text);

  white-space: nowrap;
}

.design-color-hint {
  font-size: 0.7rem;

  color: var(--color-text-muted);
}

.design-color-hex {
  font-size: 0.7rem;

  font-family: monospace;

  color: var(--color-text-light);

  background: var(--color-bg-alt);

  padding: 1px 4px;

  border-radius: 3px;

  width: fit-content;
}

/* === Font Section === */

.design-font-row {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 1.5rem;
}

@media (max-width: 640px) {
  .design-font-row {
    grid-template-columns: 1fr;
  }
}

.design-font-group {
  display: flex;

  flex-direction: column;

  gap: 0.5rem;
}

.design-font-select {
  font-size: 0.9rem;
}

.design-font-preview {
  padding: 0.75rem;

  background: var(--color-bg-alt);

  border-radius: var(--radius-sm);

  font-size: 1.15rem;

  line-height: 1.5;

  min-height: 60px;

  display: flex;

  align-items: center;

  border: 1px dashed var(--color-border);
}

/* === Radius Section === */

.design-radius-presets {
  display: flex;

  gap: 0.75rem;

  margin-bottom: 1.5rem;

  flex-wrap: wrap;
}

.design-radius-preset {
  flex: 1;

  min-width: 80px;

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 0.5rem;

  padding: 0.75rem;

  border: 2px solid var(--color-border);

  border-radius: var(--radius-md);

  background: var(--color-bg-card);

  cursor: pointer;

  transition: all var(--transition-fast);

  font-size: 0.8rem;

  color: var(--color-text-light);

  font-weight: 500;
}

.design-radius-preset:hover {
  border-color: var(--color-accent);

  background: var(--color-bg-alt);
}

.design-radius-preset.active {
  border-color: var(--color-primary);

  background: var(--color-cream);

  color: var(--color-primary);

  font-weight: 700;
}

.design-radius-demo {
  width: 48px;

  height: 48px;

  background: var(--color-primary);

  opacity: 0.6;
}

.design-radius-preset.active .design-radius-demo {
  opacity: 1;
}

.design-radius-sliders {
  display: flex;

  flex-direction: column;

  gap: 1rem;
}

.design-radius-slider-row {
  display: grid;

  grid-template-columns: 160px 1fr 40px;

  gap: 0.75rem;

  align-items: center;
}

@media (max-width: 480px) {
  .design-radius-slider-row {
    grid-template-columns: 1fr 40px;
  }

  .design-radius-slider-row .form-label {
    grid-column: 1 / -1;
  }
}

.design-radius-sample {
  width: 36px;

  height: 36px;

  border: 2px solid var(--color-primary);

  flex-shrink: 0;
}

/* === Range Slider === */

.design-range {
  -webkit-appearance: none;

  appearance: none;

  width: 100%;

  height: 6px;

  background: var(--color-border);

  border-radius: 3px;

  outline: none;

  cursor: pointer;
}

.design-range::-webkit-slider-thumb {
  -webkit-appearance: none;

  appearance: none;

  width: 20px;

  height: 20px;

  background: var(--color-primary);

  border-radius: var(--radius-full);

  cursor: pointer;

  border: 2px solid #fff;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.design-range::-moz-range-thumb {
  width: 20px;

  height: 20px;

  background: var(--color-primary);

  border-radius: var(--radius-full);

  cursor: pointer;

  border: 2px solid #fff;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* === Shadow Section === */

.design-shadow-control {
  display: flex;

  flex-direction: column;

  gap: 0.75rem;
}

.design-shadow-demos {
  display: flex;

  gap: 1rem;

  margin-top: 0.5rem;
}

.design-shadow-demo {
  flex: 1;

  padding: 1rem;

  text-align: center;

  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  font-size: 0.8rem;

  font-weight: 600;

  color: var(--color-text-muted);

  border: 1px solid var(--color-border-light);
}

/* === Live Preview Box === */

.design-preview-box {
  border-radius: var(--radius-md);

  overflow: hidden;

  border: 1px solid var(--color-border);
}

.design-preview-header {
  padding: 0.75rem 1rem;

  display: flex;

  align-items: center;

  gap: 0.5rem;

  font-family: var(--font-heading);

  font-size: 1.1rem;

  font-weight: 600;
}

.design-preview-logo {
  font-size: 1.4rem;
}

.design-preview-body {
  padding: 1.25rem;
}

.design-preview-body h4 {
  font-family: var(--font-heading);

  font-size: 1.3rem;

  margin-bottom: 0.5rem;
}

.design-preview-body p {
  margin-bottom: 1rem;

  font-size: 0.9rem;

  line-height: 1.5;
}

.design-preview-card {
  margin: 0 1.25rem 1.25rem;

  padding: 1rem;

  display: flex;

  flex-direction: column;

  gap: 0.25rem;
}

/* === Bottom Actions === */

.design-bottom-actions {
  margin-top: 1.5rem;

  padding: 1.5rem;

  background: var(--color-bg-card);

  border-radius: var(--radius-md);

  box-shadow: var(--shadow-sm);
}

/* === Background Image Section === */
.design-bg-preview {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: border-color 0.3s;
}
.design-bg-preview:hover {
  border-color: var(--color-primary);
}
.design-bg-preview.has-image {
  border-style: solid;
}
.design-bg-placeholder {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.design-bg-placeholder .icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}
.design-bg-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.design-bg-controls .form-group {
  flex: 1;
  min-width: 140px;
}
.design-bg-overlay-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
.design-bg-overlay-row label {
  white-space: nowrap;
}
.design-bg-remove {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.design-bg-remove:hover {
  background: #c0392b;
}

/* === Glass Mode === */
.design-glass-toggle {
  margin-bottom: 1rem;
}
.design-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
}
.design-toggle-label input[type="checkbox"] {
  display: none;
}
.design-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: 12px;
  transition: background 0.3s;
  flex-shrink: 0;
}
.design-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.design-toggle-label input:checked + .design-toggle-switch {
  background: var(--color-primary);
}
.design-toggle-label input:checked + .design-toggle-switch::after {
  transform: translateX(20px);
}
.design-glass-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.design-glass-preview {
  position: relative;
  height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.5rem;
}
.design-glass-preview-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: cover;
}
.design-glass-preview-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--glass-bg, rgba(255, 255, 255, 0.8));
  backdrop-filter: blur(var(--glass-blur, 10px));
  -webkit-backdrop-filter: blur(var(--glass-blur, 10px));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #333;
}
.design-glass-preview-card strong {
  font-size: 1rem;
}
.design-glass-preview-card span {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* === Image Upload Field === */
.design-img-upload {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
}
.design-img-preview {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: var(--color-bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
}
.design-img-preview .img-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}
.design-img-preview .img-preview-emoji {
  font-size: 3rem;
  line-height: 1;
}
.design-img-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.design-img-tabs {
  display: flex;
  gap: 0.25rem;
}
.design-img-tab {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}
.design-img-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.design-img-tab:hover:not(.active) {
  background: var(--color-bg-warm);
}
.design-img-tab-content {
  min-height: 32px;
}
.design-img-file-btn {
  width: 100%;
}

/* === Text Formatting === */
.design-tf-selector {
  margin-bottom: 1rem;
}
.design-tf-selector select {
  width: 100%;
  margin-top: 0.35rem;
}
.design-tf-preview-box {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.design-tf-preview-box #design-tf-preview-text {
  font-size: 1.2rem;
  font-family: var(--font-heading);
  color: var(--color-text);
  transition: all 0.2s;
}
.design-tf-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.design-tf-toggles {
  display: flex;
  gap: 0.5rem;
}
.design-tf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text);
  transition: all 0.2s;
}
.design-tf-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-alt);
}
.design-tf-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.design-tf-sliders {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.design-tf-slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.design-tf-slider-row label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-light);
}
.design-tf-slider-row label strong {
  color: var(--color-text);
}
.design-tf-stroke-row,
.design-tf-shadow-row {
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

/* === Per-page Background Tabs === */
.design-bg-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.design-bg-page-tab {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}
.design-bg-page-tab:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-alt);
}
.design-bg-page-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.design-bg-page-tab .tab-icon {
  font-size: 0.9rem;
}
.design-bg-page-tab .tab-label {
  font-weight: 500;
}
.design-bg-page-tab .tab-dot {
  color: #27ae60;
  font-size: 0.6rem;
  margin-left: 0.15rem;
}
.design-bg-page-tab.active .tab-dot {
  color: #fff;
}
.design-bg-page-tab.has-bg {
  border-color: var(--color-green);
}
.design-bg-page-tab.has-bg.active {
  border-color: var(--color-primary);
}

/* === Nav Icon Editor === */
.design-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.design-icon-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: box-shadow 0.2s;
}
.design-icon-item:hover {
  box-shadow: var(--shadow-sm);
}
.design-icon-current {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.design-icon-info {
  flex: 1;
  min-width: 0;
}
.design-icon-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
  display: block;
  margin-bottom: 0.25rem;
}
.design-icon-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  text-align: center;
}

/* === Content Section Editor === */
.design-sections-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.design-section-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
}
.design-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  background: var(--color-bg-alt);
  transition: background 0.2s;
  user-select: none;
}
.design-section-header:hover {
  background: var(--color-bg-warm);
}
.design-section-header .arrow {
  transition: transform 0.3s;
  font-size: 0.8rem;
}
.design-section-item.open .design-section-header .arrow {
  transform: rotate(180deg);
}
.design-section-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.design-section-title-row .icon {
  font-size: 1.2rem;
}
.design-section-title-row .title {
  font-weight: 600;
  font-size: 0.9rem;
}
.design-section-title-row .page-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
  font-weight: 500;
}
.design-section-body {
  display: none;
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}
.design-section-item.open .design-section-body {
  display: block;
}
.design-section-field {
  margin-bottom: 0.75rem;
}
.design-section-field:last-child {
  margin-bottom: 0;
}
.design-section-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}
.field-hint {
  font-size: 0.72rem;
  color: #9e9186;
  margin-bottom: 0.35rem;
  line-height: 1.3;
  padding-left: 0.2rem;
}
.design-section-field input,
.design-section-field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.design-section-field textarea {
  min-height: 60px;
}
.design-section-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.design-section-search input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}
.design-section-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.design-section-filter-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.design-section-filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* === Page Color Coding === */
.page-badge[data-page="index"], .design-section-filter-btn[data-page="index"].active { background: #4caf50; border-color: #4caf50; }
.page-badge[data-page="services"], .design-section-filter-btn[data-page="services"].active { background: #9c27b0; border-color: #9c27b0; }
.page-badge[data-page="glamping"], .design-section-filter-btn[data-page="glamping"].active { background: #795548; border-color: #795548; }
.page-badge[data-page="catalog"], .design-section-filter-btn[data-page="catalog"].active { background: #ff9800; border-color: #ff9800; }
.page-badge[data-page="certificates"], .design-section-filter-btn[data-page="certificates"].active { background: #e91e63; border-color: #e91e63; }
.page-badge[data-page="about"], .design-section-filter-btn[data-page="about"].active { background: #2196f3; border-color: #2196f3; }
.page-badge[data-page="common"], .design-section-filter-btn[data-page="common"].active { background: #607d8b; border-color: #607d8b; }
.design-section-filter-btn[data-page="index"]:not(.active) { color: #4caf50; border-color: #4caf50; }
.design-section-filter-btn[data-page="services"]:not(.active) { color: #9c27b0; border-color: #9c27b0; }
.design-section-filter-btn[data-page="glamping"]:not(.active) { color: #795548; border-color: #795548; }
.design-section-filter-btn[data-page="catalog"]:not(.active) { color: #ff9800; border-color: #ff9800; }
.design-section-filter-btn[data-page="certificates"]:not(.active) { color: #e91e63; border-color: #e91e63; }
.design-section-filter-btn[data-page="about"]:not(.active) { color: #2196f3; border-color: #2196f3; }
.design-section-filter-btn[data-page="common"]:not(.active) { color: #607d8b; border-color: #607d8b; }
.design-section-item[data-page="index"] { border-left: 3px solid #4caf50; }
.design-section-item[data-page="services"] { border-left: 3px solid #9c27b0; }
.design-section-item[data-page="glamping"] { border-left: 3px solid #795548; }
.design-section-item[data-page="catalog"] { border-left: 3px solid #ff9800; }
.design-section-item[data-page="certificates"] { border-left: 3px solid #e91e63; }
.design-section-item[data-page="about"] { border-left: 3px solid #2196f3; }
.design-section-item[data-page="common"] { border-left: 3px solid #607d8b; }

/* === Section "View on site" link === */
.section-view-link {
  font-size: 0.72rem;
  color: #0288d1;
  text-decoration: none;
  margin-left: auto;
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.section-view-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* === Design Mode Toggle (Simple/Advanced) === */
.design-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  width: fit-content;
}
.design-mode-btn {
  padding: 0.45rem 1.1rem;
  border: none;
  background: var(--color-bg);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all 0.2s;
}
.design-mode-btn.active {
  background: var(--color-primary);
  color: #fff;
}
.design-card[data-level="advanced"] {
  display: none;
}
.design-panel-advanced .design-card[data-level="advanced"] {
  display: block;
}

/* === Large Theme Cards === */
.design-theme-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.design-theme-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.7rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.design-theme-preset-btn:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.design-theme-preset-btn.active-theme {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary);
}
.design-theme-preset-btn.active-theme::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.7rem;
  background: var(--color-primary);
  color: #fff;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
}
.design-theme-preset-colors {
  display: flex;
  gap: 2px;
  width: 100%;
  height: 32px;
}
.design-theme-preset-colors span {
  flex: 1;
  border-radius: 4px;
}
.design-theme-preset-colors span:first-child {
  border-radius: 6px 0 0 6px;
}
.design-theme-preset-colors span:last-child {
  border-radius: 0 6px 6px 0;
}
.design-theme-preset-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.design-theme-preset-desc {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ==================== AI AGENT PANEL ==================== */

.ai-loading {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.ai-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}
.ai-spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.25rem;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* Status bar */
.ai-status-bar {
  background: linear-gradient(
    135deg,
    var(--color-bg-warm),
    var(--color-bg-card)
  );
}
.ai-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.ai-status-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.ai-status-dot.active {
  background: #27ae60;
  box-shadow: 0 0 6px rgba(39, 174, 96, 0.4);
}
.ai-status-dot.inactive {
  background: #c0392b;
}

/* Keys grid */
.ai-keys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
@media (max-width: 640px) {
  .ai-keys-grid {
    grid-template-columns: 1fr;
  }
}
.ai-key-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ai-key-input-wrap .form-input {
  padding-right: 2.5rem;
  font-family: monospace;
  font-size: 0.82rem;
}
.ai-key-toggle {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.ai-key-toggle:hover {
  opacity: 1;
}
.ai-key-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}
.ai-key-hint a {
  color: var(--color-primary);
  text-decoration: none;
}
.ai-key-hint a:hover {
  text-decoration: underline;
}

/* Prompt editor */
.ai-prompt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.ai-prompt-chars {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.ai-prompt-textarea {
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 250px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  padding: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  tab-size: 2;
}
.ai-prompt-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(123, 94, 70, 0.1);
}

/* Knowledge cards */
.ai-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}
.ai-knowledge-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light, #e8e0d5);
  border-radius: var(--radius-sm, 6px);
  transition: box-shadow 0.2s;
}
.ai-knowledge-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.ai-kb-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.ai-kb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ai-kb-info strong {
  font-size: 0.85rem;
}
.ai-kb-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Site Scan Section */
.ai-scan-section {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(
    135deg,
    rgba(123, 94, 70, 0.04) 0%,
    rgba(166, 124, 82, 0.08) 100%
  );
  border: 1.5px solid var(--color-primary, #7b5e46);
  border-radius: var(--radius-md, 10px);
  position: relative;
  overflow: hidden;
}
.ai-scan-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-primary, #7b5e46),
    var(--color-accent, #a67c52),
    var(--color-primary, #7b5e46)
  );
}
.ai-scan-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: space-between;
}
.ai-scan-info {
  flex: 1;
}
.ai-scan-title {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--color-text);
}
.ai-scan-last {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}
.ai-scan-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(123, 94, 70, 0.2);
}
.ai-scan-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(123, 94, 70, 0.3);
}
.ai-scan-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}
.ai-scan-btn-icon {
  font-size: 1.2rem;
}

/* Scan progress */
.ai-scan-progress {
  margin-top: 0.75rem;
}
.ai-scan-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(123, 94, 70, 0.12);
  border-radius: 3px;
  overflow: hidden;
}
.ai-scan-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--color-primary, #7b5e46),
    var(--color-accent, #a67c52)
  );
  border-radius: 3px;
  transition: width 0.3s ease;
}
.ai-scan-status {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
  font-style: italic;
}

/* Scan report */
.ai-scan-report {
  margin-top: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light, #e8e0d5);
  border-radius: var(--radius-sm, 6px);
  padding: 0.75rem;
  font-size: 0.82rem;
}
.ai-scan-report-header {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--color-success, #27ae60);
}
.ai-scan-report-steps {
  margin-bottom: 0.5rem;
}
.ai-scan-step {
  padding: 0.2rem 0;
  line-height: 1.5;
}
.ai-scan-report-warnings {
  background: rgba(231, 76, 60, 0.06);
  border-radius: 4px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-error, #e74c3c);
}
.ai-scan-warning {
  font-size: 0.78rem;
  padding: 0.1rem 0;
}
.ai-scan-report-summary {
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light, #e8e0d5);
  font-size: 0.85rem;
  color: var(--color-text-light);
}

@media (max-width: 640px) {
  .ai-scan-header {
    flex-direction: column;
    align-items: stretch;
  }
  .ai-scan-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Preview */
.ai-preview-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.ai-preview-tab {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.2s;
}
.ai-preview-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.ai-preview-content {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  padding: 0.75rem;
  max-height: 350px;
  overflow: auto;
  font-family: monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text-light);
}

/* Chat widget settings grid */
.ai-chat-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 640px) {
  .ai-chat-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Test chat */
.ai-test-chat {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
}
.ai-test-messages {
  min-height: 120px;
  max-height: 350px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--color-bg);
}
.ai-test-msg {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 90%;
}
.ai-test-msg.user {
  background: var(--color-primary);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 2px;
}
.ai-test-msg.bot {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light, #e8e0d5);
  border-bottom-left-radius: 2px;
}
.ai-test-action {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--color-text-muted);
}
.ai-test-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
}
.ai-test-input-row .form-input {
  flex: 1;
}

/* === TICKET BADGES === */
.ticket-status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.ticket-status-badge.open {
  background: #fef3e2;
  color: #e67e22;
}
.ticket-status-badge.resolved {
  background: #e8f8f0;
  color: #27ae60;
}
.ticket-card {
  transition: border-color 0.2s;
}
.ticket-card:hover {
  border-color: var(--color-accent);
}

/* === NAV ICON CONTROLS (Design tab) === */
.design-icon-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}
.design-icon-controls input[type="text"] {
  flex: 1;
  min-width: 0;
}
.design-nav-icon-upload-btn,
.design-nav-icon-reset {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.design-nav-icon-upload-btn:hover {
  background: #e3f2fd;
}
.design-nav-icon-reset:hover {
  background: #fff3e0;
}
.design-nav-icon-upload-btn input[type="file"] {
  display: none;
}

/* === KB ADMIN CHAT === */
.ai-kb-messages {
  min-height: 80px;
  max-height: 260px;
  overflow-y: auto;
}
.ai-kb-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}
.ai-kb-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}
.ai-kb-section-input {
  font-size: 0.8rem !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 6px;
}
.ai-kb-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.4rem;
  font-weight: 600;
}
.ai-kb-saved {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  background: #e8f5e9;
  border-radius: 6px;
  color: #2e7d32;
}

/* === ADMIN HEADER CHAT BUTTON (bright, contrasting) === */
.admin-header-chat {
  display: none;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #43a047, #2e7d32);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 18px 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
  letter-spacing: 0.01em;
}
.admin-header-chat.visible {
  display: flex !important;
}
.admin-header-chat:hover {
  background: linear-gradient(135deg, #388e3c, #1b5e20);
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.45);
}
.admin-header-chat.active {
  background: linear-gradient(135deg, #1b5e20, #0d3f13);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}
@keyframes headerChatGlow {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
  }
  50% {
    box-shadow:
      0 2px 8px rgba(46, 125, 50, 0.35),
      0 0 0 5px rgba(67, 160, 71, 0.2);
  }
}
.admin-header-chat.visible:not(.active) {
  animation: headerChatGlow 2.5s ease-in-out infinite;
}

/* === FLOATING ADMIN CHAT WINDOW === */
.admin-chat-window {
  display: flex !important;
  position: fixed !important;
  bottom: 16px;
  right: 16px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 530px;
  max-height: calc(100vh - 80px);
  background: #faf8f5;
  border-radius: 20px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  z-index: 10000;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.admin-chat-window.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header */
.admin-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #5d4037, #3e2723);
  color: #fff;
  flex-shrink: 0;
}
.admin-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.admin-chat-header-info {
  flex: 1;
  min-width: 0;
}
.admin-chat-header-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.admin-chat-header-status {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}
.admin-chat-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.admin-chat-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.admin-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Messages */
.admin-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.admin-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.admin-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.admin-chat-messages::-webkit-scrollbar-thumb {
  background: #d4c4b0;
  border-radius: 4px;
}

/* Message bubbles (shared with .chat-msg) */
.admin-chat-window .chat-msg {
  display: flex;
  gap: 0.6rem;
  max-width: 92%;
  animation: chatMsgIn 0.25s ease;
}
@keyframes chatMsgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.admin-chat-window .chat-msg.bot {
  align-self: flex-start;
}
.admin-chat-window .chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.admin-chat-window .chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: #f0ebe3;
}
.admin-chat-window .chat-msg.user .chat-msg-avatar {
  background: #e8f5e9;
}

.admin-chat-window .chat-msg-bubble {
  background: #fff;
  border-radius: 14px 14px 14px 4px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #2c2017;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  word-break: break-word;
}
.admin-chat-window .chat-msg.user .chat-msg-bubble {
  background: #5d4037;
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.admin-chat-window .chat-msg-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: #9e9186;
  margin-bottom: 2px;
}
.admin-chat-window .chat-msg.user .chat-msg-name {
  color: rgba(255, 255, 255, 0.7);
}

/* Loading dots */
.admin-chat-window .chat-msg-loading {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.4rem 0;
}
.admin-chat-window .chat-msg-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a08060;
  animation: chatDotBounce 1.4s ease-in-out infinite;
}
.admin-chat-window .chat-msg-loading span:nth-child(2) {
  animation-delay: 0.2s;
}
.admin-chat-window .chat-msg-loading span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes chatDotBounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Quick replies */
.admin-chat-window .chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.5rem;
}
.admin-chat-window .chat-quick-btn {
  background: #f5f0ea;
  border: 1.5px solid #d4c4b0;
  color: #5d4037;
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.admin-chat-window .chat-quick-btn:hover {
  background: #5d4037;
  color: #fff;
  border-color: #5d4037;
}

/* Navigate button */
.admin-chat-window .chat-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f5e9;
  border: 1.5px solid #a5d6a7;
  color: #2e7d32;
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 0.4rem;
}
.admin-chat-window .chat-nav-btn:hover {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}

/* Footer / Input */
.admin-chat-footer {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #e8e0d6;
  background: #fff;
  flex-shrink: 0;
  border-radius: 0 0 20px 20px;
}
.admin-chat-input {
  flex: 1;
  border: 1.5px solid #d4c4b0;
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  background: #faf8f5;
  color: #2c2017;
}
.admin-chat-input:focus {
  border-color: #7b5e46;
}
.admin-chat-input::placeholder {
  color: #9e9186;
}
.admin-chat-img-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b1fa2, #6a1b9a);
  color: #fff;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-chat-img-btn:hover {
  background: linear-gradient(135deg, #6a1b9a, #4a148c);
  transform: scale(1.06);
}
.admin-chat-photo-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0288d1, #01579b);
  color: #fff;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-chat-photo-btn:hover {
  background: linear-gradient(135deg, #01579b, #002f6c);
  transform: scale(1.06);
}
.admin-chat-photo-btn.processing {
  animation: pulse-img-btn 1.2s infinite;
  pointer-events: none;
  opacity: 0.7;
}
.chat-photo-preview {
  max-width: 200px;
  max-height: 150px;
  border-radius: 10px;
  margin-top: 4px;
}
.admin-chat-img-btn.generating {
  animation: pulse-img-btn 1.2s infinite;
  pointer-events: none;
  opacity: 0.7;
}
@keyframes pulse-img-btn {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}
.chat-generated-img {
  max-width: 100%;
  border-radius: 12px;
  margin-top: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}
.chat-generated-img:hover {
  transform: scale(1.03);
}
.admin-chat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #43a047, #2e7d32);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-chat-send:hover {
  background: linear-gradient(135deg, #388e3c, #1b5e20);
  transform: scale(1.06);
}

/* Mobile */
@media (max-width: 768px) {
  .admin-header-chat .chat-label {
    display: none;
  }
  .admin-header-chat {
    padding: 6px 12px;
    border-radius: 14px;
  }
  .admin-chat-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 80px);
    bottom: 8px;
    right: 8px;
    border-radius: 16px;
  }
}

/* ========================= GALLERY ADMIN EDITOR ========================= */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.gallery-admin-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e0d6cc;
  background: #f9f6f2;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
}
.gallery-admin-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.gallery-admin-thumb.dragging {
  opacity: 0.5;
}
.gallery-admin-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.gallery-caption-input {
  width: 100%;
  border: none;
  border-top: 1px solid #e0d6cc;
  padding: 4px 6px;
  font-size: 0.75rem;
  background: #fff;
}
.gallery-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(192,57,43,0.85);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-admin-thumb:hover .gallery-thumb-remove {
  opacity: 1;
}
.gallery-admin-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.gallery-admin-count {
  font-size: 0.8rem;
  color: #888;
}

/* ========================= TESTIMONIALS ADMIN EDITOR ========================= */
.testimonials-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.testimonial-admin-card {
  background: #fff;
  border: 1px solid #e0d6cc;
  border-radius: 10px;
  padding: 1rem;
}
.testimonial-admin-row {
  margin-bottom: 0.5rem;
}
.testimonial-admin-row label {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 2px;
}
.testimonial-admin-row input,
.testimonial-admin-row textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d0c8be;
  border-radius: 6px;
  font-size: 0.9rem;
}
.testimonial-admin-row textarea {
  resize: vertical;
}
