/* ======================================================
   SANGRAHAK REGISTRATION SYSTEM - MAIN STYLESHEET
   ====================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary:    #0f172a;
  --bg-secondary:  #1e293b;
  --bg-card:       #1e293b;
  --bg-glass:      rgba(30,41,59,0.85);
  --border:        #334155;
  --border-light:  rgba(99,102,241,0.25);
  --accent:        #6366f1;
  --accent-hover:  #4f46e5;
  --accent2:       #8b5cf6;
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #0ea5e9;
  --text-primary:  #f8fafc;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --sidebar-w:     260px;
  --radius:        12px;
  --transition:    0.25s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ════════════════════════════════
   LOGIN PAGE
════════════════════════════════ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 20% 80%, rgba(99,102,241,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.12) 0%, transparent 55%),
              var(--bg-primary);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-wrapper::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  border-radius: 50%;
}
.login-box {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 48px 42px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: slideUp 0.5s ease;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 2px solid var(--border-light);
  padding: 8px;
  background: var(--bg-primary);
}
.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
}

/* ════════════════════════════════
   FORM CONTROLS
════════════════════════════════ */
.form-group { margin-bottom: 18px; text-align: left; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  background: rgba(15,23,42,0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-secondary); color: var(--text-primary); }

/* ── INPUT ICON WRAPPER ── */
.input-icon { position: relative; }
.input-icon .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
}
.input-icon .form-control { padding-left: 38px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg,var(--accent),var(--accent2)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); filter: brightness(1.1); }
.btn-success { background: linear-gradient(135deg,#22c55e,#16a34a); color: #fff; }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(34,197,94,0.35); }
.btn-danger  { background: linear-gradient(135deg,#ef4444,#dc2626); color: #fff; }
.btn-danger:hover  { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(239,68,68,0.35); }
.btn-warning { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; }
.btn-warning:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(245,158,11,0.35); }
.btn-info    { background: linear-gradient(135deg,#0ea5e9,#0284c7); color: #fff; }
.btn-info:hover    { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(14,165,233,0.35); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; padding: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ════════════════════════════════
   LAYOUT - SIDEBAR + MAIN
════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--bg-primary);
  padding: 4px;
  border: 1px solid var(--border-light);
}
.sidebar-brand { font-weight: 700; font-size: 15px; line-height: 1.3; }
.sidebar-brand small { color: var(--text-muted); font-size: 11px; font-weight: 400; display: block; }

.nav-section { padding: 8px 0; }
.nav-section-title {
  padding: 6px 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.nav-link:hover { color: var(--text-primary); background: rgba(99,102,241,0.08); }
.nav-link.active {
  color: var(--accent);
  background: rgba(99,102,241,0.12);
  border-left-color: var(--accent);
}
.nav-link .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-link .badge-count {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-primary);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg,var(--accent),var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: 11px; color: var(--text-muted); }
.logout-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 16px;
  transition: color var(--transition);
  padding: 4px;
}
.logout-btn:hover { color: var(--danger); }

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

/* TOPBAR */
.topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* PAGE BODY */
.page-body { padding: 28px; flex: 1; }

/* ════════════════════════════════
   CARDS
════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 15px; font-weight: 700; }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  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;
}
.stat-card.blue::before   { background: linear-gradient(90deg,var(--accent),var(--accent2)); }
.stat-card.green::before  { background: linear-gradient(90deg,#22c55e,#16a34a); }
.stat-card.yellow::before { background: linear-gradient(90deg,#f59e0b,#ef4444); }
.stat-card.cyan::before   { background: linear-gradient(90deg,#0ea5e9,#6366f1); }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(99,102,241,0.15); color: var(--accent); }
.stat-icon.green  { background: rgba(34,197,94,0.12); color: var(--success); }
.stat-icon.yellow { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.cyan   { background: rgba(14,165,233,0.12); color: var(--info); }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ════════════════════════════════
   TABLE
════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  padding: 13px 16px;
  background: rgba(15,23,42,0.6);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody tr:hover td { background: rgba(99,102,241,0.04); }
tbody tr:last-child td { border-bottom: none; }
.td-name { color: var(--text-primary); font-weight: 600; }

/* ════════════════════════════════
   BADGES
════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-primary { background: rgba(99,102,241,0.15); color: var(--accent); }
.badge-success { background: rgba(34,197,94,0.12); color: #22c55e; }
.badge-warning { background: rgba(245,158,11,0.12); color: #f59e0b; }
.badge-danger  { background: rgba(239,68,68,0.12); color: #ef4444; }
.badge-info    { background: rgba(14,165,233,0.12); color: #0ea5e9; }

/* ════════════════════════════════
   ALERTS / FLASH MESSAGES
════════════════════════════════ */
.alert {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.25); color: #4ade80; }
.alert-danger  { background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.25); color: #fbbf24; }
.alert-info    { background: rgba(14,165,233,0.10); border: 1px solid rgba(14,165,233,0.25); color: #38bdf8; }
.alert-close { margin-left: auto; cursor: pointer; opacity: 0.6; }
.alert-close:hover { opacity: 1; }

/* ════════════════════════════════
   MODAL
════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--transition);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { cursor: pointer; color: var(--text-muted); font-size: 20px; line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ════════════════════════════════
   SEARCH & FILTERS
════════════════════════════════ */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.search-input-wrap { position: relative; flex: 1; min-width: 240px; }
.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.search-input-wrap .form-control { padding-left: 36px; }

/* ════════════════════════════════
   FILE UPLOAD
════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(99,102,241,0.02);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
}
.upload-zone .upload-icon { font-size: 36px; margin-bottom: 10px; }
.upload-zone p { color: var(--text-secondary); font-size: 14px; }
.upload-zone small { color: var(--text-muted); font-size: 12px; }

/* ════════════════════════════════
   PAGINATION
════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ════════════════════════════════
   UTILITIES
════════════════════════════════ */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-mono { font-family: 'Courier New', monospace; font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .page-body { padding: 16px; }
  .search-bar { flex-direction: column; }
  .topbar-actions { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-box { padding: 32px 24px; }
}

/* ════════════════════════════════
   IMPORT REPORT
════════════════════════════════ */
.import-report {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}
.import-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(51,65,85,0.4);
}
.import-stat:last-child { border-bottom: none; }
.import-stat .label { color: var(--text-secondary); font-size: 14px; }
.import-stat .value { font-size: 18px; font-weight: 700; }

/* LOGO PREVIEW */
.logo-preview-box {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}
.logo-preview-box img {
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
  border-radius: 12px;
}

/* PHAD BADGE TABLE */
.phad-tag {
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* SPINNER */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 17px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* HAMBURGER */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-primary);
  font-size: 22px;
}
@media (max-width: 768px) { .hamburger { display: flex; } }
