/* ============================================================
   Graceway Baptist Church — Admin Portal
   Professional UI Design System
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --green-darkest:  #111d11;
  --green-dark:     #1a2e1a;
  --green-mid:      #2d4a2d;
  --green-accent:   #4e6e52;
  --green-light:    #729071;
  --green-pale:     #e8f0e8;
  --green-ultra:    #f0f5f0;

  --white:          #ffffff;
  --gray-50:        #f8fafc;
  --gray-100:       #f1f5f1;
  --gray-200:       #e2e8e2;
  --gray-300:       #cbd5cb;
  --gray-400:       #94a394;
  --gray-500:       #6b7b6b;
  --gray-600:       #4b5b4b;
  --gray-800:       #1f2f1f;
  --gray-900:       #111811;

  --red-light:      #fff0f0;
  --red:            #dc2626;
  --amber-light:    #fffbeb;
  --amber:          #d97706;
  --blue-light:     #eff6ff;
  --blue:           #2563eb;

  --sidebar-w:      260px;
  --header-h:       64px;

  --shadow-xs:      0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 6px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 15px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.06);
  --shadow-xl:      0 20px 25px rgba(0,0,0,.12), 0 10px 10px rgba(0,0,0,.06);

  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      20px;

  --transition:     150ms ease;
  --transition-md:  250ms ease;
}

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── LOGIN PAGE ─────────────────────────────────────────────── */
body.login-body {
  background: var(--gray-100);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

.login-page {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left panel */
.login-bg {
  flex: 1;
  background: var(--green-dark);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 60px 56px;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(114,144,113,.35) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(78,110,82,.25) 0%, transparent 55%);
}

.login-bg::after {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}

.login-bg-content {
  position: relative;
  z-index: 1;
}

.login-bg-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: 32px;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.login-bg-church {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 12px;
}

.login-bg-tagline {
  font-size: 0.9rem;
  color: rgba(255,255,255,.55);
  letter-spacing: .03em;
  margin-bottom: 48px;
}

.login-bg-verse {
  border-left: 2px solid rgba(114,144,113,.6);
  padding-left: 20px;
}

.login-bg-verse p {
  font-size: 0.875rem;
  color: rgba(255,255,255,.7);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 8px;
}

.login-bg-verse cite {
  font-size: 0.78rem;
  color: rgba(255,255,255,.4);
  font-style: normal;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Right panel — login form */
.login-card {
  width: 480px;
  flex-shrink: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  box-shadow: -20px 0 60px rgba(0,0,0,.12);
  position: relative;
  z-index: 2;
}

.login-header {
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
  letter-spacing: -.025em;
}

.login-header p {
  font-size: 0.9rem;
  color: var(--gray-500);
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 7px;
  letter-spacing: .01em;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.login-form input:focus {
  border-color: var(--green-accent);
  box-shadow: 0 0 0 3px rgba(78,110,82,.12);
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--green-accent);
  color: var(--white);
  border-color: var(--green-accent);
}
.btn-primary:hover {
  background: var(--green-mid);
  border-color: var(--green-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(78,110,82,.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-200);
}
.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-danger {
  background: var(--white);
  color: var(--red);
  border-color: #fecaca;
}
.btn-danger:hover {
  background: var(--red-light);
  border-color: #fca5a5;
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
  padding: 8px 12px;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── ALERTS ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error   { background: var(--red-light);   color: var(--red);   border: 1px solid #fecaca; }
.alert-success { background: var(--green-pale);  color: var(--green-accent); border: 1px solid #bbdabc; }
.alert-warning { background: var(--amber-light); color: var(--amber); border: 1px solid #fde68a; }

/* ── ADMIN LAYOUT ──────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: .85;
}

.sidebar-brand {
  flex: 1;
  min-width: 0;
}

.sidebar-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-tagline {
  font-size: 0.7rem;
  color: rgba(255,255,255,.4);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 2px;
}

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

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

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  transition: all var(--transition);
  margin-bottom: 2px;
  white-space: nowrap;
}

.sidebar-nav a .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .7;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,.08);
  color: var(--white);
}

.sidebar-nav a:hover .nav-icon { opacity: 1; }

.sidebar-nav a.active {
  background: var(--green-accent);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(78,110,82,.4);
}

.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.7rem;
  color: rgba(255,255,255,.4);
  text-transform: capitalize;
}

.logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
}
.logout-btn:hover { color: #fc8181; background: rgba(252,129,129,.1); }

/* ── MAIN CONTENT ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOP HEADER ────────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.02em;
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── PAGE CONTENT ──────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 32px;
}

/* ── STAT CARDS ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--gray-200);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green-accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--green-ultra);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.04em;
  line-height: 1;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--gray-400);
}

/* ── CARDS / PANELS ────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.02em;
}

.card-body { padding: 24px; }

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* ── TABLES ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
  background: var(--gray-50);
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--green-ultra); }

tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  color: var(--gray-700);
}

.cell-primary {
  font-weight: 600;
  color: var(--gray-900);
}

.cell-muted {
  color: var(--gray-400);
  font-size: 0.8125rem;
}

.cell-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.badge-green  { background: var(--green-pale);  color: var(--green-accent); }
.badge-gray   { background: var(--gray-100);    color: var(--gray-500); }
.badge-amber  { background: var(--amber-light); color: var(--amber); }
.badge-red    { background: var(--red-light);   color: var(--red); }
.badge-blue   { background: var(--blue-light);  color: var(--blue); }

/* ── SERMON THUMBNAIL ──────────────────────────────────────── */
.thumb {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--gray-200);
  flex-shrink: 0;
}

.thumb-placeholder {
  width: 64px;
  height: 40px;
  border-radius: 4px;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── FORMS ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 7px;
  letter-spacing: .01em;
}

.form-label .required { color: var(--red); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--green-accent);
  box-shadow: 0 0 0 3px rgba(78,110,82,.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select.form-control { cursor: pointer; }

.form-control:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Toggle switch */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 24px;
  transition: background var(--transition);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow-xs);
}

.toggle input:checked + .toggle-slider { background: var(--green-accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* ── FILE DROP ZONE ────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-50);
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--green-accent);
  background: var(--green-ultra);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon { font-size: 2rem; margin-bottom: 10px; }

.drop-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.drop-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
}

.drop-preview {
  margin-top: 12px;
}

.drop-preview img {
  max-height: 100px;
  border-radius: var(--radius-sm);
  margin: 0 auto;
  object-fit: cover;
}

.drop-preview .file-name {
  font-size: 0.8rem;
  color: var(--green-accent);
  font-weight: 600;
  margin-top: 6px;
}

/* ── MODAL ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-md);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(.97) translateY(10px);
  transition: transform var(--transition-md);
}

.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
}

.modal-lg { max-width: 820px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.025em;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-800); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 28px;
  border-top: 1px solid var(--gray-200);
}

/* ── TOAST NOTIFICATIONS ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn .25s ease forwards;
  border: 1px solid rgba(0,0,0,.06);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-out {
  animation: toastOut .2s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(.97); }
}

.toast-success { background: var(--white); color: var(--gray-800); }
.toast-error   { background: #fff5f5; color: #c53030; }
.toast-info    { background: var(--white); color: var(--gray-800); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── SEARCH BAR ────────────────────────────────────────────── */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar input {
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: var(--gray-50);
  outline: none;
  width: 240px;
  transition: all var(--transition);
}

.search-bar input:focus {
  background: var(--white);
  border-color: var(--green-accent);
  box-shadow: 0 0 0 3px rgba(78,110,82,.1);
  width: 280px;
}

.search-bar .search-icon {
  position: absolute;
  left: 11px;
  color: var(--gray-400);
  font-size: 0.9rem;
  pointer-events: none;
}

/* ── FILTER BAR ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: .5; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.empty-desc { font-size: 0.875rem; color: var(--gray-400); margin-bottom: 20px; }

/* ── SPINNER ───────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

.spinner-dark {
  border-color: rgba(78,110,82,.2);
  border-top-color: var(--green-accent);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── BREADCRUMB ────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--green-accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--gray-300); }

/* ── QUICK ACTIONS ─────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.quick-action-btn:hover {
  border-color: var(--green-accent);
  background: var(--green-ultra);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-action-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: background var(--transition);
}

.quick-action-btn:hover .quick-action-icon { background: var(--green-accent); }

.quick-action-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* ── SETTINGS PAGE ─────────────────────────────────────────── */
.settings-section {
  margin-bottom: 32px;
}

.settings-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── PAGINATION ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 0 4px;
}

.pagination button {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
}

.pagination button:hover { border-color: var(--green-accent); color: var(--green-accent); }
.pagination button.active {
  background: var(--green-accent);
  border-color: var(--green-accent);
  color: var(--white);
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
    transition: transform var(--transition-md);
  }

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

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

  .page-content { padding: 20px 16px; }

  .login-bg { display: none; }

  .login-card {
    width: 100%;
    padding: 48px 28px;
    box-shadow: none;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
}
