/* Admin dashboard: "Cosmic Saffron" dark palette, matched to the Android app's dark theme (Theme.kt). */
:root {
    --night: #0F0B24; --panel: #1D1645; --raised: #2E2563; --gold: #E9B44C; --gold-ink: #1A1206;
    --violet: #A99BFF; --ivory: #F4EFE6; --mist: #B3ADCF; --good: #2E7D4F; --bad: #C4492B; --border: #342A6E;
}
* { box-sizing: border-box; }
body.admin { margin: 0; background: var(--night); color: var(--ivory); font-family: system-ui, -apple-system, sans-serif; }
a { color: var(--violet); text-decoration: none; }
h1, h2 { margin: 0; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--panel); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; flex-shrink: 0; }
.admin-logo { font-size: 1.15em; font-weight: 700; color: var(--ivory); }
.admin-logo span { color: var(--gold); }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--mist); font-weight: 500; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,0.05); }
.admin-sidebar nav a.active { background: var(--raised); color: var(--ivory); }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mist); }
.admin-sidebar nav a.active .nav-dot { background: var(--gold); }
.admin-logout button { width: 100%; background: transparent; border: 1px solid var(--border); color: var(--mist); padding: 10px; border-radius: 10px; cursor: pointer; }

/* flex: 1 lets this column fill the space beside the fixed sidebar; max-width + margin: 0 auto then centers
   the actual content inside that space instead of leaving it stuck to the left on a wide screen. */
.admin-main { flex: 1; padding: 32px 40px; max-width: 1100px; margin: 0 auto; width: 100%; }
.admin-header { margin-bottom: 24px; }
.admin-sub { color: var(--mist); margin: 6px 0 0; }

.stat-row { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px 22px; min-width: 160px; flex: 1; }
.stat-label { color: var(--mist); font-size: 0.85em; margin: 0 0 6px; }
.stat-value { font-size: 2em; font-weight: 700; margin: 0; color: var(--ivory); }
.stat-good .stat-value { color: #7FD9A6; }
.stat-bad .stat-value { color: #F0917A; }

.panel-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; flex: 1; min-width: 320px; }
.panel-form { flex: 1.1; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 0.78em; letter-spacing: 0.03em; color: var(--mist); border-bottom: 1px solid var(--border); padding: 8px 10px; }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--border); font-size: 0.92em; vertical-align: middle; }
.admin-table-wide { margin-top: 18px; }
.mono-small { display: block; font-family: monospace; font-size: 0.75em; color: var(--mist); margin-top: 2px; }
.feature-desc { color: var(--mist); font-size: 0.88em; }
.empty { color: var(--mist); text-align: center; padding: 20px !important; }

.tag { padding: 3px 10px; border-radius: 50px; font-size: 0.78em; font-weight: 600; }
.tag-good { background: rgba(46,125,79,0.35); color: #7FD9A6; }
.tag-bad { background: rgba(196,73,43,0.35); color: #F0917A; }

.action-group { display: flex; gap: 6px; flex-wrap: wrap; }
.action-group form { display: inline-flex; gap: 4px; }
.input-sm { width: 70px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--night); color: var(--ivory); font-size: 0.85em; }
button, .btn-accent, .btn-danger, .btn-ghost { font-size: 0.85em; padding: 7px 12px; border-radius: 8px; border: none; cursor: pointer; }
.btn-accent, button[type="submit"] { background: var(--gold); color: var(--gold-ink); font-weight: 600; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--mist); }

.admin-search { display: flex; gap: 8px; max-width: 420px; }
.admin-search input { flex: 1; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--night); color: var(--ivory); }

.message-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.message-subject { font-weight: 600; margin: 0; }
.message-meta { color: var(--mist); font-size: 0.82em; margin: 2px 0 0; }

.message-form { display: flex; flex-direction: column; gap: 14px; }
.message-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88em; color: var(--mist); }
.message-form input, .message-form select, .message-form textarea {
    padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--night); color: var(--ivory); font-size: 0.95em;
    font-family: inherit;
}

.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9em; }
.banner-good { background: rgba(46,125,79,0.25); color: #7FD9A6; }
.banner-bad { background: rgba(196,73,43,0.25); color: #F0917A; }

.admin-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.admin-login { width: 320px; display: flex; flex-direction: column; gap: 14px; background: var(--panel); padding: 28px; border-radius: 16px; border: 1px solid var(--border); }
.admin-login h1 { font-size: 1.3em; text-align: center; margin-bottom: 4px; }
.admin-login label { display: flex; flex-direction: column; gap: 5px; font-size: 0.88em; color: var(--mist); }
.admin-login input { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--night); color: var(--ivory); }
/* A login card's main action should span the card, not sit at its natural (small) width. */
.admin-login button[type="submit"] { width: 100%; padding: 11px; margin-top: 4px; }
.admin-error { color: #F0917A; font-size: 0.85em; margin: 0; }

.nav-section { color: var(--mist); font-size: 0.72em; letter-spacing: 0.06em; text-transform: uppercase; margin: 10px 12px 0; opacity: 0.7; }

/* ---- panchangam pages (Today / Calendar / Festivals / Good Times) ----------------------------------- */

.day-nav, .month-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.month-nav h1, .month-nav h2 { font-size: 1.2em; }

.hero { background: linear-gradient(135deg, #2A0B5E, #4B3FA8); border-radius: 18px; padding: 22px; margin-bottom: 20px; color: var(--ivory); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hero-weekday { opacity: 0.85; margin: 0; font-size: 0.9em; }
.hero h1 { font-size: 1.5em; margin-top: 2px; }
.hero-festival { background: var(--gold); color: var(--gold-ink); border-radius: 50px; padding: 6px 14px; font-weight: 700; font-size: 0.85em; white-space: nowrap; }
.hero-facts { display: flex; gap: 24px; margin: 18px 0; flex-wrap: wrap; }
.hero-fact .fact-label { opacity: 0.75; font-size: 0.8em; margin: 0; }
.hero-fact .fact-value { font-size: 1.25em; font-weight: 700; margin: 2px 0; }
.hero-fact .fact-note { opacity: 0.8; font-size: 0.8em; margin: 0; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-chips .chip { background: rgba(255,255,255,0.15); border-radius: 50px; padding: 5px 12px; font-size: 0.8em; }

/* Tables that fit the page: fixed layout + 100% width means every table ends exactly at its panel's edge
   on any screen, with columns sized once and long text wrapping instead of forcing a wider table. */
.data-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 0.88em; text-align: left; overflow-wrap: break-word; }
.data-table th { color: var(--mist); font-size: 0.76em; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table td.cell-strong, .data-table .cell-strong { font-weight: 700; }
.data-table tr.row-good td:first-child { border-left: 3px solid #7FD9A6; padding-left: 8px; }
.data-table tr.row-bad td:first-child { border-left: 3px solid #F0917A; padding-left: 8px; }
.data-table tr.row-past { opacity: 0.5; }
.data-table tr.slot-now { outline: 1px solid var(--gold); background: rgba(233,180,76,0.08); }
.festival-date { white-space: nowrap; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekday { text-align: center; font-size: 0.75em; color: var(--mist); padding: 4px 0; }
.cal-cell { background: var(--night); border: 1px solid var(--border); border-radius: 10px; padding: 6px; min-height: 68px; color: var(--ivory); display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-blank { background: transparent; border: none; }
.cal-day { font-weight: 700; }
.cal-tithi { font-size: 0.72em; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-fest { font-size: 0.68em; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-today { outline: 2px solid var(--gold); }
.cal-mark-pournami, .cal-mark-amavasya { background: #241A3F; }

.slot-col { flex: 1; min-width: 260px; }

/* ---- pooja guides, books, policy pages, calculators --------------------------------------------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pooja-card { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.pooja-card:hover { border-color: var(--gold); }
.mantra-text { white-space: pre-wrap; line-height: 1.6; }

/* Rendered markdown (Privacy/Terms): the page has no classes to hook, so style the raw tags directly. */
.policy-body h1 { font-size: 1.4em; margin: 0 0 12px; }
.policy-body h2 { font-size: 1.15em; margin: 20px 0 8px; color: var(--gold); }
.policy-body h3 { font-size: 1em; margin: 14px 0 6px; }
.policy-body p, .policy-body li { line-height: 1.6; color: var(--ivory); }
.policy-body ul, .policy-body ol { padding-left: 22px; }
.policy-body strong { color: var(--ivory); }
.policy-body hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
