@charset "UTF-8";
:root {
  --ink: #17222e;
  --muted: #526577;
  --subtle: #7d91a3;
  --blue: #4a8fc6;
  --deep: #286794;
  --deep-hover: #174a71;
  --light: #eaf4fc;
  --surface: #f5f9fd;
  --bg: #f1f6fb;
  --line: #d7e6f0;
  --line-soft: #e6eff6;
  --white: #ffffff;
  --green: #149654;
  --green-bg: #e8f8ef;
  --amber: #c77b09;
  --amber-bg: #fff5e3;
  --red: #c93838;
  --red-bg: #fdecec;
  --purple: #6b4fc4;
  --purple-bg: #f1edfc;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(23, 55, 84, 0.05);
  --shadow-md: 0 12px 32px -12px rgba(23, 55, 84, 0.14);
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.is-embed { background: #fff; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  border: 1px solid transparent; background: var(--deep); color: #fff;
  font-weight: 700; font-size: 14px; transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--deep-hover); }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-outline {
  background: #fff; color: var(--deep); border-color: #b7d2e6;
}
.btn-outline:hover:not(:disabled) { background: var(--light); border-color: var(--blue); }
.btn-ghost {
  background: transparent; color: var(--muted); border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--light); color: var(--deep); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: #f4c6c6; }
.btn-danger:hover:not(:disabled) { background: #fad8d8; }
.btn-tg {
  background: #229ED9; color: #fff;
  box-shadow: 0 10px 24px -8px rgba(34, 158, 217, 0.55);
}
.btn-tg:hover:not(:disabled) { background: #1a8bc2; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn-xs { min-height: 30px; padding: 4px 10px; font-size: 12px; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink); }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
  font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74, 143, 198, 0.16);
}
.textarea { resize: vertical; min-height: 82px; }

/* Status Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.badge-info { background: #e6f2fc; color: #195d94; }
.badge-new { background: var(--amber-bg); color: var(--amber); }
.badge-confirmed { background: #e6f2fc; color: #195d94; }
.badge-arrived { background: var(--green-bg); color: var(--green); }
.badge-completed { background: #edf2f6; color: #3d5266; }
.badge-cancelled { background: #fde2e2; color: #b91c1c; border: 1px solid #f5bcbc; }
.badge-in_progress { background: var(--amber-bg); color: var(--amber); }
.badge-done { background: var(--green-bg); color: var(--green); }
.badge-demo { background: var(--amber-bg); color: var(--amber); }
.badge-sent { background: var(--green-bg); color: var(--green); }
.badge-error { background: var(--red-bg); color: var(--red); }

/* Toast */
.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 30px rgba(15, 32, 48, 0.28);
  animation: toastIn .2s ease;
}
.toast.is-error { background: #a82424; }
.toast.is-success { background: #147a46; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   BOOKING WIDGET / PAGE
   ============================================================ */
.book-shell {
  max-width: 960px; margin: 24px auto 48px; padding: 0 16px;
}
body.is-embed .book-shell {
  max-width: 100%; margin: 0; padding: 0;
}
.book-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden; display: flex; flex-direction: column;
  min-height: 620px;
}
body.is-embed .book-card {
  border: none; border-radius: 0; box-shadow: none; min-height: 100vh;
}
body.is-embed .book-head { padding-right: 64px; }
.book-head {
  padding: 18px 24px; background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.book-brand { display: flex; align-items: center; gap: 12px; }
.book-brand img { width: 38px; height: 38px; object-fit: contain; }
.book-brand strong { display: block; font-size: 18px; letter-spacing: -.03em; line-height: 1.1; }
.book-brand small { color: var(--muted); font-size: 12.5px; font-weight: 600; }

.book-mode-switch {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.book-mode-switch button {
  border: none; background: transparent; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--muted); transition: all .15s;
}
.book-mode-switch button.is-active {
  background: var(--deep); color: #fff; box-shadow: 0 4px 12px -4px rgba(40,103,148,.5);
}

/* Stepper */
.book-steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft); background: #fafdff;
}
.step-btn {
  display: flex; align-items: center; gap: 9px; padding: 13px 16px;
  border: none; background: transparent; text-align: left;
  border-bottom: 2.5px solid transparent; transition: background .15s, border-color .15s;
}
.step-btn:hover:not(:disabled) { background: var(--light); }
.step-btn.is-active { background: #fff; border-bottom-color: var(--deep); }
.step-num {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--line-soft); color: var(--muted);
}
.step-btn.is-active .step-num { background: var(--deep); color: #fff; }
.step-btn.is-done .step-num { background: var(--green-bg); color: var(--green); }
.step-meta strong { display: block; font-size: 13px; font-weight: 800; line-height: 1.2; }
.step-meta small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 165px; }

.book-body { padding: 22px 24px 96px; flex: 1; }

/* Selected Context Chips Bar */
.context-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.ctx-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--light); color: var(--deep); border: 1px solid #c5dff2;
}
.ctx-chip button {
  border: none; background: rgba(40,103,148,.14); color: var(--deep);
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; line-height: 1; padding: 0;
}
.ctx-chip button:hover { background: var(--deep); color: #fff; }

/* Services Step */
.svc-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.svc-search { flex: 1; min-width: 210px; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pill {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 700; color: var(--muted);
  transition: all .14s;
}
.cat-pill:hover { border-color: var(--blue); color: var(--deep); }
.cat-pill.is-active { background: var(--deep); color: #fff; border-color: var(--deep); }

.svc-list { display: grid; gap: 10px; }
.svc-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-soft);
  background: #fff; transition: border-color .15s, background .15s; cursor: pointer;
}
.svc-item:hover { border-color: #a9cbe4; background: #fbfdff; }
.svc-item.is-selected { border-color: var(--deep); background: #f2f8fd; }
.svc-item.is-disabled { opacity: .45; cursor: not-allowed; }
.svc-info { flex: 1; }
.svc-title { font-weight: 750; font-size: 15px; color: var(--ink); }
.svc-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.svc-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.svc-price { font-weight: 800; color: var(--deep); font-size: 14.5px; }
.svc-dur {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line-soft);
  padding: 2px 9px; border-radius: 999px;
}
.svc-check {
  width: 24px; height: 24px; border-radius: 8px; flex: none; margin-top: 2px;
  border: 2px solid #b8d1e4; display: grid; place-items: center; background: #fff;
  color: transparent; font-weight: 800; font-size: 14px; transition: all .14s;
}
.svc-item.is-selected .svc-check {
  background: var(--deep); border-color: var(--deep); color: #fff;
}

/* Specialists Step */
.spec-grid { display: grid; gap: 12px; }
.spec-card {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: start;
  padding: 16px; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; transition: border-color .15s, box-shadow .15s; cursor: pointer;
}
.spec-card:hover:not(.is-disabled) { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.spec-card.is-selected { border-color: var(--deep); background: #f2f8fd; }
.spec-card.is-disabled { opacity: .5; cursor: not-allowed; }
.spec-avatar {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--light); background: var(--light); flex: none;
  display: grid; place-items: center; font-weight: 800; color: var(--deep); font-size: 20px;
}
.spec-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.spec-name { font-size: 16px; font-weight: 800; line-height: 1.25; }
.spec-role { font-size: 13px; color: var(--muted); margin-top: 2px; }
.spec-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.spec-tags span {
  font-size: 11.5px; font-weight: 700; color: var(--deep);
  background: var(--light); padding: 2px 9px; border-radius: 999px;
}
.spec-quick {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.spec-quick-label { font-size: 12px; font-weight: 700; color: var(--muted); width: 100%; }
.slot-chip {
  padding: 5px 11px; border-radius: 10px; border: 1px solid #b9d4e8;
  background: #fff; color: var(--deep); font-size: 13px; font-weight: 750;
  transition: all .14s;
}
.slot-chip:hover { background: var(--deep); color: #fff; border-color: var(--deep); }
.spec-radio {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #b8d1e4;
  display: grid; place-items: center; margin-top: 4px;
}
.spec-card.is-selected .spec-radio { border-color: var(--deep); }
.spec-card.is-selected .spec-radio::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--deep);
}

/* Date & Time Step */
.dt-layout { display: grid; grid-template-columns: 330px 1fr; gap: 22px; align-items: start; }
.cal-box {
  border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff;
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.cal-head strong { font-size: 15px; font-weight: 800; text-transform: capitalize; }
.cal-nav {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--deep); font-weight: 800;
}
.cal-nav:hover { background: var(--light); }
.cal-weekdays, .cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center;
}
.cal-weekdays span { font-size: 11.5px; font-weight: 700; color: var(--subtle); padding-bottom: 6px; }
.cal-day {
  aspect-ratio: 1; border-radius: 11px; border: 1px solid transparent;
  background: transparent; font-size: 13.5px; font-weight: 750; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; transition: all .14s;
}
.cal-day:hover:not(:disabled) { background: var(--light); border-color: #a9cbe4; }
.cal-day.is-today { border-color: var(--blue); }
.cal-day.is-selected { background: var(--deep) !important; color: #fff !important; border-color: var(--deep) !important; }
.cal-day:disabled {
  color: #b8c6d3; background: #f6f9fb; cursor: not-allowed; font-weight: 500;
}
.cal-dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--green); margin-top: 2px;
}
.cal-day.is-selected .cal-dot { background: #fff; }

.slots-box {
  border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fff;
}
.slots-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.slots-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.slots-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.slots-legend span { display: inline-flex; align-items: center; gap: 5px; }
.slots-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.slot-group { margin-bottom: 14px; }
.slot-group-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); margin-bottom: 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot-btn {
  padding: 10px 6px; border-radius: 11px; border: 1px solid #bfd7ea;
  background: #fff; color: var(--ink); font-weight: 750; font-size: 14px;
  transition: all .14s; text-align: center;
}
.slot-btn:hover:not(:disabled) { border-color: var(--deep); background: var(--light); color: var(--deep); }
.slot-btn.is-selected { background: var(--deep); color: #fff; border-color: var(--deep); }
.slot-btn:disabled {
  background: #f3f6f9; border-color: #e4ecf2; color: #aebcc8;
  cursor: not-allowed; text-decoration: line-through;
}

.empty-day {
  text-align: center; padding: 28px 16px; color: var(--muted);
}
.empty-day strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }

/* Confirm & Success */
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.summary-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
}
.summary-box h3 { margin: 0 0 12px; font-size: 16px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.summary-row:last-child { border-bottom: none; }
.summary-row span { color: var(--muted); }
.summary-row strong { text-align: right; }

.success-box {
  text-align: center; max-width: 520px; margin: 12px auto; padding: 12px;
}
.success-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--green-bg); color: var(--green);
  display: grid; place-items: center; font-size: 30px; font-weight: 800;
}
.tg-callout {
  margin: 18px 0; padding: 16px; border-radius: 16px;
  background: linear-gradient(135deg, #edf7fe 0%, #f6fbff 100%);
  border: 1px solid #c3e2f7; text-align: left;
}
.tg-callout strong { display: block; font-size: 14.5px; margin-bottom: 4px; color: #124c78; }
.tg-callout p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

/* Sticky Footer Bar inside booking */
.book-sticky {
  position: sticky; bottom: 0; left: 0; right: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.book-sticky-info strong { display: block; font-size: 15px; }
.book-sticky-info small { color: var(--muted); font-size: 12.5px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px circle at 15% 10%, #dceefb 0%, transparent 55%), var(--bg);
}
.login-card {
  width: min(100%, 440px); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-md);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-brand img { width: 42px; height: 42px; object-fit: contain; }
.login-brand h1 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.login-brand small { color: var(--muted); font-size: 12.5px; display: block; }
.login-error {
  background: var(--red-bg); color: var(--red); border: 1px solid #f4c6c6;
  padding: 10px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 700; margin-bottom: 14px;
}
.demo-box {
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line);
}
.demo-box p { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.demo-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   ADMIN & MASTER DASHBOARD SHELL
   ============================================================ */
.crm-layout {
  display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh;
}
.crm-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.crm-ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.crm-ic-sm {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.85;
  stroke-linecap: round; stroke-linejoin: round;
}
.crm-ic-xs {
  width: 13px; height: 13px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.crm-sidebar {
  background: #102030; color: #dbe9f5; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.06);
}
.crm-logo {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 10px;
}
.crm-logo img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 9px; padding: 3px; }
.crm-logo strong { display: block; color: #fff; font-size: 16px; line-height: 1.1; letter-spacing: -.02em; }
.crm-logo small { color: #87a6c1; font-size: 11.5px; }

.crm-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: #a7c1d8; font-size: 13.5px; font-weight: 650; text-align: left; width: 100%;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-label { display: inline-flex; align-items: center; gap: 10px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.is-active {
  background: rgba(74, 143, 198, 0.22); color: #fff;
  border-color: rgba(114, 179, 230, 0.28);
}
.nav-item.is-active .crm-ic { color: #7bc4ff; }
.nav-pill {
  background: #d94343; color: #fff; font-size: 11px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; line-height: 1.3;
}
.crm-side-foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 10px;
}
.crm-user-meta small { display: block; font-size: 11px; color: #7e9eb9; text-transform: uppercase; letter-spacing: .05em; }
.crm-user-meta strong { display: block; font-size: 13.5px; color: #fff; margin-top: 2px; }
.crm-side-links { display: flex; gap: 6px; flex-wrap: wrap; }
.side-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 650;
  background: rgba(255,255,255,.07); color: #d3e3f0; transition: background .15s, color .15s;
}
.side-action:hover { background: rgba(255,255,255,.14); color: #fff; }
.side-action.is-logout { background: rgba(217, 67, 67, 0.16); color: #ffb9b9; }
.side-action.is-logout:hover { background: rgba(217, 67, 67, 0.28); color: #fff; }

.crm-main { padding: 22px 26px 48px; min-width: 0; }
.crm-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.crm-topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.03em; }

/* KPI Cards */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px;
}
.kpi-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow-sm); text-align: left; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.kpi-card.kpi-clickable:hover { border-color: var(--blue); box-shadow: 0 8px 22px -12px rgba(23, 55, 84, 0.22); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-card small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.kpi-ic {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; background: var(--surface); color: var(--deep);
}
.kpi-ic.is-amber { background: var(--amber-bg); color: var(--amber); }
.kpi-ic.is-green { background: var(--green-bg); color: var(--green); }
.kpi-ic.is-blue { background: var(--light); color: var(--deep); }
.kpi-card strong { display: block; font-size: 30px; font-weight: 800; color: var(--ink); margin-top: 8px; line-height: 1.05; letter-spacing: -.03em; }
.kpi-sub { display: block; font-size: 12px; color: var(--subtle); margin-top: 6px; font-weight: 600; }

/* Summary Layout */
.summary-layout {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr); gap: 16px; align-items: start;
}
.panel-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px;
}
.panel-head-row h2 { margin: 0; }
.summary-appt-row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 12px; margin-bottom: 8px;
  background: #fff; transition: border-color .14s, background .14s;
}
.summary-appt-row:hover { border-color: #b7d2e6; background: #fbfdff; }
.summary-time { font-weight: 800; font-size: 14px; color: var(--deep); line-height: 1.2; }
.summary-time small { display: block; font-weight: 600; font-size: 11.5px; color: var(--subtle); }
.summary-spec-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.summary-spec-row:last-child { border-bottom: none; }
.summary-spec-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.summary-spec-left img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: top; flex: none; }
.summary-spec-left strong { display: block; font-size: 13.5px; line-height: 1.2; }
.summary-spec-left small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.badge-block { background: #edf2f7; color: #3f556a; border: 1px solid #cbd9e6; }
.modal-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  margin-bottom: 16px;
}
.modal-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 12px; border-radius: 9px; border: none; background: transparent;
  font-size: 13.5px; font-weight: 750; color: var(--muted); transition: all .14s;
}
.modal-tab.is-active { background: #fff; color: var(--deep); box-shadow: 0 2px 8px rgba(23,55,84,.08); }
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.preset-chip {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--deep); font-size: 12px; font-weight: 700;
}
.preset-chip:hover { background: var(--light); border-color: var(--blue); }
.inline-ic-row { display: inline-flex; align-items: center; gap: 5px; }

/* Schedule Board Grid */
.board-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 16px; margin-bottom: 16px;
}
.date-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-scroll {
  overflow-x: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm);
}
.board-grid {
  display: grid; min-width: 820px;
}
.board-head-cell {
  padding: 12px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft);
  background: #f8fbff; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 3;
}
.board-head-cell img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: top; flex: none; }
.board-head-cell strong { display: block; font-size: 13.5px; line-height: 1.2; }
.board-head-cell small { display: block; font-size: 11.5px; color: var(--muted); }
.board-time-col { background: #fafdff; border-right: 1px solid var(--line); }
.board-time-tick {
  height: 54px; padding: 4px 8px; font-size: 11.5px; font-weight: 700; color: var(--subtle);
  border-bottom: 1px solid var(--line-soft); text-align: right;
}
.board-spec-col {
  position: relative; border-right: 1px solid var(--line-soft);
  background: #fff;
}
.board-spec-col.is-off {
  background: repeating-linear-gradient(-45deg, #f6f9fb, #f6f9fb 8px, #eef3f7 8px, #eef3f7 16px);
}
.board-slot-cell {
  height: 27px; border-bottom: 1px dashed #ebf2f7; cursor: pointer;
  transition: background .12s;
}
.board-slot-cell:nth-child(2n) { border-bottom-style: solid; border-bottom-color: var(--line-soft); }
.board-slot-cell:hover { background: rgba(74, 143, 198, 0.12); }
.board-slot-cell.is-outside {
  background: rgba(230, 238, 245, 0.55); cursor: default;
}
.board-block {
  position: absolute; left: 5px; right: 5px; z-index: 2; border-radius: 10px;
  background: repeating-linear-gradient(-45deg, #eef3f7, #eef3f7 6px, #e3ebf2 6px, #e3ebf2 12px);
  border: 1px solid #b8cad9; border-left: 4px solid #58728a;
  padding: 5px 8px; font-size: 11.5px; font-weight: 750; color: #364e63;
  overflow: hidden; cursor: pointer; display: flex; align-items: flex-start; gap: 5px;
  transition: border-color .14s, box-shadow .14s;
}
.board-block:hover { border-color: var(--deep); box-shadow: 0 4px 12px -6px rgba(23,55,84,.25); z-index: 4; }
.board-appt {
  position: absolute; left: 5px; right: 5px; z-index: 2; border-radius: 11px;
  padding: 6px 8px; font-size: 12px; line-height: 1.25; cursor: pointer;
  border-left: 4px solid #d98a12; background: #fff6e5; color: var(--ink);
  box-shadow: 0 4px 12px -6px rgba(23, 55, 84, 0.25); overflow: hidden;
  transition: box-shadow .14s;
}
.board-appt:hover { box-shadow: 0 8px 18px -6px rgba(23, 55, 84, 0.35); z-index: 4; }
.board-appt.st-confirmed { background: #e8f3fc; border-left-color: var(--deep); }
.board-appt.st-arrived { background: #e6f7ee; border-left-color: var(--green); }
.board-appt.st-completed { background: #edf2f6; border-left-color: #6c8093; opacity: .85; }
.board-appt.st-cancelled { background: #fef2f2; border-left-color: #dc2626; color: #7f1d1d; opacity: .92; text-decoration: line-through; }
.board-appt strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-appt small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Panels & Tables */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.panel h2, .panel h3 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.02em; }
.table-wrap { overflow-x: auto; }
table.crm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.crm-table th {
  text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 800;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--line); background: #fafdff;
}
table.crm-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
table.crm-table tr:hover td { background: #fafdff; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(17, 34, 51, 0.48);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px;
}
.modal-card {
  width: min(100%, 580px); max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 20px; border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 34, 52, 0.28); padding: 22px 24px;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 18px; line-height: 1;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-full { grid-column: 1 / -1; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); flex-wrap: wrap;
}

/* Master Cabinet */
.master-shell { max-width: 980px; margin: 0 auto; padding: 20px 16px 48px; }
.master-head {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.master-profile { display: flex; align-items: center; gap: 14px; }
.master-profile img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--light); }
.appt-card {
  background: #fff; border: 1px solid var(--line); border-left: 5px solid #d98a12;
  border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.appt-card.st-confirmed { border-left-color: var(--deep); }
.appt-card.st-arrived { border-left-color: var(--green); }
.appt-card.st-completed { border-left-color: #7d91a3; opacity: .82; }
.appt-card.st-cancelled { background: #fef2f2; border-color: #f5bcbc; border-left-color: #dc2626; opacity: .92; }

/* Responsive */
@media (max-width: 900px) {
  .crm-layout { grid-template-columns: 1fr; }
  .crm-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .crm-nav { flex-direction: row; flex-wrap: wrap; }
  .crm-logo { border-bottom: none; margin: 0; padding: 4px 8px; }
  .nav-item { width: auto; padding: 8px 12px; font-size: 13px; }
  .crm-side-foot { margin-top: 0; border-top: none; padding-top: 0; flex-direction: row; align-items: center; margin-left: auto; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .summary-layout { grid-template-columns: 1fr; }
  .dt-layout, .confirm-grid { grid-template-columns: 1fr; }
  .book-steps { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .book-head, .book-body, .book-sticky { padding-inline: 14px; }
  .spec-card { grid-template-columns: 50px 1fr auto; padding: 12px; }
  .spec-avatar { width: 50px; height: 50px; }
  .crm-main { padding: 14px 12px 36px; }
}
