/* ─── BaliLexVisa Admin — Neumorphic Design ──────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:    #e8ecf1;
  --sh-d:  #b8c0cc;
  --sh-l:  #ffffff;
  --tx:    #2d3748;
  --tx2:   #64748b;
  --tx3:   #a0aec0;
  --ac:    #6c5ce7;
  --ac2:   #5a4bd1;
  --ac-lt: rgba(108,92,231,.12);
  --red:   #e17055; --red-lt:    rgba(225,112,85,.12);
  --green: #00b894; --green-lt:  rgba(0,184,148,.12);
  --yellow:#f9a825; --yellow-lt: rgba(249,168,37,.12);
  --blue:  #0984e3; --blue-lt:   rgba(9,132,227,.12);
  --pink:  #e84393; --pink-lt:   rgba(232,67,147,.12);
  --r: 16px;
  --r-sm: 10px;
  --r-pill: 50px;

  /* Neumorphic shadow presets */
  --neu:    6px 6px 12px var(--sh-d), -6px -6px 12px var(--sh-l);
  --neu-lg: 10px 10px 20px var(--sh-d), -10px -10px 20px var(--sh-l);
  --neu-sm: 3px 3px 6px var(--sh-d),   -3px -3px 6px var(--sh-l);
  --neu-in: inset 4px 4px 8px var(--sh-d),   inset -4px -4px 8px var(--sh-l);
  --neu-in-sm: inset 2px 2px 5px var(--sh-d), inset -2px -2px 5px var(--sh-l);
  --neu-in-lg: inset 6px 6px 14px var(--sh-d), inset -6px -6px 14px var(--sh-l);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--tx);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────────── */
/* sidebar is position:fixed so adm-main uses margin-left, not grid */
.adm-wrap { display: block; min-height: 100vh; }

.adm-sidebar {
  position: fixed; top: 0; left: 0; width: 240px; height: 100vh;
  background: var(--bg);
  box-shadow: 6px 0 20px var(--sh-d), -2px 0 8px var(--sh-l);
  display: flex; flex-direction: column;
  z-index: 50; overflow: hidden;
}
.adm-main { margin-left: 240px; padding: 28px 32px; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.adm-sb-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(0,0,0,.05);
  flex-shrink: 0;
}
.adm-sb-logo-txt {
  font-size: 17px; font-weight: 800; color: var(--tx);
  letter-spacing: -.4px;
}
.adm-sb-logo-txt b { color: var(--ac); }
.adm-sb-logo small {
  display: block; font-size: 10.5px; font-weight: 500;
  color: var(--tx3); margin-top: 2px; letter-spacing: .3px;
}

.adm-nav { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.adm-nav::-webkit-scrollbar { width: 0; }
.adm-nav-group {
  font-size: 9.5px; font-weight: 700; color: var(--tx3);
  letter-spacing: 1.4px; text-transform: uppercase;
  padding: 14px 8px 4px;
}
.adm-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--tx2); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: all .2s; position: relative;
  box-shadow: none;
}
.adm-nav a:hover {
  box-shadow: var(--neu-sm);
  color: var(--tx);
}
.adm-nav a.act {
  box-shadow: var(--neu-in);
  color: var(--ac);
  font-weight: 600;
}
.adm-nav-ic { width: 17px; flex-shrink: 0; display: flex; align-items: center; }
.adm-nav-badge {
  margin-left: auto; background: var(--ac); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 99px; display: flex; align-items: center; justify-content: center; padding: 0 5px;
  box-shadow: 2px 2px 5px rgba(108,92,231,.3);
}

.adm-sb-footer {
  padding: 10px 14px 16px;
  border-top: 1px solid rgba(0,0,0,.05);
  flex-shrink: 0;
}
.adm-sb-footer a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--tx3); text-decoration: none;
  font-size: 13px; transition: color .15s;
}
.adm-sb-footer a:hover { color: var(--tx2); }

/* ── Topbar ─────────────────────────────────────────────────── */
.adm-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; padding-bottom: 22px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.adm-page-ttl {
  font-size: 22px; font-weight: 800; color: var(--tx); letter-spacing: -.4px;
}
.adm-topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--tx3); }
.adm-topbar-right a { color: var(--tx3); text-decoration: none; }
.adm-topbar-right a:hover { color: var(--tx2); }

/* ── Panels ─────────────────────────────────────────────────── */
.adm-panel {
  background: var(--bg);
  border-radius: var(--r);
  box-shadow: var(--neu-lg);
  margin-bottom: 24px;
  overflow: hidden;
}
.adm-panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(0,0,0,.05);
  gap: 12px;
}
.adm-panel-ttl { font-size: 14px; font-weight: 700; color: var(--tx); }
.adm-panel-body { padding: 22px; }
.adm-empty {
  padding: 52px 20px; text-align: center;
  color: var(--tx3); font-size: 14px; line-height: 2;
}

/* ── KPIs ───────────────────────────────────────────────────── */
.adm-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.adm-kpi {
  background: var(--bg); border-radius: var(--r); box-shadow: var(--neu);
  padding: 20px 22px;
}
.adm-kpi-n {
  font-size: 30px; font-weight: 800; color: var(--tx);
  line-height: 1; margin-bottom: 5px;
}
.adm-kpi-l { font-size: 11.5px; color: var(--tx3); font-weight: 500; }
.adm-kpi.ac { border-left: 4px solid var(--ac); }
.adm-kpi.gr { border-left: 4px solid var(--green); }
.adm-kpi.yw { border-left: 4px solid var(--yellow); }
.adm-kpi.rd { border-left: 4px solid var(--red); }

/* ── Table ──────────────────────────────────────────────────── */
.adm-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-tbl thead th {
  padding: 10px 18px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--tx3); text-align: left;
  border-bottom: 1px solid rgba(0,0,0,.06);
  white-space: nowrap;
}
.adm-tbl tbody td {
  padding: 12px 18px; border-bottom: 1px solid rgba(0,0,0,.04);
  vertical-align: middle;
}
.adm-tbl tbody tr:last-child td { border-bottom: none; }
.adm-tbl tbody tr:hover { background: rgba(0,0,0,.015); }
.adm-tbl .td-act { white-space: nowrap; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
  letter-spacing: .2px; box-shadow: var(--neu-sm);
}
.b-gray   { color: var(--tx2); }
.b-green  { color: var(--green); }
.b-yellow { color: var(--yellow); }
.b-red    { color: var(--red); }
.b-purple { color: var(--ac); }
.b-blue   { color: var(--blue); }
.b-pink   { color: var(--pink); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none;
  transition: box-shadow .2s, transform .1s;
  font-family: inherit; white-space: nowrap;
  box-shadow: var(--neu);
  background: var(--bg); color: var(--tx2);
}
.btn:hover { box-shadow: var(--neu-lg); }
.btn:active { box-shadow: var(--neu-in); transform: scale(.98); }

.btn-p {
  background: var(--ac); color: #fff;
  box-shadow: 4px 4px 10px rgba(108,92,231,.35), -2px -2px 8px rgba(255,255,255,.6);
}
.btn-p:hover {
  background: var(--ac2);
  box-shadow: 6px 6px 14px rgba(108,92,231,.45), -2px -2px 8px rgba(255,255,255,.7);
}
.btn-p:active { box-shadow: inset 3px 3px 8px rgba(0,0,0,.2); }

.btn-o  { background: var(--bg); color: var(--tx2); box-shadow: var(--neu); }
.btn-sm { padding: 5px 13px; font-size: 12px; }
.btn-red { color: var(--red); }
.btn-red:hover { box-shadow: var(--neu-lg); }
.btn-green { color: var(--green); }

/* ── Forms ──────────────────────────────────────────────────── */
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg label { font-size: 11.5px; font-weight: 700; color: var(--tx2); letter-spacing: .3px; }
.fg input[type=text],
.fg input[type=email],
.fg input[type=number],
.fg input[type=date],
.fg input[type=tel],
.fg input[type=url],
.fg input[type=password],
.fg input[type=file],
.fg select,
.fg textarea {
  width: 100%;
  padding: 10px 14px;
  border: none; border-radius: var(--r-sm);
  font-family: inherit; font-size: 13.5px; color: var(--tx);
  background: var(--bg);
  box-shadow: var(--neu-in);
  outline: none;
  transition: box-shadow .2s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  box-shadow: var(--neu-in-lg);
}
.fg textarea { resize: vertical; min-height: 80px; }
.fg select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 30px; cursor: pointer;
}
.fg input[type=file] {
  padding: 8px 12px; font-size: 13px; cursor: pointer;
}

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; gap: 12px; align-items: center; padding-top: 4px; }
.form-feedback { font-size: 13px; padding: 12px 16px; border-radius: var(--r-sm); display: none; box-shadow: var(--neu-in-sm); }
.form-feedback.ok  { display: block; color: var(--green); }
.form-feedback.err { display: block; color: var(--red); }

.cb-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--tx2); cursor: pointer;
}
.cb-row input[type=checkbox] {
  width: 16px; height: 16px;
  appearance: none; border: none; border-radius: 5px;
  background: var(--bg); box-shadow: var(--neu-in-sm);
  cursor: pointer; position: relative; flex-shrink: 0;
}
.cb-row input[type=checkbox]:checked {
  background: var(--ac);
  box-shadow: inset 2px 2px 4px rgba(0,0,0,.2);
}
.cb-row input[type=checkbox]:checked::after {
  content: '✓'; position: absolute; top: 0; left: 2px;
  font-size: 11px; color: #fff; font-weight: 700;
}

/* ── Login ──────────────────────────────────────────────────── */
.adm-login-pg {
  min-height: 100vh; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.adm-login-box {
  background: var(--bg); border-radius: 28px;
  box-shadow: var(--neu-lg);
  padding: 44px 38px; width: 100%; max-width: 390px;
}
.adm-login-logo { font-size: 20px; font-weight: 800; color: var(--tx); margin-bottom: 3px; }
.adm-login-logo b { color: var(--ac); }
.adm-login-sub { font-size: 12.5px; color: var(--tx3); margin-bottom: 32px; }
.adm-login-box .fg label { color: var(--tx2); }
.adm-login-box .fg input {
  background: var(--bg);
  box-shadow: var(--neu-in-lg);
  border-radius: var(--r-pill);
  padding: 12px 18px;
}
.adm-login-box .fg input:focus {
  box-shadow: inset 6px 6px 14px var(--sh-d), inset -6px -6px 14px var(--sh-l);
}

/* ── 2-col / 3-col grid ─────────────────────────────────────── */
.adm-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.adm-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }

/* ── Client timeline ────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px;
  width: 1px; background: rgba(0,0,0,.08);
}
.tl-item { position: relative; margin-bottom: 20px; }
.tl-dot {
  position: absolute; left: -24px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); box-shadow: var(--neu-sm);
}
.tl-dot.done   { background: var(--ac); box-shadow: 2px 2px 6px rgba(108,92,231,.4), -1px -1px 4px #fff; }
.tl-dot.active { background: var(--green); box-shadow: 2px 2px 6px rgba(0,184,148,.4), -1px -1px 4px #fff; }
.tl-title { font-size: 13.5px; font-weight: 600; color: var(--tx); }
.tl-desc  { font-size: 12.5px; color: var(--tx2); margin-top: 2px; }
.tl-date  { font-size: 11.5px; color: var(--tx3); margin-top: 3px; }

/* ── Invoice items ──────────────────────────────────────────── */
.inv-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-items th {
  font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--tx3);
  padding: 6px 8px; border-bottom: 1px solid rgba(0,0,0,.06); text-align: left;
}
.inv-items td { padding: 6px 8px; vertical-align: middle; }
.inv-items input {
  width: 100%; border: none; border-radius: var(--r-sm);
  padding: 6px 9px; font-size: 13px; font-family: inherit;
  background: var(--bg); box-shadow: var(--neu-in-sm);
  outline: none; color: var(--tx);
}
.inv-items input:focus { box-shadow: var(--neu-in); }
.inv-footer { margin-top: 14px; display: flex; justify-content: flex-end; }
.inv-summary { min-width: 260px; }
.inv-summary-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; color: var(--tx2); }
.inv-summary-row.total { font-weight: 800; font-size: 16px; color: var(--tx); border-top: 1px solid rgba(0,0,0,.08); padding-top: 12px; margin-top: 6px; }

/* ── WA ─────────────────────────────────────────────────────── */
.wa-preview {
  background: var(--bg); border-radius: var(--r);
  box-shadow: var(--neu-in);
  padding: 16px 18px; font-size: 13.5px; line-height: 1.7;
  color: var(--tx); white-space: pre-wrap; min-height: 80px;
}
.wa-send-btn {
  background: #25d366; color: #fff; border: none;
  padding: 11px 24px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; transition: all .15s;
  box-shadow: 4px 4px 10px rgba(37,211,102,.3), -2px -2px 8px rgba(255,255,255,.6);
}
.wa-send-btn:hover { background: #1aab53; }
.wa-tag {
  display: inline-flex; align-items: center; padding: 2px 9px;
  background: var(--bg); box-shadow: var(--neu-sm);
  color: var(--ac); border-radius: 4px;
  font-size: 12px; font-family: monospace; font-weight: 600;
}

/* ── Misc ───────────────────────────────────────────────────── */
code {
  background: var(--bg); box-shadow: var(--neu-in-sm);
  padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-family: 'Courier New', monospace;
  color: var(--ac);
}
.flex { display: flex; gap: 8px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.tx2 { color: var(--tx2); }
.tx3 { color: var(--tx3); font-size: 12.5px; }
.fw6 { font-weight: 600; }
.fw7 { font-weight: 700; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sh-d); border-radius: 99px; }

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}

/* ════════════════════════════════════════════════════════════
   ADMIN RESPONSIVE
════════════════════════════════════════════════════════════ */

/* Hamburger button — hidden on desktop */
.adm-hamburger {
  display: none;
  width: 38px; height: 38px; border: none; cursor: pointer;
  background: var(--bg); border-radius: var(--r-sm);
  box-shadow: var(--neu-sm);
  align-items: center; justify-content: center;
  color: var(--tx2); flex-shrink: 0;
  transition: box-shadow .2s;
}
.adm-hamburger:active { box-shadow: var(--neu-in-sm); }

/* Sidebar overlay backdrop */
.adm-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 49;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s;
}
.sidebar-open .adm-overlay { display: block; opacity: 1; }

@media (max-width: 960px) {
  .adm-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .adm-kpi-row { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 768px) {
  .adm-hamburger { display: flex; }

  /* Sidebar → off-canvas drawer */
  .adm-sidebar {
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 50;
    box-shadow: none;
  }
  .sidebar-open .adm-sidebar {
    transform: translateX(0);
    box-shadow: 6px 0 24px var(--sh-d);
  }

  /* Main: full width */
  .adm-main { margin-left: 0; padding: 16px; }

  /* Topbar */
  .adm-topbar { gap: 12px; }
  .adm-page-ttl { font-size: 18px; }
  .adm-topbar-right > span { display: none; }

  /* Tables scroll horizontally */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

  /* Forms single column */
  .adm-form-row,
  .adm-form-2col { grid-template-columns: 1fr !important; }

  /* Modals: full width */
  .adm-modal-inner { width: calc(100vw - 32px) !important; max-width: 100% !important; }

  /* Filters / action bars wrap */
  .adm-bar { flex-wrap: wrap; gap: 8px; }
  .adm-bar .btn { font-size: 12px; padding: 8px 14px; }
}

@media (max-width: 480px) {
  .adm-main { padding: 10px; }
  .adm-stats { grid-template-columns: 1fr !important; }
  .adm-kpi-row { grid-template-columns: 1fr !important; }
  .adm-page-ttl { font-size: 16px; }
  .adm-card { padding: 14px !important; }
}

/* ════════════════════════════════════════════════════════════
   ADMIN BOTTOM NAV — mobile only (≤768px)
════════════════════════════════════════════════════════════ */
.adm-bottom-nav {
  display: none;
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 60;
  width: calc(100% - 32px); max-width: 400px;
  height: 70px;
  background: var(--bg);
  border-radius: 28px;
  box-shadow: 8px 8px 20px var(--sh-d), -8px -8px 20px var(--sh-l);
  padding: 0 10px;
  align-items: center;
  justify-content: space-around;
}
@media (max-width: 768px) {
  .adm-bottom-nav { display: flex; }
  .adm-main { padding-bottom: 100px; }
}

/* Regular items */
.adm-bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--tx3);
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  flex: 1; padding: 8px 0;
  background: none; border: none; cursor: pointer;
  transition: color .2s;
  position: relative;
}
.adm-bn-item svg { width: 20px; height: 20px; transition: transform .2s; }
.adm-bn-item:hover,
.adm-bn-item.act { color: var(--ac); }
.adm-bn-item.act svg { transform: scale(1.12); }

/* Badge on icon */
.adm-bn-badge {
  position: absolute; top: 4px; right: calc(50% - 16px);
  min-width: 16px; height: 16px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  line-height: 1;
}

/* Center raised button */
.adm-bn-center {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: var(--tx); color: var(--bg);
  text-decoration: none;
  box-shadow: 4px 4px 12px var(--sh-d), -2px -2px 8px var(--sh-l),
              0 8px 24px rgba(0,0,0,.25);
  position: relative; top: -16px;
  transition: transform .2s, box-shadow .2s;
}
.adm-bn-center:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 6px 6px 16px var(--sh-d), -2px -2px 10px var(--sh-l),
              0 12px 28px rgba(0,0,0,.3);
}
.adm-bn-center:active { transform: scale(.95); }
.adm-bn-center svg { width: 22px; height: 22px; }
