/* Font Plus Jakarta Sans via Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --bg: #f5f5fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e8e8f3;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(79, 70, 229, 0.08);
}

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

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ---------- LOGIN ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.brand { text-align: center; margin-bottom: 24px; }
.brand-logo {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px;
}
.brand h1 { font-size: 22px; }
.brand p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.tabs {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.tab.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.field input:focus, select:focus { border-color: var(--primary); }

/* Tombol bergaya Argon: pill, uppercase, shadow lembut, efek angkat saat hover */
.btn {
  border: none;
  border-radius: 50rem;            /* pill */
  padding: 11px 24px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
  will-change: transform;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(87deg, #6366f1 0, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 4px 6px rgba(79, 70, 229, .22);
}
.btn-primary:hover {
  box-shadow: 0 7px 14px rgba(79, 70, 229, .28), 0 3px 6px rgba(0,0,0,.08);
  filter: brightness(1.04);
}

.btn-block { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 11px; }

.btn-danger {
  background: linear-gradient(87deg, #f5365c 0, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 6px rgba(220, 38, 38, .22);
}
.btn-danger:hover {
  box-shadow: 0 7px 14px rgba(220, 38, 38, .28), 0 3px 6px rgba(0,0,0,.08);
  filter: brightness(1.04);
}

/* Tombol "Tambah" gaya Argon: biru-ungu solid, sudut sedang, shadow lembut */
#addCategoryBtn, #addProviderBtn {
  background: #5e72e4;
  color: #fff;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: .4px;
  box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);
}
#addCategoryBtn:hover, #addProviderBtn:hover {
  background: #5161d8;
  box-shadow: 0 7px 14px rgba(50, 50, 93, .12), 0 3px 6px rgba(0, 0, 0, .10);
  transform: translateY(-1px);
}

/* tombol sekunder (Batal dll) — putih dengan shadow lembut ala Argon */
.btn-ghost {
  background: #fff;
  color: #475569;
  border: 1px solid #e8e8f3;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.btn-ghost:hover {
  box-shadow: 0 7px 14px rgba(50,50,93,.10), 0 3px 6px rgba(0,0,0,.06);
  color: #1e293b;
}

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert.error { background: #fef2f2; color: var(--danger); }
.alert.success { background: #f0fdf4; color: var(--success); }

.hint {
  margin-top: 20px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}
.hint code { background: #e2e8f0; padding: 1px 5px; border-radius: 4px; }

/* ---------- DASHBOARD ---------- */
.app { min-height: 100vh; display: flex; }

.sidebar {
  position: relative;
  overflow: hidden;
  width: 248px;
  background:
    radial-gradient(220px 220px at 15% 8%, rgba(129,140,248,0.28), transparent 70%),
    radial-gradient(260px 260px at 92% 30%, rgba(168,85,247,0.22), transparent 70%),
    radial-gradient(240px 240px at 20% 95%, rgba(139,92,246,0.20), transparent 70%),
    #e2e0f0;
  color: #4b5168;
  padding: 22px 14px;
  flex-shrink: 0;
  border-right: 1px solid #d6d3ec;
}
/* gelembung dekoratif (lingkaran lembut yang melayang) */
.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.sidebar::before {
  width: 160px; height: 160px;
  right: -55px; top: 110px;
  background: radial-gradient(circle, rgba(129,140,248,0.32) 0%, transparent 70%);
}
.sidebar::after {
  width: 130px; height: 130px;
  left: -45px; bottom: 80px;
  background: radial-gradient(circle, rgba(192,132,252,0.28) 0%, transparent 70%);
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar .logo {
  display: flex; align-items: center; gap: 10px;
  color: #1e293b; font-size: 18px; font-weight: 700;
  margin-bottom: 28px; padding: 4px 8px;
}
.logo-mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff; font-weight: 800; font-size: 16px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 11px 14px;
  color: #475569;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.sidebar nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .8; }
.sidebar nav a:hover {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
}
.sidebar nav a.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
.sidebar nav a.active svg { opacity: 1; color: #fff; }
/* aksen garis di kiri menu aktif */
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 22px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #a5b4fc, #6366f1);
}
/* menu Keluar di bawah dengan jarak */
.sidebar nav .nav-logout { margin-top: 14px; color: #f87171; }
.sidebar nav .nav-logout:hover { background: rgba(248, 113, 113, 0.12); color: #fca5a5; }

.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h2 { font-size: 18px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  padding: 6px 14px 6px 6px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: box-shadow .15s ease, border-color .15s ease;
  cursor: default;
}
.user-chip:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
}
.avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

/* Avatar ilustrasi karakter (gambar orang) */
.avatar-illus {
  background:
    url("../img/avatar.svg") center/cover no-repeat,
    linear-gradient(135deg, #dbeafe 0%, #c7d2fe 100%);
  box-shadow: none;
}

/* Tombol avatar (bisa diklik) */
.profile-wrap { position: relative; }
.avatar-btn {
  border: 2px solid transparent;
  background: transparent;
  padding: 2px;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
  line-height: 0;
}
.avatar-btn:hover, .avatar-btn.open {
  border-color: #c7d2fe;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.18);
}

/* Dropdown profil (elegan) */
.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  width: 290px;
  background: var(--card);
  border: 1px solid #eef2f7;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  z-index: 60;
  animation: pdIn .16s cubic-bezier(.2,.8,.2,1);
}
.profile-dropdown::before {
  /* segitiga kecil penunjuk ke avatar */
  content: "";
  position: absolute;
  top: -7px; right: 22px;
  width: 14px; height: 14px;
  background: linear-gradient(135deg, #eff3ff, #eef2ff);
  border-left: 1px solid #eef2f7;
  border-top: 1px solid #eef2f7;
  transform: rotate(45deg);
}
@keyframes pdIn {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pd-header {
  background: linear-gradient(135deg, #eff3ff 0%, #eef2ff 100%);
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f7;
}
.pd-title { font-size: 14px; font-weight: 700; color: #334155; letter-spacing: .2px; }

.pd-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 18px 8px;
}
.avatar-lg {
  width: 76px; height: 76px;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.20), 0 0 0 3px #e0e7ff;
  margin-bottom: 12px;
}
.pd-name { font-weight: 700; font-size: 17px; color: #1e293b; }
.pd-role {
  display: inline-block;
  margin: 6px 0 8px;
  padding: 3px 12px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
}
.pd-email {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px;
  max-width: 100%;
}
.pd-email span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pd-actions { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 9px; }
.pd-action, .pd-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  font-weight: 600;
  font-size: 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.pd-action { color: var(--primary); }
.pd-logout { color: var(--danger); }
.pd-action:hover  { background: #eff6ff; border-color: #bfdbfe; }
.pd-logout:hover  { background: #fef2f2; border-color: #fecaca; }
.pd-action:active, .pd-logout:active { transform: translateY(1px); }

.content { padding: 28px; flex: 1; }

/* animasi saat pindah menu/view (dipicu ulang via class .view-anim) */
.view-anim { animation: viewIn .6s cubic-bezier(.22,.8,.2,1); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 6px; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
thead th {
  background: #faf9ff;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
thead th:first-child { border-radius: 8px 0 0 8px; }
thead th:last-child { border-radius: 0 8px 8px 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f7f6ff; }
/* header bisa diklik untuk sorting */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after {
  content: "\2195";          /* panah atas-bawah samar (belum diurutkan) */
  margin-left: 6px;
  opacity: .35;
  font-size: 11px;
}
th.sortable:hover::after { opacity: .7; }
th.sortable.sort-asc::after  { content: "\2191"; opacity: 1; color: var(--primary); }
th.sortable.sort-desc::after { content: "\2193"; opacity: 1; color: var(--primary); }
tr:last-child td { border-bottom: none; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.admin { background: #ede9fe; color: #6d28d9; }
.badge.customer { background: #dbeafe; color: #1d4ed8; }
.badge.active { background: #dcfce7; color: #15803d; }
.badge.inactive { background: #fee2e2; color: #b91c1c; }
.badge.pending { background: #fef3c7; color: #b45309; }

/* ---------- Provider page ---------- */
.page-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #eef2ff 0%, #e0e7ff 55%, #ddd6fe 100%);
  border: 1px solid #e0e7ff;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.08);
}
/* hiasan lingkaran lembut di latar */
.page-banner::before {
  content: "";
  position: absolute;
  right: -40px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(165,180,252,0.35) 0%, rgba(165,180,252,0) 70%);
  border-radius: 50%;
}
.page-banner h2 { font-size: 24px; font-weight: 700; color: #1e293b; }
.breadcrumb { color: #64748b; font-size: 13px; margin-top: 6px; }
.breadcrumb span { margin: 0 6px; color: #a5b4fc; }
.banner-icon {
  position: relative;
  z-index: 1;
  line-height: 0;
  filter: drop-shadow(0 8px 14px rgba(79, 70, 229, 0.18));
}

.search-input {
  flex: 1;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.search-input:focus { border-color: var(--primary); }

.table-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn.edit { color: var(--primary); }
.icon-btn.del  { color: var(--danger); }
/* tombol power: aktif -> merah (untuk mematikan), nonaktif -> hijau (untuk menyalakan) */
.icon-btn.power.on  { color: var(--danger); }
.icon-btn.power.off { color: var(--success); }

.empty-row td { text-align: center; color: var(--muted); padding: 24px; }

/* mutasi saldo: panah naik/turun + warna nominal */
.mutasi {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.mutasi.naik  { background: #dcfce7; color: #15803d; }
.mutasi.turun { background: #fee2e2; color: #b91c1c; }
.amt-in  { color: #15803d; font-weight: 700; }
.amt-out { color: #b91c1c; font-weight: 700; }

/* tombol saldo + dropdown (+/-) */
.saldo-wrap { position: relative; display: inline-block; }
.icon-btn.saldo-btn { color: var(--success); }
.saldo-menu {
  position: fixed;            /* mengambang bebas, tidak terpotong container */
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15,23,42,.18);
  padding: 6px;
  z-index: 9999;
  min-width: 170px;
  animation: pdIn .12s ease;
}
.saldo-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: transparent; border: none;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.saldo-menu button:hover { background: var(--bg); }
.sm-plus  { color: var(--success); font-weight: 800; font-size: 15px; }
.sm-minus { color: var(--danger); font-weight: 800; font-size: 15px; }

.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 760px; }
#view-product .table-scroll table { min-width: 900px; }
#view-price .table-scroll table { min-width: 1000px; }
#view-invoice .table-scroll table { min-width: 1100px; }
#view-balance .table-scroll table { min-width: 950px; }

/* kartu ringkasan per periode (Hari Ini / Kemarin / Bulan Ini) */
.period-card { padding: 20px 22px; }
.pc-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.pc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pc-dot.today { background: #16a34a; }
.pc-dot.yest  { background: #94a3b8; }
.pc-dot.month { background: #6366f1; }
.pc-dot.year  { background: #d97706; }
.pc-amount { font-size: 26px; font-weight: 800; color: var(--text); margin: 10px 0 10px; }
.pc-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-stats span {
  font-size: 12px; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 3px 10px;
}
.pc-stats b { font-weight: 700; }
.ps-sukses b  { color: var(--success); }
.ps-pending b { color: #d97706; }
.ps-gagal b   { color: var(--danger); }
/* kartu Bulan Ini ditonjolkan */
.period-card.highlight {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border-color: #c7d2fe;
}
.period-card.highlight .pc-amount { color: var(--primary); }

/* grafik dashboard */
.chart-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; margin-bottom: 24px; }
.chart-box { position: relative; height: 280px; }
@media (max-width: 820px) { .chart-grid { grid-template-columns: 1fr; } }

/* rincian QRIS/Saldo di kartu statistik */
.stat-detail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}
.sd-row {
  display: grid;
  grid-template-columns: 72px 28px auto;  /* nama | jumlah | amount (rapat, tidak melar) */
  align-items: center;
  gap: 10px;
}
.sd-name {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--text);
  white-space: nowrap;
}
.dot-qris .sd-name::before, .dot-saldo .sd-name::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.dot-qris .sd-name::before    { background: #6366f1; }
.dot-saldo .sd-name::before   { background: #16a34a; }
.dot-sukses .sd-name::before  { background: #16a34a; }
.dot-pending .sd-name::before { background: #d97706; }
.dot-gagal .sd-name::before   { background: #dc2626; }
.sd-sep { border-top: 1px dashed var(--border); margin: 2px 0; }
.sd-qty {
  justify-self: start;
  min-width: 24px;
  text-align: center;
  background: var(--bg);
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 700;
  color: var(--text);
}
.sd-amt { text-align: left; font-weight: 600; color: var(--primary); }

/* toolbar invoice (filter + tombol) */
.inv-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.inv-filter { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inv-filter .field { margin-bottom: 0; }
.inv-filter .field label { font-size: 11px; }
.inv-filter input[type=date] { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; }
.inv-filter .search-input { max-width: 220px; }
.grp-badge {
  display: inline-block;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  margin: 1px 0;
  white-space: nowrap;
}
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; color: var(--muted); }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50;
  animation: ovIn .15s ease;
}
@keyframes ovIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  width: 100%; max-width: 420px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, .3);
  animation: mdIn .18s cubic-bezier(.2,.8,.2,1);
}
@keyframes mdIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Modal besar dengan isi banyak (scroll) */
.modal-lg { max-width: 760px; padding: 0; max-height: 92vh; display: flex; flex-direction: column; }
.modal-lg .modal-head {
  position: relative;
  padding: 22px 30px;
  background: linear-gradient(120deg, #eef2ff 0%, #f5f3ff 100%);
  border-bottom: 1px solid #e8e8f3;
  border-radius: 18px 18px 0 0;
}
/* aksen garis tebal di kiri judul */
.modal-lg .modal-head h3 {
  position: relative;
  margin: 0;
  padding-left: 16px;
  font-size: 20px;
  font-weight: 800;
  color: #1e1b4b;
}
.modal-lg .modal-head h3::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, #818cf8, #6366f1);
}
.modal-lg .modal-body { padding: 26px 30px; overflow-y: auto; }
.modal-lg .modal-actions {
  padding: 18px 30px;
  border-top: 1px solid var(--border);
  margin-top: 0;
  background: #faf9ff;
  border-radius: 0 0 18px 18px;
}

/* Tata letak grid di dalam modal (manfaatkan lebar) */
.modal-lg .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.modal-lg .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.modal-lg .grid-2 .field, .modal-lg .grid-3 .field { margin-bottom: 18px; }
@media (max-width: 600px) {
  .modal-lg .grid-2, .modal-lg .grid-3 { grid-template-columns: 1fr; gap: 0; }
}

/* Field & label dalam modal lebih lega */
.modal-lg .field { margin-bottom: 18px; }
.modal-lg .field:last-child { margin-bottom: 0; }
.modal-lg .field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  letter-spacing: .2px;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.modal-lg .field input,
.modal-lg .field select,
.modal-lg .field textarea {
  background: #f8fafc;
  border: 1px solid #e5e9f0;
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.modal-lg .field input:focus,
.modal-lg .field select:focus,
.modal-lg .field textarea:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;            /* ukuran tetap, tanpa gagang resize */
  outline: none;
}
.field textarea:focus { border-color: var(--primary); }
.req { color: var(--danger); }

.field-hint { font-size: 12px; color: var(--muted); margin: -2px 0 8px; font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Kode grup & harga (baris dinamis) */
.group-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.group-row { display: flex; gap: 10px; align-items: center; }
.group-row .grp-kode  { flex: 1.6; }
.group-row .grp-nama  { flex: 1; }
.group-row .grp-harga { flex: 1; }
.group-row .grp-del {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--danger);
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.group-row .grp-del:hover { background: #fee2e2; }
.btn-add-group {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: #eef2ff;
  color: var(--primary);
  border: 1px dashed #c7d2fe;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-add-group:hover { background: #e0e7ff; border-color: var(--primary); }

@media (max-width: 640px) {
  .sidebar { width: 66px; padding: 16px 10px; }
  .sidebar .logo-text, .sidebar nav a span { display: none; }
  .sidebar nav a { justify-content: center; padding: 12px; }
  .sidebar nav a.active::before { left: -10px; }
}
