/* ═════════════════════════════════════════════════════════════
   File: assets/style.css
   CSS chung cho subdomain admin.hungphuong.edu.vn
   ═════════════════════════════════════════════════════════════ */

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

:root {
  --ink: #0C1A2E;
  --blue: #1B4F8A;
  --blue2: #2563C4;
  --blue-pale: #EFF6FF;
  --gold: #C8973A;
  --gold2: #E0A83E;
  --cream: #F8F6F2;
  --bg: #F5F7FA;
  --text: #1C2B3A;
  --muted: #6B7D8F;
  --border: #DDE4EC;
  --green: #1A7A4A;
  --green-pale: rgba(26,122,74,.09);
  --red: #C0392B;
  --red-pale: rgba(192,57,43,.09);
  --yellow: #B7791F;
  --yellow-pale: #FFF8E7;
  --shadow: 0 2px 8px rgba(12,26,46,.06);
  --shadow-lg: 0 8px 32px rgba(12,26,46,.12);
}

html, body {
  width: 100%; min-height: 100vh;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══ LOGIN PAGE ═══ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--ink) 0%, var(--blue) 100%);
  padding: 20px;
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(200,151,58,.18), transparent 70%);
}
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  position: relative;
}
.login-logo {
  text-align: center; margin-bottom: 24px;
}
.login-logo img {
  width: 64px; height: auto; display: block; margin: 0 auto 12px;
  filter: drop-shadow(0 4px 12px rgba(200,151,58,.3));
}
.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700;
  color: var(--ink); line-height: 1.2;
}
.login-logo p {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 2px;
  margin-top: 4px;
}

/* ═══ FORM ═══ */
.field {
  display: flex; flex-direction: column; gap: 5px;
  margin-bottom: 14px;
}
.field label {
  font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
}
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 14px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,196,.12);
}
.field.error input, .field.error select {
  border-color: var(--red);
}

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: none; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue2); }
.btn-primary:disabled { background: var(--border); cursor: not-allowed; }
.btn-ghost { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: #fff; border-color: var(--blue); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a3271c; }
.btn-success { background: var(--green); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ ALERTS ═══ */
.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: var(--red-pale); color: var(--red); border-left: 3px solid var(--red); }
.alert-success { background: var(--green-pale); color: var(--green); border-left: 3px solid var(--green); }
.alert-warning { background: var(--yellow-pale); color: var(--yellow); border-left: 3px solid var(--gold); }


/* ═══════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════ */
.app {
  display: flex; min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 240px;
  background: var(--ink);
  color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 10;
}
.sidebar-head {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-head img { width: 32px; height: auto; }
.sidebar-head .name {
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 700; color: var(--gold2);
  line-height: 1.1;
}
.sidebar-head .sub {
  font-size: 9px; color: rgba(255,255,255,.4);
  text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}
.nav-group-title {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.35);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px;
  color: rgba(255,255,255,.7);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
  transition: all .12s;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.nav-item.active {
  background: var(--blue);
  color: #fff;
}
.nav-item .icon {
  font-size: 15px; width: 20px; text-align: center;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--ink);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 100px;
}

.sidebar-foot {
  padding: 14px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--blue); color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .name {
  font-size: 13px; font-weight: 600;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-info .role {
  font-size: 10px;
  color: rgba(255,255,255,.5);
  text-transform: uppercase; letter-spacing: .5px;
}
.user-menu-btn {
  background: none; border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer; padding: 6px;
  font-size: 16px;
  border-radius: 6px;
}
.user-menu-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ── MAIN CONTENT ── */
.main {
  margin-left: 240px;
  flex: 1;
  padding: 24px 28px;
  min-height: 100vh;
}
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.page-head h1 {
  font-family: 'Playfair Display', serif;
  font-size: 24px; font-weight: 700; color: var(--ink);
}
.page-head .sub {
  font-size: 13px; color: var(--muted); margin-top: 2px;
}
.page-head-actions { display: flex; gap: 8px; }

/* ── CARDS ── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 {
  font-size: 14px; font-weight: 700;
  color: var(--ink);
}
.card-body { padding: 18px 20px; }

/* ── STATS GRID ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
}
.stat-card .icon {
  position: absolute; top: 18px; right: 18px;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 16px;
}
.stat-card .lbl {
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.stat-card .num {
  font-size: 28px; font-weight: 700;
  color: var(--ink);
  margin-top: 6px; line-height: 1;
}
.stat-card .delta {
  font-size: 11px;
  margin-top: 6px;
  color: var(--muted);
}

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty .icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty p { font-size: 14px; }


/* ═══ MODAL ═══ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(12,26,46,.4);
  z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } }
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.modal-close {
  background: none; border: none;
  color: var(--muted);
  font-size: 20px; cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 8px;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 18px 22px; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}


/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .mobile-menu-btn { display: block !important; }
}
.mobile-menu-btn {
  display: none;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  font-size: 16px; cursor: pointer;
}
