/* Neko SIA — Sistem Informasi Akademik
   Tema ungu-pink, modern & responsive (mobile + desktop). */

:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --pink: #ec4899;
  --bg: #f5f3ff;
  --card: #ffffff;
  --text: #1e1b2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(30, 27, 46, 0.08), 0 4px 16px rgba(124, 58, 237, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 0.95rem; }
.hidden { display: none !important; }

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(30, 27, 46, 0.35);
  padding: 40px 32px;
  width: 100%; max-width: 400px;
  text-align: center;
}
.login-logo { font-size: 56px; }
.login-card h1 { font-size: 1.5rem; margin: 12px 0 4px; }
.login-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.login-card form { text-align: left; display: flex; flex-direction: column; gap: 14px; }

/* ---------- LAYOUT ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px; font-weight: 700; font-size: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.sidebar-brand .logo { font-size: 28px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 11px 14px; margin: 2px 0;
  border-radius: 10px; border: none; background: transparent;
  color: rgba(255, 255, 255, 0.85); font-size: 0.92rem;
  transition: background 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.22); color: #fff; font-weight: 600; }
.sidebar-user {
  padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar-user .u-name { font-size: 0.85rem; opacity: 0.95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar h2 { font-size: 1.15rem; }
.topbar .sub { color: var(--muted); font-size: 0.8rem; }
.content { padding: 24px; max-width: 1100px; width: 100%; margin: 0 auto; }

/* mobile nav toggle */
.menu-toggle { display: none; background: none; border: none; font-size: 22px; color: var(--text); }

/* ---------- CARD ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px;
  border: 1px solid var(--border);
}
.card h2 { font-size: 1.05rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card h3 { font-size: 0.95rem; margin-bottom: 10px; }

/* ---------- FORMS ---------- */
.form-row { display: flex; flex-wrap: wrap; gap: 14px; }
.form-row > div { flex: 1 1 180px; min-width: 0; }
.form-row > div.full { flex: 1 1 100%; }
label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: #fbfaff; color: var(--text);
  transition: border 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); background: #fff;
}
textarea { resize: vertical; min-height: 70px; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 9px; border: 1px solid transparent;
  font-size: 0.9rem; font-weight: 600; transition: all 0.15s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: #f3f0ff; border-color: var(--primary); }
.btn-danger { background: transparent; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fef2f2; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-export { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.btn-export:hover { background: #d1fae5; }

/* ---------- TABLE ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: #faf8ff; }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- BADGE / CHIP ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-purple { background: #ede9fe; color: var(--primary); }
.badge-pink { background: #fce7f3; color: var(--pink); }
.badge-green { background: #d1fae5; color: #047857; }
.badge-gray { background: #f3f4f6; color: var(--muted); }
.chip { display: inline-block; background: #ede9fe; color: var(--primary); padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; margin: 2px; }

/* ---------- STATS ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.stat-card .num { font-size: 1.9rem; font-weight: 700; color: var(--primary); }
.stat-card .lbl { color: var(--muted); font-size: 0.82rem; }

/* ---------- TABS ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted); font-size: 0.85rem; font-weight: 600;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- QR ---------- */
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px; }
.qr-box canvas { background: #fff; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.qr-code-tag { font-family: monospace; font-size: 1.5rem; font-weight: 700; color: var(--primary); letter-spacing: 3px; }

/* ---------- NOTICE ---------- */
.notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.notice-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.notice-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.notice-warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---------- EMPTY / ITEM ---------- */
.empty-state { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-state .big { font-size: 40px; margin-bottom: 8px; }
.item-list { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.item-title { font-weight: 600; }
.item-sub { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.item-actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(30, 27, 46, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal h3 { margin-bottom: 16px; }
.modal .form-row { margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- CHECK-IN (publik siswa) ---------- */
.checkin-wrap { min-height: 100vh; background: linear-gradient(135deg, #7c3aed, #ec4899); padding: 20px; }
.checkin-card { max-width: 440px; margin: 0 auto; background: #fff; border-radius: 20px; padding: 30px 26px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center; }
.checkin-card .logo { font-size: 52px; }
.checkin-card h1 { font-size: 1.3rem; margin: 8px 0; }
.checkin-card .info { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.checkin-ok { text-align: center; }
.checkin-ok .ok { font-size: 60px; }
.checkin-ok h2 { color: var(--success); margin: 8px 0; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; transition: left 0.25s; z-index: 50; }
  .sidebar.open { left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 16px; }
  .form-row > div { flex: 1 1 100%; }
}
