/* ============================================================
   BANI H. SHOLEH — DESIGN SYSTEM CSS
   assets/css/bani-sholeh.css
   Dipakai oleh semua halaman: publik, login, dashboard
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lora:ital,wght@0,400;0,500;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── TOKENS ── */
:root {
  --gold        : #C9952A;
  --gold-light  : #E8C97A;
  --gold-pale   : #FAF0D7;
  --gold-dim    : rgba(201,149,42,0.15);
  --gold-border : rgba(201,149,42,0.25);
  --gold-border-hover : rgba(201,149,42,0.55);

  --brown-dark  : #1E0C04;
  --brown-deep  : #3D1F0A;
  --brown-mid   : #6B3D1E;

  --cream       : #FDF6E3;
  --cream-dim   : rgba(253,246,227,0.68);
  --cream-muted : rgba(253,246,227,0.42);

  --green       : #2D5A27;
  --green-light : #7CBF74;

  --red         : #C0392B;
  --red-dim     : rgba(192,57,43,0.15);

  --surface-1   : rgba(61,31,10,0.5);
  --surface-2   : rgba(45,22,6,0.65);
  --surface-3   : rgba(30,12,4,0.8);

  --text-primary   : #FDF6E3;
  --text-secondary : rgba(253,246,227,0.65);
  --text-muted     : rgba(253,246,227,0.38);

  --radius-sm : 4px;
  --radius-md : 8px;
  --radius-lg : 12px;
  --radius-xl : 16px;

  --shadow-sm : 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md : 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg : 0 16px 48px rgba(0,0,0,0.5);

  --font-display : 'Playfair Display', Georgia, serif;
  --font-arabic  : 'Amiri', 'Times New Roman', serif;
  --font-body    : 'Lora', Georgia, serif;
  --font-mono    : 'JetBrains Mono', monospace;

  --transition   : all 0.2s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--brown-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--brown-dark); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

/* ── BG PATTERN ── */
.bs-pattern {
  background-image:
    repeating-linear-gradient(45deg,  rgba(201,149,42,.022) 0, rgba(201,149,42,.022) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(-45deg, rgba(201,149,42,.022) 0, rgba(201,149,42,.022) 1px, transparent 1px, transparent 32px);
}

/* ── TYPOGRAPHY ── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--cream); }
.arabic { font-family: var(--font-arabic); color: var(--gold-light); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .45rem; padding: .6rem 1.4rem;
  font-family: var(--font-body); font-size: .875rem;
  border-radius: var(--radius-md); border: 1px solid;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; white-space: nowrap; font-weight: 500;
  letter-spacing: .03em;
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--gold); border-color: var(--gold);
  color: var(--brown-dark); font-weight: 700;
}
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); }

.btn-outline {
  background: transparent; border-color: var(--gold-border);
  color: var(--gold-light);
}
.btn-outline:hover { background: var(--gold-dim); border-color: var(--gold); color: var(--cream); }

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

.btn-danger {
  background: transparent; border-color: rgba(192,57,43,.4);
  color: #E07060;
}
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

.btn-sm { padding: .35rem .85rem; font-size: .78rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn-loading { position: relative; pointer-events: none; }
.btn-loading::after {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: bsSpin .6s linear infinite;
}

/* ── FORM INPUTS ── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block; margin-bottom: .35rem;
  font-size: .75rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary);
}
.form-label .req { color: var(--gold); margin-left: 2px; }

.form-control {
  width: 100%; padding: .65rem 1rem;
  background: rgba(61,31,10,.6);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  color: var(--cream); font-family: var(--font-body); font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,149,42,.15);
  background: rgba(61,31,10,.8);
}
.form-control.error { border-color: #C0392B; }
.form-control:disabled { opacity: .5; cursor: not-allowed; }

.form-control-icon { position: relative; }
.form-control-icon .icon {
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .9rem; pointer-events: none;
}
.form-control-icon .form-control { padding-left: 2.6rem; }
.form-control-icon .icon-right {
  position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); cursor: pointer; font-size: .9rem;
}
.form-control-icon .icon-right:hover { color: var(--gold-light); }
.form-control-icon .form-control.has-right { padding-right: 2.6rem; }

.form-error { color: #E07060; font-size: .75rem; margin-top: .3rem; display: flex; align-items: center; gap: .3rem; }
.form-hint  { color: var(--text-muted); font-size: .75rem; margin-top: .3rem; }

select.form-control option { background: var(--brown-deep); color: var(--cream); }

/* ── CARDS ── */
.card {
  background: var(--surface-2);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid rgba(201,149,42,.1);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--cream); }
.card-body   { padding: 1.4rem; }
.card-footer {
  padding: .75rem 1.4rem;
  background: rgba(201,149,42,.04);
  border-top: 1px solid rgba(201,149,42,.1);
}

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .18rem .65rem; border-radius: 2rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .05em;
  border: 1px solid;
}
.badge-gold    { background: rgba(201,149,42,.15); border-color: rgba(201,149,42,.4); color: var(--gold-light); }
.badge-green   { background: rgba(45,90,39,.2);   border-color: rgba(45,90,39,.5);   color: var(--green-light); }
.badge-red     { background: rgba(192,57,43,.15); border-color: rgba(192,57,43,.4);  color: #E07060; }
.badge-blue    { background: rgba(26,90,138,.2);  border-color: rgba(26,90,138,.5);  color: #7AB4E8; }
.badge-muted   { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: var(--text-secondary); }

/* ── ALERTS ── */
.alert {
  padding: .8rem 1rem; border-radius: var(--radius-md);
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .85rem; line-height: 1.55;
  border: 1px solid; margin-bottom: 1rem;
}
.alert-success { background: rgba(45,90,39,.2);   border-color: rgba(45,90,39,.4);   color: var(--green-light); }
.alert-error   { background: rgba(192,57,43,.15); border-color: rgba(192,57,43,.4);  color: #E07060; }
.alert-warning { background: rgba(201,149,42,.12); border-color: rgba(201,149,42,.35); color: var(--gold-light); }
.alert-info    { background: rgba(26,90,138,.15); border-color: rgba(26,90,138,.4);  color: #7AB4E8; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--gold-border); }
table.bs-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.bs-table thead tr { background: rgba(61,31,10,.8); }
.bs-table th {
  padding: .7rem 1rem; text-align: left;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; white-space: nowrap;
  border-bottom: 1px solid var(--gold-border);
}
.bs-table td {
  padding: .7rem 1rem; border-bottom: 1px solid rgba(201,149,42,.07);
  color: var(--text-secondary); vertical-align: middle;
}
.bs-table tbody tr { transition: background .15s; }
.bs-table tbody tr:hover { background: rgba(201,149,42,.06); }
.bs-table tbody tr:last-child td { border-bottom: none; }

/* ── DIVIDER ── */
.divider-gold {
  display: flex; align-items: center; gap: .8rem; margin: 1rem 0;
}
.divider-gold::before, .divider-gold::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-border), transparent);
}
.divider-gold span { color: var(--gold); font-size: .9rem; flex-shrink: 0; }

/* ── LOADING SPINNER ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(201,149,42,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: bsSpin .7s linear infinite;
  display: inline-block;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

/* ── ANIMATIONS ── */
@keyframes bsSpin    { to { transform: rotate(360deg); } }
@keyframes bsFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes bsFadeUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes bsSlideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes bsPulse   { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes bsShake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-5px); }
  40%,80% { transform: translateX(5px); }
}

.animate-fadein  { animation: bsFadeIn  .4s ease both; }
.animate-fadeup  { animation: bsFadeUp  .5s ease both; }
.animate-slidein { animation: bsSlideIn .4s ease both; }
.animate-shake   { animation: bsShake  .4s ease; }

/* Stagger helpers */
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 100; display: flex;
  align-items: center; justify-content: center;
  padding: 1rem;
  animation: bsFadeIn .2s ease;
}
.modal {
  background: var(--brown-deep);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: bsFadeUp .25s ease;
  position: relative;
}
.modal-header {
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid rgba(201,149,42,.12);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1.05rem; font-weight: 600; color: var(--cream); }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(201,149,42,.1); border: 1px solid var(--gold-border);
  color: var(--gold); cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(201,149,42,.25); }
.modal-body   { padding: 1.4rem; }
.modal-footer { padding: 1rem 1.4rem; border-top: 1px solid rgba(201,149,42,.1); display: flex; gap: .7rem; justify-content: flex-end; }

/* ── TOAST NOTIFICATION ── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 999; display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  display: flex; align-items: center; gap: .7rem;
  padding: .75rem 1.1rem; border-radius: var(--radius-md);
  border: 1px solid; font-size: .85rem;
  min-width: 260px; max-width: 380px;
  animation: bsSlideIn .3s ease, bsFadeIn .3s ease;
  box-shadow: var(--shadow-md);
}
.toast.success { background: rgba(27,50,24,.95); border-color: rgba(45,90,39,.6); color: var(--green-light); }
.toast.error   { background: rgba(50,15,12,.95); border-color: rgba(192,57,43,.5); color: #E07060; }
.toast.warning { background: rgba(50,38,10,.95); border-color: rgba(201,149,42,.5); color: var(--gold-light); }
.toast.info    { background: rgba(12,28,50,.95); border-color: rgba(26,90,138,.5); color: #7AB4E8; }
.toast-msg { flex: 1; }
.toast-close { opacity: .5; cursor: pointer; flex-shrink: 0; transition: opacity .15s; }
.toast-close:hover { opacity: 1; }

/* ── AVATAR ── */
.avatar {
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-family: var(--font-display);
  font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-md { width: 40px; height: 40px; font-size: .95rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: .8rem; opacity: .5; }
.empty-state-title { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-secondary); margin-bottom: .4rem; }
.empty-state-desc  { font-size: .85rem; }

/* ── UTILITIES ── */
.text-gold    { color: var(--gold); }
.text-cream   { color: var(--cream); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-sm      { font-size: .82rem; }
.text-xs      { font-size: .72rem; }
.text-lg      { font-size: 1.1rem; }
.font-display { font-family: var(--font-display); }
.font-arabic  { font-family: var(--font-arabic); }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.mt-1 { margin-top: .4rem; } .mt-2 { margin-top: .8rem; } .mt-3 { margin-top: 1.2rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .4rem; } .mb-2 { margin-bottom: .8rem; } .mb-3 { margin-bottom: 1.2rem; }
.gap-1 { gap: .4rem; } .gap-2 { gap: .8rem; } .gap-3 { gap: 1.2rem; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.w-full { width: 100%; } .hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase { text-transform: uppercase; letter-spacing: .08em; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
