:root {
  --navy: #0f1b3d;
  --navy-light: #16234d;
  --blue: #2563eb;
  --green: #16a34a;
  --purple: #7c3aed;
  --orange: #f59e0b;
  --bg: #f3f5fb;
}

* { box-sizing: border-box; }
body {
  font-family: 'Khmer OS Battambang', 'Noto Sans Khmer', system-ui, sans-serif;
  background: var(--bg);
  margin: 0;
}

.kh { font-family: 'Khmer OS Battambang', 'Noto Sans Khmer', sans-serif; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--navy);
  color: #cdd5e8;
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
}
.sidebar .logo-box {
  padding: 24px 18px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar .logo-box img { width: 56px; height: 56px; margin-bottom: 10px; }
.sidebar nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: #cdd5e8; text-decoration: none; font-size: 14.5px;
  margin-bottom: 4px;
  transition: background .15s;
}
.sidebar a:hover { background: rgba(255,255,255,0.08); }
.sidebar a.active { background: var(--blue); color: #fff; }
.sidebar .user-box {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}

.main { margin-left: 260px; padding: 24px 28px; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}

.stat-card {
  border-radius: 16px; padding: 18px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex; gap: 14px; align-items: flex-start;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; flex-shrink: 0;
}
.card {
  background: #fff; border-radius: 16px; padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.badge {
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; font-size: 14px;
  border: none; cursor: pointer; font-weight: 600;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: #fff; border: 1px solid #d1d5db; color: #374151; }
.btn-outline:hover { background: #f9fafb; }
.btn-danger { background: #fee2e2; color: #b91c1c; }

input, select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid #d1d5db; font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }

label { font-size: 13.5px; font-weight: 600; color: #374151; display:block; margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th { text-align: left; padding: 10px 12px; color: #6b7280; font-weight: 600; border-bottom: 1px solid #e5e7eb; }
table td { padding: 10px 12px; border-bottom: 1px solid #f1f2f6; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal-box {
  background: #fff; border-radius: 16px; padding: 24px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
}

.field-group {
  border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; margin-bottom: 12px;
  background: #fafbff;
}
