/* ============================================================
   NEXORA — tema platform
   One Platform. Endless Possibilities.
   Dipakai halaman portal (login, beranda modul, pengguna).
   ============================================================ */
:root {
  --ink: #1F1B3A;
  --muted: #635F82;
  --primary: #4F46E5;
  --violet: #8B5CF6;
  --grad: linear-gradient(135deg, #4F46E5, #8B5CF6);
  --grad-soft: linear-gradient(135deg, rgba(79,70,229,.10), rgba(139,92,246,.10));
  --bg: #F3F0FF;
  --glass: rgba(255,255,255,.60);
  --glass-strong: rgba(255,255,255,.80);
  --border: rgba(255,255,255,.8);
  --line: rgba(31,27,58,.10);
  --shadow: 0 12px 38px rgba(79,70,229,.12);
  --shadow-lg: 0 22px 60px rgba(79,70,229,.18);
  --radius: 16px;
  --green: #10B981;
  --amber: #F59E0B;
  --red: #EF4444;
  --sidebar-w: 268px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(720px 460px at 8% -6%, rgba(79,70,229,.20), transparent 70%),
    radial-gradient(620px 420px at 100% 0%, rgba(139,92,246,.18), transparent 72%),
    radial-gradient(560px 420px at 50% 108%, rgba(14,165,233,.14), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; opacity: .88; }

/* ---------- kartu kaca ---------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card-pad { padding: 22px; }
.muted { color: var(--muted); }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; background: var(--glass-strong); color: var(--ink);
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: .16s ease; text-decoration: none;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 22px rgba(99,102,241,.30); }
.btn-outline { background: rgba(255,255,255,.45); border-color: rgba(79,70,229,.35); color: var(--primary); }
.btn-danger { background: rgba(239,68,68,.12); color: #B91C1C; border-color: rgba(239,68,68,.25); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- form ---------- */
label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%; padding: 11px 13px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: rgba(255,255,255,.82); border: 1px solid rgba(31,27,58,.14); border-radius: 12px;
  outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(79,70,229,.55); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.form-grid > * { min-width: 0; }
.field { display: flex; flex-direction: column; }

/* ---------- flash ---------- */
.flash { display: block; padding: 12px 15px; border-radius: 12px; font-size: 13.5px; margin-bottom: 18px; border: 1px solid transparent; }
.flash-success { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.30); color: #047857; }
.flash-error   { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.30);  color: #B91C1C; }
.flash-info    { background: rgba(79,70,229,.10);  border-color: rgba(79,70,229,.28);  color: #3730A3; }

/* ---------- label kecil ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-soft { background: rgba(255,255,255,.72); border: 1px solid var(--line); color: var(--muted); }
.badge-ok   { background: rgba(16,185,129,.16); color: #047857; }
.badge-off  { background: rgba(239,68,68,.14); color: #B91C1C; }
.badge-role { background: var(--grad-soft); color: var(--primary); }

/* ============================================================
   Halaman login
   ============================================================ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.login-card { width: 100%; max-width: 430px; padding: 34px 30px; }
.login-logo {
  width: 62px; height: 62px; border-radius: 19px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 27px; font-weight: 800; letter-spacing: -.5px;
  box-shadow: 0 14px 32px rgba(79,70,229,.34); margin-bottom: 18px;
}
.login-title { font-size: 25px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.login-sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 24px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.7; }

/* ============================================================
   Layout aplikasi
   ============================================================ */
.app { display: flex; min-height: 100vh; align-items: flex-start; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: rgba(255,255,255,.66); backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-right: 1px solid var(--border); padding: 22px 16px; display: flex; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 18px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 19px; box-shadow: 0 10px 22px rgba(79,70,229,.30);
}
.brand-txt b { display: block; font-size: 15px; letter-spacing: .3px; }
.brand-txt span { display: block; font-size: 11.5px; color: var(--muted); }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); padding: 16px 10px 7px; font-weight: 700; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink); font-size: 13.5px; font-weight: 500; margin-bottom: 3px; transition: .14s;
}
.nav-link:hover { background: rgba(255,255,255,.75); }
.nav-link.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 8px 18px rgba(99,102,241,.30); }
.sidebar-foot { margin-top: auto; padding: 16px 10px 4px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); line-height: 1.7; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 15px 26px; background: rgba(255,255,255,.62);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: -.2px; }
.topbar h1 small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.topbar .actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.content { padding: 26px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h2 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.crumb { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- hero beranda ---------- */
.hero {
  border-radius: 20px; padding: 30px 32px; margin-bottom: 28px; color: #fff;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 55%, #A855F7 100%);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.6px; }
.hero p { margin: 0; opacity: .92; font-size: 13.5px; }
.hero .tagline { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; opacity: .8; margin-bottom: 10px; font-weight: 700; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.chip { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); padding: 5px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }

/* ---------- kartu modul ---------- */
.modul-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 22px; }
.modul-card {
  position: relative; background: var(--glass); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px; box-shadow: var(--shadow); backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex; flex-direction: column; gap: 12px; overflow: hidden; transition: .18s ease;
}
.modul-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--nx, var(--grad)); }
.modul-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.modul-ico {
  width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 24px;
  background: var(--nx-soft, var(--grad-soft)); border: 1px solid rgba(255,255,255,.7);
}
.modul-card h3 { margin: 0; font-size: 16.5px; letter-spacing: -.2px; }
.modul-card p { margin: 0; font-size: 12.5px; color: var(--muted); flex: 1; }
.modul-card .foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.pill-role { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--nx, var(--grad)); color: #fff; }

/* ---------- tabel ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
table.tbl tr:last-child td { border-bottom: 0; }
select.sel-peran { min-width: 190px; padding: 8px 10px; font-size: 12.5px; border-radius: 10px; }

/* ---------- footer ---------- */
.app-footer { margin-top: auto; padding: 22px 26px 26px; text-align: center; font-size: 11.5px; color: var(--muted); }
.app-footer .af-line { line-height: 1.7; }
.app-footer .af-line:first-child { font-weight: 700; letter-spacing: .8px; color: var(--ink); }

/* ---------- mobile ---------- */
.btn-menu { display: none; }
@media (max-width: 900px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; transform: translateX(-102%); transition: .22s ease;
    width: 280px; box-shadow: 0 20px 50px rgba(31,27,58,.22); z-index: 60;
  }
  body.sidebar-open .sidebar { transform: none; }
  .btn-menu { display: inline-flex; }
  .content { padding: 18px 15px; }
  .topbar { padding: 13px 15px; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 21px; }
  .modul-grid { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 18px; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 480px) {
  .login-card { padding: 26px 20px; }
}
