@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --navy: #071428;
  --navy-2: #0b1d38;
  --navy-hover: #132a4f;
  --primary: #1d4ed8;
  --primary-2: #2563eb;
  --accent: #ea580c;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #16a34a;
  --warn: #ca8a04;
  --danger: #dc2626;
  --shadow: 0 12px 32px rgba(15, 23, 42, .07);
  --radius: 16px;
  --sidebar: 268px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  font-weight: 600; transition: .15s ease; white-space: nowrap;
}
.btn-primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .25); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: #f8fafc; }
.btn-orange { background: var(--accent); color: #fff; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-sm { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #dbe7ff;
  position: sticky; top: 0; height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  flex-shrink: 0;
  z-index: 30;
  overflow: hidden;
}
.brand {
  padding: 22px 22px 8px;
  font-size: 24px; font-weight: 800; color: #60a5fa; letter-spacing: -.04em;
}
.nav-label {
  text-transform: uppercase; font-size: 11px; letter-spacing: .16em;
  color: #7d93b8; padding: 12px 22px 6px;
}
.nav-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #1e3a8a transparent;
}
.nav {
  padding-bottom: 8px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  margin: 0 10px; padding: 7px 12px; border-radius: 9px;
  color: #c9d7f0; font-size: 13px; line-height: 1.2;
}
.nav a:hover { background: var(--navy-hover); }
.nav a.active { background: #1e3a8a; color: #fff; font-weight: 600; }
.nav svg { width: 17px; height: 17px; opacity: .9; flex-shrink: 0; }
.sidebar-foot {
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #071428;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.user-chip { font-size: 12px; color: #93c5fd; margin: 0 0 8px; padding: 0 4px; }
.user-chip strong { display: block; color: #fff; font-size: 13px; }
.signout { width: 100%; background: transparent; border: 1px solid #334155; color: #cbd5e1; }
.signout:hover { background: #132a4f; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 25;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #1e3a8a; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer;
}
.lang-switch { display: flex; gap: 4px; background: #f1f5f9; padding: 3px; border-radius: 10px; }
.lang-switch a { padding: 6px 10px; border-radius: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.lang-switch a.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.content { padding: 28px 28px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-title {
  font-size: clamp(28px, 3.4vw, 40px); margin: 0 0 6px; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(90deg, #0f172a 20%, #92400e 140%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-sub { color: var(--muted); margin: 0 0 20px; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head .page-title { margin-bottom: 4px; }
.page-head .page-sub { margin-bottom: 0; }
.page-head .btn { flex-shrink: 0; margin-top: 6px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; border: 1px solid rgba(226,232,240,.7);
}
.card h2 { margin: 0 0 6px; font-size: 20px; }
.kpi { position: relative; overflow: hidden; min-height: 148px; }
.kpi h4 { margin: 0; font-size: 11px; letter-spacing: .08em; font-weight: 700; color: var(--primary); padding-right: 44px; }
.kpi .val {
  font-size: clamp(20px, 1.8vw, 32px); font-weight: 800; margin: 14px 0 8px;
  line-height: 1.15; word-break: break-word;
}
.kpi p { margin: 0; color: var(--muted); font-size: 13px; padding-right: 36px; }
.kpi .ico {
  position: absolute; right: 14px; top: 14px; width: 40px; height: 40px;
  border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.6); font-size: 18px;
}
.kpi-blue { background: linear-gradient(135deg, #dbeafe, #eff6ff); }
.kpi-orange { background: linear-gradient(135deg, #ffedd5, #fff7ed); }
.kpi-orange h4 { color: #c2410c; }
.kpi-green { background: linear-gradient(135deg, #dcfce7, #f0fdf4); }
.kpi-green h4 { color: #15803d; }
.kpi-purple { background: linear-gradient(135deg, #ede9fe, #f5f3ff); }
.kpi-purple h4 { color: #6d28d9; }

.banner-2fa {
  background: #fff7ed; border: 1px solid #fdba74; color: #9a3412;
  border-radius: 14px; padding: 16px 18px; margin-bottom: 18px;
}
.banner-2fa h3 { margin: 0 0 6px; font-size: 16px; }
.banner-2fa p { margin: 0; max-width: 720px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.badge-paid { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-cancelled, .badge-failed { background: #f1f5f9; color: #475569; }
.badge-refunded { background: #e0e7ff; color: #3730a3; }
.badge-blocked { background: #ffedd5; color: #9a3412; }
.badge-vip { background: #1d4ed8; color: #fff; }
.badge-client { background: #e2e8f0; color: #334155; }
.badge-prospect { background: #f1f5f9; color: #475569; }
.badge-partner { background: #dbeafe; color: #1e3a8a; }
.badge-actif { background: #dcfce7; color: #166534; }
.badge-inactif { background: #e2e8f0; color: #475569; }
.badge-archive { background: #f1f5f9; color: #64748b; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: #f8fafc; }

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center;
}
.search {
  flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: #fff;
}
select.search { flex: 0 1 180px; }

.list { display: grid; gap: 12px; }
.item {
  background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start;
  border: 1px solid rgba(226,232,240,.8);
}
.item h3 { margin: 0 0 6px; font-size: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meta { color: var(--muted); font-size: 13px; display: grid; gap: 8px; }
.meta strong { color: var(--text); font-size: 18px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.inv-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.inv-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.inv-check {
  width: 16px;
  height: 16px;
  margin-top: 5px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.inv-title-wrap { flex: 1; min-width: 0; }
.inv-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.01em;
}
.inv-client {
  margin-top: 3px;
  font-size: 13px;
  color: #0f766e;
  font-weight: 500;
}
.inv-card .badge { flex-shrink: 0; }
.inv-card .badge .ico { flex-shrink: 0; }
.badge-pending { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.badge-overdue { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-paid { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.inv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 28px;
  margin: 16px 0 8px;
  padding-left: 28px;
}
.inv-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 3px;
}
.inv-field .val {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}
.inv-field .val.amount { font-size: 16px; font-weight: 800; }
.inv-field .val.slim { font-weight: 600; font-size: 14px; color: #1e293b; }
.inv-desc {
  padding-left: 28px;
  color: #94a3b8;
  font-size: 13px;
  margin: 6px 0 14px;
  line-height: 1.45;
  word-break: break-word;
}
.inv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 28px;
}
.inv-act { display: inline-flex; margin: 0; }
.ibtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.ibtn:hover { background: #f8fafc; }
.ibtn-blue { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.ibtn-blue:hover { background: #1e40af; }
.ibtn-orange { background: #ea580c; border-color: #ea580c; color: #fff; }
.ibtn-orange:hover { background: #c2410c; }
.ibtn-red { background: #dc2626; border-color: #dc2626; color: #fff; }
.ibtn-red:hover { background: #b91c1c; }
.ibtn-green { background: #16a34a; border-color: #16a34a; color: #fff; }
.ibtn-green:hover { background: #15803d; }
.ibtn .ico, .badge .ico { flex-shrink: 0; pointer-events: none; }
.receipt {
  max-width: 560px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.receipt-brand { font-weight: 800; color: var(--primary); font-size: 22px; }
.receipt h1 { margin: 8px 0 4px; font-size: 22px; }
.receipt .sub { color: var(--muted); margin: 0 0 16px; }

.page-title-notif {
  background: linear-gradient(90deg, #2563eb 0%, #0d9488 40%, #65a30d 70%, #ca8a04 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.export-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-export {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e2e8f0; color: #334155;
  border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 14px;
}
.btn-export:hover { background: #f8fafc; }
.btn-export .ico { color: #64748b; }
.notif-filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 4px 0 12px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 8px 12px; color: #64748b; min-height: 42px;
}
.chip select, .chip input {
  border: 0; background: transparent; outline: none;
  font: inherit; color: #0f172a; min-width: 110px;
}
.chip-search { flex: 1; min-width: 200px; }
.chip-search input { flex: 1; min-width: 0; width: 100%; }
.notif-count { color: #94a3b8; font-size: 13px; margin: 0 0 14px; }
.tx-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.tx-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0; margin-top: 2px;
  color: #fff;
}
.tx-icon .ico { pointer-events: none; }
.tx-icon-completed { background: #22c55e; }
.tx-icon-pending { background: #eab308; }
.tx-icon-failed { background: #ef4444; }
.tx-body { flex: 1; min-width: 0; }
.tx-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tx-name { font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .01em; }
.tx-inv { color: #64748b; font-size: 13px; margin-top: 3px; }
.tx-meta {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 8px 24px;
  margin-top: 12px;
  font-size: 14px;
}
.tx-meta .k { color: #0f172a; }
.tx-id, .tx-date { color: #94a3b8; font-size: 13px; margin-top: 6px; }
.badge-tx-completed { background: #1e3a8a; color: #fff; }
.badge-tx-pending { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.badge-tx-failed { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 16px; color: var(--muted); }

.btn-phone-req { color: #334155; }
.btn-phone-req .ico { color: #ea580c; }
.cust-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 16px 18px 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.cust-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cust-name {
  margin: 0; font-size: 18px; font-weight: 800;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.cust-tools { display: flex; gap: 8px; flex-shrink: 0; }
.icon-sq {
  width: 36px; height: 36px; border: 1px solid #e2e8f0; background: #fff;
  border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: #334155;
}
.icon-sq:hover { background: #f8fafc; }
.icon-sq .ico { pointer-events: none; transition: transform .15s; }
.cust-card.open [data-toggle-invoices] .ico { transform: rotate(180deg); }
.cust-email {
  display: inline-flex; align-items: center; gap: 8px;
  color: #0d9488; margin: 8px 0 14px; font-size: 14px;
}
.cust-email.muted { color: #94a3b8; }
.cust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.cust-field { display: flex; gap: 10px; align-items: flex-start; color: #94a3b8; font-size: 13px; }
.cust-field .lab { font-size: 12px; }
.cust-field .val { color: #0f172a; font-weight: 600; font-size: 14px; margin-top: 2px; }
.phone-missing {
  width: 22px; height: 22px; color: #ea580c; display: grid; place-items: center; flex-shrink: 0;
}
.badge-nophone { background: #fff; border: 1px solid #fdba74; color: #ea580c; margin-top: 4px; }
.badge-type-client { background: #ccfbf1; color: #0f766e; }
.badge-type-vip { background: #1d4ed8; color: #fff; }
.badge-type-prospect { background: #f1f5f9; color: #475569; }
.badge-type-partner { background: #dbeafe; color: #1e3a8a; }
.badge-status-actif { background: #1e3a8a; color: #fff; }
.badge-status-inactif { background: #e2e8f0; color: #475569; }
.badge-status-archive { background: #f1f5f9; color: #64748b; }
.badge-inv-count { background: #fff; border: 1px solid #e2e8f0; color: #64748b; font-weight: 600; }
.cust-invoices { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e5e7eb; }
.cust-invoices h4 {
  margin: 0 0 10px; font-size: 14px; display: flex; gap: 8px; align-items: center; font-weight: 700;
}
.cust-inv-row {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9;
}
.cust-inv-row:last-child { border-bottom: 0; }
.cust-inv-num { font-weight: 700; }
.cust-inv-date { color: #94a3b8; font-size: 13px; }
.cust-inv-amt { margin-left: auto; font-weight: 700; text-align: right; }

.page-title-users {
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 38%, #ca8a04 72%, #ea580c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.role-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.role-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 16px 16px 18px;
  border-left: 4px solid #cbd5e1;
  min-height: 148px;
}
.role-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.role-card p { margin: 0; font-size: 13px; color: #475569; line-height: 1.45; }
.role-admin { border-left-color: #a855f7; }
.role-admin h3, .role-admin .ico { color: #7e22ce; }
.role-comptable { border-left-color: #2563eb; }
.role-comptable h3, .role-comptable .ico { color: #1d4ed8; }
.role-moderator { border-left-color: #22c55e; }
.role-moderator h3, .role-moderator .ico { color: #16a34a; }
.role-user { border-left-color: #64748b; }
.role-user h3, .role-user .ico { color: #475569; }
.users-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  border-top: 3px solid #2563eb;
  padding: 18px 20px 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.users-panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.users-table th { font-weight: 600; }
.users-table td { vertical-align: middle; }
.muted-cell { color: #64748b; }
.tbl-select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  min-width: 130px;
  max-width: 180px;
}
.inline-form { margin: 0; }
.row-actions { display: flex; gap: 6px; }
.icon-sq-danger { color: #dc2626; }
.users-table tr.is-blocked { opacity: .6; }
.user-dialog {
  border: 0;
  border-radius: 16px;
  padding: 24px;
  width: min(440px, 92vw);
  box-shadow: var(--shadow);
}
.user-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.user-dialog h2 { margin: 0 0 12px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 8px; }

.form { display: grid; gap: 12px; }
.form label { font-weight: 600; font-size: 14px; }
.form input, .form select, .form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid #bfdbfe; border-color: var(--primary-2);
}
.form input[type=checkbox], .form input[type=radio] {
  width: auto; padding: 0; margin-right: 8px; accent-color: var(--primary);
}
.check-list { display: grid; gap: 10px; }
.check-list label { display: flex; align-items: center; font-weight: 500; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.form .btn { justify-self: start; }
.form .btn-block { justify-self: stretch; width: 100%; }
.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.flash-ok { background: #dcfce7; color: #166534; }
.flash-err { background: #fee2e2; color: #991b1b; }

.guest-body { background: linear-gradient(180deg, #f8fbff, #e8f0ff); min-height: 100vh; }
.auth-wrap {
  min-height: calc(100vh - 80px); display: grid; place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(440px, 100%); background: #fff; border-radius: 24px;
  box-shadow: var(--shadow); padding: 28px;
}
.logo-mark {
  width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 20px;
  background: linear-gradient(135deg, #1e3a8a, #38bdf8);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 28px;
}
.auth-card h1 { text-align: center; color: var(--primary); margin: 8px 0 4px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 18px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs a { text-align: center; padding: 10px; border-radius: 10px; font-weight: 700; color: #64748b; }
.tabs a.on { background: var(--primary); color: #fff; }

.pay-hero { text-align: center; padding: 28px 0 8px; }
.pay-card { max-width: 520px; margin: 0 auto; }
.pay-amount { font-size: 28px; font-weight: 800; margin: 8px 0; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 8px; }
.pay-method {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 12px;
  text-align: center; background: #fff; color: inherit; text-decoration: none;
  display: flex; flex-direction: column; gap: 4px; min-height: 92px; justify-content: center;
}
.pay-method:hover { border-color: var(--primary); box-shadow: 0 8px 20px rgba(15,23,42,.08); }
.pay-method.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.pay-method strong { font-size: 14px; }
.pay-method span { font-size: 12px; color: var(--muted); }
.pay-orange { border-color: #fdba74; }
.pay-visa { border-color: #93c5fd; }
.pay-paypal { border-color: #7dd3fc; }
.paypal-box { min-height: 54px; margin: 18px 0 8px; }
.paypal-box iframe { max-width: 100%; }
.pay-touchpay { border-color: #c4b5fd; }
.pay-qr { text-align: center; margin: 16px 0; }
.pay-qr img { border: 3px solid #ff6600; border-radius: 12px; background: #fff; padding: 8px; }
.pay-demo { margin-top: 18px; }
.methods { display: grid; gap: 10px; }
.method {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px; cursor: pointer; background: #fff;
}
.method:has(input:checked) { border-color: var(--primary-2); background: #eff6ff; }
.method input { margin: 0; accent-color: var(--primary); }
.footer-mini { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 12px 28px; }
.footer-mini a { color: var(--primary); }

.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.bar { height: 10px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.bar > span { display: block; height: 100%; background: var(--primary); }

.back-link { display: inline-flex; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--primary); }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 12px; overflow: auto; }

.mobile-toggle { display: none; }
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; }
  .sidebar-overlay.show { display: block; }
  .mobile-toggle { display: grid; }
  .item { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 40px; }
  .inv-grid, .inv-desc, .inv-actions { padding-left: 0; }
  .inv-grid { grid-template-columns: 1fr 1fr; }
  .cust-grid { grid-template-columns: 1fr; }
  .role-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tabs-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 16px; }
.tabs-bar .tab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; font-weight: 700; color: #475569; cursor: pointer;
}
.tabs-bar .tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.filter-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-grid label { display: grid; gap: 6px; font-size: 13px; color: #64748b; font-weight: 600; }
.filter-grid input, .filter-grid select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: #fff; font: inherit; color: inherit;
}
.filter-row {
  display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end;
}
.filter-row label {
  display: grid; gap: 6px; font-size: 12px; color: #64748b; font-weight: 600;
  min-width: 140px; flex: 1;
}
.filter-row input, .filter-row select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: #fff; font: inherit; color: inherit; min-height: 42px;
}
.filter-row .filter-actions { display: flex; gap: 8px; margin: 0; flex: 0 0 auto; padding-bottom: 1px; }
.report-h { display: flex; align-items: center; gap: 8px; }
.channel-block {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-radius: 12px; margin: 8px 0;
}
.channel-block.ch-blue { background: #eff6ff; }
.channel-block.ch-green { background: #ecfdf5; }
.channel-block.ch-orange { background: #fff7ed; }
.channel-block.ch-purple { background: #f5f3ff; }
.channel-block.ch-gray { background: #f1f5f9; }
.pill-method {
  display: inline-block; background: #eff6ff; color: #1d4ed8;
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700;
}
.filter-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.lbl-ico { display: inline-flex; align-items: center; gap: 6px; }
.audit-empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.audit-empty h3 { margin: 8px 0 4px; color: var(--text); font-size: 18px; }
.audit-empty p { margin: 0; }
.audit-empty-ico {
  width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%;
  background: #f1f5f9; color: #94a3b8; display: grid; place-items: center;
}
@media (max-width: 980px) {
  .filter-grid-4 { grid-template-columns: 1fr 1fr; }
}
.blocked-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 12px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hint-note { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.status-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; margin: 8px 0; }
.status-row.ok { background: #ecfdf5; }
.status-row.wait { background: #fffbeb; }
.status-row.late { background: #fef2f2; }
.status-row.ok strong { color: #15803d; background: #dcfce7; border-radius: 999px; padding: 2px 10px; }
.status-row.wait strong { color: #b45309; background: #ffedd5; border-radius: 999px; padding: 2px 10px; }
.status-row.late strong { color: #b91c1c; background: #fee2e2; border-radius: 999px; padding: 2px 10px; }
.action-alert { border-radius: 12px; padding: 12px; margin: 8px 0; font-weight: 600; }
.action-alert.late { background: #fef2f2; color: #991b1b; }
.action-alert.wait { background: #fff7ed; color: #9a3412; }
.action-alert.ok { background: #ecfdf5; color: #166534; }
.channel-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin: 10px 0; }
.channel-amt { text-align: right; font-weight: 700; }
.channel-amt small { display: block; color: var(--muted); font-weight: 500; }
.age-cell { white-space: nowrap; color: #b45309; font-weight: 700; }
.fail-reason { color: #b91c1c; }
.check-list { margin: 8px 0 16px; padding-left: 18px; line-height: 1.6; }
.check-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-weight: 600; }
.log-list { font-size: 13px; line-height: 1.7; color: #334155; }
.pci-wrap { margin-top: 14px; display: grid; justify-items: center; gap: 6px; }
.pci-badge { width: 88px; height: 88px; object-fit: contain; background: #0b3a82; border-radius: 12px; }
.pci-score { margin: 12px 0 16px; padding: 12px 16px; border-radius: 12px; font-weight: 800; }
.pci-score.ok { background: #ecfdf5; color: #166534; }
.pci-score.warn { background: #fff7ed; color: #9a3412; }
.sec-chart { display: flex; align-items: end; gap: 8px; height: 160px; padding: 12px 0 0; overflow-x: auto; }
.sec-bar { flex: 1; min-width: 28px; display: grid; justify-items: center; align-items: end; height: 100%; }
.sec-bar span { width: 100%; max-width: 28px; background: var(--primary); border-radius: 8px 8px 0 0; display: block; }
.sec-bar small { margin-top: 6px; color: var(--muted); font-size: 11px; }
.sec-alert { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; }
.sec-alert.sec-critical { border-left: 4px solid #dc2626; }
.sec-alert.sec-high { border-left: 4px solid #ea580c; }
.live-dot { background: #dcfce7; color: #166534; font-weight: 800; padding: 6px 12px; border-radius: 999px; }
.live-dot::before { content: ''; display: inline-block; width: 8px; height: 8px; background: #16a34a; border-radius: 50%; margin-right: 6px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.search-sm { max-width: 140px; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }
@media print {
  .sidebar, .topbar, .no-print, .sidebar-overlay { display: none !important; }
  .app { display: block; }
  .main { margin: 0; }
}

@media (max-width: 720px) {
  .grid-4 { grid-template-columns: 1fr; }
  .inv-grid { grid-template-columns: 1fr; }
  .role-cards { grid-template-columns: 1fr; }
}

.guide-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  background: #eef2f7;
  border-radius: 12px;
  padding: 4px;
  margin: 0 0 18px;
}
.guide-tabs .tab {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 12px 10px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.guide-tabs .tab.on { background: #fff; color: #0f172a; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.guide-hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafc, #fff);
}
.guide-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: #eff6ff; color: #1d4ed8; flex: 0 0 40px;
}
.guide-hero h2 { margin: 0; font-size: 20px; }
.guide-hero p { margin: 4px 0 0; color: var(--muted); }
.guide-body { padding: 8px 20px 20px; }
.guide-body h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 22px 0 10px; font-size: 17px;
}
.guide-body h4 { margin: 14px 0 8px; font-size: 14px; }
.guide-body p, .guide-body li { font-size: 14px; line-height: 1.55; color: #334155; }
.guide-acc {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 8px 0;
  background: #fff;
  overflow: hidden;
}
.guide-acc > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-acc > summary::-webkit-details-marker { display: none; }
.guide-acc > summary::before {
  content: '›';
  font-size: 18px;
  color: #94a3b8;
  transform: rotate(0deg);
  transition: .15s;
}
.guide-acc[open] > summary::before { transform: rotate(90deg); }
.guide-acc .guide-acc-body { padding: 0 16px 14px; }
.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.guide-steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
}
.guide-steps li::before {
  counter-increment: gstep;
  content: counter(gstep);
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 12px;
  display: grid;
  place-items: center;
}
.guide-acc-body ol.guide-steps, .guide-body ol.guide-steps { counter-reset: gstep; }
.guide-list { margin: 0; padding-left: 18px; }
.guide-list li { margin: 4px 0; }
.guide-note, .guide-warn, .guide-alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.5;
}
.guide-note { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.guide-warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.guide-alert { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.guide-contact { display: grid; gap: 6px; }
.guide-contact a { color: var(--primary); font-weight: 600; }
@media print {
  .guide-tabs { display: none; }
  .tab-panel[hidden] { display: block !important; break-before: page; }
  .guide-acc { break-inside: avoid; }
  .guide-acc > summary::before { display: none; }
}
.api-key-code { font-size: 12px; word-break: break-all; }
.inv-exp { display: flex; flex-direction: column; gap: 2px; }
.text-ok { color: #16a34a; font-weight: 600; }
.text-err { color: #dc2626; font-weight: 600; }
.docs-panel pre {
  background: #0f172a; color: #e2e8f0; padding: 14px 16px;
  border-radius: 12px; overflow: auto; font-size: 13px; line-height: 1.5;
}
.docs-panel h3 { margin: 18px 0 8px; font-size: 16px; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; }
