/* Artiha — plain-white admin look for the authenticated web dashboard.

   Loaded after style.css on every dashboard-shell page and scoped under
   body.dashboard-body (set in the page markup, and by initDashboardPage()
   in dashboard-common.js for dashboard.php, which also hosts the public
   login view). Public pages, the login/onboarding flow, the /mobile-app
   prototype and the native apps keep style.css's cream/terracotta palette.

   Colors only: white surfaces, neutral grays, sage as the single accent.
   Fonts, radii and layout are unchanged — except the top bar, which follows the website header (see the end of this file). Most of the shell recolors just by
   redefining the tokens below (custom properties inherit); the explicit
   rules after them cover colors style.css hardcodes. */

/* The top bar uses the website header's fonts (everything below it keeps the dashboard's own). */
@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

body.dashboard-body {
  --color-cream-bg: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-border: #E5E7EB;

  --color-charcoal: #111827;
  --color-body-text: #6B7280;

  /* Tints used for hover / active / pill backgrounds → neutral light gray. */
  --color-sage-tint: #F3F4F6;
  --color-terracotta-tint: #F3F4F6;

  /* The old terracotta "second accent" becomes a neutral dark gray, so every
     place that used it (headings accent, stat-card icons, secondary badges,
     hover link color, inline var(--color-terracotta) styles) stays on-palette. */
  --color-terracotta: #4B5563;

  /* Warning/pending status keeps a conventional amber, not a brand color. */
  --color-gold: #D97706;
  --color-gold-tint: #FEF3C7;
  --color-gold-dark: #92400E;

  /* One border radius for the whole dashboard: 7px on every corner, for
     buttons, cards, inputs, badges, menus and images. Both the style.css
     tokens and the Bootstrap vars are redefined here — style.css's :root
     bridge resolves --bs-border-radius* once at the root, so overriding only
     --radius-* wouldn't reach Bootstrap components. Circles (avatars, icon
     badges, rings) are deliberately left alone: .rounded-circle and the
     50% rules in style.css still win. */
  --radius-xs: 7px;
  --radius-sm: 7px;
  --radius-md: 7px;
  --radius-lg: 7px;
  --radius-xl: 7px;
  --radius-2xl: 7px;
  --radius-pill: 7px;
  --bs-border-radius: 7px;
  --bs-border-radius-sm: 7px;
  --bs-border-radius-lg: 7px;
  --bs-border-radius-xl: 7px;
  --bs-border-radius-xxl: 7px;
  --bs-border-radius-2xl: 7px;
  --bs-border-radius-pill: 7px;

  /* Bootstrap bridge */
  --bs-body-bg: #F8F8F8;
  --bs-body-color: #111827;
  --bs-secondary: #6B7280;
  --bs-secondary-rgb: 107, 114, 128;
  --bs-link-hover-color: #4A6455;
  --bs-border-color: #E5E7EB;

  /* Page background; surfaces (cards, tables, inputs, menus) stay white via
     --color-surface / --color-cream-bg above. */
  background-color: #F8F8F8;
}

/* Links: sage, hovering to a darker sage (style.css hovers to terracotta). */
body.dashboard-body a:hover {
  color: #4A6455;
}

/* Surfaces: flat white with a hairline border instead of a warm shadow. */
body.dashboard-body .bhakti-card,
body.dashboard-body .stat-card,
body.dashboard-body .class-card,
body.dashboard-body .event-row,
body.dashboard-body .player-widget {
  box-shadow: none;
  border: 1px solid var(--color-border);
}

body.dashboard-body .stat-card-anchor:hover .stat-card--link {
  transform: none;
  border-color: #D1D5DB;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.06);
}

body.dashboard-body .stat-card-icon {
  background-color: var(--color-sage-tint);
  color: var(--color-sage);
}

/* Buttons: sage stays the accent; hover shades are cool, not warm. */
body.dashboard-body .btn-secondary {
  --bs-btn-border-color: #D1D5DB;
  --bs-btn-color: #374151;
  --bs-btn-hover-bg: #F3F4F6;
  --bs-btn-hover-border-color: #D1D5DB;
  --bs-btn-hover-color: #111827;
  --bs-btn-active-bg: #F3F4F6;
  --bs-btn-active-border-color: #D1D5DB;
  --bs-btn-active-color: #111827;
}

body.dashboard-body .btn-outline-secondary {
  --bs-btn-color: #4B5563;
  --bs-btn-border-color: #D1D5DB;
  --bs-btn-hover-bg: #F3F4F6;
  --bs-btn-hover-border-color: #D1D5DB;
  --bs-btn-hover-color: #111827;
  --bs-btn-active-bg: #F3F4F6;
  --bs-btn-active-border-color: #D1D5DB;
  --bs-btn-active-color: #111827;
}

body.dashboard-body .btn-icon:hover {
  background-color: #F3F4F6;
}

/* Form controls: neutral placeholder, white fill. */
body.dashboard-body .form-control,
body.dashboard-body .form-select {
  background-color: #FFFFFF;
  border-color: #D1D5DB;
}

body.dashboard-body .form-control::placeholder {
  color: #9CA3AF;
}

body.dashboard-body .form-control:focus,
body.dashboard-body .form-select:focus {
  border-color: var(--color-sage);
  box-shadow: 0 0 0 0.2rem rgba(94, 124, 104, 0.18);
}

/* Tables: white, hairline rows, no stripe tint. */
body.dashboard-body .table {
  --bs-table-bg: transparent;
  --bs-table-border-color: #E5E7EB;
  --bs-table-hover-bg: #F9FAFB;
}

/* Sidebar, mobile nav and chrome stay white with a gray divider. */
body.dashboard-body .app-sidebar {
  background-color: #FFFFFF;
  border-bottom: 0;
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08);
}

body.dashboard-body .app-sidebar-nav-item:hover {
  background-color: #F3F4F6;
}

body.dashboard-body .app-sidebar-nav-item.active {
  background-color: #F3F4F6;
}

/* Badges: Bootstrap's neutral "secondary" (was terracotta via the bridge)
   reads as a quiet gray pill. */
body.dashboard-body .badge.bg-secondary {
  background-color: #6B7280 !important;
}

/* Row-action hover and danger keep conventional semantics. */
body.dashboard-body .row-action-btn:hover,
body.dashboard-body .row-action-btn:focus-visible {
  background-color: #F3F4F6;
}

/* Install-app banner: neutral dark instead of a green bar. */
body.dashboard-body .install-banner {
  background-color: #111827;
}

body.dashboard-body .install-banner-action {
  color: #111827;
}

/* The student Home "anchor" hero card is the one deliberately branded
   block — a sage gradient — and stays as is. */

/* Images in page content share the 7px radius (avatars stay circular). */
body.dashboard-body .app-main img:not(.rounded-circle) {
  border-radius: 7px;
}

/* Every table sits inside a card. All dashboard tables are already wrapped in
   .table-responsive, so that wrapper becomes the card. Where the table is
   already inside a card (the default #section-body.bhakti-card, stat cards,
   modals) the wrapper is reset so cards never nest. */
body.dashboard-body .table-responsive {
  background-color: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 7px;
}

body.dashboard-body .table-responsive > .table {
  margin-bottom: 0;
}

body.dashboard-body .table-responsive > .table > tbody > tr:last-child > * {
  border-bottom-width: 0;
}

body.dashboard-body .bhakti-card .table-responsive,
body.dashboard-body .stat-card .table-responsive,
body.dashboard-body .modal-body .table-responsive {
  background-color: transparent;
  border: 0;
  border-radius: 0;
}

/* ---------------------------------------------------------------------------
   Top bar = the website header (WordPress theme "Artiha Yogana"): cream bar, the same logo,
   Plus Jakarta Sans menu text, sage buttons with 3px corners. Only the bar changes; the page
   below it keeps the plain-white dashboard look. "Back to Site" returns to the WordPress home.
   --------------------------------------------------------------------------- */
body.dashboard-body .app-sidebar {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #F4ECDF;
  border-bottom: 1px solid rgba(42, 39, 37, 0.08);
  box-shadow: none;
  padding: 0.65rem 2rem;
  gap: 1.75rem;
}

body.dashboard-body .app-sidebar button {
  font-family: inherit;
}

body.dashboard-body .app-sidebar-brand-logo {
  height: 52px;
}

body.dashboard-body .app-topnav-link,
body.dashboard-body .app-topnav-trigger {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #2A2725;
  background: none;
}

body.dashboard-body .app-topnav-link:hover,
body.dashboard-body .app-topnav-trigger:hover,
body.dashboard-body .app-topnav-link.active,
body.dashboard-body .app-topnav-trigger.active {
  background: none;
  color: #5E7C68;
}

body.dashboard-body .app-topnav-link.active,
body.dashboard-body .app-topnav-trigger.active {
  font-weight: 700;
}

body.dashboard-body .app-sidebar-mobile-title {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #2A2725;
}

/* Back to Site: outlined sage button, then My Account (sage) at the far right. */
body.dashboard-body .app-back-to-site {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid #5E7C68;
  border-radius: 3px;
  color: #5E7C68;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s, color 0.25s;
}

body.dashboard-body .app-back-to-site:hover {
  background-color: #5E7C68;
  color: #FFFFFF;
}

body.dashboard-body .app-sidebar-account--desktop {
  margin-left: 0;
}

body.dashboard-body .app-sidebar-account-toggle--desktop {
  max-width: none;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem;
  border-radius: 3px;
  background-color: #5E7C68;
  color: #FFFFFF;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.25s;
}

body.dashboard-body .app-sidebar-account-toggle--desktop:hover {
  background-color: #2A2725;
}

body.dashboard-body .app-sidebar-account-toggle--desktop img {
  width: 28px;
  height: 28px;
}

body.dashboard-body .app-sidebar-account-toggle--desktop::after {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  margin: -0.2rem 0.1rem 0 0.2rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* The bar button already does this on desktop, so the menu item is for phones only. */
body.dashboard-body .app-sidebar-account--desktop .app-menu-back-to-site {
  display: none;
}

/* Laptop widths (staff have many menu items): Back to Site becomes an arrow, My Account an avatar + caret. */
@media (max-width: 1360px) {
  body.dashboard-body .app-back-label,
  body.dashboard-body .app-account-label {
    display: none;
  }

  body.dashboard-body .app-back-to-site {
    padding: 0.6rem 0.75rem;
  }

  body.dashboard-body .app-sidebar-account-toggle--desktop {
    padding: 0.5rem 0.75rem;
  }

  body.dashboard-body .app-sidebar {
    gap: 1rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (max-width: 768px) {
  body.dashboard-body .app-back-to-site {
    display: none;
  }

  body.dashboard-body .app-sidebar {
    padding: 0.5rem 1rem;
  }
}

/* "Require Finished Guided Access?": a flagged item stays visible but unusable to a student who has not finished
   the guided course, covered by a rotating ring around a lock with the message at the bottom. Cards and Kirtan rows
   get their own small overlay; a locked lesson's own page shows the same icon and text as a panel. */
.guided-lock-icon {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  color: #5E7C68;
  font-size: 2rem;
}

.guided-lock-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px dashed #5E7C68;
  animation: guided-lock-spin 8s linear infinite;
}

@keyframes guided-lock-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .guided-lock-icon::before {
    animation: none;
  }
}

.guided-lock-text {
  text-align: center;
  font-weight: 600;
  color: #111827;
}

/* On a locked lesson's own page: the same icon and text, as a card under the lesson details. */
.guided-lock-panel {
  max-width: 480px;
  padding: 1.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.guided-lock-icon--sm {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}

.guided-lock-icon--sm::before {
  border-width: 2px;
}

.guided-card-locked {
  position: relative;
  overflow: hidden;
  min-height: 150px;
}

.guided-card-locked > :not(.guided-card-lock) {
  filter: blur(2.5px);
  pointer-events: none;
  user-select: none;
}

.guided-card-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 248, 248, 0.45);
}

.guided-card-lock-text {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.6rem;
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  color: #111827;
}

/* Login page: no top bar, just the logo above the form. */
.login-logo img { height: 120px; width: auto; }

/* Rich event description (sanitized HTML) shown on the event page, and the editor in the event form */
.event-rich > :first-child { margin-top: 0; }
.event-rich > :last-child { margin-bottom: 0; }
.event-rich p { margin: 0 0 0.75rem; }
.event-rich h2, .event-rich h3, .event-rich h4 { margin: 1rem 0 0.4rem; line-height: 1.3; }
.event-rich h2 { font-size: 1.25rem; }
.event-rich h3 { font-size: 1.1rem; }
.event-rich h4 { font-size: 1rem; }
.event-rich ul, .event-rich ol { margin: 0 0 0.75rem; padding-left: 1.4rem; }
.event-rich blockquote { margin: 0 0 0.75rem; padding: 0.2rem 0 0.2rem 1rem; border-left: 3px solid #cfd6d1; color: #666; }
.event-rich a { text-decoration: underline; }
#event-description-editor { background: #fff; }
#event-description-editor .ql-editor { min-height: 140px; font-size: 0.95rem; }
.ql-toolbar.ql-snow { border-radius: 0.375rem 0.375rem 0 0; }
.ql-container.ql-snow { border-radius: 0 0 0.375rem 0.375rem; }
