/* ============================================================
   MAGNOLIA WELLNESS VILLA - Dashboard Styles
   ============================================================ */

/* ---- Layout ---- */
.dash-wrap { display: flex; min-height: 100vh; }

.dash-sidebar {
  width: 260px;
  background: #2C2C2C;
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s var(--ease-out);
}

.dash-sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-sidebar-header img {
  width: 40px;
  height: 40px;
  clip-path: inset(0 0 36% 0);
  margin-bottom: -14px;
}

.dash-sidebar-brand {
  display: flex;
  flex-direction: column;
}

.dash-sidebar-brand .brand-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.dash-sidebar-brand .brand-sub {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.dash-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem 0;
  overflow-y: auto;
}

.dash-nav-section {
  padding: 0.5rem 1.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-top: 0.5rem;
}

.dash-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}

.dash-nav-link:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.dash-nav-link.active { color: var(--white); background: rgba(196,165,90,0.15); }

.dash-nav-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.dash-nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: #2C2C2C;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
}

.dash-sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: #2C2C2C;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.dash-user-info { flex: 1; min-width: 0; }
.dash-user-info .name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-user-info .role { font-size: 0.7rem; color: rgba(255,255,255,0.5); }

.dash-logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0.3rem;
  transition: color 0.2s;
}
.dash-logout-btn:hover { color: var(--white); }
.dash-logout-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* ---- Main Content ---- */
.dash-main {
  flex: 1;
  margin-left: 260px;
  background: var(--cream);
  min-height: 100vh;
}

.dash-topbar {
  padding: 1.5rem 2rem;
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.dash-topbar-left h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
}

.dash-topbar-left .dash-date {
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Old "View as" dropdown retired in favour of the sidebar role switch */
.viewas { display: none !important; }

.dash-status {
  display: none; /* WhatsApp live indicator removed on all screens */
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.dash-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
}

.dash-content {
  padding: 2rem;
}

/* ---- Stat Cards ---- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  border: 1px solid rgba(0,0,0,0.06);
}

.dash-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--text);
  margin: 0.2rem 0 0.1rem;
}

.dash-stat-sub {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* Small per-card breakdown list (login users, etc.) - grows height, not width */
.dash-stat-list { margin-top: 0.55rem; border-top: 1px solid rgba(0,0,0,0.06); padding-top: 0.45rem; display: flex; flex-direction: column; gap: 0.22rem; font-size: 0.72rem; color: var(--text-light); }
.dash-stat-list > div { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
.dash-stat-list .sl-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dash-stat-list .sl-c { white-space: nowrap; color: var(--text-muted); font-weight: 600; }
.dash-stat-list .sl-empty { color: #b8b3a6; }

/* ---- Section Heading ---- */
.dash-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* ---- Action Cards ---- */
.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-action-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 0.2s;
}

.dash-action-card:hover { box-shadow: var(--shadow-sm); }

.dash-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-action-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-action-icon.sage { background: var(--sage-mist); color: var(--sage); }
.dash-action-icon.gold { background: rgba(196,165,90,0.15); color: var(--gold); }
.dash-action-icon.rose { background: rgba(245,230,224,0.8); color: #B07C6A; }
.dash-action-icon.charcoal { background: rgba(44,44,44,0.08); color: var(--charcoal); }

.dash-action-body { flex: 1; }
.dash-action-body h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.2rem; }
.dash-action-body p { font-size: 0.76rem; color: var(--text-light); line-height: 1.5; }

.dash-action-btn {
  margin-top: 0.6rem;
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--charcoal);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-body);
}

.dash-action-btn:hover { background: var(--charcoal-soft); }
.dash-action-btn.outline {
  background: none;
  color: var(--charcoal);
  border: 1px solid rgba(0,0,0,0.15);
}
.dash-action-btn.outline:hover { background: rgba(0,0,0,0.03); }

/* ---- Table ---- */
.dash-table-wrap {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 2rem;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.dash-table th {
  text-align: left;
  padding: 0.8rem 1.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.01);
}

.dash-table td {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--text);
}

.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: rgba(0,0,0,0.01); }

.dash-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 500;
}

.dash-badge.confirmed { background: rgba(76,175,80,0.1); color: #2E7D32; }
.dash-badge.pending { background: rgba(255,152,0,0.1); color: #E65100; }
.dash-badge.completed { background: var(--sage-mist); color: var(--sage-deep); }
.dash-badge.cancelled { background: rgba(244,67,54,0.08); color: #C62828; }
.dash-badge.paid { background: rgba(76,175,80,0.1); color: #2E7D32; }
.dash-badge.outstanding { background: rgba(255,152,0,0.1); color: #E65100; }

/* ---- Guest Portal Cards ---- */
.guest-menu {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guest-menu-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.2s;
}

.guest-menu-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: rgba(0,0,0,0.1);
}

.guest-menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--charcoal);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guest-menu-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guest-menu-text { flex: 1; }
.guest-menu-text h3 { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.guest-menu-text p { font-size: 0.82rem; color: var(--text-light); margin-top: 0.1rem; }

.guest-menu-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.guest-menu-arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---- Guest Treatment Section ---- */
.guest-treatments {
  display: none;
  margin-top: 1rem;
}

.guest-treatments.active { display: block; }

.guest-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  font-family: var(--font-body);
  color: var(--text);
  transition: background 0.2s;
}

.guest-back-btn:hover { background: rgba(0,0,0,0.03); }

.guest-back-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1100px 680px at 50% 26%, #FFFDF9 0%, var(--cream-warm) 55%, #ECE4D6 100%);
  padding: 100px 1.5rem 0;
}
.login-page .login-card { margin: auto; }
.login-mini-footer {
  padding: 1rem 2rem 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: #7a7a6f;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.login-mini-footer a { color: #5a6b4f; font-weight: 600; }
.login-mini-footer a:hover { text-decoration: underline; }

.login-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--cream);
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #9CA585;
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  text-align: center;
  border: 1px solid rgba(0,0,0,0.06);
}

.login-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.5rem;
  clip-path: inset(0 0 36% 0);
  margin-bottom: -14px;
}

.login-logo-wrap {
  margin: 0 auto 0.5rem;
  text-align: center;
}

.login-logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-logo-flower {
  height: 180px;
  width: auto;
  clip-path: inset(0 0 36% 0);
  margin-bottom: -65px;
  display: block;
}
.login-magnolia {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 400;
  color: #F1DD83;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 2px;
  white-space: nowrap;
  text-align: center;
}
.login-wellness-villa {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  font-weight: 400;
  color: #F1DD83;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 3px;
  white-space: nowrap;
  text-align: center;
}

.login-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--cream);
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--sage);
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.login-brand-sub {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.login-form { text-align: left; }

.login-field {
  margin-bottom: 1rem;
}

.login-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2E3D31;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: #2E3D31;
  background: #FFFFFF;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input::placeholder { color: rgba(0,0,0,0.4); }

.login-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,165,90,0.2);
}

.login-error {
  display: none;
  color: #7A1F1F;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  text-align: center;
}

.login-error.visible { display: block; }

.login-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--gold);
  color: var(--sage-deep);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.03em;
}

.login-submit:hover { background: #D4B56A; }

.login-hint { font-weight: 400; font-size: 0.78rem; color: rgba(255,255,255,0.45); }

.login-forgot {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 500;
}
.login-forgot:hover { text-decoration: underline; }

.login-footer {
  margin-top: 2rem;
  font-size: 0.78rem;
  color: #2E3D31;
}

.login-footer a {
  color: #3A4B3E;
  font-weight: 600;
}

.login-signup {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0,0,0,0.12);
  font-size: 0.85rem;
  color: #2E3D31;
  text-align: center;
}

.login-signup a {
  color: #3A4B3E;
  font-weight: 700;
  text-decoration: underline;
}

/* ---- Mobile Sidebar Toggle ---- */
.dash-mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--charcoal);
  color: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.dash-mobile-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---- Mobile drawer scrim (dims page behind the open menu; tap to close) ---- */
.dash-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.45); opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease-out); z-index: 99; }
.dash-scrim.show { opacity: 1; visibility: visible; }
@media (min-width: 901px) { .dash-scrim { display: none; } }

/* Close (X) inside the mobile drawer */
.dash-drawer-close { display: none; }
@media (max-width: 900px) {
  .dash-drawer-close {
    display: block; position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2;
    background: none; border: none; color: rgba(255,255,255,0.75);
    font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 0.1rem 0.55rem;
  }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .dash-mobile-toggle { display: flex; }

  /* Sidebar becomes a slide-in drawer instead of a fixed column */
  .dash-sidebar {
    width: 82%;
    max-width: 300px;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0,0,0,0.35);
  }
  .dash-sidebar.open { transform: translateX(0); }

  /* Main content fills the full screen width - no more sideways scrolling */
  .dash-main { margin-left: 0; width: 100%; }

  /* Room for the floating toggle button next to the heading */
  .dash-topbar { padding: 1.1rem 1.1rem 1.1rem 3.6rem; }
  .dash-content { padding: 1.1rem; }

  /* Wide tables scroll inside their own card rather than widening the page */
  .dash-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dash-table { min-width: 520px; }

  /* Stat and action cards stack one per row for an easy vertical read */
  .dash-stats { grid-template-columns: 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
  .dash-actions { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .dash-topbar { flex-wrap: wrap; gap: 0.4rem; }
  .dash-topbar-left h1 { font-size: 1.1rem; }
  .dash-content { padding: 0.85rem; }
}

/* ===== Mobile identity chip + multi-role switcher ===== */
.dash-mobile-id { display: none; }
@media (max-width: 900px) {
  .dash-mobile-id {
    display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto;
    background: var(--sage-mist, #eef1ec); color: var(--charcoal, #2c2c2c);
    border: none; border-radius: 20px; padding: 0.4rem 0.85rem;
    font-family: var(--font-body, sans-serif); font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.03em; cursor: pointer; white-space: nowrap;
  }
}
.role-switch { padding: 0.65rem 0.95rem; border-top: 1px solid rgba(255,255,255,0.08); }
.role-switch .rs-h { font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 0.35rem; }
.role-switch a, .role-switch .rs-cur { display: inline-block; font-size: 0.78rem; margin: 0.15rem 0.5rem 0.15rem 0; text-decoration: none; }
.role-switch a { color: var(--gold, #C4A55A); }
.role-switch a:hover { text-decoration: underline; }
.role-switch .rs-cur { color: rgba(255,255,255,0.85); font-weight: 600; }

/* ===== Director "View as" read-only overlay ===== */
.viewas-banner{position:fixed;left:0;right:0;bottom:0;z-index:500;background:#2C2C2C;color:#fff;
  display:flex;align-items:center;justify-content:center;gap:1.2rem;padding:.7rem 1rem;font-family:var(--font-body);font-size:.85rem;
  box-shadow:0 -6px 20px rgba(0,0,0,.18)}
.viewas-banner strong{color:var(--gold)}
.viewas-banner a{color:var(--gold);font-weight:600;text-decoration:none}
.viewas-banner a:hover{text-decoration:underline}
.viewas-switch{opacity:.92;font-size:.82rem}
.viewas-switch a{margin-left:.55rem}
html.viewing-as body{padding-bottom:56px}
/* Director working inside a desk has full access; the bar is just for navigation. */
html.viewing-as .viewas-banner a{pointer-events:auto;opacity:1}
