/* ==========================================================================
   Cream, Gold, Light Brown & White Theme System
   Inspired by: Logo Perpustakaan Pusat Pondok Pesantren Assalafiyyah Mlangi
   Palette: Cream (#fcf8f2), Gold (#c59b27), Light Brown (#8b5e3c), White (#ffffff)
   ========================================================================== */

:root {
  --bs-primary: #8b5e3c !important;
  --bs-primary-rgb: 139, 94, 60 !important;
  --bs-link-color: #8b5e3c !important;
  --bs-link-hover-color: #6e4727 !important;
  --bs-success: #10b981 !important;
  --bs-warning: #c59b27 !important;

  --theme-cream-bg: #fcf8f2;
  --theme-cream-card: #f8f2e6;
  --theme-brown-main: #8b5e3c;
  --theme-brown-dark: #6e4727;
  --theme-gold-main: #c59b27;
  --theme-gold-light: #d4af37;
  --theme-white: #ffffff;
}

body, .body-wrapper, .page-wrapper {
  background-color: #fcf8f2 !important;
  color: #2d241e !important;
}

/* Header Banner - Light Brown to Warm Gold Gradient */
.card-gradient-header {
  background: linear-gradient(135deg, #6e4727 0%, #8b5e3c 45%, #c59b27 100%) !important;
  color: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 28px -5px rgba(110, 71, 39, 0.35), 0 8px 12px -6px rgba(197, 155, 39, 0.25) !important;
}

.info-card {
  border: 1px solid #e8decb !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 4px 6px -1px rgba(139, 94, 60, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02) !important;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.info-card:hover {
  box-shadow: 0 12px 20px -3px rgba(139, 94, 60, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04) !important;
}

.member-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #8b5e3c 0%, #c59b27 100%) !important;
  color: #ffffff !important;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(139, 94, 60, 0.3) !important;
  flex-shrink: 0;
}

.stat-box {
  background: #f8f2e6 !important;
  border: 1px solid #e8decb !important;
  border-radius: 10px;
  padding: 12px 16px;
}

.fine-banner {
  background: linear-gradient(135deg, #fffcf5 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 14px;
}

/* Primary Buttons Override - Light Brown to Gold */
.btn-primary,
button.btn-primary,
a.btn-primary,
input.btn-primary {
  background: linear-gradient(135deg, #8b5e3c 0%, #c59b27 100%) !important;
  border-color: #8b5e3c !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(139, 94, 60, 0.25) !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
  background: linear-gradient(135deg, #6e4727 0%, #8b5e3c 100%) !important;
  border-color: #6e4727 !important;
  box-shadow: 0 6px 18px rgba(110, 71, 39, 0.35) !important;
  color: #ffffff !important;
}

/* All Outline Buttons Harmonized Overrides */
.btn-outline-primary {
  color: #8b5e3c !important;
  border-color: #8b5e3c !important;
  background-color: transparent !important;
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active, .btn-outline-primary.active {
  background-color: #8b5e3c !important;
  color: #ffffff !important;
  border-color: #8b5e3c !important;
  box-shadow: 0 4px 12px rgba(139, 94, 60, 0.25) !important;
}

.btn-outline-success {
  color: #6e4727 !important;
  border-color: #c59b27 !important;
  background-color: #fffdf8 !important;
}

.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active, .btn-outline-success.active {
  background: linear-gradient(135deg, #8b5e3c 0%, #c59b27 100%) !important;
  color: #ffffff !important;
  border-color: #8b5e3c !important;
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.3) !important;
}

.btn-outline-warning {
  color: #c59b27 !important;
  border-color: #c59b27 !important;
  background-color: transparent !important;
}

.btn-outline-warning:hover, .btn-outline-warning:focus, .btn-outline-warning:active, .btn-outline-warning.active {
  background-color: #c59b27 !important;
  color: #ffffff !important;
  border-color: #c59b27 !important;
}

.btn-outline-secondary {
  color: #6e4727 !important;
  border-color: #e8decb !important;
  background-color: #fbf8f2 !important;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active, .btn-outline-secondary.active {
  background-color: #6e4727 !important;
  color: #ffffff !important;
  border-color: #6e4727 !important;
}

.btn-outline-danger {
  color: #991b1b !important;
  border-color: #fca5a5 !important;
  background-color: #fff5f5 !important;
}

.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active, .btn-outline-danger.active {
  background-color: #991b1b !important;
  color: #ffffff !important;
  border-color: #991b1b !important;
}

.btn-outline-info {
  color: #8b5e3c !important;
  border-color: #d4af37 !important;
  background-color: #fcf8f2 !important;
}

.btn-outline-info:hover, .btn-outline-info:focus, .btn-outline-info:active, .btn-outline-info.active {
  background-color: #8b5e3c !important;
  color: #ffffff !important;
  border-color: #8b5e3c !important;
}

/* Secondary & Warning Buttons Override */
.btn-secondary {
  background-color: #6e4727 !important;
  border-color: #6e4727 !important;
  color: #ffffff !important;
}

.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
  background-color: #5c4838 !important;
  border-color: #5c4838 !important;
}

.btn-warning {
  background: linear-gradient(135deg, #c59b27 0%, #d4af37 100%) !important;
  border-color: #c59b27 !important;
  color: #ffffff !important;
}

.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
  background: linear-gradient(135deg, #b45309 0%, #c59b27 100%) !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
}

.btn-info {
  background-color: #c59b27 !important;
  border-color: #c59b27 !important;
  color: #ffffff !important;
}

.btn-light {
  background-color: #fffdf8 !important;
  border-color: #e8decb !important;
  color: #6e4727 !important;
}

.btn-light:hover {
  background-color: #f8f2e6 !important;
  color: #6e4727 !important;
}

/* Radio Button Checked State Override */
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary {
  background: linear-gradient(135deg, #8b5e3c 0%, #c59b27 100%) !important;
  color: #ffffff !important;
  border-color: #8b5e3c !important;
  box-shadow: 0 4px 10px rgba(139, 94, 60, 0.3) !important;
}

.btn-check + .btn-outline-primary {
  color: #6e4727 !important;
  border-color: #c59b27 !important;
  background-color: #fffdf8 !important;
  transition: all 0.2s ease;
}

.btn-check + .btn-outline-primary:hover {
  background-color: #f8f2e6 !important;
  color: #6e4727 !important;
}

/* Text & Badges Color Overrides */
.text-primary {
  color: #8b5e3c !important;
}

.text-success {
  color: #8b5e3c !important;
}

.text-success-emphasis {
  color: #6e4727 !important;
}

a {
  color: #8b5e3c;
}

a:hover {
  color: #6e4727;
}

.bg-primary {
  background-color: #8b5e3c !important;
}

.bg-primary-subtle {
  background-color: #f8f2e6 !important;
  color: #6e4727 !important;
}

.bg-success {
  background-color: #8b5e3c !important;
  color: #ffffff !important;
}

.bg-success-subtle {
  background-color: #f8f2e6 !important;
  border-color: #e8decb !important;
  color: #6e4727 !important;
}

.bg-secondary-subtle {
  background-color: #f3ebd9 !important;
  color: #6e4727 !important;
}

.border-primary {
  border-color: #8b5e3c !important;
}

.border-primary-subtle {
  border-color: #e8decb !important;
}

.border-success-subtle {
  border-color: #e8decb !important;
}

.badge.bg-primary {
  background-color: #8b5e3c !important;
  color: #ffffff !important;
}

.badge.bg-success {
  background-color: #8b5e3c !important;
  color: #ffffff !important;
}

.badge.bg-info {
  background-color: #c59b27 !important;
  color: #ffffff !important;
}

.badge.bg-warning {
  background-color: #d97706 !important;
  color: #ffffff !important;
}

.badge.bg-secondary {
  background-color: #6e4727 !important;
  color: #ffffff !important;
}

.badge-subtle-primary {
  background-color: #f8f2e6 !important;
  color: #6e4727 !important;
  font-weight: 600;
}

.badge-subtle-success {
  background-color: #f8f2e6 !important;
  color: #6e4727 !important;
  font-weight: 600;
  border: 1px solid #e8decb !important;
}

.badge-subtle-warning {
  background-color: #fef3c7 !important;
  color: #c59b27 !important;
  font-weight: 600;
  border: 1px solid #fde68a !important;
}

.badge-subtle-danger {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
  font-weight: 600;
  border: 1px solid #fca5a5 !important;
}

.badge-subtle-secondary {
  background-color: #f6efe2 !important;
  color: #5c4838 !important;
  font-weight: 600;
}

.badge-subtle-info {
  background-color: #fef3c7 !important;
  color: #b45309 !important;
  font-weight: 600;
}

/* Modals & Popups Overrides */
.modal-content {
  background-color: #ffffff !important;
  border: 1px solid #e8decb !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 30px rgba(110, 71, 39, 0.2) !important;
}

.modal-header {
  background-color: #f8f2e6 !important;
  border-bottom: 1px solid #e8decb !important;
  color: #6e4727 !important;
}

.modal-footer {
  background-color: #fcf8f2 !important;
  border-top: 1px solid #e8decb !important;
}

/* Duration Radio Button Group Pill Styling */
.duration-btn-group .btn-check:checked + .btn-outline-primary {
  background: linear-gradient(135deg, #8b5e3c 0%, #c59b27 100%) !important;
  color: #ffffff !important;
  border-color: #8b5e3c !important;
  box-shadow: 0 4px 12px rgba(139, 94, 60, 0.3) !important;
}

.duration-btn-group .btn-outline-primary {
  border-color: #e8decb !important;
  color: #6e4727 !important;
  background-color: #ffffff !important;
  transition: all 0.2s ease-in-out;
}

.duration-btn-group .btn-outline-primary:hover {
  background-color: #f8f2e6 !important;
  color: #5C3D2E !important;
  border-color: #c59b27 !important;
}

/* Alerts Overrides */
.alert-success {
  background-color: #f8f2e6 !important;
  border-color: #e8decb !important;
  color: #6e4727 !important;
}

.alert-warning {
  background-color: #fffdf5 !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}

.alert-info {
  background-color: #fcf8f2 !important;
  border-color: #e8decb !important;
  color: #8b5e3c !important;
}

.alert-danger {
  background-color: #fff5f5 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}

/* Light Background Helper */
.bg-light, .bg-light-subtle {
  background-color: #f8f2e6 !important;
}

/* Custom Table Design */
.table-custom, .table-assalafiyyah {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table-custom th, .table-assalafiyyah thead th {
  background-color: #f8f2e6 !important;
  color: #6e4727 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.05em !important;
  border-bottom: 1px solid #e8decb !important;
  padding: 14px 18px !important;
}


.table-assalafiyyah tbody tr th.col-index,
.table-assalafiyyah tbody tr td.col-index {
  background-color: #fcf8f2 !important;
  color: #5c4838 !important;
  font-weight: 600 !important;
  text-align: center;
  border-right: 1px solid #f3ebd9 !important;
}

.table-custom td, .table-assalafiyyah tbody td, .table-assalafiyyah tbody th {
  padding: 14px 18px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f3ebd9 !important;
}

.table-custom tbody tr:hover td, .table-assalafiyyah tbody tr:hover td {
  background-color: #fffdf8 !important;
}

.btn-pill-gold {
  background: linear-gradient(135deg, #8b5e3c 0%, #c59b27 100%) !important;
  color: #ffffff !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  padding: 6px 20px !important;
  border: none !important;
  box-shadow: 0 4px 10px rgba(139, 94, 60, 0.25) !important;
  transition: all 0.2s ease !important;
}

.btn-pill-gold:hover {
  background: linear-gradient(135deg, #6e4727 0%, #8b5e3c 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 14px rgba(110, 71, 39, 0.35) !important;
}

.btn-pill-brown {
  background: #6e4727 !important;
  color: #ffffff !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  padding: 6px 20px !important;
  border: none !important;
  box-shadow: 0 4px 10px rgba(110, 71, 39, 0.25) !important;
}

.table-avatar-initial {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5e3c 0%, #c59b27 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(139, 94, 60, 0.25);
  flex-shrink: 0;
}

/* Modern Form Search Input */
.search-group .form-control {
  border-radius: 10px 0 0 10px;
  border-color: #cbd5e1;
  padding: 8px 14px;
}

.search-group .btn {
  border-radius: 0 10px 10px 0;
  padding: 8px 16px;
}

/* Crisp Search Group inside Gradient Header */
.card-gradient-header .search-group .form-control {
  background-color: #ffffff !important;
  color: #1e293b !important;
  border-color: #ffffff !important;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.card-gradient-header .search-group .form-control::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

.card-gradient-header .search-group .form-control:focus {
  background-color: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.4) !important;
}

.card-gradient-header .search-group .btn {
  background-color: #ffffff !important;
  color: #8b5e3c !important;
  border-color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.card-gradient-header .search-group .btn:hover {
  background-color: #f8f2e6 !important;
  color: #6e4727 !important;
}

/* Sidebar Active & Selected Nav Highlights */
.left-sidebar {
  background-color: #ffffff !important;
  border-right: 1px solid #e8decb !important;
}

.sidebar-nav #sidebarnav .sidebar-item .sidebar-link {
  color: #5c4838 !important;
  border-radius: 10px !important;
}

.sidebar-nav #sidebarnav .sidebar-item .sidebar-link:hover {
  background-color: #f8f2e6 !important;
  color: #8b5e3c !important;
}

.sidebar-nav #sidebarnav .sidebar-item.selected > .sidebar-link,
.sidebar-nav #sidebarnav .sidebar-item > .sidebar-link.active,
.sidebar-nav #sidebarnav .sidebar-item .sidebar-link.active {
  background: linear-gradient(135deg, #8b5e3c 0%, #c59b27 100%) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 12px rgba(139, 94, 60, 0.35) !important;
}

.sidebar-nav #sidebarnav .sidebar-item.selected > .sidebar-link i,
.sidebar-nav #sidebarnav .sidebar-item > .sidebar-link.active i,
.sidebar-nav #sidebarnav .sidebar-item .sidebar-link.active i {
  color: #ffffff !important;
}

.sidebar-nav #sidebarnav .nav-small-cap {
  color: #c59b27 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

/* Card Member Template Styles */
.card-template-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  margin: 0 auto;
}

.card-template-img {
  width: 100%;
  height: auto;
  display: block;
}

.card-overlay-name {
  position: absolute;
  bottom: 22%;
  left: 8%;
  right: 8%;
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-overlay-code {
  position: absolute;
  bottom: 12%;
  left: 8%;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 2px;
  color: #f8f9fa;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 10px;
  border-radius: 6px;
}

/* SPA Top Progress Bar & Smooth Fade Animation */
#top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5e3c 0%, #c59b27 50%, #d4af37 100%) !important;
  z-index: 99999;
  transition: width 0.3s ease, opacity 0.3s ease;
  width: 0%;
  opacity: 0;
  box-shadow: 0 0 10px rgba(197, 155, 39, 0.7);
  pointer-events: none;
}

.spa-fade-in {
  animation: spaFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes spaFadeIn {
  from {
    opacity: 0.3;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
