:root {
  --bg-base: #F4EFE6;
  --sidebar-bg: #EFE9DC;
  --card-white: #FFFFFF;
  --gold: #C5A059;
  --gold-dark: #8b5e3c;
  --gold-light: #DFD3BF;
  --gold-premium: linear-gradient(135deg, #C5A059 0%, #F1E2C3 50%, #B08A43 100%);
  --text-dark: #2F2A25;
  --text-muted: #8E8577;
  --color-pink: #FDECE9;
  --color-yellow: #FEF9E5;
  --color-blue: #E8F4F8;
  --color-green: #EAF7EE;
  --color-purple: #F3EBF9;
  --danger: #c0392b;
  --success: #25D366;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-base);
  color: var(--text-dark);
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* LOGIN */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EFE9DC 0%, #F4EFE6 40%, #DFD3BF 100%);
  padding: 1rem;
}

.login-card {
  background: var(--card-white);
  padding: 2.5rem;
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  border: 1px solid rgba(197, 160, 89, 0.2);
  box-shadow: 0 20px 40px rgba(47, 42, 37, 0.08);
  text-align: center;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* APP LAYOUT */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--gold-light);
  padding: 12px 10px 8px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 10;
  flex-shrink: 0;
  transition: width 0.22s ease, padding 0.22s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 72px;
  padding: 16px 8px;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 24px;
}

.sidebar.collapsed .sidebar-top {
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sidebar-toggle:hover {
  border-color: var(--gold);
  color: var(--text-dark);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
  min-width: 0;
  flex: 1;
}

.sidebar.collapsed .brand {
  padding-left: 0;
  justify-content: center;
  flex: none;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gold-premium);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(197, 160, 89, 0.3);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo-icon.has-logo {
  background: var(--card-white);
  padding: 2px;
}

.brand-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.brand-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #604B28 0%, #B08A43 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s, width 0.22s;
}

.sidebar.collapsed .brand-title,
.sidebar.collapsed .menu-label,
.sidebar.collapsed .user-profile-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 12px 8px;
  gap: 0;
}

.menu-item i {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.menu-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}

.menu-msg-badge {
  position: absolute;
  top: -9px;
  right: -11px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(192, 57, 43, 0.4);
  pointer-events: none;
}

.menu-msg-badge.hidden {
  display: none !important;
}

.menu-item.has-unread {
  color: var(--text-dark);
}

.menu-item.has-unread i {
  color: var(--gold-dark);
}

.sidebar.collapsed .menu-msg-badge {
  top: -7px;
  right: -8px;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  font-size: 0.58rem;
}

.menu-label {
  transition: opacity 0.15s, width 0.22s;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-dark);
}

.menu-item.active {
  background: var(--gold-premium);
  color: #FFF;
  box-shadow: 0 8px 20px rgba(176, 138, 67, 0.25);
}

.user-profile,
.sidebar-footer {
  background: var(--card-white);
  padding: 6px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(197, 160, 89, 0.2);
  margin-top: 8px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
}

.user-profile-text h5 {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .user-profile,
.sidebar.collapsed .sidebar-footer {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
}

.sidebar-logout {
  margin-left: auto;
  padding: 5px 8px !important;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.user-profile-text {
  min-width: 0;
  flex: 1;
  transition: opacity 0.15s, width 0.22s;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #E8E2D5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #604B28;
  font-size: 0.68rem;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.topbar h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #604B28;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.notif-bell-wrap {
  position: relative;
}

.notif-bell-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  color: var(--gold-dark);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.notif-bell-btn:hover,
.notif-bell-btn.active {
  border-color: var(--gold);
  background: var(--bg-base);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(192, 57, 43, 0.35);
}

.notif-badge.hidden {
  display: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, calc(100vw - 32px));
  max-height: min(480px, calc(100vh - 120px));
  background: #fff;
  border: 1px solid var(--gold-light);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-panel.hidden {
  display: none;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gold-light);
  background: #FEF9E5;
}

.notif-panel-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}

.notif-mark-all {
  border: none;
  background: none;
  color: var(--gold-dark);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 8px;
}

.notif-mark-all:hover {
  background: rgba(197, 160, 89, 0.15);
}

.notif-panel-list {
  overflow-y: auto;
  flex: 1;
}

.notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.notif-panel-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.15);
  cursor: pointer;
  transition: background 0.12s;
}

.notif-panel-item:hover {
  background: rgba(197, 160, 89, 0.06);
}

.notif-panel-item.unread {
  background: rgba(197, 160, 89, 0.1);
}

.notif-panel-item.unread .notif-panel-title {
  font-weight: 800;
}

.notif-panel-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dark);
  font-size: 0.9rem;
}

.notif-panel-body {
  min-width: 0;
}

.notif-panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.3;
}

.notif-panel-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
}

.notif-panel-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.notif-panel-dismiss {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.notif-panel-dismiss:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar-actions input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: var(--card-white);
  font-size: 0.85rem;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease forwards;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.page.active-page {
  display: block;
  overflow-y: auto;
}

.page.active-page.grid-dashboard {
  display: grid;
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid-dashboard {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
}

.left-panel > .section-card:first-child {
  flex-shrink: 0;
}

.section-card-schedule {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px !important;
}

.schedule-focus-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.schedule-focus-bar .btn-outline {
  font-size: 0.8rem;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ——— Режим расписания на весь экран ——— */
.app.schedule-focus-mode .sidebar {
  width: 72px;
  padding: 16px 8px;
}

.app.schedule-focus-mode .sidebar .brand-title,
.app.schedule-focus-mode .sidebar .menu-label,
.app.schedule-focus-mode .sidebar .user-profile-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.app.schedule-focus-mode .sidebar .menu-item {
  justify-content: center;
  padding: 12px 8px;
  gap: 0;
}

.app.schedule-focus-mode .sidebar .user-profile {
  flex-direction: column;
  align-items: center;
}

.app.schedule-focus-mode .sidebar .sidebar-logout {
  margin-left: 0;
}

.app.schedule-focus-mode .main-content {
  padding: 8px 12px;
  gap: 8px;
}

.app.schedule-focus-mode .topbar h1 {
  font-size: 1.15rem;
}

.app.schedule-focus-mode #topbar-actions #export-btn,
.app.schedule-focus-mode #topbar-actions #refresh-btn {
  display: none;
}

.app.schedule-focus-mode #page-appointments.grid-dashboard {
  grid-template-columns: 1fr;
  gap: 0;
}

.app.schedule-focus-mode #page-appointments .right-panel,
.app.schedule-focus-mode #page-appointments .left-panel > .section-card:first-child {
  display: none !important;
}

.app.schedule-focus-mode #page-appointments .left-panel {
  min-height: 0;
}

.app.schedule-focus-mode #page-appointments .section-card-schedule {
  border-radius: 16px;
  padding: 10px 12px !important;
}

.app.schedule-focus-mode .schedule-focus-label::after {
  content: "";
}

.app.schedule-focus-mode .schedule-focus-label {
  font-weight: 600;
}

.right-panel {
  overflow-y: auto;
  overflow-x: hidden;
}

.section-card {
  background: var(--card-white);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(197, 160, 89, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
}

.timeline-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin: 10px 0;
  padding-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-line {
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  height: 2px;
  background: #E5DEC9;
  z-index: 1;
}

.timeline-node {
  position: relative;
  z-index: 2;
  background: var(--card-white);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--gold-light);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-muted);
}

.timeline-node:hover,
.timeline-node.active {
  border-color: #B08A43;
  color: var(--text-dark);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(197, 160, 89, 0.15);
}

.timeline-node.active {
  background: #FEF9E5;
  border-width: 2px;
}

.scheduler-wrapper {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 15px;
  min-height: 320px;
}

.hours-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 65px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.hours-column div { height: 95px; }

.masters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.master-col-header {
  text-align: center;
  margin-bottom: 15px;
}

.master-col-header h4 { font-size: 1rem; font-weight: 700; }
.master-col-header span { font-size: 0.75rem; color: var(--text-muted); }

.session-item {
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.1, 0.8, 0.3, 1), box-shadow 0.25s;
}

.session-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
}

.session-item.cancelled {
  opacity: 0.5;
  text-decoration: line-through;
}

.session-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 6px;
}

.session-client {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
}

.session-service {
  display: inline-block;
  background: rgba(255, 255, 255, 0.6);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.chart-mock {
  width: 100%;
  height: 120px;
  margin-top: 15px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chart-bar {
  flex-grow: 1;
  background: linear-gradient(to top, #EFE9DC, #C5A059);
  border-radius: 4px 4px 0 0;
  transition: height 1s ease;
  min-height: 8px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 15px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  transition: all 0.2s;
}

.loyalty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.85rem;
  gap: 10px;
}

.progress-bar-bg {
  width: 100px;
  height: 6px;
  background: #EFE9DC;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: var(--gold-premium);
}

.btn-premium {
  background: var(--gold-premium);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.2);
  transition: opacity 0.2s;
}

.btn-premium:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  color: #604B28;
  border: 1px solid var(--gold-light);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.5);
}

.btn-danger {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6c0;
}

.client-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.client-table th,
.client-table td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid #EFE9DC;
  font-size: 0.9rem;
}

.client-table th {
  font-weight: 700;
  color: var(--text-muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stat-box {
  background: var(--bg-base);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.1);
}

.stat-box h5 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-box h2 {
  font-family: 'Cinzel', serif;
  margin-top: 10px;
  color: #604B28;
  font-size: 1.6rem;
}

.vip-badge {
  color: #C5A059;
  font-weight: 700;
}

.inactive-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(120, 113, 108, 0.12);
  border: 1px solid rgba(120, 113, 108, 0.3);
  color: #57534e;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-new {
  color: var(--gold-dark, #8b5e3c);
  font-weight: 500;
}

.status-regular {
  color: #166534;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(47, 42, 37, 0.3);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-window {
  background: var(--card-white);
  padding: 30px;
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--gold-light);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  animation: modalScale 0.3s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  float: right;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  font-size: 1.2rem;
}

.modal-form label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.85rem;
  font-weight: 700;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  margin-bottom: 15px;
  font-family: inherit;
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.modal-actions .btn-premium,
.modal-actions .btn-outline {
  flex: 1;
}

.status-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-confirmed { background: var(--color-green); color: #2d6a4f; }
.status-arrived { background: var(--color-blue); color: #1d4ed8; }
.status-paid { background: var(--color-purple); color: #6b21a8; }
.status-cancelled { background: #fdecea; color: var(--danger); }

.settings-group {
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
}

.settings-group legend {
  display: none;
}

.settings-page {
  overflow-y: auto;
}

.settings-section {
  border: 1px solid var(--gold-light);
  border-radius: 14px;
  margin-bottom: 0.75rem;
  background: var(--card-white);
  overflow: hidden;
}

.settings-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.settings-section > summary::-webkit-details-marker {
  display: none;
}

.settings-section > summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.settings-section[open] > summary::after {
  transform: rotate(180deg);
}

.settings-section-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--gold-light);
}

.settings-section-badge {
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--gold-dark);
  background: var(--color-yellow);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 0.35rem;
}

.settings-field textarea,
.settings-field select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  font-family: inherit;
  font-size: inherit;
}

.settings-field-check span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.settings-field-check input {
  width: auto;
  margin: 0;
}

.personalization-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.theme-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bg-base);
  border: 1px dashed var(--gold-light);
}

.theme-preview-card {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--card-white);
  border: 1px solid var(--gold-light);
  font-size: 0.85rem;
}

.theme-preview-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.org-profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.org-logo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.org-logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 2px solid var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--bg-base);
  overflow: hidden;
  flex-shrink: 0;
}

.org-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.org-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.org-logo-upload {
  cursor: pointer;
  margin: 0;
}

.settings-save-status {
  margin-top: 1rem;
  padding: 12px;
  background: var(--color-green);
  border-radius: 10px;
}

.auto-save-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.working-hours-editor {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.working-hours-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(197, 160, 89, 0.15);
}

.working-hours-row:last-child {
  border-bottom: none;
}

.working-hours-day {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 130px;
  font-size: 0.88rem;
}

.working-hours-day input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.working-hours-times {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}

.working-hours-times input {
  width: 4.5rem;
  padding: 8px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.working-hours-times input:disabled {
  opacity: 0.45;
  background: var(--bg-base);
}

.working-hours-closed {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: right;
}

.sidebar.collapsed .sidebar-logout {
  margin-left: 0;
}

.settings-field {
  font-size: 17px;
}

body.ui-font-large {
  font-size: 17px;
}

body.ui-compact-tables .data-table td,
body.ui-compact-tables .data-table th,
body.ui-compact-tables .client-table td,
body.ui-compact-tables .client-table th {
  padding: 6px 8px;
  font-size: 0.85rem;
}

.settings-field {
  margin-top: 0.75rem;
}

.settings-field span {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.settings-field input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
}

.settings-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted, #666);
}

.settings-hint-ok {
  color: #2d6a4f;
}

.settings-token-input {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
}

#settings-status.settings-status-warn {
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffc107;
  padding: 0.75rem;
  border-radius: 8px;
}

.broadcast-platforms {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.broadcast-platforms label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.toggle-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.toggle-on { background: var(--color-green); color: #2d6a4f; }
.toggle-off { background: #fdecea; color: var(--danger); }

.hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
}

.filters-bar input,
.filters-bar select {
  padding: 10px 12px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  font-family: inherit;
  background: #fff;
}

.filters-bar input[type="search"] {
  flex: 1;
  min-width: 200px;
}

.schedule-table-wrap {
  overflow: auto;
  border: 1px solid var(--gold-light);
  border-radius: 14px;
  background: #fff;
  flex: 1;
  min-height: 0;
}

/* ——— Date picker ——— */
.date-picker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}

.date-nav-btn:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.date-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: min(420px, 36vw);
  padding: 2px 0;
}

.date-chip {
  flex-shrink: 0;
  min-width: 56px;
  padding: 6px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all 0.15s;
}

.date-chip .dc-day {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.date-chip .dc-num {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.date-chip:hover {
  border-color: var(--gold);
}

.date-chip.active {
  background: var(--gold-premium);
  border-color: var(--gold-dark);
  color: #fff;
}

.date-chip.active .dc-day {
  color: rgba(255,255,255,0.85);
}

.date-chip.today:not(.active) {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.25);
}

.date-today-btn {
  flex-shrink: 0;
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
}

.month-calendar-anchor {
  position: relative;
  flex-shrink: 0;
}

#date-month-open[aria-expanded="true"] {
  border-color: var(--gold-dark);
  color: var(--gold-dark);
  background: rgba(197, 160, 89, 0.12);
}

.month-calendar-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 250;
  width: 300px;
  padding: 14px;
  background: var(--card-white);
  border: 1px solid var(--gold-light);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(47, 42, 37, 0.14);
}

.month-calendar-popover.open {
  display: block;
}

.db-status-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.db-status-banner.hidden {
  display: none;
}

.empty-state.error-state {
  color: #c0392b;
  padding: 24px 16px;
  text-align: center;
  line-height: 1.5;
}

.schedule-col.drop-target {
  background-color: rgba(197, 160, 89, 0.12) !important;
  outline: 2px dashed var(--gold);
  outline-offset: -2px;
}

.month-calendar-window {
  max-width: 360px;
}

.month-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mc-title {
  font-weight: 700;
  font-size: 1rem;
  text-transform: capitalize;
}

.month-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.mc-weekday {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  padding: 4px 0;
}

.mc-day {
  aspect-ratio: 1;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.12s;
}

.mc-day:hover:not(:disabled) {
  border-color: var(--gold);
}

.mc-day.other-month {
  opacity: 0.35;
}

.mc-day.today:not(.selected) {
  border-color: var(--gold);
}

.mc-day.selected {
  background: var(--gold-premium);
  border-color: var(--gold-dark);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 94, 60, 0.35);
}

.mc-day.other-month.selected {
  opacity: 1;
}

.mc-day:disabled {
  opacity: 0.2;
  cursor: default;
}

/* ——— Timeline schedule ——— */
.schedule-timeline {
  width: max-content;
  min-width: 100%;
}

.schedule-timeline-header {
  display: grid;
  grid-template-columns: 64px 1fr;
  border-bottom: 1px solid rgba(197, 160, 89, 0.25);
  background: #FEF9E5;
  position: sticky;
  top: 0;
  z-index: 6;
}

.schedule-timeline-header .st-corner {
  border-right: 1px solid rgba(197, 160, 89, 0.2);
  position: sticky;
  left: 0;
  top: 0;
  z-index: 8;
  background: #FEF9E5;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
}

.schedule-master-cols {
  display: grid;
}

.schedule-master-head {
  padding: 8px 6px;
  text-align: center;
  font-size: 0.78rem;
  border-right: 1px solid rgba(197, 160, 89, 0.2);
  line-height: 1.25;
  background: #FEF9E5;
  position: sticky;
  top: 0;
  z-index: 6;
}

.schedule-master-head:last-child {
  border-right: none;
}

.schedule-timeline-body {
  display: grid;
  grid-template-columns: 64px 1fr;
}

.schedule-time-labels {
  border-right: 1px solid rgba(197, 160, 89, 0.2);
  background: #faf8f3;
  position: sticky;
  left: 0;
  z-index: 4;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
  align-self: start;
}

.schedule-time-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(197, 160, 89, 0.12);
  box-sizing: border-box;
}

.schedule-columns-wrap {
  position: relative;
}

.schedule-columns {
  display: grid;
  height: 100%;
}

.schedule-col {
  position: relative;
  border-right: 1px solid rgba(197, 160, 89, 0.15);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(var(--schedule-row-px, 36px) - 1px),
    rgba(197, 160, 89, 0.12) calc(var(--schedule-row-px, 36px) - 1px),
    rgba(197, 160, 89, 0.12) var(--schedule-row-px, 36px)
  );
}

.schedule-col:last-child {
  border-right: none;
}

.schedule-col.off-band {
  background-color: #f5f5f5;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(var(--schedule-row-px, 36px) - 1px),
    rgba(0, 0, 0, 0.04) calc(var(--schedule-row-px, 36px) - 1px),
    rgba(0, 0, 0, 0.04) var(--schedule-row-px, 36px)
  );
}

.schedule-slot-hit {
  position: absolute;
  left: 0;
  right: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1;
  padding: 0;
  font-family: inherit;
}

.schedule-slot-hit:hover {
  background: rgba(197, 160, 89, 0.18);
}

.schedule-slot-hit:active {
  background: rgba(197, 160, 89, 0.28);
}

.schedule-block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 10px;
  padding: 6px 8px 10px;
  font-size: 0.72rem;
  cursor: grab;
  border: 1px solid rgba(0,0,0,0.08);
  z-index: 2;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  user-select: none;
  touch-action: none;
}

.schedule-block.dragging,
.schedule-block.resizing {
  cursor: grabbing;
  z-index: 5;
  opacity: 0.92;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.schedule-block .sb-time { font-weight: 700; opacity: 0.75; font-size: 0.68rem; }
.schedule-block .sb-client { font-weight: 700; font-size: 0.78rem; }
.schedule-block.cancelled { opacity: 0.45; text-decoration: line-through; cursor: default; }

.schedule-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  cursor: ns-resize;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.08));
}

.schedule-resize-handle::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin: 4px auto 0;
  border-radius: 2px;
  background: rgba(0,0,0,0.2);
}

.schedule-edit-panel {
  background: var(--bg-base);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--gold-light);
}

.schedule-edit-panel.hidden {
  display: none;
}

.schedule-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.schedule-edit-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
}

.schedule-edit-row input {
  padding: 8px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  font-family: inherit;
}

.duration-slider {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--gold-dark);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid rgba(197, 160, 89, 0.2);
  padding: 0;
  vertical-align: top;
  min-width: 140px;
}

.schedule-table th {
  background: #FEF9E5;
  padding: 12px 8px;
  text-align: center;
  font-size: 0.85rem;
}

.schedule-table .time-cell {
  width: 72px;
  min-width: 72px;
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #faf8f3;
  padding: 8px 4px;
}

.schedule-table .slot-cell {
  height: 42px;
  position: relative;
  background: #fff;
}

.schedule-table .slot-cell.off-hours {
  background: #f5f5f5;
}

.schedule-table .slot-booking {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 2px;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.05);
  z-index: 2;
  overflow: hidden;
}

.schedule-table .slot-booking .sb-time { font-weight: 700; opacity: 0.7; }
.schedule-table .slot-booking .sb-client { font-weight: 700; font-size: 0.78rem; }
.schedule-table .slot-booking.cancelled { opacity: 0.45; text-decoration: line-through; }

.broadcast-section { margin-bottom: 1.25rem; }
.broadcast-section h4 { font-size: 0.95rem; margin-bottom: 8px; }
.broadcast-targets { display: flex; flex-direction: column; gap: 10px; }
.broadcast-targets label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.9rem; }
.broadcast-targets select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--gold-light); }

.conversations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  background: var(--bg-base);
  cursor: pointer;
  transition: background 0.15s;
}

.conversation-item:hover {
  background: #fff;
}

.conversation-item.unread {
  border-color: var(--gold);
  background: #fffdf8;
}

.btn-refresh-loading i {
  animation: refreshSpin 0.75s linear infinite;
}

.btn-refresh-success {
  border-color: #2d6a4f !important;
  color: #2d6a4f !important;
  background: var(--color-green) !important;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

@keyframes refreshSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.conversation-body {
  flex: 1;
  min-width: 0;
}

.conversation-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.conversation-preview {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-meta {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.chat-modal-window {
  width: min(560px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.chat-header {
  margin-bottom: 12px;
}

.chat-messages {
  flex: 1;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-base);
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-bubble.in {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--gold-light);
}

.chat-bubble.out {
  align-self: flex-end;
  background: var(--color-yellow);
}

.chat-bubble-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.chat-compose textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  font-family: inherit;
  margin-bottom: 8px;
  resize: vertical;
}

.chat-platform-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.chat-platform-label select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--gold-light);
}

/* ——— Floating messages widget ——— */
.msg-widget-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  pointer-events: none;
}

.msg-fab {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--gold-premium);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(176, 138, 67, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.msg-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 32px rgba(176, 138, 67, 0.55);
}

.msg-fab.active {
  transform: scale(0.95);
}

.msg-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.45);
  pointer-events: none;
}

.msg-fab-badge.hidden {
  display: none !important;
}

.msg-widget {
  pointer-events: auto;
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  background: var(--card-white);
  border-radius: 18px;
  border: 1px solid var(--gold-light);
  box-shadow: 0 16px 48px rgba(47, 42, 37, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: msgWidgetIn 0.22s ease;
}

.msg-widget.hidden {
  display: none !important;
}

@keyframes msgWidgetIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.msg-widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gold-light);
  background: linear-gradient(180deg, #fff 0%, var(--bg-base) 100%);
  flex-shrink: 0;
}

.msg-widget-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  font-family: 'Cinzel', serif;
  color: #604B28;
}

.msg-widget-header-actions {
  display: flex;
  gap: 4px;
}

.msg-widget-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-widget-icon-btn:hover {
  background: var(--bg-base);
  color: var(--text-dark);
}

.msg-widget-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msg-widget-hint {
  padding: 10px 14px 0;
  margin: 0;
  font-size: 0.78rem;
}

.msg-widget-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.msg-widget-list .conversation-item {
  margin-bottom: 6px;
  border-radius: 12px;
  border: 1px solid var(--gold-light);
  padding: 10px 12px;
  cursor: pointer;
}

.msg-widget-client-meta {
  padding: 8px 14px 0;
  margin: 0;
  font-size: 0.78rem;
}

.msg-widget-messages {
  min-height: 0;
  max-height: none;
  flex: 1;
  margin: 8px 10px;
}

.msg-widget-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--gold-light);
  background: var(--card-white);
  flex-shrink: 0;
}

.msg-widget-platform {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  font-family: inherit;
}

.msg-widget-compose textarea {
  grid-column: 1;
  padding: 10px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  resize: none;
  font-family: inherit;
  font-size: 0.9rem;
}

.msg-widget-send-btn {
  grid-column: 2;
  grid-row: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app.hidden .msg-widget-wrap {
  display: none;
}

.modal-wide { max-width: 640px; }

.schedule-days-grid {
  display: grid;
  gap: 8px;
}

.schedule-day-row {
  display: grid;
  grid-template-columns: 100px 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: var(--bg-base);
  border-radius: 10px;
  font-size: 0.85rem;
}

.schedule-day-row input[type="time"] {
  padding: 6px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
}

.review-badge-offered { background: #fff3cd; color: #856404; padding: 2px 8px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; }
.review-badge-left { background: var(--color-green); color: #2d6a4f; padding: 2px 8px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; }

.btn-danger-outline { border-color: var(--danger); color: var(--danger); }
.btn-danger-outline:hover { background: #fdecea; }

.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 1200px) {
  .grid-dashboard {
    grid-template-columns: 1fr;
  }
  .right-panel {
    max-height: 280px;
  }
}

@media (max-width: 1024px) {
  .grid-dashboard { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body { overflow: auto; height: auto; }
  .app { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
  .sidebar { width: 100%; padding: 1rem; }
  .sidebar.collapsed { width: 100%; }
  .sidebar.collapsed .brand-title,
  .sidebar.collapsed .menu-label,
  .sidebar.collapsed .user-profile-text {
    opacity: 1;
    width: auto;
    pointer-events: auto;
  }
  .menu-list { flex-direction: row; flex-wrap: wrap; }
  .main-content { padding: 1rem; overflow: visible; }
  .page.active-page { overflow: visible; }
}

.runtime-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 1rem 0;
}

.runtime-card {
  background: var(--bg-base);
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  padding: 12px 14px;
}

.runtime-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.runtime-card-value {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 4px;
}

.runtime-ok { color: #2d6a4f; }
.runtime-warn { color: #856404; }
.runtime-error { color: var(--danger); }

.logs-panel {
  background: #1a1a2e;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 0;
  max-height: min(65vh, 720px);
  overflow-y: auto;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  border: 1px solid #2d3748;
}

.logs-empty {
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
}

.log-line {
  display: grid;
  grid-template-columns: 72px 62px 88px 1fr;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  align-items: start;
}

.log-line:hover { background: rgba(255,255,255,0.04); }

.log-time { color: #64748b; }
.log-level {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.log-level-error { color: #f87171; }
.log-level-warn { color: #fbbf24; }
.log-level-info { color: #60a5fa; }
.log-level-debug { color: #94a3b8; }
.log-source { color: #c4b5fd; }
.log-message { white-space: pre-wrap; word-break: break-word; }
.log-detail {
  grid-column: 1 / -1;
  margin-left: 232px;
  color: #fca5a5;
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.logs-auto-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.logs-filter-select {
  padding: 8px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: white;
  font-family: inherit;
}

/* ——— Toast notifications ——— */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: start;
  padding: 14px 14px 12px;
  background: #fff;
  border: 1px solid var(--gold-light);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  animation: toast-in 0.28s ease-out;
  transition: transform 0.15s, box-shadow 0.15s;
}

.toast-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.toast-item.toast-booking_created { border-left-color: #27ae60; }
.toast-item.toast-booking_cancelled { border-left-color: #c0392b; }
.toast-item.toast-booking_updated { border-left-color: #2980b9; }
.toast-item.toast-booking_status { border-left-color: #8e44ad; }
.toast-item.toast-message_in { border-left-color: #d68910; }
.toast-item.toast-client_new { border-left-color: var(--gold-dark); }

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dark);
  font-size: 1rem;
}

.toast-content {
  min-width: 0;
}

.toast-title {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 4px;
  line-height: 1.3;
}

.toast-body {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

.toast-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.85;
}

.toast-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.page-header-row .card-title {
  margin-bottom: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.client-invite-result {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.client-invite-result.hidden {
  display: none;
}

.client-invite-link {
  display: block;
  word-break: break-all;
  padding: 0.75rem;
  margin: 0.75rem 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 0.9rem;
}

.client-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.client-actions-cell {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.client-mode-fieldset {
  border: none;
  margin: 0 0 1rem;
  padding: 0;
}

.client-mode-fieldset legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding: 0;
}

.client-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.client-mode-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.client-mode-tab:has(input:checked) {
  background: rgba(139, 94, 60, 0.12);
  border-color: rgba(139, 94, 60, 0.35);
  font-weight: 600;
}

.client-mode-tab input {
  margin: 0;
}

.phone-duplicate-warning {
  margin: -0.35rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.35);
  color: #9a3412;
  font-size: 0.9rem;
  line-height: 1.4;
}

.phone-duplicate-warning.hidden {
  display: none;
}

.clients-empty-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.nb-client-search-label {
  display: block;
  margin-bottom: 0.35rem;
}

.nb-client-search-label input {
  width: 100%;
  margin-top: 0.35rem;
}

.nb-client-search-count {
  margin: 0 0 0.35rem;
  min-height: 1.1em;
}

.auth-card { max-width: 420px; width: 100%; }
.auth-tabs { display: flex; gap: 0.35rem; margin: 1rem 0; flex-wrap: wrap; }
.auth-tab {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border, rgba(0,0,0,0.1));
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
}
.auth-tab.active { background: var(--gold, #c9a227); color: #fff; border-color: transparent; }
.auth-panel { display: none; flex-direction: column; gap: 0.75rem; }
.auth-panel.active { display: flex; }
.auth-panel label { margin: 0; }
.legacy-login { margin-top: 0.75rem; font-size: 0.85rem; }
.menu-item.hidden { display: none !important; }

#nb-existing-client-wrap #nb-client-add-from-search {
  width: 100%;
  margin-top: 0.5rem;
  justify-content: center;
}

.master-categories-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.master-category-block {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}

.master-cat-label {
  font-weight: 600;
}

.master-category-services {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0 0 1.5rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--gold, #c9a227);
}

.master-category-services.hidden {
  display: none;
}

.specializations-checkboxes,
.master-form-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.modal-form .form-section-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}

.inline-add-form label {
  margin: 0;
}

/* ——— Finance & payments ——— */
.finance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.finance-date-input {
  padding: 8px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  font-family: inherit;
}

.finance-date-sep {
  color: var(--text-muted);
}

.finance-preset.active {
  border-color: var(--gold-premium);
  background: var(--color-yellow);
}

.finance-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.finance-subcard {
  padding: 16px;
  border: 1px solid var(--gold-light);
  border-radius: 14px;
  background: var(--card-white);
}

.finance-subtitle {
  font-size: 0.95rem;
  margin: 0 0 12px;
  font-family: 'Cinzel', serif;
  color: #604B28;
}

.finance-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finance-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}

.finance-bar-track {
  height: 10px;
  background: var(--bg-base);
  border-radius: 999px;
  overflow: hidden;
}

.finance-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), var(--gold-premium));
  border-radius: 999px;
}

.finance-daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 120px;
  padding-top: 8px;
}

.finance-day-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.finance-day-bar {
  width: 100%;
  max-width: 36px;
  background: var(--gold-premium);
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
}

.finance-day-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.finance-payments-table {
  overflow-x: auto;
}

.finance-payments-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.finance-payments-table th,
.finance-payments-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--gold-light);
  text-align: left;
}

.finance-methods-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.finance-method-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: var(--bg-base);
}

.finance-method-item.disabled {
  opacity: 0.55;
}

.finance-settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.finance-new-method-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.payment-panel {
  background: linear-gradient(180deg, #fffdf8 0%, var(--bg-base) 100%);
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.payment-panel-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.payment-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.payment-edit-grid,
.payment-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.payment-note-label {
  grid-column: 1 / -1;
}

.payment-history {
  margin-top: 12px;
  font-size: 0.82rem;
}

.payment-history-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed var(--gold-light);
}

.text-success {
  color: #2d6a4f;
}

.stat-box-highlight {
  border-color: var(--gold-premium);
  background: #fffdf8;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* ——— Analytics dashboard ——— */
.page.active-page.analytics-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow-y: auto;
}

.analytics-header {
  background: var(--card-white);
  border: 1px solid var(--gold-light);
  border-radius: 16px;
  padding: 18px 20px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.analytics-kpi {
  background: var(--card-white);
  border: 1px solid var(--gold-light);
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.analytics-kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold-premium));
}

.analytics-kpi.primary::before {
  background: linear-gradient(90deg, #c5a059, #8b6914);
  height: 4px;
}

.analytics-kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.analytics-kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: 'Cinzel', serif;
  color: #604B28;
  line-height: 1.1;
}

.analytics-kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.analytics-kpi-delta {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
}

.analytics-kpi-delta.up { color: #2d6a4f; }
.analytics-kpi-delta.down { color: #c0392b; }
.analytics-kpi-delta.neutral { color: var(--text-muted); }

.analytics-chart-card {
  background: var(--card-white);
  border: 1px solid var(--gold-light);
  border-radius: 16px;
  padding: 16px 18px;
}

.analytics-chart-wide {
  grid-column: 1 / -1;
}

.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.analytics-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.analytics-chart-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-family: 'Cinzel', serif;
  color: #604B28;
}

.analytics-chart-head h3 i {
  color: var(--gold-premium);
  margin-right: 6px;
}

.analytics-canvas-wrap {
  position: relative;
  height: 280px;
}

.analytics-canvas-donut {
  height: 260px;
  max-width: 360px;
  margin: 0 auto;
}

.analytics-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.analytics-table-card {
  background: var(--card-white);
  border: 1px solid var(--gold-light);
  border-radius: 16px;
  padding: 16px 18px;
}

.analytics-table-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-family: 'Cinzel', serif;
  color: #604B28;
}

.analytics-table-title i {
  color: var(--gold-premium);
  margin-right: 6px;
}

.analytics-table-wrap {
  overflow-x: auto;
}

.analytics-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.analytics-table-wrap th,
.analytics-table-wrap td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--gold-light);
  text-align: left;
}

.analytics-table-wrap th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.analytics-progress {
  height: 8px;
  background: var(--bg-base);
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}

.analytics-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), var(--gold-premium));
  border-radius: 999px;
}

.analytics-fulfillment {
  font-weight: 700;
  font-size: 0.82rem;
}

.analytics-fulfillment.good { color: #2d6a4f; }
.analytics-fulfillment.mid { color: #b08a43; }
.analytics-fulfillment.low { color: #c0392b; }
