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

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

:root {
  --green:      #00B087;
  --green-dark: #008f6d;
  --green-light:#EEF9F5;
  --text-dark:  #1A1A1A;
  --text-body:  #555555;
  --text-muted: #888888;
  --bg:         #FFFFFF;
  --bg-sidebar: #F8FFFE;
  --border:     #E5E5E5;
  --shadow:     0 2px 8px rgba(0,0,0,0.08);
  --radius:     6px;
}

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

/* ── Auth pages ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-light);
}

.auth-card {
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,176,135,0.12);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-mark {
  width: 56px;
  height: 56px;
  background: var(--green);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin-bottom: 12px;
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--bg);
  transition: border-color .2s;
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--green);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, opacity .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover { background: var(--green-dark); }

.btn-secondary {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.btn-secondary:hover { background: var(--green-light); }

.btn-danger {
  background: #e53e3e;
  color: #fff;
}
.btn-danger:hover { background: #c53030; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-full { width: 100%; justify-content: center; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #FFF5F5; color: #c53030; border: 1px solid #FED7D7; }
.alert-success { background: #F0FFF4; color: #276749; border: 1px solid #C6F6D5; }

.otp-hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

/* ── App layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}

.sidebar-logo .sub {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-section {
  padding: 12px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.nav-items {
  list-style: none;
  padding: 0 8px;
}

.nav-items li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-body);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.nav-items li a:hover { background: var(--green-light); color: var(--green); }
.nav-items li a.active { background: var(--green-light); color: var(--green); }

.nav-items li a .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  word-break: break-all;
}

.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: #FAFAFA;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
}

/* ── Cards ── */
.card {
  background: var(--bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body { padding: 24px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--green);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

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

thead th {
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--green);
}

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #FAFFFE; }
tbody td { padding: 10px 14px; font-size: 13px; vertical-align: middle; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--green-light);
  color: var(--green-dark);
}

.actions { display: flex; gap: 6px; }

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.show { display: flex; }

.modal {
  background: var(--bg);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.modal-body { padding: 24px; }

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

/* ── Misc ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

.loading {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

.separator { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); font-size: 12px; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
