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

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

:root {
  --bg:           #F1F5F9;
  --white:        #FFFFFF;
  --border:       #E2E8F0;
  --border2:      #CBD5E1;
  --text:         #1E293B;
  --muted:        #64748B;
  --light:        #F8FAFC;
  --accent:       #2563EB;
  --accent-h:     #1D4ED8;
  --accent-bg:    #EFF6FF;
  --success:      #16A34A;
  --success-bg:   #F0FDF4;
  --success-b:    #86EFAC;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --danger-b:     #FCA5A5;
  --warning:      #D97706;
  --warning-bg:   #FFFBEB;
  --warning-b:    #FDE68A;
  --radius:       8px;
  --shadow:       0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08);
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ── NAVBAR ── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-brand { font-weight: 700; font-size: 17px; color: var(--text); }
.nav-brand span { color: var(--accent); }

.nav-links { display: flex; gap: 4px; }

.nav-link {
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all .2s;
}
.nav-link:hover { background: var(--light); color: var(--text); }
.nav-link.active { background: var(--accent-bg); color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

.btn-logout {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  display: inline-block;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ── PAGE WRAPPER ── */
.page-wrapper { padding: 28px 32px; max-width: 1140px; margin: 0 auto; }

.page-title { margin-bottom: 24px; }
.page-title h1 { font-size: 20px; font-weight: 600; margin-bottom: 2px; }
.page-title p { color: var(--muted); font-size: 13px; font-weight: 300; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  width: 32px; height: 32px;
  background: var(--accent-bg);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.card-title { font-weight: 600; font-size: 14px; }

.card-body { padding: 24px; }

/* ── FORM ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-control {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-control::placeholder { color: #CBD5E1; }
select.form-control { cursor: pointer; }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--light); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger-sm {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 11px; font-weight: 500;
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid var(--danger-b);
  cursor: pointer; transition: background .2s;
  text-decoration: none;
}
.btn-danger-sm:hover { background: #FEE2E2; }

/* ── ALERTS ── */
.alert {
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: var(--success-bg); border: 1px solid var(--success-b); color: var(--success); }
.alert-danger   { background: var(--danger-bg);  border: 1px solid var(--danger-b);  color: var(--danger); }

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 300; }

/* ── FILTERS ── */
.filters-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── TABLE ── */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table-top {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-top-title { font-weight: 600; font-size: 14px; }
.table-count { font-size: 12px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--light); }
tbody td { padding: 12px 16px; font-size: 13px; vertical-align: middle; }
.cell-name { font-weight: 500; }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.cell-num { color: var(--muted); }

/* ── BADGE ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: #DCFCE7; color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--accent-bg); color: var(--accent); }

/* ── NO DATA ── */
.no-data { text-align: center; padding: 52px 20px; color: var(--muted); }
.no-data-icon { font-size: 36px; margin-bottom: 10px; opacity: .4; }
.no-data-text { font-size: 13px; }

/* ── PHOTO UPLOAD ── */
.photo-upload {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--light);
}
.photo-upload:hover { border-color: var(--accent); background: var(--accent-bg); }
.photo-upload-icon { font-size: 28px; margin-bottom: 8px; }
.photo-upload-text { color: var(--muted); font-size: 13px; }
.photo-upload-text strong { color: var(--accent); }

.photo-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.photo-thumb {
  width: 72px; height: 72px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid var(--border);
}

/* ── LOGIN ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-title span { color: var(--accent); }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; font-weight: 300; }
.login-divider { height: 1px; background: var(--border); margin: 22px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .filters-bar { grid-template-columns: 1fr 1fr; }
  .stats-grid  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .page-wrapper { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters-bar { grid-template-columns: 1fr; }
  .navbar { padding: 0 16px; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
