/* ================================================================
   Nallaneram 360 Admin — Production SaaS Design System
   ================================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:              #F3F0EA;
  --card:            #FFFCF8;
  --border:          #E5DFD6;
  --text-primary:    #1C1917;
  --text-secondary:  #6B6560;
  --brand:           #7A1F35;
  --brand-hover:     #631729;
  --brand-light:     #F8ECEF;
  --brand-muted:     #E8C4CC;
  --green:           #1F5A45;
  --green-light:     #E6F4EE;
  --gold:            #C4941A;
  --gold-light:      #FBF3E0;
  --success:         #16A34A;
  --success-light:   #ECFDF3;
  --warning:         #D97706;
  --warning-light:   #FEF3C7;
  --danger:          #DC2626;
  --danger-light:    #FEE2E2;
  --input-bg:        #FFFCF8;
  --input-border:    #D9D2C8;
  --input-focus:     rgba(122, 31, 53, 0.14);
  --sidebar-bg:      #FAF7F2;
  --sidebar-border:  #E8E2D8;
  --sidebar-active:  #F5E6EA;
  --sidebar-active-border: #7A1F35;
  --navbar-bg:       #FFFCF8;
  --content-bg:      #F3F0EA;
  --sidebar-width:   240px;
  --navbar-height:   56px;
  --shadow-sm:       0 1px 3px rgba(28, 25, 23, 0.06);
  --shadow-md:       0 4px 12px rgba(28, 25, 23, 0.07);
  --radius:          12px;
  --radius-sm:       8px;
  --radius-btn:      8px;
  --font:            'Outfit', system-ui, sans-serif;
  --font-heading:    'Poppins', system-ui, sans-serif;
}

html, body {
  height: 100%;
}

/* ── Typography ─────────────────────────────────────────────── */
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 13px; }

.page-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  color: var(--text-primary);
  background: var(--card);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--input-border);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}

.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* ── Forms ──────────────────────────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: var(--text-secondary);
}

.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--input-focus);
}

.textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.input-plain {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  height: auto;
}

.input-plain:focus {
  box-shadow: none;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 40px;
}

.input-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
}

.input-action:hover {
  color: var(--text-primary);
  background: var(--bg);
}

.input-file {
  height: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.select {
  height: 36px;
  padding: 0 12px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
}

.select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--input-focus);
}

.field-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hidden { display: none !important; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid;
}

.alert-danger {
  color: var(--danger);
  background: var(--danger-light);
  border-color: #FECACA;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  line-height: 1.5;
}

.badge-success {
  color: #15803D;
  background: var(--success-light);
}

.badge-warning {
  color: #B45309;
  background: var(--warning-light);
}

.badge-danger {
  color: #B91C1C;
  background: var(--danger-light);
}

.badge-neutral {
  color: var(--text-secondary);
  background: var(--bg);
}

/* ── Login ──────────────────────────────────────────────────── */
body.login-body {
  background: var(--bg);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(196, 148, 26, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(122, 31, 53, 0.06) 0%, transparent 45%),
    var(--bg);
}

.login-panel {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  display: block;
  margin: 0 auto 16px;
  object-fit: contain;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--brand);
}

.login-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Admin Layout ───────────────────────────────────────────── */
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.admin-body {
  overflow: hidden;
  height: 100%;
}

.admin-layout {
  display: flex;
  height: 100vh;
  min-height: 0;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--navbar-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--card);
  flex-shrink: 0;
}

.sidebar-logo {
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-app-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-tagline {
  font-size: 12px;
  color: var(--text-secondary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-section + .sidebar-section {
  margin-top: 20px;
}

.sidebar-section-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 8px;
  margin-bottom: 4px;
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.sidebar-link.is-active {
  background: var(--sidebar-active);
  color: var(--brand);
  border-left: 3px solid var(--sidebar-active-border);
  padding-left: 7px;
  font-weight: 600;
}

.sidebar-link.is-active .sidebar-icon {
  color: var(--brand);
}

.sidebar-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-panchang {
  font-size: 12px;
  color: var(--text-secondary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 90;
}

.sidebar-overlay.is-visible {
  display: block;
}

/* ── Main ───────────────────────────────────────────────────── */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin-left: var(--sidebar-width);
  overflow: hidden;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--navbar-height);
  padding: 0 24px;
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -2px 0 var(--gold-light);
  flex-shrink: 0;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text-primary);
  cursor: pointer;
}

.navbar-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.navbar-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.navbar-meta svg {
  color: var(--gold);
}

.navbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-light);
  border-radius: 999px;
}

.navbar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── Content ────────────────────────────────────────────────── */
.admin-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--content-bg);
}

.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-actions {
  flex-shrink: 0;
}

/* ── Panel ──────────────────────────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--gold-light);
}

.panel-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
}

.panel-link:hover {
  text-decoration: underline;
}

.panel-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard-greeting {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.dashboard-greeting .text-secondary {
  font-size: 14px;
}

.dashboard-date {
  font-size: 14px;
  color: var(--green);
  font-weight: 500;
  margin-top: 2px;
}

.dashboard-section {
  margin-bottom: 24px;
}

.dashboard-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dashboard-section-head .section-title {
  margin-bottom: 0;
}

.dashboard-empty-panchang {
  padding: 20px 24px;
}

.stat-grid-panchang {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-grid {
  display: grid;
  gap: 16px;
}

.stat-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

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

.stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-card-link:hover {
  border-color: var(--brand-muted);
  box-shadow: var(--shadow-md);
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card-panchang {
  background: var(--gold-light);
  border-color: #EDD9A8;
}

.stat-card-panchang .stat-label {
  color: #8B6914;
}

.stat-card-panchang .stat-value-sm {
  color: var(--text-primary);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-icon {
  color: var(--text-secondary);
}

.stat-icon-sun {
  color: var(--gold);
}

.stat-grid-4 .stat-card:not(.stat-card-panchang):nth-child(1) {
  border-top: 3px solid var(--brand);
}

.stat-grid-4 .stat-card:not(.stat-card-panchang):nth-child(2) {
  border-top: 3px solid var(--green);
}

.stat-grid-4 .stat-card:not(.stat-card-panchang):nth-child(3) {
  border-top: 3px solid var(--gold);
}

.stat-grid-4 .stat-card:not(.stat-card-panchang):nth-child(4) {
  border-top: 3px solid var(--brand-muted);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-value-sm {
  font-size: 16px;
  font-weight: 600;
}

.stat-change {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
}

.stat-change-up {
  color: var(--success);
}

.dashboard-split {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}

.notif-stats {
  padding: 8px 20px 16px;
}

.notif-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.notif-stat-row:last-child {
  border-bottom: none;
}

.notif-stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  padding: 0 12px;
  height: 36px;
  background: var(--gold-light);
  border: 1px solid #EDD9A8;
  border-radius: var(--radius-sm);
}

.search-box svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  padding: 10px 20px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--brand-light);
  border-bottom: 1px solid var(--brand-muted);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 20px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--brand-light);
}

.table-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.table-link:hover {
  text-decoration: underline;
}

.col-play {
  width: 48px;
  text-align: center;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-play:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.col-action {
  width: 88px;
  white-space: nowrap;
}

.action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-icon-edit {
  color: var(--green);
}

.btn-icon-edit:hover {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green);
}

.btn-icon-delete {
  color: var(--danger);
}

.btn-icon-delete:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.col-preview {
  width: 72px;
}

.thumb-btn {
  display: block;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.thumb-btn:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-light);
}

.table-thumb {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.edit-preview-wrap {
  margin-bottom: 8px;
}

.edit-preview-thumb {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: contain;
}

.modal-preview {
  max-width: 640px;
}

.preview-body {
  text-align: center;
}

.preview-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 12px;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: contain;
}

/* ── App Settings ───────────────────────────────────────────── */
.settings-panel {
  padding: 0;
}

.settings-section {
  padding: 24px;
}

.settings-section-head {
  margin-bottom: 20px;
}

.settings-section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-section-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 4px;
}

.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-divider {
  height: 1px;
  background: var(--border);
}

.settings-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-preview {
  display: block;
  max-width: 280px;
  max-height: 160px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg);
}

.settings-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--gold-light);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--input-border);
  border-radius: 999px;
  transition: background 0.2s;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-track {
  background: var(--brand);
}

.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.toggle input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px var(--input-focus);
}

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 56px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panchang-output-panel {
  margin-top: 24px;
}

.api-systems-note {
  margin-bottom: 16px;
}

.panchang-output {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panchang-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.panchang-summary-card {
  background: var(--gold-light);
  border: 1px solid #EDD9A8;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panchang-summary-label {
  font-size: 12px;
  font-weight: 600;
  color: #8B6914;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panchang-summary-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.panchang-section-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 12px;
}

.panchang-section-success .panchang-section-title {
  color: var(--green);
}

.panchang-section-danger .panchang-section-title {
  color: var(--danger);
}

.panchang-table th {
  font-size: 11px;
}

.panchang-extra {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

.modal-player {
  max-width: 420px;
}

.player-body {
  padding-top: 8px;
}

.player-song-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.player-song-file {
  margin-bottom: 16px;
  word-break: break-all;
}

.audio-player {
  width: 100%;
  height: 40px;
}

.table-state {
  text-align: center;
  padding: 40px 20px !important;
  color: var(--text-secondary);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.page-btn:hover:not(:disabled):not(.is-active) {
  background: var(--bg);
}

.page-btn.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px;
}

.empty-state svg {
  color: var(--text-secondary);
  opacity: 0.5;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 320px;
  font-size: 14px;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.modal-sm {
  max-width: 400px;
}

.confirm-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.confirm-text strong {
  color: var(--brand);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 20px;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast svg {
  color: var(--success);
  flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stat-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .admin-main {
    margin-left: 0;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar {
    padding: 0 16px;
  }

  .navbar-meta,
  .navbar-divider {
    display: none;
  }

  .navbar-user-name {
    display: none;
  }

  .page-container {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .stat-grid-4,
  .stat-grid-2 {
    grid-template-columns: 1fr;
  }

  .settings-form-grid {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .table-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 440px) {
  .login-panel {
    padding: 32px 24px;
  }
}
