/* ==================================================================
   Muhaza Pro 2.0 — Design System
   ================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --brand: #0e9f8a;
  --brand-600: #0b8371;
  --brand-700: #086b5d;
  --brand-soft: #e6f7f4;
  --brand-ring: rgba(14, 159, 138, .18);

  --ink: #0c1b2a;
  --ink-2: #33475b;
  --ink-3: #64798d;
  --ink-4: #93a4b5;
  --line: #e5ebf1;
  --line-2: #eef2f6;
  --bg: #f4f7fa;
  --card: #ffffff;

  --amber: #d97706;
  --amber-soft: #fef3e2;
  --sky: #0284c7;
  --sky-soft: #e6f4fd;
  --violet: #7c3aed;
  --violet-soft: #f1ebfe;
  --rose: #e11d48;
  --rose-soft: #fee9ee;
  --emerald: #059669;
  --emerald-soft: #e7f8f1;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(12, 27, 42, .05);
  --shadow: 0 10px 30px -12px rgba(12, 27, 42, .18), 0 2px 6px rgba(12, 27, 42, .04);
  --shadow-lg: 0 30px 70px -30px rgba(12, 27, 42, .35);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
svg { flex: none; }
::selection { background: var(--brand); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd8e3; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aebdcd; background-clip: content-box; border: 3px solid transparent; }

/* --------------------------- Typography --------------------------- */
.h1 { font-size: 30px; font-weight: 800; letter-spacing: -.9px; line-height: 1.18; }
.h2 { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.h3 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* --------------------------- Buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px;
  padding: 10px 16px; font-weight: 700; font-size: 13.5px; line-height: 1.2;
  background: #fff; color: var(--ink-2); border-color: var(--line);
  transition: .18s ease; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #cfdae5; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(180deg, #10ab94, var(--brand)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(14, 159, 138, .6); }
.btn-primary:hover { background: linear-gradient(180deg, #0fa78f, var(--brand-600)); box-shadow: 0 8px 22px -6px rgba(14, 159, 138, .7); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { background: #13293e; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); box-shadow: none; }
.btn-soft { background: var(--brand-soft); color: var(--brand-700); border-color: transparent; }
.btn-soft:hover { background: #d8f2ed; }
.btn-danger { background: #fff; color: var(--rose); border-color: #f8ccd7; }
.btn-danger:hover { background: var(--rose-soft); }
.btn-white { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.btn-white:hover { background: rgba(255,255,255,.16); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 10px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; border-radius: 11px; }
.btn-icon svg { width: 18px; height: 18px; }

/* --------------------------- Forms -------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.label .req { color: var(--rose); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #fff;
  padding: 11px 13px; font-size: 13.5px; color: var(--ink); transition: .15s ease; outline: none;
  min-height: 42px;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:hover, .select:hover, .textarea:hover { border-color: #cfdae6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); background: #fff; }
.textarea { min-height: 88px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364798d' stroke-width='2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.hint { font-size: 11.5px; color: var(--ink-4); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 11px 0 0 11px; }
.input-group .btn { border-radius: 0 11px 11px 0; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-4); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 14px; }
@media (max-width: 720px) { .form-grid, .form-grid-3 { grid-template-columns: 1fr; } }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 23px; border-radius: 99px; background: #d8e1ea; position: relative; transition: .18s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .18s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* --------------------------- Cards -------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h3 { font-size: 15.5px; font-weight: 800; letter-spacing: -.2px; }
.card-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }

/* --------------------------- Badges ------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; letter-spacing: .1px; border: 1px solid transparent; white-space: nowrap; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-emerald { background: var(--emerald-soft); color: #047857; }
.badge-amber { background: var(--amber-soft); color: #b45309; }
.badge-sky { background: var(--sky-soft); color: #0369a1; }
.badge-violet { background: var(--violet-soft); color: #6d28d9; }
.badge-rose { background: var(--rose-soft); color: #be123c; }
.badge-slate { background: #eef2f6; color: #475569; }
.badge-brand { background: var(--brand-soft); color: var(--brand-700); }
.badge-outline { background: transparent; border-color: var(--line); color: var(--ink-3); }

/* --------------------------- Tables ------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 680px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--ink-4); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafcfe; white-space: nowrap;
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13px; }
.tbl tbody tr:hover { background: #fafcfe; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .right { text-align: right; }
.tbl .center { text-align: center; }
.row-main { font-weight: 700; color: var(--ink); }
.row-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.cell-flex { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-700); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sq { border-radius: 10px; }
.avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }

.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .ico { width: 54px; height: 54px; border-radius: 18px; background: var(--line-2); color: var(--ink-4); display: grid; place-items: center; margin: 0 auto 12px; }
.empty .ico svg { width: 24px; height: 24px; }
.empty h4 { font-size: 14px; color: var(--ink-2); font-weight: 700; margin-bottom: 4px; }
.empty p { font-size: 12.5px; }

/* --------------------------- Modal -------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 20, 33, .55); backdrop-filter: blur(3px); z-index: 90; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .overlay { align-items: center; padding: 24px; } }
.modal {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideUp .22s ease;
}
@media (min-width: 640px) { .modal { border-radius: 20px; max-height: 90vh; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-lg { max-width: 760px; }
.modal-sm { max-width: 420px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 16px; font-weight: 800; }
.modal-head p { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; background: #fbfcfe; border-radius: 0 0 20px 20px; }
.x-btn { border: none; background: var(--line-2); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); }
.x-btn:hover { background: #e4eaf0; color: var(--ink); }

/* --------------------------- Toast -------------------------------- */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 36px); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 260px; max-width: 380px;
  animation: toastIn .25s ease; font-size: 13px;
}
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast .ti { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; margin-top: 1px; }
.toast.ok .ti { background: var(--emerald-soft); color: var(--emerald); }
.toast.err .ti { background: var(--rose-soft); color: var(--rose); }
.toast.info .ti { background: var(--sky-soft); color: var(--sky); }
.toast b { display: block; font-size: 12.5px; margin-bottom: 1px; }
.toast span { color: var(--ink-3); font-size: 12px; }

/* --------------------------- Utilities ---------------------------- */
.flex { display: flex; } .items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.wrap { flex-wrap: wrap; } .grow { flex: 1; } .hidden { display: none !important; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.text-right { text-align: right; } .text-center { text-align: center; }
.w-full { width: 100%; } .grid { display: grid; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); display: inline-block; }
.scroll-x { overflow-x: auto; }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skel { background: linear-gradient(90deg, #eef2f6 25%, #f7fafc 37%, #eef2f6 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* --------------------------- Charts ------------------------------- */
.spark { width: 100%; height: 54px; display: block; overflow: visible; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bars .bar { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #2bc0a8, var(--brand)); min-height: 3px; position: relative; transition: .3s; }
.bars .bar:hover { filter: brightness(1.06); }
.bar-labels { display: flex; gap: 8px; margin-top: 8px; }
.bar-labels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--ink-4); }

/* Progress */
.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* Tab pills */
.pill-tabs { display: inline-flex; gap: 2px; background: var(--line-2); padding: 3px; border-radius: 11px; flex-wrap: wrap; }
.pill-tabs button { border: none; background: transparent; padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.pill-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
