:root {
  --navy: #1f3864;
  --navy-light: #2c4a80;
  --gold: #b08d3e;
  --green: #2e7d32;
  --red: #c0392b;
  --bg: #f4f6f9;
  --border: #e1e5ea;
  --text: #223;
  --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; }
.brand-badge { background: var(--gold); color: #fff; padding: .2rem .5rem; border-radius: 6px; font-size: .8rem; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { color: #dfe7f5; text-decoration: none; font-size: .92rem; }
.nav a:hover { color: #fff; text-decoration: underline; }
.nav-user { color: #b9c6e0; font-size: .85rem; }
.btn-logout { background: rgba(255,255,255,.15); padding: .3rem .7rem; border-radius: 6px; }

.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

h1 { font-size: 1.6rem; color: var(--navy); margin: .2rem 0 1rem; }
h2 { font-size: 1.2rem; color: var(--navy); }
h3 { font-size: 1.05rem; color: var(--navy); margin-top: 0; }
.muted { color: var(--muted); }
.eyebrow { color: var(--gold); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .88rem; margin: .7rem 0 .3rem; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
}
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-block;
  padding: .55rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: .8rem;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary { background: #e5e9f0; color: var(--navy); }
.btn-danger { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; margin-top: 0; }

.inline-form { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.inline-form input { width: auto; flex: 1; min-width: 120px; }

/* Alerts */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; }
.alert-success { background: #e6f4ea; color: #1e5e2f; border: 1px solid #b7dfc2; }
.alert-error { background: #fdecea; color: #8a2418; border: 1px solid #f3c2bb; }

/* Login */
.login-wrap { display: flex; justify-content: center; padding-top: 2rem; }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 2rem; max-width: 380px; width: 100%; box-shadow: 0 6px 20px rgba(0,0,0,.05); }
.login-card h1 { margin-bottom: .2rem; }
.demo-box { margin-top: 1.5rem; background: #f6f8fb; border-radius: 8px; padding: .8rem 1rem; font-size: .82rem; color: var(--muted); }
.demo-box ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.demo-box code { background: #e9edf3; padding: 1px 5px; border-radius: 4px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.stat-label { color: var(--muted); font-size: .85rem; margin-top: .2rem; }

/* Cards grid (courses) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.card-item { display: block; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; border-top: 4px solid var(--gold); }
.card-item:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.card-code { color: var(--gold); font-weight: 700; font-size: .8rem; text-transform: uppercase; }
.card-title { font-weight: 700; color: var(--navy); margin: .3rem 0; }
.card-sub { color: var(--muted); font-size: .85rem; }

/* Tabs */
.tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--border); margin: 1.2rem 0 1.2rem; flex-wrap: wrap; }
.tab-btn { background: none; border: none; padding: .6rem 1rem; font-size: .92rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel.hidden { display: none; }
.hidden { display: none !important; }

/* Panels */
.panel { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.panel > summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.panel-sm { background: #f8fafc; border: 1px dashed var(--border); border-radius: 8px; padding: .6rem .9rem; margin-top: .7rem; }
.panel-sm > summary { cursor: pointer; font-weight: 600; font-size: .87rem; color: var(--navy); }

/* List items (materi/tugas/pengumuman) */
.list-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.list-item-title { font-weight: 700; color: var(--navy); font-size: 1.02rem; }
.list-item-meta { color: var(--muted); font-size: .8rem; margin: .15rem 0 .5rem; }
.file-link { display: inline-block; margin-top: .3rem; color: var(--navy); font-size: .88rem; text-decoration: none; background: #eef1f7; padding: .25rem .6rem; border-radius: 6px; }
.file-link:hover { text-decoration: underline; }

.submission-box { background: #f8fafc; border-radius: 8px; padding: .7rem .9rem; margin-top: .6rem; font-size: .9rem; }
.grade-box { margin-top: .4rem; color: var(--green); font-weight: 700; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); text-align: left; font-size: .9rem; }
.table th { background: var(--navy); color: #fff; font-weight: 600; }

.badge { padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #fff; }
.badge-admin { background: var(--red); }
.badge-dosen { background: var(--gold); }
.badge-mahasiswa { background: var(--green); }

.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 1.5rem 1rem; }
