/* ===========================
   SWC PAKISTAN — ADMIN CRM
   Dark professional dashboard
   =========================== */

:root {
  --navy: #0a0e1a;
  --navy-mid: #111827;
  --navy-light: #1a2540;
  --navy-border: #1e2d45;
  --green: #1a7a3c;
  --green-bright: #22c55e;
  --gold: #d4af37;
  --blue: #3b82f6;
  --red: #ef4444;
  --white: #ffffff;
  --off-white: #e8eaf0;
  --gray: #8892a4;
  --gray-light: #c5cad6;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* ===========================
   LOGIN
   =========================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(26,122,60,0.15) 0%, transparent 60%);
}

.login-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
}

.login-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--white);
}

.login-sub {
  font-size: 0.75rem;
  color: var(--green-bright);
}

.login-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: 6px;
}

.login-note {
  color: var(--gray);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

.lform-group {
  margin-bottom: 20px;
}

.lform-group label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 8px;
}

.lform-group input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  padding: 11px 14px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.lform-group input:focus {
  border-color: var(--green-bright);
  background: rgba(34,197,94,0.04);
}

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.login-btn {
  width: 100%;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 13px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.login-btn:hover { background: var(--green-bright); }

.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: var(--gray);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: var(--green-bright); }

/* ===========================
   CRM LAYOUT
   =========================== */
.crm-panel {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.crm-sidebar {
  width: var(--sidebar-w);
  background: var(--navy-mid);
  border-right: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--navy-border);
}

.sidebar-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--white);
}

.sidebar-sub {
  font-size: 0.7rem;
  color: var(--green-bright);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--gray);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--white);
}

.nav-item.active {
  background: rgba(34,197,94,0.1);
  color: var(--green-bright);
  border-left: 2px solid var(--green-bright);
}

.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.view-site-btn {
  display: block;
  text-align: center;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--green-bright);
  text-decoration: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.view-site-btn:hover {
  background: rgba(34,197,94,0.2);
}

.logout-btn {
  width: 100%;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
  border-radius: 6px;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239,68,68,0.2);
}

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

.crm-topbar {
  height: var(--topbar-h);
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--gray-light);
}

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

/* SECTIONS */
.crm-section {
  display: none;
  padding: 32px 28px;
  flex: 1;
}

.crm-section.active-section { display: block; }

.section-header {
  margin-bottom: 28px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--white);
  margin-bottom: 4px;
}

.section-header p {
  color: var(--gray);
  font-size: 0.875rem;
}

/* DASHBOARD */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.dash-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.dash-card-icon.green { background: rgba(34,197,94,0.1); }
.dash-card-icon.blue { background: rgba(59,130,246,0.1); }
.dash-card-icon.gold { background: rgba(212,175,55,0.1); }
.dash-card-icon.red { background: rgba(239,68,68,0.1); }

.dash-card-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  color: var(--white);
  line-height: 1;
}

.dash-card-label {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 2px;
}

.dash-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-info-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  padding: 24px;
}

.dash-info-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--navy-border);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.875rem;
}

.info-row span { color: var(--gray); }
.info-row strong { color: var(--white); text-align: right; }

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qa-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--navy-border);
  color: var(--gray-light);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.qa-btn:hover {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.3);
  color: var(--white);
}

/* BRANDING */
.branding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.brand-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  padding: 24px;
}

.brand-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--white);
}

.preview-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--navy-border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 100px;
}

.banner-preview-wrap { min-height: 140px; }

.logo-preview {
  max-height: 80px;
  max-width: 100%;
  object-fit: contain;
}

.banner-preview {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 4px;
}

.upload-area {
  position: relative;
  background: rgba(255,255,255,0.02);
  border: 2px dashed var(--navy-border);
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}

.upload-area:hover {
  border-color: var(--green-bright);
  background: rgba(34,197,94,0.03);
}

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

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.upload-icon {
  font-size: 1.5rem;
  color: var(--gray);
}

.upload-label span:nth-child(2) {
  font-size: 0.875rem;
  color: var(--gray-light);
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--gray);
}

/* PEOPLE EDITOR */
.city-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.city-tab {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--navy-border);
  color: var(--gray);
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.city-tab:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.city-tab.active {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.4);
  color: var(--green-bright);
}

.people-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.person-edit-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
}

.person-edit-photo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.person-edit-photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--navy-border);
  flex-shrink: 0;
  background: var(--navy-light);
}

.photo-upload-mini {
  position: relative;
  flex: 1;
}

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

.photo-upload-mini-btn {
  display: block;
  background: rgba(255,255,255,0.04);
  border: 1px dashed var(--navy-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--gray);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.photo-upload-mini:hover .photo-upload-mini-btn {
  border-color: var(--green-bright);
  color: var(--green-bright);
}

.person-edit-card .edit-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--white);
  font-size: 0.875rem;
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.person-edit-card .edit-input:focus {
  border-color: var(--green-bright);
}

.person-edit-card .edit-input:last-of-type {
  margin-bottom: 0;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(239,68,68,0.1);
  border: none;
  color: #fca5a5;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-btn:hover { background: rgba(239,68,68,0.25); }

/* PARTNER EDITOR */
.partner-edit-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.partner-logo-preview {
  width: 100%;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
  padding: 4px;
}

/* BUTTONS */
.save-btn {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.save-btn:hover { background: var(--green-bright); }

.primary-save {
  padding: 12px 32px;
  font-size: 1rem;
}

.add-btn {
  background: rgba(34,197,94,0.08);
  border: 1px dashed rgba(34,197,94,0.4);
  color: var(--green-bright);
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 12px;
}

.add-btn:hover {
  background: rgba(34,197,94,0.15);
}

/* REGISTRATIONS */
.reg-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.reg-count {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gray-light);
  font-size: 0.9rem;
  flex: 1;
}

.export-btn {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: #93c5fd;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.export-btn:hover { background: rgba(59,130,246,0.2); }

.clear-btn {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-btn:hover { background: rgba(239,68,68,0.2); }

.reg-table-wrap {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  overflow: hidden;
}

.reg-table {
  width: 100%;
  border-collapse: collapse;
}

.reg-table th {
  background: rgba(255,255,255,0.04);
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  border-bottom: 1px solid var(--navy-border);
}

.reg-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--gray-light);
}

.reg-table tr:last-child td { border-bottom: none; }

.reg-table tr:hover td {
  background: rgba(255,255,255,0.02);
  color: var(--white);
}

.reg-table td:first-child { color: var(--gray); }

.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.role-badge.startup { background: rgba(34,197,94,0.1); color: var(--green-bright); }
.role-badge.mentor { background: rgba(59,130,246,0.1); color: #93c5fd; }
.role-badge.participant { background: rgba(212,175,55,0.1); color: #fcd34d; }

.reg-empty {
  padding: 48px;
  text-align: center;
  color: var(--gray);
  font-size: 0.875rem;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy-light);
  border: 1px solid rgba(34,197,94,0.4);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.toast.error {
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.1);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .crm-sidebar { width: 200px; }
  .crm-main { margin-left: 200px; }
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
  .dash-info { grid-template-columns: 1fr; }
  .branding-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .crm-sidebar { display: none; }
  .crm-main { margin-left: 0; }
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
}
