/* ===== NetBill ISP design system ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --brand: #d81b21;
  --brand-600: #e11d26;
  --brand-500: #f04c4c;
  --brand-700: #a80f14;
  --brand-900: #3d0507;
  --ink: #241417;
  --ink-2: #4a3538;
  --muted: #8a7376;
  --line: #f1e7e7;
  --bg: #faf7f7;
  --card: #ffffff;
  --green: #16a34a;
  --green-soft: #e7f8ee;
  --red: #ef4444;
  --red-soft: #fdeaea;
  --amber: #f59e0b;
  --amber-soft: #fef4e2;
  --blue: #2563eb;
  --blue-soft: #e8efff;
  --violet-soft: #fdecec;
  --gold: #f5b301;
  --gold-600: #d99a00;
  --gold-soft: #fff6dd;
  --sidebar-1: #2b0a0d;
  --sidebar-2: #150305;
  --shadow-sm: 0 1px 2px rgba(60, 10, 14, .05);
  --shadow: 0 1px 2px rgba(60, 10, 14, .04), 0 10px 30px -14px rgba(60, 10, 14, .18);
  --radius: 16px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ===== logo ===== */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, #2f7cf6 0%, #d81b21 55%, #a855f7 100%);
  box-shadow: 0 6px 16px -6px rgba(216, 27, 33, .7);
  flex: none;
}
.logo-mark svg { width: 22px; height: 22px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.logo-text b span { background: linear-gradient(90deg, #60a5fa, #c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-text small { font-size: 9.5px; letter-spacing: .16em; font-weight: 700; text-transform: uppercase; opacity: .65; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  background: #fff; color: var(--ink-2); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: .16s ease; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(135deg, #e11d26 0%, #a80f14 100%);
  color: #fff; box-shadow: 0 8px 20px -8px rgba(216, 27, 33, .8);
}
.btn-primary:hover { box-shadow: 0 12px 24px -8px rgba(216, 27, 33, .9); }
.btn-ghost { border-color: var(--line); background: #fff; }
.btn-ghost:hover { border-color: #d9d2ef; background: #fbfaff; }
.btn-soft { background: var(--violet-soft); color: var(--brand-700); }
.btn-danger { background: var(--red-soft); color: #b91c1c; }
.btn-green { background: var(--green-soft); color: #15803d; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ===== forms ===== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; height: 42px; border: 1px solid #e4e0f0; border-radius: 11px; padding: 0 12px;
  background: #fff; color: var(--ink); outline: none; transition: .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(216, 27, 33, .13); }
.input::placeholder, .textarea::placeholder { color: #a9a3bd; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237d7796' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ===== badge / pill ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
}
.badge-lunas, .badge-aktif { background: var(--green-soft); color: #15803d; }
.badge-belum { background: var(--red-soft); color: #dc2626; }
.badge-telat, .badge-nonaktif { background: var(--amber-soft); color: #b45309; }
.badge-soft { background: var(--violet-soft); color: var(--brand-700); }
.badge-blue { background: var(--blue-soft); color: #1d4ed8; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ===== avatar ===== */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #fde4e4, #fbcaca); color: var(--brand-700);
  font-weight: 800; font-size: 13px; letter-spacing: -.02em;
}
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }

/* ===== card ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; }
.card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* ===== table ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: #fbfaff; white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid #f3f1fa; font-size: 13px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbfaff; }
.table .name { font-weight: 600; color: var(--ink); }
.table .sub { font-size: 11.5px; color: var(--muted); }
.mono { font-family: 'Inter', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* ===== modal ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(60, 10, 14, .5);
  display: flex; align-items: center; justify-content: center; z-index: 95; padding: 20px;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  box-shadow: 0 30px 80px -20px rgba(60, 10, 14, .5);
}
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-body { padding: 16px 22px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: #f7f5ff; color: var(--brand); }
.icon-btn svg { width: 16px; height: 16px; }

/* ===== toast ===== */
#toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1b1136; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 500;
  box-shadow: 0 18px 40px -12px rgba(60, 10, 14, .6); display: flex; align-items: center; gap: 9px;
  animation: slidein .2s ease;
}
.toast.err { background: #7f1d1d; }
.toast svg { width: 17px; height: 17px; flex: none; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ===== empty ===== */
.empty { padding: 42px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty svg { width: 34px; height: 34px; opacity: .4; margin-bottom: 8px; }

/* ===== utility ===== */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); }
.pagination .pages { display: flex; gap: 5px; }
.page-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.page-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-btn[disabled] { opacity: .45; cursor: not-allowed; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(216,27,33,.25); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.skeleton { background: linear-gradient(90deg, #f1eefb 25%, #f8f6ff 50%, #f1eefb 75%); background-size: 400% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }
.scroll-x { overflow-x: auto; }
