/* ============================================================
   PROXILY ADMIN — admin.css
   ============================================================ */

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

:root {
  --bg:       #F5F4F0;
  --bg-2:     #EEECEA;
  --bg-card:  #FFFFFF;
  --green:    #6BBF3E;
  --green-dim: rgba(107,191,62,0.12);
  --amber:    #F0A500;
  --red:      #E53E3E;
  --blue:     #3B82F6;
  --purple:   #8B5CF6;
  --text:     #1C1C1A;
  --muted:    rgba(0,0,0,0.45);
  --border:   rgba(0,0,0,0.08);
  --sidebar-w: 220px;
  --radius:   10px;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── LOGIN ──────────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 380px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.login-logo { margin-bottom: 24px; display: flex; justify-content: center; }

.login-box h1 {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.login-box > p { color: var(--muted); margin-bottom: 28px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }

.lfield { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.lfield label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.lfield input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  background: var(--bg);
  transition: border-color 0.2s;
}
.lfield input:focus { border-color: var(--green); }

.btn-login {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s;
}
.btn-login:hover { background: #57a82e; }

.login-error { color: var(--red); font-size: 0.82rem; min-height: 18px; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
#admin-app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: #1A1A1A;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.55);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0;
  transition: all 0.18s;
  cursor: pointer;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-item.active { color: var(--green); background: rgba(107,191,62,0.1); border-right: 2px solid var(--green); }

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

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

.btn-logout {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  padding: 8px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.18s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

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

/* ─── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.btn-refresh {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.18s;
}
.btn-refresh:hover { border-color: var(--green); color: var(--green); }

.admin-badge {
  background: var(--green-dim);
  color: var(--green);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── VIEWS ──────────────────────────────────────────────── */
.view { display: none; padding: 28px; }
.view.active { display: block; }

/* ─── STATS ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon.green { background: rgba(107,191,62,0.12); }
.stat-icon.blue { background: rgba(59,130,246,0.12); }
.stat-icon.amber { background: rgba(240,165,0,0.12); }
.stat-icon.purple { background: rgba(139,92,246,0.12); }

.stat-num { font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ─── DASH GRID ──────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.dash-card h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; color: var(--text); font-family: 'DM Sans', sans-serif; }

/* ─── BAR CHART ──────────────────────────────────────────── */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 0.78rem; color: var(--muted); width: 90px; flex-shrink: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.bar-track { flex: 1; height: 8px; background: var(--bg-2); border-radius: 100px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 100px; transition: width 0.4s ease; }
.bar-val { font-size: 0.78rem; font-weight: 600; width: 28px; text-align: right; }

/* ─── MINI TABLE ─────────────────────────────────────────── */
.mini-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.mini-table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.mini-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); }
.mini-table tr:last-child td { border-bottom: none; }

/* ─── TABLE CONTROLS ─────────────────────────────────────── */
.table-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  background: var(--bg-card);
  flex: 1;
  min-width: 200px;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--green); }

.filter-select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  background: var(--bg-card);
  cursor: pointer;
}

.result-count { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* ─── DATA TABLE ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 900px; }

.data-table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table th:hover { color: var(--text); }

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

.desc-cell { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── BADGES ─────────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.role-seeker { background: rgba(59,130,246,0.1); color: var(--blue); }
.role-provider { background: rgba(240,165,0,0.1); color: var(--amber); }
.role-both { background: rgba(139,92,246,0.1); color: var(--purple); }

.lang-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-2);
  color: var(--muted);
}

.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  background: var(--green-dim);
  color: var(--green);
  font-weight: 600;
}

.check { color: var(--green); font-weight: 700; }
.cross { color: var(--muted); }

.email-link { color: var(--blue); text-decoration: none; }
.email-link:hover { text-decoration: underline; }

/* ─── ACTIONS ────────────────────────────────────────────── */
.actions { display: flex; gap: 6px; white-space: nowrap; }

.btn-edit, .btn-del {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.btn-edit:hover { border-color: var(--blue); background: rgba(59,130,246,0.08); }
.btn-del:hover { border-color: var(--red); background: rgba(229,62,62,0.08); }

/* ─── CITIES ─────────────────────────────────────────────── */
.cities-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.city-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  transition: border-color 0.18s;
}
.city-card:hover { border-color: var(--green); }
.city-name { font-weight: 600; margin-bottom: 10px; font-size: 0.9rem; }
.city-stats { display: flex; flex-direction: column; gap: 4px; }
.city-total { font-size: 0.8rem; color: var(--muted); }
.city-seeker { font-size: 0.78rem; color: var(--blue); }
.city-provider { font-size: 0.78rem; color: var(--amber); }

/* ─── EXPORT ─────────────────────────────────────────────── */
.export-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 700px;
}
.export-box h3 { font-size: 1.1rem; margin-bottom: 8px; }
.export-box > p { color: var(--muted); margin-bottom: 24px; }

.export-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.export-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.export-card:hover { border-color: var(--green); background: var(--green-dim); }
.export-icon { font-size: 1.8rem; }
.export-card strong { font-size: 0.85rem; display: block; }
.export-card span { font-size: 0.75rem; color: var(--muted); }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: 14px;
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.22s ease;
}
.modal-sm { width: 420px; }

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  transition: color 0.18s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px 24px; }
.modal-body p { color: var(--muted); font-size: 0.9rem; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.mfield { display: flex; flex-direction: column; gap: 5px; }
.mfield.full { grid-column: 1 / -1; }
.mfield label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.mfield input, .mfield select, .mfield textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  background: var(--bg);
  transition: border-color 0.18s;
}
.mfield input:focus, .mfield select:focus, .mfield textarea:focus { border-color: var(--green); }
.mfield textarea { resize: vertical; min-height: 70px; }

.btn-cancel {
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-cancel:hover { border-color: var(--muted); }

.btn-save {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}
.btn-save:hover { background: #57a82e; }

.btn-delete {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}
.btn-delete:hover { background: #c53030; }

/* ─── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #1A1A1A; color: #fff; }
.toast.error { background: var(--red); color: #fff; }

/* ─── MISC ───────────────────────────────────────────────── */
.loading { text-align: center; color: var(--muted); padding: 24px; font-style: italic; }
.no-data { text-align: center; color: var(--muted); padding: 24px; }
