/* public/css/style.css
   Desain soft & eye-friendly sesuai spesifikasi:
   - Background off-white (bukan putih mutlak), dark mode arang kebiruan
   - Teks charcoal (bukan hitam pekat)
   - Aksen pastel diredam saturasinya (Soft Blue & Mint Green)
   - Font sans-serif bersih, body >=16px, line-height 1.5-1.6
*/

:root {
  --bg: #F8F9FA;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F4F6F8;
  --text: #2D3748;
  --text-muted: #718096;
  --border: #E2E8F0;
  --accent-blue: #5670C4;
  --accent-blue-hover: #4A5FB0;
  --accent-mint: #3FAF8B;
  --accent-mint-soft: #E4F5F0;
  --danger: #D9534F;
  --danger-soft: #FBEAEA;
  --warning: #C9922B;
  --warning-soft: #FBF3E4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(45, 55, 72, 0.06), 0 2px 8px rgba(45, 55, 72, 0.04);
}

:root[data-theme="dark"] {
  --bg: #121212;
  --bg-elevated: #1A1D20;
  --bg-subtle: #1E2124;
  --text: #E7E9EC;
  --text-muted: #9AA5B1;
  --border: #2A2F36;
  --accent-blue: #7C93E0;
  --accent-blue-hover: #93A6E8;
  --accent-mint: #57C9A3;
  --accent-mint-soft: #163029;
  --danger: #E88B87;
  --danger-soft: #3A2323;
  --warning: #E0B563;
  --warning-soft: #362C1A;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.3; font-weight: 650; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* --- Auth (login/register) --- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text-muted); }
.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}
.field input:disabled { opacity: 0.65; cursor: not-allowed; }
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}
.field-hint { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: var(--accent-blue-hover); }
.btn-mint { background: var(--accent-mint); color: #fff; }
.btn-mint:hover { filter: brightness(1.05); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-subtle); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-muted); }

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--accent-mint-soft); color: var(--accent-mint); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }

/* --- App shell (dashboard/admin) --- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-mint-soft); color: var(--accent-mint); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-title { font-size: 16px; font-weight: 650; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.icon-btn .badge { position: absolute; top: -4px; right: -4px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-subtle);
  cursor: pointer; font-size: 16px;
}

.content { padding: 24px 28px 64px; }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.card-sub { font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .sidebar { display: none; } }

.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 13.5px; color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: none; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.pill-premium { background: var(--accent-mint-soft); color: var(--accent-mint); }
.pill-free { background: var(--warning-soft); color: var(--warning); }
.pill-expired { background: var(--danger-soft); color: var(--danger); }
.pill-pending { background: var(--warning-soft); color: var(--warning); }
.pill-paid { background: var(--accent-mint-soft); color: var(--accent-mint); }
.pill-audit { background: #E7E3FB; color: #6B4FBB; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 24, 30, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--bg-elevated); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 420px; box-shadow: var(--shadow);
}
.hidden { display: none !important; }

/* --- Logo / Branding --- */
.auth-logo-img {
  display: block;
  width: 132px;
  height: auto;
  margin: 0 auto 20px;
}
.sidebar-logo { padding: 6px 10px 18px; text-align: center; }
.sidebar-logo-img { display: block; width: 110px; height: auto; margin: 0 auto; }
.sidebar-logo-tag {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Teks "EduKerja" pada logo berwarna biru tua -> kurang terbaca di latar gelap.
   Di dark mode, logo ditaruh di atas bidang terang lembut agar tetap jelas. */
:root[data-theme="dark"] .auth-logo-img,
:root[data-theme="dark"] .sidebar-logo-img {
  background: #F4F6F8;
  border-radius: 12px;
  padding: 10px 12px;
  box-sizing: content-box;
}
:root[data-theme="dark"] .auth-logo-img { width: 112px; }
:root[data-theme="dark"] .sidebar-logo-img { width: 92px; }
