/* ==========================================================================
       DAINIK PATRIKA — SIMPLE, CLEAN LIGHT CRM UI (FIRST DEMO STYLE)
       Minimalist, airy layout with crisp white cards, plain labels, and zero clutter
       ========================================================================== */
:root {
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Devanagari', sans-serif;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --muted-2: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;

  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-bg: #fff7ed;
  --accent-border: #fed7aa;

  --green: #16a34a;
  --green-2: #15803d;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;

  --gold: #d97706;
  --gold-2: #b45309;
  --gold-bg: #fffbeb;
  --gold-border: #fde68a;

  --red: #dc2626;
  --red-2: #b91c1c;
  --red-bg: #fef2f2;
  --red-border: #fecaca;

  --fest: #7c3aed;
  --fest-bg: #f5f3ff;
  --fest-border: #ddd6fe;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* --- Clean Left Sidebar (First Demo Style) --- */
.sidebar {
  width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px;
  flex-shrink: 0;
}

.brand-card {
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.brand-sub {
  font-size: 12px;
  color: var(--muted-2);
  display: block;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.nav-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

.nav-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-ic {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.svg-ic {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  vertical-align: -2px;
}

.svg-ic.lg {
  width: 18px;
  height: 18px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.user-email {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--muted-2);
}

/* --- Main Content Area --- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  min-height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 8px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.breadcrumb-current {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  padding: 24px 28px 48px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* --- Page Header --- */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.header-row h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.header-row p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Buttons & Inputs --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.btn:hover {
  background: var(--surface-2);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.small {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn.soft {
  background: var(--surface-2);
  border-color: transparent;
}

.input,
.select,
textarea.input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}

.select {
  width: auto;
}

/* --- Date Stepper & Language Toggle --- */
.studio-date-nav {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.studio-date-btn {
  border: none;
  background: transparent;
  padding: 7px 11px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.studio-date-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.studio-date-current {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.lang-seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
}

.lang-seg-btn {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.lang-seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* --- Simple 3-Tab Bar --- */
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  padding-bottom: 0;
  flex-wrap: wrap;
}

.tab {
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* --- Cards & Layouts --- */
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 0;
  overflow: hidden;
}

.panel-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.panel-body {
  padding: 18px 20px;
}

.card-head-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px;
}

.summary-paragraph {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}

.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

/* --- 4-Cell Panchang Strip --- */
.panchang-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.panchang-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.panchang-cell .lbl {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
}

.panchang-cell .val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

/* --- Simple Subcards --- */
.simple-subcard {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.simple-subcard-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.simple-subcard-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.simple-subcard-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.simple-details {
  margin-top: 12px;
}

.simple-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* --- Clean 12-Rashi Grid --- */
.rashi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.rashi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rashi-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.rashi-dialog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.rashi-dialog-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
}

.rashi-dialog-box .k {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rashi-dialog-box .v {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}

.rashi-card.empty-sign-card {
  background: #fcfcfd;
  border-style: dashed;
}

.rashi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rashi-sign-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rashi-symbol {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.rashi-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.rashi-headline {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.rashi-summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.rashi-meta-line {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rashi-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.rashi-pill.good {
  background: var(--green-bg);
  color: var(--green-2);
  border: 1px solid var(--green-border);
}

.rashi-pill.neutral {
  background: var(--gold-bg);
  color: var(--gold-2);
  border: 1px solid var(--gold-border);
}

.rashi-pill.avoid {
  background: var(--red-bg);
  color: var(--red-2);
  border: 1px solid var(--red-border);
}

/* --- Status Pills --- */
.state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.state.ready {
  background: var(--green-bg);
  color: var(--green-2);
  border: 1px solid var(--green-border);
}

.state.pending {
  background: var(--gold-bg);
  color: var(--gold-2);
  border: 1px solid var(--gold-border);
}

.state.failed {
  background: var(--red-bg);
  color: var(--red-2);
  border: 1px solid var(--red-border);
}

.fest-badge-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--fest-bg);
  color: var(--fest);
  border: 1px solid var(--fest-border);
}

/* --- Full Month Calendar Grid & Next Coming Days Strip --- */
.next-days-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.next-day-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.next-day-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.next-day-card.today-card {
  border-color: var(--green);
  background: #f8fef9;
}

.next-day-card.tomorrow-card {
  border-color: var(--accent);
  background: #fffaf5;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.1);
}

.cal-month-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
  gap: 10px;
}

.cal-grid-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(115px, 1fr));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.cal-weekday {
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
  border-right: 1px solid var(--line-soft);
}

.cal-weekday:last-child {
  border-right: none;
}

.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(115px, 1fr));
}

.cal-cell {
  min-height: 108px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: background 0.12s ease;
}

.cal-cell:nth-child(7n) {
  border-right: none;
}

.cal-cell:hover {
  background: var(--surface-2);
}

.cal-cell.outside {
  background: #f8fafc;
  color: var(--muted-2);
  opacity: 0.55;
  cursor: default;
}

.cal-cell.is-today {
  background: #f0fdf4;
  box-shadow: inset 0 0 0 2px var(--green);
}

.cal-cell.is-tomorrow {
  background: #fffaf5;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cal-cell.is-selected {
  box-shadow: inset 0 0 0 2px var(--text);
}

.cal-day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.cal-day-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.cal-dot-empty {
  display: inline-block;
  width: 8px !important;
  height: 8px !important;
  min-width: 8px;
  min-height: 8px;
  max-width: 8px;
  max-height: 8px;
  flex: 0 0 8px;
  box-sizing: border-box;
  padding: 0 !important;
  margin: 0;
  border: none;
  border-radius: 50% !important;
  background: #cbd5e1 !important;
}

.cal-dot.ready {
  background: var(--green);
}

.cal-dot.pending {
  background: var(--gold);
}

.cal-dot.empty {
  background: #cbd5e1;
}

.cal-tithi {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.cal-fest-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--fest-bg);
  color: var(--fest);
  border: 1px solid var(--fest-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- 15-Day Simple Schedule Grid --- */
.days-simple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.day-card-simple {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
}

.day-card-simple:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.day-card-simple.today {
  border-color: var(--accent);
  background: #fffaf5;
}

.day-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.today-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-solid);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

.fest-inline {
  font-size: 12px;
  font-weight: 600;
  color: var(--fest);
}

/* --- Tables & KV --- */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: top;
}

.table th {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
  background: var(--bg);
}

.table tr.click {
  cursor: pointer;
}

.table tr.click:hover {
  background: var(--surface-2);
}

.kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}

.kv:last-child {
  border-bottom: none;
}

.kv .k {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.kv .v {
  font-size: 13px;
  color: var(--text);
}

/* --- Prompt Box (Only shown before JSON upload) --- */
.prompt-preview-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.prompt-pre,
.raw {
  margin: 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* --- Modals & Mobile Simulator --- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  border: none;
  background: var(--surface-2);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.simple-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.modal-footer-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.phone-frame {
  width: 345px;
  max-width: 100%;
  background: #0f172a;
  border: 8px solid #1e293b;
  border-radius: 36px;
  padding: 10px 14px 14px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22);
}

.phone-notch {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.phone-notch-pill {
  width: 72px;
  height: 15px;
  background: #020617;
  border-radius: 999px;
}

.phone-screen {
  display: flex;
  flex-direction: column;
  color: #fff;
}

.phone-tab-btn {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.phone-tab-btn.active {
  background: var(--accent-solid);
  color: #fff;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  display: none;
}

/* --- Responsive Table Wrapper & Mobile Navigation --- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 900;
}

.mobile-bottom-nav {
  display: none;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px 8px;
  z-index: 800;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.05);
}

.mobile-bottom-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.mobile-bottom-btn.active {
  color: var(--accent);
  background: var(--accent-bg);
}

/* Interactive Viewport Tester Frame (Desktop / Tablet / Mobile) */
.vp-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  transition: max-width 0.2s ease;
  margin: 0 auto;
  background: var(--bg);
}

.vp-shell.vp-tablet {
  max-width: 768px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.08);
}

.vp-shell.vp-mobile {
  max-width: 412px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.12);
}

/* Tablet & Mobile Responsive Rules (Triggered by real screen width OR Viewport Switcher) */
@media (max-width: 960px) {
  .panchang-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .rashi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .days-simple-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content {
    padding: 18px 18px 40px;
  }

  .topbar {
    padding: 8px 18px;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 950;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .drawer-backdrop.open {
    display: block;
  }

  .mobile-bottom-nav {
    display: grid;
  }

  .header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .toolbar {
    width: 100%;
    justify-content: space-between;
  }

  .studio-date-nav {
    flex: 1;
    justify-content: space-between;
  }

  .card-head-simple {
    flex-direction: column;
    align-items: flex-start;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .modal-bg {
    padding: 10px;
    align-items: flex-end;
  }

  .modal {
    max-height: 92vh;
    border-radius: 16px 16px 12px 12px;
  }
}

@media (max-width: 540px) {
  .panchang-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .panchang-cell {
    padding: 11px 12px;
  }

  .panchang-cell .val {
    font-size: 13.5px;
  }

  .rashi-grid {
    grid-template-columns: 1fr;
  }

  .days-simple-grid {
    grid-template-columns: 1fr;
  }

  .two,
  .three {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 14px 12px 72px;
  }

  .topbar {
    padding: 8px 12px;
  }

  .card {
    padding: 14px;
  }

  .header-row h1 {
    font-size: 18px;
  }

  .tabs {
    gap: 2px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .tab {
    padding: 9px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* Apply the exact same responsive layout when user clicks Tablet or Mobile in Viewport Tester */
.vp-shell.vp-tablet .panchang-strip,
.vp-shell.vp-mobile .panchang-strip {
  grid-template-columns: repeat(2, 1fr);
}

.vp-shell.vp-tablet .rashi-grid {
  grid-template-columns: repeat(2, 1fr);
}

.vp-shell.vp-mobile .rashi-grid {
  grid-template-columns: 1fr;
}

.vp-shell.vp-tablet .days-simple-grid {
  grid-template-columns: repeat(2, 1fr);
}

.vp-shell.vp-mobile .days-simple-grid {
  grid-template-columns: 1fr;
}

.vp-shell.vp-mobile .two,
.vp-shell.vp-mobile .three {
  grid-template-columns: 1fr;
}

.vp-shell.vp-tablet .mobile-menu-btn,
.vp-shell.vp-mobile .mobile-menu-btn {
  display: inline-flex;
}

.vp-shell.vp-tablet .sidebar,
.vp-shell.vp-mobile .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  z-index: 950;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.vp-shell.vp-tablet .sidebar.open,
.vp-shell.vp-mobile .sidebar.open {
  transform: translateX(0);
}

.vp-shell.vp-tablet .drawer-backdrop.open,
.vp-shell.vp-mobile .drawer-backdrop.open {
  display: block;
}

.vp-shell.vp-tablet .mobile-bottom-nav,
.vp-shell.vp-mobile .mobile-bottom-nav {
  display: grid;
}

.vp-shell.vp-mobile .header-row {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.vp-shell.vp-mobile .toolbar {
  width: 100%;
  justify-content: space-between;
}

.vp-shell.vp-mobile .studio-date-nav {
  flex: 1;
  justify-content: space-between;
}

.vp-shell.vp-mobile .card-head-simple {
  flex-direction: column;
  align-items: flex-start;
}

.vp-shell.vp-mobile .content {
  padding: 14px 12px 72px;
}

.vp-shell.vp-mobile .topbar {
  padding: 8px 12px;
}

.vp-shell.vp-mobile .card {
  padding: 14px;
}

.vp-shell.vp-mobile .header-row h1 {
  font-size: 18px;
}

.vp-shell.vp-mobile .tabs {
  gap: 2px;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.vp-shell.vp-mobile .tab {
  padding: 9px 11px;
  font-size: 12.5px;
  white-space: nowrap;
}

/* --- 2026 MODERN SAAS / CRM UI UPGRADES (Linear / Attio / Shadcn tokens) --- */
/* html.theme-dark: drawers, toasts and the page background use the same night colours */
.vp-shell.theme-dark,
html.theme-dark {
  /* deeper fills so white text stays readable in night mode */
  --accent-solid: #c2410c;
  --accent-solid-hover: #9a3412;
  --green-solid: #15803d;
  --green-solid-2: #166534;
  --bg: #09090b;
  --surface: #121215;
  --surface-2: #1c1c21;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --line: #27272a;
  --line-soft: #1f1f23;

  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-bg: rgba(249, 115, 22, 0.12);
  --accent-border: rgba(249, 115, 22, 0.28);

  --green: #22c55e;
  --green-2: #4ade80;
  --green-bg: rgba(34, 197, 94, 0.12);
  --green-border: rgba(34, 197, 94, 0.28);

  --gold: #f59e0b;
  --gold-2: #fbbf24;
  --gold-bg: rgba(245, 158, 11, 0.12);
  --gold-border: rgba(245, 158, 11, 0.28);

  --red: #ef4444;
  --red-2: #f87171;
  --red-bg: rgba(239, 68, 68, 0.12);
  --red-border: rgba(239, 68, 68, 0.28);

  --fest: #a78bfa;
  --fest-bg: rgba(167, 139, 250, 0.12);
  --fest-border: rgba(167, 139, 250, 0.28);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color: var(--text);
}

.vp-shell.theme-dark .cal-cell.is-today,
.vp-shell.theme-dark .next-day-card.today-card {
  background: rgba(34, 197, 94, 0.08);
}

.vp-shell.theme-dark .cal-cell.is-tomorrow,
.vp-shell.theme-dark .next-day-card.tomorrow-card,
.vp-shell.theme-dark .day-card-simple.today {
  background: rgba(249, 115, 22, 0.08);
}

.vp-shell.theme-dark .cal-cell.outside,
.vp-shell.theme-dark .rashi-card.empty-sign-card {
  background: #0d0d10;
}

/* Tabular numerals & nested radii (2026 Spec: 12px outer, 8px inner) */
.tabular-nums,
.panchang-cell .val,
.cal-day-num,
.next-day-card,
.table td,
.bento-kpi-val {
  font-variant-numeric: tabular-nums;
}

/* Frosted Sticky Topbar & Collapsible 64px Sidebar Rail */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar {
  width: 248px;
  transition: width 0.18s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s ease;
}

.sidebar.collapsed {
  width: 68px;
  padding: 20px 10px;
}

.sidebar.collapsed .brand-text-wrap,
.sidebar.collapsed .nav-label-text,
.sidebar.collapsed .user-text-wrap,
.sidebar.collapsed #envSelect {
  display: none;
}

.sidebar.collapsed .brand-card {
  padding: 4px 0 16px;
  justify-content: center;
}

.sidebar.collapsed .nav-btn {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-footer {
  flex-direction: column;
  align-items: center;
}

.nav-btn.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Command Palette (⌘K) Trigger Pill */
.cmd-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cmd-trigger-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface);
}

.kbd-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted-2);
}

/* 2026 Bento KPI Strip (4 Cards Above the Fold) */
.bento-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.bento-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: var(--shadow);
}

.bento-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.bento-kpi-val {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}

.bento-kpi-delta {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Attio-style AI Copilot Readiness Surface */
.ai-copilot-bar {
  background: linear-gradient(90deg, var(--accent-bg), var(--surface));
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Filter Chips for 12-Rashi Grid */
.filter-pills {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.filter-pill-btn.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

/* Command Palette List Items */
.cmd-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 10px;
}

.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  width: 100%;
}

.cmd-item:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
}

/* --- Additional Firebase Admin & Utility Classes --- */
.loading,
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.error-note {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red-2);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.success-note {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green-2);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.notice {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold-2);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: -2px;
}

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

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
/* ==========================================================================
   DESIGN SYSTEM v2 — professional admin (2026-11-16)
   Layered on top of the rules above: same class names, refined tokens and components.
   Remove this block to return to the previous look. No page logic depends on it.
   ========================================================================== */
:root {
  --font-sans: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --text: #1f2933;
  --muted: #667085;
  --muted-2: #6b7587; /* 4.6:1 on white: small helper text stays readable */
  --line: #e4e7ec;
  --line-soft: #f2f4f7;
  --accent: #c2520c;
  --accent-hover: #a8441a;
  --accent-bg: #fbede4;
  --accent-border: #f3c9ae;
  --green: #1e7b34;
  --green-2: #176328;
  --green-bg: #e6f4ea;
  --green-border: #b7dfc3;
  --gold: #b45f06;
  --gold-2: #8f4b05;
  --gold-bg: #fff4e5;
  --gold-border: #f5d6a8;
  --red: #b3261e;
  --red-2: #8c1d17;
  --red-bg: #fce8e6;
  --red-border: #f3c2b8;
  /* Solid fills behind white text (buttons, badges, tags) */
  --accent-solid: #c2520c;
  --accent-solid-hover: #a8441a;
  --green-solid: #1e7b34;
  --green-solid-2: #176328;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.14);
  --focus: 0 0 0 3px rgba(194, 82, 12, 0.22);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
.theme-dark {
  --bg: #0f141c;
  --surface: #151b26;
  --surface-2: #1b2230;
  --text: #e6e9ef;
  --muted: #8b95a7;
  --muted-2: #6b7587;
  --line: #232b3a;
  --line-soft: #1b2230;
  --accent: #e8743a;
  --accent-hover: #f08a55;
  --accent-bg: rgba(232, 116, 58, 0.14);
  --accent-border: rgba(232, 116, 58, 0.32);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

body { font-size: 14px; letter-spacing: -0.003em; }
::selection { background: var(--accent-bg); }
*:focus-visible { outline: none; box-shadow: var(--focus); }

/* Scrolling: thin, quiet scrollbars and smooth anchor jumps */
html { scroll-behavior: smooth; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* Sidebar */
@media (min-width: 961px) {
  .sidebar { width: 248px; padding: 0; position: sticky; top: 0; height: 100vh; transition: width 220ms var(--ease); }
  .sidebar.collapsed { width: 68px; }
}
.sidebar { background: var(--surface); }
.sidebar .brand-card { height: 64px; padding: 0 16px; margin: 0; border-bottom: 1px solid var(--line); }
.brand-title { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--muted); }
.nav-list { padding: 8px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-section-title { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted-2); padding: 14px 10px 6px; text-transform: uppercase; }
.sidebar.collapsed .nav-section-title { visibility: hidden; height: 10px; padding: 6px 0 0; }
.nav-btn { height: 38px; border-radius: 8px; padding: 0 10px; border: none; background: transparent; color: var(--text); font-size: 14px; font-weight: 500; transition: background 120ms ease, color 120ms ease; }
.nav-btn:hover { background: var(--surface-2); }
.nav-btn.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; box-shadow: none; }
.nav-btn .nav-ic { color: inherit; opacity: 0.9; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-solid); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sidebar.collapsed .nav-badge { display: none; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--line); }

/* Environment card: production is unmistakable */
.env-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.env-card.is-prod { border-color: var(--red-border); background: var(--red-bg); }
.env-card .env-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--green); flex-shrink: 0; }
.env-card.is-prod .env-dot { background: #d93025; box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.15); }
.env-card .env-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.env-card .env-name { font-size: 12px; font-weight: 600; color: var(--text); }
.env-card.is-prod .env-name { color: var(--red); }
.env-card .env-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-card .select { height: 28px; font-size: 11px; padding: 0 6px; }
.sidebar.collapsed .env-card .env-text, .sidebar.collapsed .env-card .select { display: none; }

/* Top bar */
.topbar { height: 64px; padding: 0 24px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.breadcrumb-current { font-size: 14px; font-weight: 600; color: var(--text); }
.cmd-trigger-btn { height: 36px; min-width: 260px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 13px; transition: border-color 120ms ease; }
.cmd-trigger-btn:hover { border-color: var(--muted-2); }
.kbd-pill { font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--muted); background: var(--surface); }

/* Page */
.content { padding: 28px 32px 48px; }
.header-row { margin-bottom: 20px; align-items: flex-end; }
.header-row h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; margin: 0; color: var(--text); }
.header-row p { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 760px; }

/* Surfaces */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.panel-body { padding: 18px; }

/* Tables: sticky header, comfortable rows, clear hover */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--surface); max-height: calc(100vh - 260px); }
.table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background 100ms ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-selected { background: var(--accent-bg); }

/* Buttons */
.btn { height: 36px; border-radius: 9px; padding: 0 14px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: background 120ms ease, border-color 120ms ease, transform 80ms ease; }
.btn:hover { border-color: var(--muted-2); }
.btn:active { transform: scale(0.98); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.btn.primary:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); }
.btn.soft { background: var(--surface-2); border-color: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Inputs */
.input, .select, textarea.input { height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; padding: 0 12px; transition: border-color 120ms ease, box-shadow 120ms ease; }
textarea.input { height: auto; padding: 10px 12px; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }

/* Segmented tabs and filter pills */
.lang-seg { background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; border: 1px solid var(--line); }
.lang-seg-btn { height: 32px; border-radius: 8px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); border: none; background: transparent; transition: background 120ms ease, color 120ms ease; }
.lang-seg-btn:hover { color: var(--text); }
.lang-seg-btn.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.filter-pill-btn { height: 32px; border-radius: 999px; padding: 0 14px; font-size: 13px; }

/* Detail windows: slide-in drawer from the right (every openModal caller; width kept) */
.modal-bg { background: rgba(15, 20, 30, 0.38); justify-content: flex-end; align-items: stretch; padding: 0; backdrop-filter: blur(2px); animation: dsFade 160ms ease-out both; }
.modal-bg .modal { width: 100%; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; border: none; border-left: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: dsDrawer 260ms var(--ease) both; }
.modal-head { height: 64px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); flex-shrink: 0; font-size: 15px; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
/* Content written for the old centred pop-up sometimes caps its own height; in the drawer the body scrolls instead. */
.modal-body > [style*="max-height"] { max-height: none !important; overflow: visible !important; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 18px; line-height: 1; }
.modal-footer-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 14px 20px; margin: 20px -20px -20px; }
@keyframes dsDrawer { from { transform: translateX(100%); } to { transform: none; } }
@keyframes dsFade { from { opacity: 0; } to { opacity: 1; } }

/* Toast */
.toast { border-radius: 10px; background: #1f2a44; color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); }

/* Bulk selection (Pandit verification) */
.row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.bulk-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: #1f2a44; color: #fff; font-size: 13px; position: sticky; top: 76px; z-index: 5; animation: dsFade 160ms ease-out both; }
.bulk-bar .btn { height: 32px; }
.bulk-bar .btn.approve { background: var(--green-solid); border-color: var(--green-solid); color: #fff; }
.bulk-bar .btn.ghost { background: transparent; border-color: rgba(255, 255, 255, 0.3); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ── Task 6 fixes (2026-11-17) ─────────────────────────────────────────── */
/* Festival type badges: same four types and colours as the customer app */
.fest-badge-pill.fest-type-p { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }
.fest-badge-pill.fest-type-v { background: var(--red-bg); color: var(--red-2); border-color: var(--red-border); }
.fest-badge-pill.fest-type-e { background: var(--green-bg); color: var(--green-2); border-color: var(--green-border); }
.fest-badge-pill.fest-type-u { background: var(--gold-bg); color: var(--gold-2); border-color: var(--gold-border); }
.fest-actions { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; }
.fest-actions > div { display: contents !important; }
.fest-actions .btn { white-space: nowrap; width: 100%; justify-content: center; }
/* Pandit table: scrolls inside its own box; actions stacked so the table fits a laptop screen */
.pandit-table-wrap { max-height: none; border: 0; border-radius: 0; }
.pandit-row-actions { display: inline-flex; flex-direction: column; align-items: stretch; gap: 6px; }
/* Segmented tabs (e.g. Pandit status) scroll sideways on narrow screens instead of widening the page */
.lang-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.lang-seg::-webkit-scrollbar { display: none; }
.lang-seg-btn { flex: 0 0 auto; white-space: nowrap; }
/* Puja Types: the header row names the columns on wide screens; locked IDs look locked */
@media (min-width: 769px) { .puja-type-row .puja-row-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 768px) {
  .puja-type-head { display: none !important; }
  .puja-type-row { grid-template-columns: 1fr !important; }
  .puja-type-row .puja-row-label { display: block; margin-bottom: 4px; }
}
.puja-id-locked { background: var(--surface-2); color: var(--muted); border-style: dashed; cursor: not-allowed; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
/* Festival card tools + editor drawer (Task 6) */
.fest-card-tools { display: inline-flex; align-items: center; gap: 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0; transition: background 120ms ease, color 120ms ease, border-color 120ms ease; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red-2); border-color: var(--red-border); }
.icon-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon-btn .svg-ic { width: 15px; height: 15px; }
.fest-edit-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0 0 14px; min-width: 0; }
.fest-edit-form .input, .fest-edit-form .select { width: 100%; min-width: 0; box-sizing: border-box; }
.fest-edit-form legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--text); }
.fest-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fest-edit-grid .form-label { display: flex; flex-direction: column; gap: 6px; }
.fest-edit-wide { grid-column: 1 / -1; }
.fest-edit-hint { font-size: 12px; color: var(--muted-2); font-weight: 400; }
.fest-edit-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text); }
.fest-edit-error { background: var(--red-bg); color: var(--red-2); border: 1px solid var(--red-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; line-height: 1.5; }
.fest-edit-actions { display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 2px; }
@media (max-width: 540px) { .fest-edit-grid { grid-template-columns: 1fr; } }

/* Night mode: the active filter pill uses the accent fill instead of a near-white block */
.theme-dark .filter-pill-btn.active { background: var(--accent-solid); color: #fff; border-color: var(--accent-solid); }
/* Built-in controls (date pickers, dropdown lists, scrollbars) follow the admin theme */
html { color-scheme: light; }
html.theme-dark { color-scheme: dark; }
/* Themed confirmation dialog (replaces the browser's window.confirm) */
.confirm-bg { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 20, 30, 0.45); backdrop-filter: blur(2px); animation: dsFade 140ms ease-out both; }
.confirm-box { width: min(440px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 20px; }
.confirm-box h3 { margin: 0 0 8px; font-size: 16px; }
.confirm-msg { color: var(--muted); font-size: 14px; line-height: 1.55; max-height: 50vh; overflow: auto; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-solid:hover { background: var(--red-2); border-color: var(--red-2); }
/* Calendar legend: "empty" dot readable in night mode */
.theme-dark .cal-dot-empty { background: var(--muted-2) !important; opacity: 0.6; }
/* Reported Chats + Change History (Task 6) */
.report-person { display: flex; flex-direction: column; gap: 3px; }
.report-role { display: inline-block; width: fit-content; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.report-role.pandit { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }
.report-role.customer { background: var(--surface-2); }
.report-reason { font-weight: 600; font-size: 13px; }
.report-note-cell { max-width: 280px; font-size: 13px; color: var(--muted); }
.report-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.report-pill.open { background: var(--red-bg); color: var(--red-2); border-color: var(--red-border); }
.report-pill.action { background: var(--gold-bg); color: var(--gold-2); border-color: var(--gold-border); }
.report-pill.dismissed { background: var(--green-bg); color: var(--green-2); border-color: var(--green-border); }
.report-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: 13.5px; }
.report-summary .report-wide { grid-column: 1 / -1; }
.report-k { display: block; font-size: 11.5px; color: var(--muted-2); margin-bottom: 2px; }
.report-admin-note { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.report-privacy { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 12px 0; }
.report-h { margin: 16px 0 8px; font-size: 14px; } .report-h span { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.report-thread { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.report-msg { max-width: 82%; padding: 8px 11px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.report-msg.pandit { align-self: flex-end; background: var(--accent-bg); border-color: var(--accent-border); }
.report-msg.from-reported { box-shadow: inset 3px 0 0 var(--red); }
.report-msg-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.report-msg-text { font-size: 13.5px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.report-flag { color: var(--red-2); font-weight: 600; }
.report-attach { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-left: 6px; }
.report-decision { margin-top: 6px; }
.report-choice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; font-size: 13.5px; }
.report-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.history-area { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.history-area.festivals { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }
.history-area.pandits { background: var(--green-bg); color: var(--green-2); border-color: var(--green-border); }
.history-area.reports { background: var(--red-bg); color: var(--red-2); border-color: var(--red-border); }
.history-details { font-size: 12.5px; color: var(--muted); max-width: 360px; }
@media (max-width: 768px) { .report-summary { grid-template-columns: 1fr; } .report-msg { max-width: 92%; } }
/* Reported Chats: each report is a card on phones */
@media (max-width: 768px) {
  .report-table thead { display: none; }
  .report-table, .report-table tbody, .report-table tr, .report-table td { display: block; width: 100%; }
  .report-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .report-table td { padding: 4px 0 !important; border: 0 !important; max-width: none; text-align: left !important; }
  .report-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted-2); margin-bottom: 2px; }
  .report-table .report-action-cell { padding-top: 8px !important; }
  .report-table .report-action-cell .btn { width: 100%; justify-content: center; }
}
/* City selector (Task 7): daily data is per city */
.city-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12.5px; color: var(--muted); }
.city-card-label { font-weight: 600; color: var(--text); }
.city-card .select { max-width: 70%; font-size: 12.5px; padding: 4px 8px; }
.city-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.city-chip .svg-ic { width: 13px; height: 13px; }
.sidebar.collapsed .city-card { display: none; }
@media (max-width: 540px) { .city-chip { display: none; } }
/* Task 8: dates that needed a rule decision */
.fest-review { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--gold-2); background: var(--gold-bg); border: 1px solid var(--gold-border); border-radius: 999px; padding: 2px 9px; margin-bottom: 8px; }
.fest-review.is-done { color: var(--green-2); background: var(--green-bg); border-color: var(--green-border); }
.fest-date-note { font-size: 12px; line-height: 1.45; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--line); padding: 6px 9px; margin: 0 0 8px; border-radius: 6px; }

.history-table [data-history-row] { cursor: pointer; }
.history-open {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.history-open:hover { text-decoration: underline; }
.history-sheet {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(720px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
  border: 0;
  padding: 0;
  background: var(--surface, Canvas);
  color: var(--text, CanvasText);
}
.history-sheet::backdrop { background: rgb(0 0 0 / 35%); }
.history-sheet-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: inherit;
  border-bottom: 1px solid var(--line, #ddd);
}
.history-sheet-header h2 { margin: 0; }
.history-sheet-body { padding: 8px 24px 24px; overflow-wrap: anywhere; }
.history-sheet-message, .history-sheet pre { white-space: pre-wrap; overflow-wrap: anywhere; }
