/* =====================================================================
   Panel: Dashboard Pelanggan, Terapis & Administrator (CMS)
   ===================================================================== */
body.panel { background: var(--bg); }
.panel-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--dark-band); color: #bdb6a8;
  padding: 24px 16px; display: flex; flex-direction: column; z-index: 950;
}
.sidebar .logo { color: #fff; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 18px; }
.sidebar .logo-mark { width: 40px; height: 40px; }
.sidebar .logo-text strong { font-size: 1.3rem; }
.side-label { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: #7f887f; margin: 18px 12px 8px; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: #cfc8ba; font-size: .95rem; transition: background .25s, color .25s, padding .3s; overflow: hidden;
}
.side-nav a .bi { font-size: 1.1rem; width: 22px; text-align: center; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; padding-left: 18px; }
.side-nav a.active { background: var(--accent); color: #fff; }
.side-nav a.active::before { content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; border-radius: 3px; background: #fff; }
.side-nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--danger); color: #fff; font-size: .72rem; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }

.panel-main { min-width: 0; display: flex; flex-direction: column; }
.panel-top {
  position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.panel-top h1 { font-size: 1.45rem; margin: 0; }
.panel-top .spacer { flex: 1; }
.panel-user { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.panel-user small { display: block; color: var(--muted); font-size: .75rem; }
.panel-content { padding: 28px; flex: 1; }
.panel-toggle { display: none; }
@media (max-width: 1024px) {
  .panel-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .45s var(--ease); }
  .sidebar.open { transform: none; }
  .panel-toggle { display: inline-grid; }
  .panel-content { padding: 18px; }
  .panel-top { padding: 12px 16px; }
  .panel-user .who { display: none; }
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.stat::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(var(--accent-rgb), .07); }
.stat-icon { width: 54px; height: 54px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: rgba(46,125,91,.14); color: var(--success); }
.stat-icon.red { background: rgba(192,57,43,.12); color: var(--danger); }
.stat-icon.blue { background: rgba(47,111,159,.12); color: var(--info); }
.stat strong { display: block; font: 400 1.6rem/1.2 var(--font-head); color: var(--heading); }
.stat span { font-size: .85rem; color: var(--muted); }

.panel-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel-grid-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1200px) { .panel-grid, .panel-grid-even { grid-template-columns: minmax(0, 1fr); } }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 18px; }
.filters .field { min-width: 150px; flex: 1; }
.filters .field input, .filters .field select { min-height: 44px; padding: 9px 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 16px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .88rem; transition: .25s; }
.tabs a:hover { border-color: var(--accent); color: var(--accent); }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Tabel responsif: berubah jadi kartu di layar kecil */
@media (max-width: 760px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; padding: 6px 4px; background: var(--surface); }
  .table-cards td { border: 0; padding: 7px 12px; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-weight: 500; color: var(--muted); font-size: .8rem; text-align: left; flex: none; }
  .table-cards td.num { text-align: right; }
}

/* Daftar booking (kartu) */
.booking-item { display: flex; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: .35s var(--ease); margin-bottom: 14px; }
.booking-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateX(4px); }
.booking-date { flex: none; width: 74px; text-align: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); padding: 10px 6px; line-height: 1.15; }
.booking-date strong { display: block; font: 400 1.8rem var(--font-head); }
.booking-date small { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.booking-body { flex: 1; min-width: 0; }
.booking-body h4 { margin: 0 0 4px; font-size: 1.1rem; }
.booking-body .meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .86rem; color: var(--muted); }
.booking-body .meta .bi { color: var(--accent); }
.booking-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; justify-content: center; }
@media (max-width: 640px) { .booking-item { flex-wrap: wrap; } .booking-actions { flex-direction: row; flex-wrap: wrap; width: 100%; align-items: center; } }

.countdown { display: flex; gap: 10px; }
.countdown div { min-width: 64px; text-align: center; padding: 10px 6px; border-radius: 10px; background: rgba(255,255,255,.12); }
.countdown strong { display: block; font: 400 1.6rem var(--font-head); }
.countdown small { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.hero-card { position: relative; overflow: hidden; border-radius: var(--radius); padding: 28px; background: linear-gradient(135deg, var(--primary), #2b6155); color: var(--primary-contrast); margin-bottom: 24px; }
:root[data-theme="dark"] .hero-card { background: linear-gradient(135deg, #3a2c16, #1d2622); color: #f3eee5; }
.hero-card h2, .hero-card h3 { color: inherit; }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 30px solid rgba(255,255,255,.06); }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 18px 42px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); }
.timeline li.done::before { background: var(--success); border-color: var(--success); }
.timeline li.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .2); }
.timeline li.fail::before { background: var(--danger); border-color: var(--danger); }
.timeline li strong { display: block; color: var(--heading); font-weight: 500; }
.timeline li small { color: var(--muted); }

.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list .bi { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.notif-list li.unread strong::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--danger); vertical-align: middle; }
.notif-list small { color: var(--muted); display: block; }
.notif-list p { margin: 0; font-size: .9rem; }

.loc-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 30px; font-size: .82rem; border: 1px solid var(--border); background: var(--surface); }
.loc-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.loc-status.on::before { background: #3ddc84; box-shadow: 0 0 0 4px rgba(61,220,132,.25); animation: blink 1.6s infinite; }
.loc-status.err::before { background: var(--danger); }

.th-marker { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.35); background: var(--accent); }
.th-marker img { width: 100%; height: 100%; object-fit: cover; }
.th-marker.offline { filter: grayscale(1); opacity: .7; }
.online-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.online-list { list-style: none; padding: 0; margin: 0; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.online-dot.on { background: #3ddc84; }

.chat-admin { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 160px); min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-list a { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .2s; }
.chat-list a:hover { background: rgba(var(--accent-rgb), .06); }
.chat-list a.active { background: rgba(var(--accent-rgb), .14); }
.chat-list .cl-body { flex: 1; min-width: 0; }
.chat-list .cl-body strong { display: block; font-weight: 500; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list .cl-body small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-room { display: flex; flex-direction: column; min-width: 0; }
.chat-room-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-room .chat-body { flex: 1; }
@media (max-width: 900px) {
  .chat-admin { grid-template-columns: minmax(0, 1fr); height: auto; }
  .chat-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-room { height: 70vh; }
}

.sched-table td, .sched-table th { padding: 8px 10px; }
.sched-table input[type=time] { min-height: 40px; padding: 6px 10px; }
.money-input { position: relative; }
.money-input::before { content: "Rp"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; }
.money-input input { padding-left: 42px !important; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .input { width: auto; flex: 1; min-width: 120px; min-height: 42px; padding: 8px 12px; }
.photo-preview { width: 120px; height: 150px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-alt); border: 1px solid var(--border); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.week-cal { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 10px; overflow-x: auto; }
.week-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; min-height: 160px; }
.week-col h5 { margin: 0 0 8px; font-family: var(--font-body); font-weight: 500; font-size: .85rem; color: var(--muted); }
.week-col.today { border-color: var(--accent); }
.week-ev { display: block; padding: 8px 10px; margin-bottom: 8px; border-radius: 8px; background: var(--surface); border-left: 3px solid var(--accent); font-size: .8rem; color: var(--text); transition: .2s; }
.week-ev:hover { transform: translateX(3px); color: var(--text); box-shadow: var(--shadow-sm); }
.week-ev.pending { border-left-color: var(--warning); }
.week-ev.completed { border-left-color: var(--success); opacity: .75; }
.week-ev.off { border-left-color: var(--danger); background: rgba(192,57,43,.06); }
.alarm-banner { display: none; position: fixed; z-index: 3100; left: 50%; top: 20px; transform: translateX(-50%); width: min(520px, calc(100vw - 30px)); padding: 18px 20px; border-radius: var(--radius); background: var(--accent); color: #fff; box-shadow: var(--shadow); animation: fadeUp .4s var(--ease); }
.alarm-banner.show { display: flex; gap: 14px; align-items: center; }
.alarm-banner .bi { font-size: 1.8rem; animation: ring 1s infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(18deg); } 75% { transform: rotate(-18deg); } }
.side-nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; border-radius: 10px; background: none; color: #cfc8ba; font-size: .95rem; cursor: pointer; text-align: left; transition: background .25s, color .25s; }
.side-nav-btn:hover { background: rgba(192,57,43,.2); color: #fff; }
.side-nav-btn .bi { width: 22px; text-align: center; font-size: 1.1rem; }
@media (max-width: 640px) { .panel-top .loc-status { font-size: 0; padding: 7px; gap: 0; } .panel-top h1 { font-size: 1.1rem; } .panel-top { gap: 8px; } }
.hero-card .loc-status { color: var(--text); }
