/* ============================================================
   Hədəf Payment Manager — design system
   Brand: Hədəf Liseyi navy + azure (hedefliseyi.edu.az)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Mulish:wght@400;500;600;700&display=swap');

:root {
  /* Brand */
  --brand: #2f77b3;
  --brand-hover: #135cae;
  --brand-dark: #0b4690;
  --brand-soft: #e8f1fb;
  --accent: #4a9fe0; /* light azure highlight (active nav) */

  /* Sidebar */
  --nav-top: #0e2e49;
  --nav-bottom: #0e192d;
  --nav-text: #b7c4d6;
  --nav-active: rgba(255, 255, 255, 0.12);

  /* Surfaces */
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5eaf1;

  /* Text */
  --text: #0f1e33;
  --muted: #64748b;
  --faint: #94a3b8;

  /* Semantic */
  --green: #12a150;
  --green-bg: #e6f7ee;
  --orange: #d97706;
  --orange-bg: #fef3e2;
  --red: #e4032b;
  --red-bg: #fdeaec;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 30, 51, 0.06), 0 1px 3px rgba(15, 30, 51, 0.05);
  --shadow: 0 4px 16px rgba(15, 30, 51, 0.08);
  --shadow-lg: 0 18px 50px rgba(11, 42, 84, 0.28);
}

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

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Mulish', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  font-size: 14px;
}

h1, h2, h3,
.login-logo .name,
.sidebar .brand .txt,
.stat-card .value,
.detail-hero .meta h2 {
  font-family: 'Poppins', 'Mulish', 'Segoe UI', sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

/* ===================== Login ===================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, #1c6fd6 0%, transparent 55%),
    linear-gradient(135deg, #0b2a54 0%, #103b73 55%, #0c3e86 100%);
  position: relative;
  overflow: hidden;
}

.login-wrap::before,
.login-wrap::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
}
.login-wrap::before {
  width: 520px;
  height: 520px;
  right: -160px;
  top: -160px;
}
.login-wrap::after {
  width: 340px;
  height: 340px;
  right: -60px;
  top: -60px;
  border-color: rgba(228, 3, 43, 0.25);
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 410px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.login-logo .mark {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.login-logo .name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.login-logo .name small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-card .subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 26px;
}

.login-hint {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.login-hint b {
  color: var(--text);
}

/* ===================== App layout ===================== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 248px;
  background: linear-gradient(180deg, var(--nav-top) 0%, var(--nav-bottom) 100%);
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar .brand .mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.sidebar .brand .txt {
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.1;
}
.sidebar .brand .txt small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: #8fa8c8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--nav-text);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  opacity: 0.9;
}
.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.sidebar nav a.active {
  background: var(--nav-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar nav .divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 6px;
}

.sidebar .user-box {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .user-box .avatar {
  flex-shrink: 0;
}
.sidebar .user-box .meta {
  overflow: hidden;
}
.sidebar .user-box .meta .n {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .user-box .meta .e {
  font-size: 11.5px;
  color: #8fa8c8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content {
  flex: 1;
  padding: 26px 30px 40px;
  min-width: 0;
}

/* Mobile top bar (hidden on desktop) */
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--nav-top);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar .hamburger {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar .hamburger svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}
.topbar .tb-brand {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .tb-brand .mark {
  width: 24px;
  height: 24px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 42, 84, 0.5);
  z-index: 45;
}
.sidebar-overlay.show {
  display: block;
}

/* ===================== Page header ===================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.page-header .subtitle {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}

/* ===================== Stat cards ===================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: transform 0.12s, box-shadow 0.12s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
}
.stat-icon.blue { background: var(--brand-soft); color: var(--brand); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-icon.orange { background: var(--orange-bg); color: var(--orange); }

.stat-card .label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.stat-card .value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: -0.02em;
}

/* ===================== Cards & tables ===================== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 22px;
  overflow: hidden;
}
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-head h2 {
  font-size: 15.5px;
  font-weight: 700;
}
.card-head .hint {
  font-size: 12.5px;
  color: var(--faint);
}

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  text-align: left;
  padding: 12px 20px;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
tbody td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr.clickable {
  cursor: pointer;
  transition: background 0.12s;
}
tbody tr.clickable:hover {
  background: var(--brand-soft);
}

.text-right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { color: var(--brand); }
th.sortable::after {
  content: '↕';
  margin-left: 5px;
  font-size: 10px;
  opacity: 0.35;
}
th.sortable.sorted-asc::after { content: '↑'; opacity: 1; color: var(--brand); }
th.sortable.sorted-desc::after { content: '↓'; opacity: 1; color: var(--brand); }
.strong { font-weight: 600; }
.muted-text { color: var(--muted); }

/* Cell with avatar + name */
.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===================== Avatar ===================== */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

/* ===================== Progress bar ===================== */
.progress {
  height: 7px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
  min-width: 90px;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.4s ease;
}
.progress-fill.full { background: var(--green); }
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-row .pct {
  font-size: 12px;
  color: var(--muted);
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ===================== Badges ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.paid { background: var(--green-bg); color: var(--green); }
.badge.has_debt { background: var(--orange-bg); color: var(--orange); }

/* ===================== Forms ===================== */
label.field {
  display: block;
  margin-bottom: 15px;
  font-size: 13px;
  font-weight: 600;
  color: #33445c;
}
label.field > span {
  display: block;
  margin-bottom: 6px;
}
label.field small {
  font-weight: 400;
  color: var(--faint);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder { color: var(--faint); }
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 99, 198, 0.15);
}
select[multiple] {
  min-height: 128px;
  padding: 6px;
}
select[multiple] option {
  padding: 6px 8px;
  border-radius: 6px;
}
textarea {
  resize: vertical;
  min-height: 74px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; }

.btn.secondary {
  background: #fff;
  color: #334155;
  border-color: var(--border);
}
.btn.secondary:hover { background: var(--surface-2); border-color: #cbd5e1; }

.btn.ghost {
  background: transparent;
  color: var(--brand);
}
.btn.ghost:hover { background: var(--brand-soft); }

.btn.danger { background: var(--red); }
.btn.danger:hover { background: #c00325; }

.btn.sm { padding: 7px 12px; font-size: 12.5px; gap: 5px; }
.btn.icon { padding: 8px; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===================== Filter bar ===================== */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  background: var(--surface);
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  align-items: end;
}
.filter-bar label.field { margin-bottom: 0; }
.filter-bar .actions {
  display: flex;
  gap: 8px;
}

/* Search input with icon */
.search-field {
  position: relative;
}
.search-field svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--faint);
  pointer-events: none;
}
.search-field input {
  padding-left: 34px;
}

/* ===================== Period tabs ===================== */
.period-tabs {
  display: inline-flex;
  background: #eaeef4;
  border-radius: 10px;
  padding: 3px;
}
.period-tabs button {
  border: none;
  background: transparent;
  padding: 7px 15px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.period-tabs button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* ===================== Bar chart ===================== */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 200px;
  padding: 20px 20px 8px;
}
.chart .bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
  min-width: 24px;
}
.chart .bar-track {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1;
}
.chart .bar {
  width: 100%;
  max-width: 46px;
  background: linear-gradient(180deg, #2b7de0 0%, var(--brand) 100%);
  border-radius: 7px 7px 0 0;
  min-height: 4px;
  position: relative;
  transition: height 0.5s ease;
}
.chart .bar:hover { filter: brightness(1.08); }
.chart .bar .bar-val {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.chart .bar-label {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ===================== Modal ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 42, 84, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open {
  display: flex;
  animation: overlay-in 0.15s ease;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes modal-in {
  from { transform: translateY(14px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-head .close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--faint);
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.modal-head .close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px; }
.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
}

/* ===================== Toast ===================== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fff;
  border-radius: 11px;
  padding: 13px 16px;
  box-shadow: var(--shadow-lg);
  min-width: 270px;
  max-width: 360px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  animation: toast-in 0.22s ease;
}
.toast .t-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
}
.toast.success .t-icon { background: var(--green); }
.toast.error .t-icon { background: var(--red); }
.toast.info .t-icon { background: var(--brand); }
@keyframes toast-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===================== Spinner ===================== */
#spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(243, 246, 251, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(1px);
}
#spinner-overlay.show { display: flex; }
.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #d7e0ec;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Empty state ===================== */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}
.empty .icon svg { width: 26px; height: 26px; stroke: currentColor; }
.empty .title { font-weight: 600; color: var(--text); margin-bottom: 3px; }
.empty .sub { font-size: 13px; }

/* ===================== Customer detail ===================== */
.detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.detail-hero .meta h2 { font-size: 20px; font-weight: 700; }
.detail-hero .meta .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  padding: 22px 24px;
}
.info-item .k {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.info-item .v {
  font-size: 17px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.01em;
}

.pay-summary {
  padding: 0 24px 22px;
}
.pay-summary .bar-big {
  height: 12px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}
.pay-summary .bar-big > div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b7de0, var(--brand));
}
.pay-summary .legend {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.suggested {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--brand-soft);
  border: 1px solid #cfe1f8;
  color: var(--brand-dark);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  margin: 0 24px 20px;
}
.suggested svg { width: 18px; height: 18px; stroke: var(--brand); flex-shrink: 0; }

.error-text {
  color: var(--red);
  font-size: 12.5px;
  margin: -8px 0 12px;
  min-height: 16px;
}

/* ===================== Checkbox multi-select ===================== */
.checklist {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 190px;
  overflow-y: auto;
  padding: 4px;
  background: #fff;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s;
}
.check-item:hover { background: var(--surface-2); }
.check-item.checked { background: var(--brand-soft); }
.check-item input { display: none; }
.check-item .cbx {
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}
.check-item .cbx svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; opacity: 0; }
.check-item.checked .cbx { background: var(--brand); border-color: var(--brand); }
.check-item.checked .cbx svg { opacity: 1; }
.check-empty { padding: 14px; color: var(--faint); font-size: 13px; text-align: center; }

/* ===================== Copy payment link ===================== */
.paylink-box {
  margin: 0 24px 22px;
  padding: 14px 16px;
  border: 1px dashed #cfe1f8;
  background: #f5f9fe;
  border-radius: var(--radius-sm);
}
.paylink-box .pl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 8px;
}
.paylink-box .pl-head svg { width: 16px; height: 16px; stroke: var(--brand); }
.paylink-row { display: flex; gap: 8px; }
.paylink-row input {
  font-size: 12.5px;
  background: #fff;
  color: var(--muted);
}

/* ===================== Language switcher ===================== */
.lang-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}
.lang-switch.light {
  background: #eaeef4;
}
.lang-btn {
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.7;
  letter-spacing: 0.02em;
}
.lang-switch.light .lang-btn {
  color: var(--muted);
}
.lang-btn:hover {
  opacity: 1;
}
.lang-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  opacity: 1;
}
.lang-switch.light .lang-btn.active {
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.sidebar .lang-row {
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.login-lang {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

/* ===================== Payment method selector ===================== */
.method-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}
.method-opt {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.method-opt:hover {
  border-color: var(--brand);
}
.method-opt.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.method-opt input {
  width: auto;
  margin: 0;
}
.method-opt .mi {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.method-opt .mi svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}
.method-opt .mt {
  font-size: 13px;
  font-weight: 600;
}

.badge.method {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge.method::before {
  background: var(--brand);
}
.badge.pending { background: var(--orange-bg); color: var(--orange); }
.badge.completed { background: var(--green-bg); color: var(--green); }
.badge.failed { background: var(--red-bg); color: var(--red); }

/* ===================== EPAY checkout (sandbox) ===================== */
.epay-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #0e2e49 0%, #0e192d 100%);
}
.epay-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}
.epay-top {
  background: var(--nav-top);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.epay-top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 17px;
}
.epay-sandbox-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent);
  color: #05203a;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.epay-body { padding: 24px; }
.epay-amount {
  text-align: center;
  margin: 6px 0 22px;
}
.epay-amount .lbl {
  font-size: 12.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.epay-amount .amt {
  font-family: 'Poppins', sans-serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-top: 4px;
}
.epay-rows { margin-bottom: 22px; }
.epay-rows .row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.epay-rows .row:last-child { border-bottom: none; }
.epay-rows .row .k { color: var(--muted); }
.epay-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 16px;
  line-height: 1.6;
}
.epay-actions { display: flex; flex-direction: column; gap: 10px; }
.epay-fail-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  margin-top: 2px;
}

/* ===================== Responsive ===================== */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { display: flex; }
  .content { padding: 18px 16px 32px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .page-header h1 { font-size: 20px; }
  .stat-card .value { font-size: 21px; }
}
