/* Shree Anjar Shaher Kshatriya Samaaj - admin theme.
   Brand colours from the logo: saffron #F38411, deep red #C13823, cream #FAE0C4.
   White text is used only on red (contrast 5.2:1, WCAG AA). */
:root {
  --brand-red: #C13823;
  --brand-red-dark: #9E2C1B;
  --brand-saffron: #F38411;
  --brand-cream: #FAE0C4;
  --brand-cream-soft: #FDF4EA;
  --bs-primary: #C13823;
  --bs-primary-rgb: 193, 56, 35;
  --bs-link-color: #A8301E;
  --bs-link-color-rgb: 168, 48, 30;
  --bs-link-hover-color: #7E2416;
  --sidebar-width: 250px;
}

body { background: #f6f3ef; font-size: .95rem; }

.btn-primary {
  --bs-btn-bg: var(--brand-red); --bs-btn-border-color: var(--brand-red);
  --bs-btn-hover-bg: var(--brand-red-dark); --bs-btn-hover-border-color: var(--brand-red-dark);
  --bs-btn-active-bg: var(--brand-red-dark); --bs-btn-active-border-color: var(--brand-red-dark);
  --bs-btn-disabled-bg: var(--brand-red); --bs-btn-disabled-border-color: var(--brand-red);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-red); --bs-btn-border-color: var(--brand-red);
  --bs-btn-hover-bg: var(--brand-red); --bs-btn-hover-border-color: var(--brand-red);
  --bs-btn-active-bg: var(--brand-red-dark); --bs-btn-active-border-color: var(--brand-red-dark);
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--brand-saffron); box-shadow: 0 0 0 .2rem rgba(243, 132, 17, .25);
}
.form-check-input:checked { background-color: var(--brand-red); border-color: var(--brand-red); }
.page-link { color: var(--brand-red); }
.active > .page-link, .page-link.active { background-color: var(--brand-red); border-color: var(--brand-red); }

/* Touch-friendly controls on phones (min 44px tap targets). */
@media (max-width: 767.98px) {
  .btn, .form-control, .form-select { min-height: 44px; }
  .btn-sm { min-height: 36px; }
}

/* Layout */
.admin-topbar { background: #fff; border-bottom: 3px solid var(--brand-saffron); }
.admin-topbar .brand img { height: 40px; width: auto; }
.admin-sidebar { background: #fff; }
.admin-sidebar .nav-link { color: #333; border-radius: .375rem; padding: .6rem .75rem; display: flex; gap: .6rem; align-items: center; }
.admin-sidebar .nav-link:hover { background: var(--brand-cream-soft); }
.admin-sidebar .nav-link.active { background: var(--brand-cream); color: var(--brand-red-dark); font-weight: 600; }
.admin-sidebar .nav-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8a7f74; margin: 1rem .75rem .25rem; }
@media (min-width: 992px) {
  .admin-sidebar { width: var(--sidebar-width); min-height: calc(100vh - 66px); border-right: 1px solid #eee; position: sticky; top: 0; }
}
.admin-main { min-width: 0; }
.min-w-0 { min-width: 0; } /* lets text-truncate work inside flex rows */

.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: #6c757d; font-size: .82rem; }
.stat-card .stat-icon { font-size: 1.6rem; color: var(--brand-saffron); }

/* Responsive tables: rows become stacked cards below 768px. Each <td>
   carries data-label with its column name. */
@media (max-width: 767.98px) {
  table.table-stack thead { display: none; }
  table.table-stack, table.table-stack tbody, table.table-stack tfoot, table.table-stack tr, table.table-stack td { display: block; width: 100%; }
  table.table-stack tr { background: #fff; border: 1px solid #eee; border-radius: .5rem; margin-bottom: .75rem; padding: .5rem .75rem; }
  table.table-stack td { border: 0; padding: .3rem 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; text-align: right; }
  table.table-stack td::before { content: attr(data-label); font-weight: 600; color: #6c757d; text-align: left; }
  table.table-stack td.td-actions { justify-content: flex-end; }
  table.table-stack td.td-actions::before { content: none; }
}

.timeline { list-style: none; padding-left: 1rem; border-left: 2px solid var(--brand-cream); }
.timeline li { position: relative; padding: 0 0 .9rem .75rem; }
.timeline li::before { content: ""; position: absolute; left: -1.42rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--brand-saffron); }

.bar-track { background: #f1ebe4; border-radius: .25rem; height: .6rem; }
.bar-fill { background: var(--brand-saffron); border-radius: .25rem; height: .6rem; }

/* Auth page */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: linear-gradient(160deg, var(--brand-cream-soft), #fff); }
.auth-card { width: 100%; max-width: 400px; }

/* Committee and gallery */
.min-w-0 { min-width: 0; }
.avatar-placeholder { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-cream, #FAE0C4); color: var(--brand-red); display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.album-card .card-img-top, .album-empty { aspect-ratio: 4 / 3; width: 100%; }
.album-empty { background: #f3eee8; color: #b9a99a; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.gallery-thumb { aspect-ratio: 4 / 3; width: 100%; }

/* History timeline list */
.history-year-tile { width: 72px; height: 54px; border-radius: .375rem; background: var(--brand-cream, #FAE0C4); color: var(--brand-red, #C13823); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* Income receipt (printed and handed to the payer) */
.receipt-page { background: #fff; }
.receipt { max-width: 760px; margin: 1rem auto; padding: 1.5rem 1.75rem; border: 2px solid #3a2a20; border-radius: .5rem; }
.receipt-title { font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-red, #C13823); }
.receipt-line { margin: 0 0 .6rem; line-height: 1.8; }
.receipt-line strong { border-bottom: 1px dotted #3a2a20; }
.receipt-amount { font-size: 1.5rem; font-weight: 700; border: 2px solid #3a2a20; padding: .25rem 1rem; }
.receipt-sign { min-width: 220px; text-align: center; border-top: 1px solid #3a2a20; padding-top: .25rem; font-size: .85rem; }

@media print {
  .no-print, .admin-topbar, .admin-sidebar { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
