/* EduHub Dashboard — Design System Biru & Orens */
:root {
  --primary: #0D47A1;
  --primary-2: #1E88E5;
  --accent: #FF6F00;
  --accent-2: #FF8F00;
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --text: #1C2A3A;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 30px -10px rgba(13, 71, 161, 0.18);
  --radius: 14px;
}

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

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary-2); text-decoration: none; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0D47A1 0%, #1E88E5 55%, #FF8F00 130%);
}
.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
}
.login-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
  margin: 0 auto 16px;
}
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  transition: border .15s, box-shadow .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.18);
}
.btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-2); }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-2); }
.error-box {
  display: none;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.error-box.show { display: block; }

/* ---------- Dashboard layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--primary);
  color: #fff;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 17px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  margin-bottom: 12px;
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary-2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.82);
  cursor: pointer;
  font-weight: 600; font-size: 14px;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.10); }
.nav-item.active { background: var(--accent); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar .user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.role-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  background: rgba(255, 111, 0, 0.14); color: var(--accent);
}
.logout {
  background: #fef2f2; color: #b91c1c;
  border: 1px solid #fecaca; border-radius: 9px;
  padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer;
}

.content { padding: 26px 28px; display: flex; flex-direction: column; gap: 22px; }
.section-title { font-size: 18px; font-weight: 800; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-2);
}
.stat-card.orange { border-left-color: var(--accent); }
.stat-card .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat-card .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Panels */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel h3 { font-size: 15px; margin-bottom: 14px; }

/* Bars chart */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 90px; align-items: center; gap: 12px; }
.bar-row .name { font-size: 13px; font-weight: 600; }
.bar-track { background: #eef2f7; border-radius: 8px; height: 18px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--primary-2), var(--accent-2));
  transition: width .4s ease;
}
.bar-row .val { font-size: 13px; font-weight: 700; text-align: right; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 11px 12px;
  background: #f1f5f9; color: var(--muted);
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .3px;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
tr:hover td { background: #f8fafc; }
.tag {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.tag.dasar { background: rgba(30,136,229,0.12); color: var(--primary-2); }
.tag.lanjutan { background: rgba(255,111,0,0.14); color: var(--accent); }
.tag.admin { background: rgba(255,111,0,0.14); color: var(--accent); }
.tag.staff { background: rgba(30,136,229,0.12); color: var(--primary-2); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-right { text-align: right; }
.section { display: none; }
.section.active { display: flex; flex-direction: column; gap: 22px; }
.hidden { display: none; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 70px; padding: 16px 8px; }
  .sidebar .brand span, .nav-item span { display: none; }
  .nav-item { justify-content: center; }
}

/* ---------- Modal, forms, action buttons ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn-sm { width: auto; padding: 9px 16px; font-size: 13px; }
.mini {
  border: 1px solid var(--border); background: #fff; color: var(--primary);
  border-radius: 7px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.mini:hover { background: #f1f5f9; }
.mini.danger { color: #b91c1c; border-color: #fecaca; }
.mini.danger:hover { background: #fef2f2; }
.nowrap { white-space: nowrap; }
.field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 15px; background: #fff;
}
.field select:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(30,136,229,0.18); }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13, 42, 74, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 540px;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 25px 60px -10px rgba(0,0,0,0.4);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff;
}
.modal-head h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Calendar ---------- */
.calendar-layout { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.calendar-side { position: sticky; top: 70px; }
.month-list { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.month-btn {
  text-align: left; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
}
.month-btn:hover { background: #f1f5f9; }
.month-btn.active { background: var(--primary); color: #fff; }
.calendar-main { min-width: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h3 { font-size: 16px; }
.nav-btn2 {
  background: #fff; border: 1px solid var(--border); color: var(--primary);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 700;
}
.nav-btn2:hover { background: var(--primary); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 92px; background: #fbfcfe; border: 1px solid var(--border); border-radius: 8px;
  padding: 5px; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-dow {
  min-height: auto; background: transparent; border: none; font-weight: 700; font-size: 11px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .3px; text-align: center; padding: 4px 0;
}
.cal-daynum { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-event {
  font-size: 10.5px; line-height: 1.3; border-radius: 6px; padding: 4px 6px;
  color: #fff; cursor: pointer; border-left: 3px solid rgba(255,255,255,0.6);
}
.cal-event.low { background: #e11d48; }
.cal-event.mid { background: #d97706; }
.cal-event.full { background: #16a34a; }
.cal-badge { display: block; margin-top: 2px; font-weight: 700; font-size: 9.5px; opacity: .95; }
@media (max-width: 900px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-side { position: static; }
}

/* ---------- Chat widget ---------- */
.chat-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 90;
  width: 58px; height: 58px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 24px; cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(255, 111, 0, 0.5);
  transition: transform .15s;
}
.chat-fab:hover { transform: scale(1.07); }
.chat-panel {
  position: fixed; bottom: 90px; right: 22px; z-index: 90;
  width: 360px; max-width: calc(100vw - 44px); height: 480px; max-height: 70vh;
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 25px 60px -10px rgba(0,0,0,0.35);
  border: 1px solid var(--border);
}
.chat-panel.hidden { display: none; }
.chat-head {
  background: var(--primary); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
}
.chat-avatar { margin-right: 6px; }
.chat-close { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; }
.chat-body {
  flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  background: #f8fafc;
}
.msg { max-width: 82%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: #fff; }
.chat-input input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 20px; font-size: 14px;
}
.chat-input input:focus { outline: none; border-color: var(--primary-2); }
.chat-input button {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--accent); color: #fff;
  font-size: 16px; cursor: pointer;
}
.chat-input button:hover { background: var(--accent-2); }
.typing { color: var(--muted); font-size: 12px; }

/* ---------- Login split (EDUKASIH) ---------- */
.login-split { display: flex; min-height: 100vh; }
.login-visual {
  flex: 1.1; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #0D47A1 0%, #1E88E5 55%, #FF8F00 135%);
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.visual-glow {
  position: absolute; width: 440px; height: 440px; border-radius: 50%;
  background: rgba(255,255,255,0.12); filter: blur(40px); top: -90px; right: -60px;
}
.visual-content { position: relative; text-align: center; color: #fff; z-index: 2; }
.big-logo { font-size: 72px; line-height: 1; }
.brand-name { font-size: 46px; font-weight: 800; letter-spacing: 3px; margin: 12px 0 6px; }
.tagline { font-size: 15px; color: rgba(255,255,255,0.88); max-width: 400px; margin: 0 auto 22px; line-height: 1.6; }
.visual-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 30px; padding: 7px 14px; font-size: 13px; font-weight: 600;
}
.login-form-side {
  flex: 0.9; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
@media (max-width: 860px) {
  .login-split { flex-direction: column; }
  .login-visual { flex: none; min-height: 210px; padding: 24px; }
  .big-logo { font-size: 44px; }
  .brand-name { font-size: 28px; }
  .visual-chips { display: none; }
}
