/* ═══════════════════════════════════════════════
   HalalCert — Main Stylesheet
   ═══════════════════════════════════════════════ */

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

:root {
  --green:       #1a6b3c;
  --green-light: #2e8b57;
  --green-pale:  #e8f5ee;
  --gold:        #c9a84c;
  --gold-light:  #f0d98a;
  --dark:        #1a1a2e;
  --mid:         #3a3a5c;
  --text:        #2c2c3e;
  --muted:       #6b7280;
  --border:      #d1d5db;
  --bg:          #f5f7f5;
  --white:       #ffffff;
  --red:         #dc2626;
  --blue:        #2563eb;
  --shadow:      0 4px 24px rgba(26,107,60,0.10);
  --shadow-lg:   0 12px 48px rgba(26,107,60,0.16);
  --radius:      12px;
  --radius-sm:   8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; }

/* ─── LOGIN PAGE ─────────────────────────────────── */
.login-page {
  display: flex;
  min-height: 100vh;
}
.login-left {
  flex: 1;
  background: linear-gradient(135deg, #0f3d24 0%, #1a6b3c 45%, #2e8b57 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(201,168,76,0.12);
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.login-logo-area { text-align: center; z-index: 1; animation: fadeUp 0.8s ease both; }
.login-logo-icon {
  width: 88px; height: 88px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(201,168,76,0.4);
  font-size: 40px;
}
.login-logo-area h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  color: #fff;
  letter-spacing: -0.5px;
}
.login-logo-area h1 span { color: var(--gold-light); }
.login-logo-area p { margin-top: 14px; color: rgba(255,255,255,0.70); font-size: 1rem; font-weight: 300; }
.login-badges { display: flex; gap: 12px; margin-top: 40px; z-index: 1; flex-wrap: wrap; justify-content: center; }
.badge {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  color: #fff;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.login-right {
  width: 480px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  box-shadow: -12px 0 48px rgba(0,0,0,0.15);
}
.login-form-head { text-align: center; margin-bottom: 36px; width: 100%; }
.login-form-head h2 { font-family: 'Playfair Display', serif; font-size: 1.9rem; color: var(--dark); }
.login-form-head p { color: var(--muted); margin-top: 6px; font-size: 0.92rem; }
.login-note { margin-top: 20px; font-size: 0.82rem; color: var(--muted); text-align: center; }
.login-note strong { color: var(--green); }

/* ─── FORMS ──────────────────────────────────────── */
.form-group { width: 100%; margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.req { color: var(--red); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,107,60,0.10);
}
.form-group textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section-title {
  grid-column: 1 / -1;
  margin: 12px 0 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green-pale);
}
.form-section-title span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--green);
  background: var(--green-pale);
  padding: 4px 14px;
  border-radius: 100px;
}
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── BUTTONS ────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  display: block;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,107,60,0.30);
}
.btn-sm {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #145c33; box-shadow: 0 4px 14px rgba(26,107,60,0.25); }
.btn-gold  { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #b8973e; }
.btn-outline {
  background: #fff; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #b91c1c; }
.btn-logout {
  padding: 7px 14px;
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(220,38,38,0.30);
  border-radius: 8px;
  color: #fca5a5;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-logout:hover { background: rgba(220,38,38,0.25); }

/* ─── TOPNAV ──────────────────────────────────────── */
.topnav {
  background: linear-gradient(90deg, var(--dark) 0%, #2a2a45 100%);
  padding: 0 32px;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 4px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 24px;
  text-decoration: none;
}
.nav-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.nav-logo span {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: #fff;
  font-weight: 700;
}
.nav-logo span em { color: var(--gold-light); font-style: normal; }
.nav-title {
  color: rgba(255,255,255,0.45);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: 20px;
  margin-right: auto;
  white-space: nowrap;
}
.nav-menu { display: flex; gap: 4px; }
.nav-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.nav-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-btn.active {
  background: rgba(201,168,76,0.18);
  border-color: rgba(201,168,76,0.30);
  color: var(--gold-light);
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid rgba(255,255,255,0.10);
}
.nav-avatar {
  width: 34px; height: 34px;
  background: var(--green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.nav-username { color: rgba(255,255,255,0.80); font-size: 0.88rem; }

/* ─── LAYOUT ──────────────────────────────────────── */
.dash-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 32px;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--dark);
  line-height: 1.2;
}
.section-head p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* ─── STATS ──────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.green { border-color: var(--green); }
.stat-card.gold  { border-color: var(--gold); }
.stat-card.blue  { border-color: var(--blue); }
.stat-card.red   { border-color: var(--red); }
.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.green .stat-card-icon { background: var(--green-pale); }
.gold  .stat-card-icon { background: #fdf6e3; }
.blue  .stat-card-icon { background: #eff6ff; }
.red   .stat-card-icon { background: #fef2f2; }
.stat-num { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--dark); }
.stat-label { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

/* ─── TABLE CARD ─────────────────────────────────── */
.table-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.table-toolbar h3 { font-size: 1.05rem; font-weight: 600; color: var(--dark); }
.toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  gap: 8px;
  background: var(--bg);
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  width: 220px;
  padding: 0;
}
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: #f8fafc; }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfa; }
.action-btns { display: flex; gap: 6px; }
.btn-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: none;
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-icon.view { background: #eff6ff; color: #2563eb; }
.btn-icon.edit { background: var(--green-pale); color: var(--green); }
.btn-icon.del  { background: #fee2e2; color: var(--red); }
.btn-icon:hover { transform: scale(1.12); }
.paginator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
}
.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}
.pager-btn.active, .pager-btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ─── STATUS BADGES ──────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-active     { background: #dcfce7; color: #166534; }
.status-expired    { background: #fee2e2; color: #991b1b; }
.status-pending    { background: #fef9c3; color: #854d0e; }
.status-suspended  { background: #f3f4f6; color: #374151; }

/* ─── UPLOAD AREA ────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}
.upload-area:hover { border-color: var(--green); background: var(--green-pale); }
.upload-area p { color: var(--muted); font-size: 0.88rem; margin-top: 8px; }
.upload-icon { font-size: 28px; }
.upload-area input[type="file"] { display: none; }

/* ─── ALERTS ─────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: fadeUp 0.3s ease;
}
.alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ─── VIEW PAGE TABS ─────────────────────────────── */
.view-tabs {
  display: flex;
  gap: 4px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.vtab {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vtab.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.vtab-content { display: none; padding: 24px; }
.vtab-content.active { display: block; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.detail-item label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
.detail-item span {
  font-size: 0.9rem;
  color: var(--text);
  display: block;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
  word-break: break-word;
}

/* ─── SETTINGS LIST ──────────────────────────────── */
.settings-list { list-style: none; }
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.settings-item:last-child { border-bottom: none; }
.new-option-row { display: flex; gap: 10px; margin-top: 16px; }
.new-option-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
}
.new-option-row input:focus { border-color: var(--green); }

/* ─── DROPDOWN ────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-width: 170px;
  z-index: 50;
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--bg); }

/* ─── MODAL (for delete confirm) ─────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.25);
  animation: slideUp 0.3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--dark) 0%, #2a2a45 100%);
  border-radius: 16px 16px 0 0;
}
.modal-header h3 { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: #fff; }
.modal-header p { color: rgba(255,255,255,0.55); font-size: 0.82rem; margin-top: 2px; }
.btn-close {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.10);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.btn-close:hover { background: rgba(255,255,255,0.20); }
.modal-body { padding: 28px; }
.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: #fafbfa;
  border-radius: 0 0 16px 16px;
}

/* ─── EMPTY STATE ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 0.95rem; }
.empty-state a { color: var(--green); font-weight: 600; }

/* ─── FOOTER ─────────────────────────────────────── */
footer {
  background: var(--dark);
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 16px 32px;
  font-size: 0.82rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
footer strong { color: var(--gold-light); font-weight: 600; }

/* ─── ANIMATIONS ─────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .topnav { padding: 0 16px; }
  .nav-title { display: none; }
  .dash-content { padding: 20px 16px; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .nav-username { display: none; }
}
