/* ========================================================================
   TEMPLE VOLUNTEERS MANAGEMENT SYSTEM — SHARED BASE STYLES
   Design tokens, resets, and reusable components (buttons, cards, modals,
   toasts, tables, badges) shared by every page in the prototype.
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root{
  /* ---- Brand palette ---- */
  --saffron: #FF9933;
  --saffron-dark: #E67E22;
  --saffron-light: #FFE8CC;
  --indigo: #1E3A8A;
  --indigo-dark: #152a63;
  --indigo-light: #E8EDFB;
  --gold: #D4AF37;

  /* ---- Neutrals ---- */
  --bg: #FFFBF5;
  --surface: #FFFFFF;
  --surface-alt: #F4F5F7;
  --border: #E7E4DD;
  --text: #2D2A26;
  --text-soft: #6B6560;
  --text-faint: #9A948C;

  /* ---- Status ---- */
  --success: #1E8E5A;
  --success-bg: #E3F6EC;
  --warning: #C77700;
  --warning-bg: #FFF3E0;
  --danger: #D64545;
  --danger-bg: #FDEBEB;
  --info: var(--indigo);
  --info-bg: var(--indigo-light);

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgba(45,42,38,.06), 0 1px 3px rgba(45,42,38,.08);
  --shadow-md: 0 4px 10px rgba(45,42,38,.07), 0 2px 4px rgba(45,42,38,.06);
  --shadow-lg: 0 16px 40px rgba(30,26,15,.14);

  /* ---- Shape / rhythm ---- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --gap: 20px;

  --sidebar-w: 264px;
  --sidebar-w-collapsed: 84px;
  --topbar-h: 72px;

  --ease: cubic-bezier(.4,0,.2,1);
}

body.dark{
  --bg: #14171F;
  --surface: #1B1F2A;
  --surface-alt: #20242F;
  --border: #2B3040;
  --text: #F1EFEA;
  --text-soft: #B8B4AC;
  --text-faint: #82877;
  --indigo-light: #232a4a;
  --saffron-light: #3a2c17;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:'Poppins',sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  transition:background .25s var(--ease), color .25s var(--ease);
}
a{ color:inherit; text-decoration:none; }
ul{ list-style:none; margin:0; padding:0; }
button{ font-family:inherit; cursor:pointer; }
img{ max-width:100%; display:block; }
::selection{ background:var(--saffron-light); color:var(--indigo-dark); }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible{
  outline:2px solid var(--saffron-dark);
  outline-offset:2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* ---- Typography scale ---- */
h1,h2,h3,h4{ margin:0 0 4px; font-weight:700; letter-spacing:-.01em; }
.page-title{ font-size:1.5rem; font-weight:700; }
.page-sub{ color:var(--text-soft); font-size:.9rem; margin:0; }

/* ---- Buttons ---- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 18px; border-radius:10px; border:1px solid transparent;
  font-size:.88rem; font-weight:600; transition:transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
  white-space:nowrap;
}
.btn:active{ transform:translateY(1px) scale(.98); }
.btn:focus-visible{ outline:none; box-shadow:0 0 0 .2rem rgba(255,153,51,.35); }
.btn-primary{ background:linear-gradient(135deg,var(--saffron),var(--saffron-dark)); color:#fff; box-shadow:var(--shadow-sm); }
.btn-primary:hover{ box-shadow:0 6px 16px rgba(230,126,34,.35); transform:translateY(-1px); }
.btn-secondary{ background:var(--indigo); color:#fff; }
.btn-secondary:hover{ background:var(--indigo-dark); transform:translateY(-1px); }
.btn-outline{ background:transparent; border-color:var(--border); color:var(--text); }
.btn-outline:hover{ border-color:var(--saffron); color:var(--saffron-dark); background:var(--saffron-light); }
.btn-ghost{ background:transparent; color:var(--text-soft); }
.btn-ghost:hover{ background:var(--surface-alt); color:var(--text); }
.btn-danger{ background:var(--danger); color:#fff; }
.btn-danger:hover{ background:#b93636; transform:translateY(-1px); }
.btn-sm{ padding:6px 12px; font-size:.78rem; border-radius:8px; }
.btn-icon{ width:38px; height:38px; padding:0; border-radius:10px; background:var(--surface-alt); color:var(--text-soft); }
.btn-icon:hover{ background:var(--saffron-light); color:var(--saffron-dark); }
.btn:disabled{ opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }

/* ---- Cards ---- */
.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);
  box-shadow:var(--shadow-sm); transition:box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); }

/* ---- Badges ---- */
.badge{ display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:999px; font-size:.72rem; font-weight:600; border:1px solid transparent; }
.badge-success{ background:var(--success-bg); color:var(--success); border-color:rgba(30,142,90,.18); }
.badge-warning{ background:var(--warning-bg); color:var(--warning); border-color:rgba(199,119,0,.18); }
.badge-danger{ background:var(--danger-bg); color:var(--danger); border-color:rgba(214,69,69,.18); }
.badge-info{ background:var(--info-bg); color:var(--info); border-color:rgba(30,58,138,.15); }
.badge::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }

/* ---- Tables ---- */
.table-wrap{ overflow-x:auto; border-radius:var(--radius-md); border:1px solid var(--border); }
table.data-table{ width:100%; border-collapse:collapse; min-width:640px; background:var(--surface); }
.data-table th{ text-align:left; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:var(--text-faint); padding:14px 16px; background:var(--surface-alt); border-bottom:1px solid var(--border); white-space:nowrap; }
.data-table td{ padding:13px 16px; border-bottom:1px solid var(--border); font-size:.87rem; vertical-align:middle; }
.data-table tbody tr{ transition:background .15s var(--ease); }
.data-table tbody tr:hover{ background:var(--surface-alt); }
.data-table tbody tr:last-child td{ border-bottom:none; }
.cell-actions{ display:flex; gap:6px; flex-wrap:wrap; }

/* ---- Pagination ---- */
.pagination{ display:flex; align-items:center; justify-content:flex-end; gap:6px; padding:14px 16px; }
.pagination button{ width:32px; height:32px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--text-soft); font-size:.8rem; font-weight:600; transition:all .15s var(--ease); }
.pagination button.active{ background:var(--saffron); border-color:var(--saffron); color:#fff; box-shadow:var(--shadow-sm); }
.pagination button:hover:not(.active){ border-color:var(--saffron); color:var(--saffron-dark); background:var(--saffron-light); }
.pagination button:disabled{ opacity:.4; cursor:not-allowed; }

/* ---- Forms ---- */
.form-group{ margin-bottom:16px; }
.form-group label{ display:block; font-size:.8rem; font-weight:600; margin-bottom:6px; color:var(--text-soft); }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width: 600px){ .form-row{ grid-template-columns:1fr; } }
.form-control{
  width:100%; padding:11px 14px; border-radius:9px; border:1px solid var(--border);
  background:var(--surface-alt); color:var(--text); font-size:.88rem; font-family:inherit;
  transition:border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-control:focus{ outline:none; border-color:var(--saffron); box-shadow:0 0 0 .2rem rgba(255,153,51,.25); background:var(--surface); }
textarea.form-control{ resize:vertical; min-height:80px; }
.field-error{ color:var(--danger); font-size:.75rem; margin-top:4px; display:none; }
.form-group.invalid .form-control{ border-color:var(--danger); }
.form-group.invalid .field-error{ display:block; }

/* ---- Input with icon ---- */
.input-icon-wrap{ position:relative; }
.input-icon-wrap i{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--text-faint); font-size:.85rem; }
.input-icon-wrap .form-control{ padding-left:38px; }
.input-icon-wrap .toggle-pw{ position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none; color:var(--text-faint); font-size:.85rem; padding:4px; }

/* ---- Modal ---- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(20,17,10,.5); backdrop-filter:blur(2px);
  display:flex; align-items:center; justify-content:center; z-index:1000;
  opacity:0; pointer-events:none; transition:opacity .2s var(--ease);
}
.modal-overlay.open{ opacity:1; pointer-events:auto; }
.modal{
  display:block; position:static; overflow-x:visible;
  height:auto; top:auto; left:auto; z-index:auto; width:min(560px,92vw);
  background:var(--surface); border-radius:var(--radius-lg);
  max-height:88vh; overflow-y:auto; box-shadow:var(--shadow-lg);
  transform:translateY(16px) scale(.97); opacity:0; transition:transform .25s var(--ease), opacity .25s var(--ease);
}
.modal-overlay.open .modal{ transform:translateY(0) scale(1); opacity:1; }
.modal-header{ display:flex; align-items:center; justify-content:space-between; padding:20px 24px; border-bottom:1px solid var(--border); }
.modal-header h3{ margin:0; }
.modal-body{ padding:22px 24px; }
.modal-footer{ display:flex; justify-content:flex-end; gap:10px; padding:16px 24px; border-top:1px solid var(--border); }
.modal-close{ background:none; border:none; font-size:1.1rem; color:var(--text-soft); width:34px; height:34px; border-radius:8px; }
.modal-close:hover{ background:var(--surface-alt); color:var(--danger); }

/* ---- Confirm dialog ---- */
.confirm-icon{ width:52px; height:52px; border-radius:50%; background:var(--danger-bg); color:var(--danger); display:flex; align-items:center; justify-content:center; font-size:1.3rem; margin:0 auto 14px; }

/* ---- Toasts ---- */
.toast-stack{ position:fixed; top:20px; right:20px; display:flex; flex-direction:column; gap:10px; z-index:1200; width:min(340px,88vw); }
.toast-stack .toast{
  display:flex; align-items:flex-start; gap:12px; background:var(--surface); border:1px solid var(--border);
  border-left:4px solid var(--saffron); padding:14px 16px; border-radius:12px; box-shadow:var(--shadow-lg);
  transform:translateX(120%); opacity:0; transition:transform .35s var(--ease), opacity .35s var(--ease);
}
.toast.show{ transform:translateX(0); opacity:1; }
.toast.success{ border-left-color:var(--success); }
.toast.error{ border-left-color:var(--danger); }
.toast.info{ border-left-color:var(--indigo); }
.toast i.toast-ico{ font-size:1.05rem; margin-top:1px; }
.toast.success i.toast-ico{ color:var(--success); }
.toast.error i.toast-ico{ color:var(--danger); }
.toast.info i.toast-ico{ color:var(--indigo); }
.toast .toast-title{ font-weight:600; font-size:.85rem; margin-bottom:2px; }
.toast .toast-msg{ font-size:.78rem; color:var(--text-soft); }
.toast-close{ margin-left:auto; background:none; border:none; color:var(--text-faint); font-size:.8rem; }

/* ---- Loading spinner ---- */
.spinner{ width:38px; height:38px; border-radius:50%; border:4px solid var(--saffron-light); border-top-color:var(--saffron); animation:spin .7s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.page-loader{ position:fixed; inset:0; background:var(--bg); display:flex; align-items:center; justify-content:center; z-index:2000; transition:opacity .3s var(--ease), visibility .3s; }
.page-loader.hide{ opacity:0; visibility:hidden; }
.btn .btn-spinner{ width:14px; height:14px; border-width:2px; margin-right:2px; }

/* ---- Empty states ---- */
.empty-state{ text-align:center; padding:48px 20px; color:var(--text-soft); }
.empty-state i{ font-size:2.2rem; color:var(--saffron); opacity:.6; margin-bottom:12px; }
.empty-state h4{ color:var(--text); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar{ width:9px; height:9px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:var(--border); border-radius:99px; }
::-webkit-scrollbar-thumb:hover{ background:var(--saffron); }

/* ---- Utility ---- */
.flex{ display:flex; }
.items-center{ align-items:center; }
.justify-between{ justify-content:space-between; }
.gap-8{ gap:8px; } .gap-12{ gap:12px; } .gap-16{ gap:16px; }
.text-soft{ color:var(--text-soft); }
.hidden{ display:none !important; }

/* Profile Dropdown - Add to base.css */
.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 12px;
  background: var(--surface-alt);
  cursor: pointer;
  position: relative;
}

.profile-chip img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
}

.profile-chip .p-name {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.1;
}

.profile-chip .p-role {
  font-size: .68rem;
  color: var(--text-soft);
}

.profile-chip .fa-chevron-down {
  transition: transform 0.2s ease;
}

.profile-chip .fa-chevron-down.open {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 8px 0;
  display: none;
  z-index: 100;
}

.profile-dropdown.open {
  display: block;
}

.profile-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: .82rem;
  text-decoration: none;
  transition: background .15s ease;
}

.profile-dropdown a:hover {
  background: var(--surface-alt);
}

.profile-dropdown a i {
  width: 18px;
  color: var(--text-soft);
}

.profile-dropdown .divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.profile-dropdown .logout-item {
  color: var(--danger);
}

.profile-dropdown .logout-item i {
  color: var(--danger);
}