:root{
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #0b1b34;
  --muted: #5b6b7a;

  /* PLN Brand */
  --primary: #0072ce;
  --primary-dark: #005b9a;
  --secondary: #00aeef;
  --secondary-dark: #008fc4;
  --accent: #fcd116;

  --danger: #dc2626;
  --border: #e2e8f0;
  --ring: rgba(0,114,206,.25);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Topbar */
.topbar {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 2px 8px rgba(2,6,23,.12);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem .75rem;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.brand {
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 1.1rem;
}
.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}
.brand-logo-right {
  height: 36px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.user-meta .btn { white-space: nowrap; }
.user-name { font-weight: 600; }
.muted { color: var(--muted); font-size: .9rem; }
.topbar .muted { color: rgba(255,255,255,.85); }

.badge {
  background: var(--accent);
  color: #0b1b34;
  padding: .2rem .55rem;
  border-radius: .45rem;
  font-size: .8rem;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .5rem 1rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.nav a {
  color: #e2e8f0;
  padding: .45rem .75rem;
  border-radius: .6rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.12);
  font-size: .9rem;
}
.nav a.active, .nav a:hover {
  background: rgba(255,255,255,.22);
  color: #fff;
  border-color: rgba(255,255,255,.22);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(15,23,42,.06);
}
.card h2, .card h3 { margin-top: 0; }
.card-title { color: var(--muted); font-size: .9rem; }
.card-value { font-size: 1.9rem; font-weight: 700; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: .6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
th { background: #eef3f9; font-weight: 600; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #eef2f7; }

form label { display: block; font-weight: 600; margin-bottom: .3rem; }
input, select, textarea {
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: .6rem;
  font-size: .95rem;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
textarea { min-height: 80px; }

.grid {
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.btn {
  display: inline-block;
  margin-top: 5px;
  padding: .55rem 1rem;
  border-radius: .6rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: .95rem;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-light { background: #e2e8f0; color: #0f172a; border-color: #cbd5e1; }
.btn-light:hover { background: #cbd5e1; }

.btn-sm { padding: .35rem .6rem; font-size: .85rem; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline { display: inline; }

.alert {
  padding: .7rem .9rem;
  border-radius: .6rem;
  margin-bottom: 1rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.alert.success { background: #dcfce7; color: #166534; border-color: #86efac; }
.alert.error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.alert.info { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }

.login-wrap {
  max-width: 420px;
  margin: 3rem auto;
}

.align-end { display: flex; align-items: end; }

.mt-2 { margin-top: .5rem; }

/* Responsive */
@media (max-width: 768px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .brand-logo, .brand-logo-right { display: none; }
  .nav { padding: .5rem 1rem 1rem; }
}