/* ===== AbdiRiset — Design System ===== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --navy-950: #06101f;
  --navy-900: #0a1730;
  --navy-850: #0d1c3a;
  --navy-800: #0f1f3d;
  --navy-700: #16294d;
  --navy-600: #1e3560;
  --line: #24365c;
  --line-soft: #1b2b4d;
  --blue: #2f6bff;
  --blue-soft: #1971c2;
  --gold: #e7b64b;
  --gold-2: #f2cd77;
  --text: #eef3ff;
  --muted: #9db0d6;
  --muted-2: #6f83ab;
  --ok: #37b24d;
  --ok-bg: rgba(55,178,77,.15);
  --warn: #f08c00;
  --warn-bg: rgba(240,140,0,.15);
  --danger: #fa5252;
  --danger-bg: rgba(250,82,82,.15);
  --info: #4dabf7;
  --info-bg: rgba(77,171,247,.15);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 30px rgba(0,0,0,.28);
}

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

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(47,107,255,.20), transparent 60%),
    radial-gradient(900px 520px at 0% 108%, rgba(231,182,75,.10), transparent 55%),
    var(--navy-900);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== Logo ===== */
.logo, .logo-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: .5px;
  color: #0a1730;
  background: linear-gradient(140deg, var(--gold-2), var(--gold));
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(231,182,75,.3);
}
.logo { width: 76px; height: 76px; font-size: 30px; border-radius: 20px; }
.logo-sm { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }

/* ===== AUTH / LOGIN ===== */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-brand {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  background:
    linear-gradient(160deg, rgba(15,31,61,.6), rgba(6,16,31,.85)),
    radial-gradient(600px 400px at 20% 20%, rgba(47,107,255,.22), transparent 60%);
  border-right: 1px solid var(--line-soft);
}
.auth-brand h1 {
  font-size: 44px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1.05;
}
.auth-brand .sub { color: var(--muted); font-size: 16px; max-width: 40ch; }
.auth-brand .tagline { font-size: 26px; font-weight: 700; line-height: 1.3; margin-top: 6px; }
.auth-brand .tagline span { color: var(--gold-2); }
.features { list-style: none; display: grid; gap: 12px; margin-top: 10px; max-width: 420px; }
.features li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(22,41,77,.55);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.features li .ic {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  background: rgba(47,107,255,.16);
  border-radius: 8px; font-size: 15px;
}
.features li b { display: block; font-size: 14px; }
.features li small { color: var(--muted); font-size: 12px; }

.auth-panel { display: grid; place-items: center; padding: 40px; }
.login-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card .logo { margin: 0 auto 18px; }
.login-card h2 { font-size: 22px; }
.login-card .desc { color: var(--muted); font-size: 14px; margin: 6px 0 26px; }
.google-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 16px;
  border: none; border-radius: 12px;
  background: #fff; color: #1f2937;
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: filter .15s, transform .05s;
}
.google-btn:hover { filter: brightness(.97); }
.google-btn:active { transform: translateY(1px); }
.google-btn .g {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center; font-weight: 800;
  background: conic-gradient(from -45deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0 100%);
  border-radius: 50%; color: transparent;
  -webkit-mask: radial-gradient(circle 4px at center, transparent 98%, #000 100%);
}
.login-card .hint { display: block; margin-top: 16px; color: var(--muted); font-size: 13px; }
.login-card .hint b { color: var(--gold-2); }

/* ===== APP SHELL ===== */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--navy-850), var(--navy-950));
  border-right: 1px solid var(--line-soft);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; font-weight: 700; font-size: 18px; }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a .ic { width: 20px; text-align: center; }
.nav a:hover { background: rgba(47,107,255,.10); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(231,182,75,.18), rgba(231,182,75,.04)); color: var(--gold-2); border: 1px solid rgba(231,182,75,.25); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-top: 1px solid var(--line-soft); }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: #0a1730; background: linear-gradient(140deg, var(--gold-2), var(--gold)); font-size: 14px; }
.side-foot .who { line-height: 1.2; overflow: hidden; }
.side-foot .who b { font-size: 13px; display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.side-foot .who small { color: var(--muted); font-size: 11px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10,23,48,.6);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.topbar .crumb { color: var(--muted); font-size: 13px; }
.topbar .right { display: flex; align-items: center; gap: 12px; }

.content { padding: 28px; display: grid; gap: 24px; max-width: 1120px; width: 100%; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: none; border-radius: 10px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  text-decoration: none;
  transition: filter .15s, transform .05s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #0a1730; }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--blue); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

/* ===== Stat cards ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat .ic { width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.stat .ic.i-blue { background: var(--info-bg); }
.stat .ic.i-gold { background: var(--warn-bg); }
.stat .ic.i-green { background: var(--ok-bg); }
.stat .ic.i-red { background: var(--danger-bg); }
.stat .num { font-size: 26px; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ===== Card / panel ===== */
.card {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { font-size: 17px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 13px; }

/* ===== Table ===== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted-2); font-weight: 600; padding: 0 14px 12px;
  border-bottom: 1px solid var(--line);
}
.tbl td { padding: 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(47,107,255,.05); }
.tbl .judul { font-weight: 600; }
.tbl .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tag-jenis { font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 600; }
.tag-jenis.penelitian { background: var(--info-bg); color: var(--info); }
.tag-jenis.pengabdian { background: rgba(180,120,255,.16); color: #b487ff; }

/* ===== Badge ===== */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.diajukan { background: var(--info-bg); color: var(--info); }
.badge.direview { background: var(--warn-bg); color: var(--warn); }
.badge.revisi { background: var(--danger-bg); color: var(--danger); }
.badge.diterima { background: var(--ok-bg); color: var(--ok); }

/* ===== Filter tabs ===== */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--navy-600); color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: rgba(231,182,75,.16); color: var(--gold-2); border-color: rgba(231,182,75,.4); }

/* ===== Template grid ===== */
.grid-templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tpl {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.tpl .file-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--danger-bg); }
.tpl h3 { font-size: 15px; font-weight: 700; }
.tpl p { color: var(--muted); font-size: 13px; flex: 1; }
.tpl .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.tpl .ext { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ===== Form ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--navy-600); color: var(--text);
  font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.22); }
.dropzone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); background: rgba(30,53,96,.35); }
.dropzone b { color: var(--text); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ===== Empty ===== */
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-templates { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats, .grid-templates { grid-template-columns: 1fr 1fr; }
  .tbl-wrap { overflow-x: auto; }
}
@media (max-width: 480px) {
  .stats, .grid-templates { grid-template-columns: 1fr; }
}

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(3, 8, 20, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50;
}
.modal[hidden] { display: none; }
.modal .card { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; }
.modal .card.wide { max-width: 640px; }
.info-row { font-size: 14px; }
.info-row b { color: var(--text); }
.muted { color: var(--muted); }
.spinner { text-align: center; color: var(--muted); padding: 30px; }
.hidden { display: none !important; }
.card-head .btn-sm { flex: none; }
