:root {
  --kt-sidebar-width: 284px;
  --kt-bg: #f4f7fb;
  --kt-card: #ffffff;
  --kt-text: #0f172a;
  --kt-muted: #64748b;
  --kt-border: #e2e8f0;
  --kt-primary: #2563eb;
  --kt-sidebar: #0f172a;
  --kt-sidebar-soft: rgba(255,255,255,.08);
  --kt-radius: 18px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--kt-bg);
  color: var(--kt-text);
  font-size: .95rem;
  text-rendering: geometricPrecision;
}
a { transition: .18s ease; }
.form-control, .form-select {
  border-radius: 12px;
  border-color: #cbd5e1;
  min-height: 42px;
}
.form-control:focus, .form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12);
}
.btn { border-radius: 12px; font-weight: 600; }
.btn-sm { border-radius: 10px; }
.card {
  border: 1px solid rgba(226, 232, 240, .86);
  border-radius: var(--kt-radius);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .06);
  overflow: hidden;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--kt-border);
  padding: 1rem 1.2rem;
}
.card-body { padding: 1.2rem; }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { vertical-align: middle; }
.badge-soft { background: #eef2ff; color:#3730a3; }
.min-w-0 { min-width: 0; }

/* Login */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.16), transparent 36%),
    linear-gradient(135deg, #eef3ff, #f8fbff 52%, #eef8ff);
}
.auth-shell { width: 100%; max-width: 460px; }
.auth-card {
  width: 100%;
  border: 1px solid rgba(226,232,240,.75);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(25, 42, 70, .16);
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color:#fff;
  font-weight: 800;
  letter-spacing: -.03em;
}
.auth-brand-mark { width: 68px; height: 68px; border-radius: 22px; font-size: 25px; }
.auth-form .form-control-lg { min-height: 50px; font-size: 1rem; }

/* Sidebar */
.sidebar {
  width: var(--kt-sidebar-width);
  min-height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--kt-sidebar);
  color: #fff;
  transition: transform .22s ease, width .22s ease;
  z-index: 1030;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 999px; }
.sidebar .brand {
  min-height: 70px;
  display:flex;
  align-items:center;
  gap:12px;
  padding: 0 18px;
  font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: -.01em;
}
.brand-text { white-space: nowrap; }
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 24px;
}
.sidebar .nav-link,
.nav-group-toggle,
.nav-sublink {
  width: calc(100% - 20px);
  margin: 3px 10px;
  border: 0;
  border-radius: 14px;
  color: rgba(255,255,255,.78);
  background: transparent;
  text-align: left;
  text-decoration: none;
  line-height: 1.25;
}
.sidebar .nav-link {
  display:flex;
  align-items:center;
  gap:10px;
  padding: 11px 12px;
  font-weight: 650;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active,
.nav-group-toggle:hover,
.nav-group-toggle.active {
  color: #fff;
  background: var(--kt-sidebar-soft);
}
.nav-dot { width: 8px; height: 8px; border-radius: 99px; background: #60a5fa; opacity: .9; }
.nav-group-toggle {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 11px 12px;
  font-weight: 700;
}
.nav-group-toggle .chevron { transition: transform .18s ease; opacity: .8; }
.nav-group-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.nav-submenu { padding: 2px 0 8px; }
.nav-sublink {
  display:block;
  padding: 9px 12px 9px 34px;
  font-size: .9rem;
  position: relative;
}
.nav-sublink::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 99px;
  background: rgba(255,255,255,.32);
}
.nav-sublink:hover,
.nav-sublink.active { color:#fff; background: rgba(255,255,255,.07); }
.nav-sublink.active::before { background: #60a5fa; }
.sidebar-footer-note {
  margin: 12px 18px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .76rem;
  color: rgba(255,255,255,.48);
}
.sidebar-backdrop {
  display:none;
  position: fixed;
  inset:0;
  background: rgba(15, 23, 42, .42);
  z-index: 1025;
}

/* Main layout */
.main {
  margin-left: var(--kt-sidebar-width);
  min-height: 100vh;
  transition: margin-left .22s ease;
}
.topbar {
  min-height: 70px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--kt-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding:0 22px;
  position:sticky;
  top:0;
  z-index:1020;
}
.page-title { max-width: 52vw; }
.user-chip { max-width: 300px; }
.content { padding: 24px; }
.sidebar-toggle { min-width: 38px; }
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main { margin-left: 0; }

/* Forms and settings */
.settings-form .form-label { font-weight: 700; font-size: .85rem; color: #172554; }
.settings-form .form-text { color: #64748b; }
.page-heading h4 { font-weight: 800; letter-spacing: -.02em; }
.checkline { padding: 10px 12px; border: 1px solid #dcfce7; background:#f0fdf4; border-radius: 12px; color:#166534; }
.checkline span { font-weight: 900; margin-right: 6px; }

/* QR/Barcode paket published */
.qr-card { border: 1px solid #e5e7eb; border-radius: 18px; background: #fff; padding: 16px; }
.qr-image-box { display:flex; justify-content:center; align-items:center; min-height: 240px; border:1px dashed #cbd5e1; border-radius: 16px; background:#f8fafc; }
.qr-image-box img { width: 220px; height: 220px; object-fit: contain; }
.copy-link-group .form-control { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: .85rem; }

@media (max-width: 1199.98px) {
  :root { --kt-sidebar-width: 272px; }
  .content { padding: 20px; }
}
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { display:block; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px; }
  .page-title { max-width: 44vw; }
  .topbar-actions { gap: 8px !important; }
}
@media (max-width: 575.98px) {
  body { font-size: .92rem; }
  .auth-page { padding: 14px; align-items: flex-start; }
  .auth-shell { margin-top: 18px; }
  .auth-card .card-body { padding: 26px 20px !important; }
  .topbar { min-height: 64px; }
  .page-title { max-width: 40vw; font-size: .95rem; }
  .content { padding: 12px; }
  .card { border-radius: 16px; }
  .card-body { padding: 1rem; }
  .card-header { padding: .9rem 1rem; }
  .stat-grid .fs-5 { font-size: 1rem !important; }
  .table-responsive { font-size: .86rem; }
  .btn { white-space: nowrap; }
}
@media (max-height: 760px) {
  .sidebar .brand { min-height: 60px; }
  .sidebar .nav-link, .nav-group-toggle { padding-top: 9px; padding-bottom: 9px; }
  .nav-sublink { padding-top: 8px; padding-bottom: 8px; }
}
