/* BuySMS panel — brand colours taken from the logo (yellow → orange → red). */
:root {
  --brand-1: #ffb547;
  --brand-2: #ff7a2f;
  --brand-3: #e8452c;
  --brand-dark: #8b1a12;
  --brand: #f15a2b;
  --brand-rgb: 241, 90, 43;
  --brand-grad: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 45%, var(--brand-3) 100%);

  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e7e9f0;
  --text: #1c2033;
  --muted: #6b7185;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 18px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);

  --side-bg: #12131c;
  --side-bg-2: #191b27;
  --side-text: #a3a8bd;
  --side-text-hi: #ffffff;
  --side-w: 264px;
  --radius: 14px;
  --radius-sm: 10px;

  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-3);
  --bs-body-font-family: "Inter", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-border-color: var(--border);
}

[data-bs-theme="dark"] {
  --bg: #0e0f16;
  --surface: #171924;
  --surface-2: #1d202d;
  --border: #2a2d3d;
  --text: #e7e9f2;
  --muted: #9097ad;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --side-bg: #0b0c12;
  --side-bg-2: #13141d;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
}

html[lang="bn"] body { font-family: "Hind Siliguri", "Inter", system-ui, sans-serif; }

body {
  background: var(--bg);
  color: var(--text);
  font-size: .92rem;
  -webkit-font-smoothing: antialiased;
}

a, .btn-link { text-decoration: none; }
.text-muted, .text-secondary { color: var(--muted) !important; }
.fw-semi { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }

/* ---------- Buttons & form controls ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; padding: .5rem 1rem; }
.btn-sm { padding: .32rem .7rem; border-radius: 8px; }
.btn-primary, .btn-brand {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--brand-3);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand);
  background-image: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), .25);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: rgba(var(--brand-rgb), .45);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-3);
}
.btn-light { --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--border); --bs-btn-color: var(--text); --bs-btn-hover-bg: var(--border); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background-color: var(--surface);
  color: var(--text);
  padding: .55rem .8rem;
}
.form-control:focus, .form-select:focus {
  border-color: rgba(var(--brand-rgb), .6);
  box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .14);
}
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .35rem; }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .14); border-color: rgba(var(--brand-rgb), .6); }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--muted); border-radius: var(--radius-sm); }

/* ---------- App shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 1040;
  background: radial-gradient(120% 60% at 0% 0%, rgba(var(--brand-rgb), .16), transparent 60%), var(--side-bg);
  color: var(--side-text); display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.sidebar .brand {
  display: flex; align-items: center; gap: .6rem; padding: 1.25rem 1.35rem 1rem;
  color: #fff; font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em;
}
.brand img { width: 38px; height: 38px; }
.brand .w-buy { color: #fff; }
.brand .w-sms { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-light .w-buy { color: var(--text); }

.side-nav { flex: 1; overflow-y: auto; padding: .25rem .85rem 1rem; scrollbar-width: thin; scrollbar-color: #2a2c3a transparent; }
.side-nav .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #5f6479; margin: 1.1rem .7rem .45rem; font-weight: 600; }
.side-nav a {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border-radius: 10px;
  color: var(--side-text); font-weight: 500; margin-bottom: 2px; position: relative;
  transition: background .15s, color .15s;
}
.side-nav a i { font-size: 1.08rem; width: 20px; text-align: center; opacity: .9; }
.side-nav a:hover { background: rgba(255, 255, 255, .05); color: var(--side-text-hi); }
.side-nav a.active {
  color: #fff; background: linear-gradient(90deg, rgba(var(--brand-rgb), .95), rgba(232, 69, 44, .85));
  box-shadow: 0 8px 20px rgba(var(--brand-rgb), .28);
}
.side-nav .badge-count {
  margin-left: auto; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 700;
  border-radius: 20px; padding: .1rem .5rem;
}
.side-nav a.active .badge-count { background: rgba(255, 255, 255, .25); }

.side-card {
  margin: 0 .85rem 1rem; padding: .95rem 1rem; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 181, 71, .14), rgba(232, 69, 44, .12));
  border: 1px solid rgba(var(--brand-rgb), .25); color: #e9e9f2;
}
.side-card .lbl { font-size: .72rem; color: #b9bdd0; text-transform: uppercase; letter-spacing: .06em; }
.side-card .val { font-size: 1.3rem; font-weight: 700; color: #fff; }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; height: 66px; display: flex; align-items: center; gap: 1rem;
  padding: 0 1.6rem; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border);
}
.topbar .page-title { font-size: 1.08rem; font-weight: 700; margin: 0; }
.topbar .crumb { font-size: .78rem; color: var(--muted); }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: .55rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .8rem; border-radius: 30px;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: .83rem; color: var(--text);
}
.chip-brand { background: rgba(var(--brand-rgb), .1); border-color: rgba(var(--brand-rgb), .25); color: var(--brand); }
.lang-switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 30px; padding: 3px; }
.lang-switch a { padding: .22rem .65rem; border-radius: 20px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.lang-switch a.on { background: var(--brand-grad); color: #fff; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }
.user-btn { display: flex; align-items: center; gap: .55rem; background: none; border: 0; color: var(--text); padding: 0; }
.user-btn .nm { display: block; font-weight: 600; font-size: .85rem; line-height: 1.1; text-align: left; }
.user-btn .rl { font-size: .72rem; color: var(--muted); }

.content { padding: 1.6rem; flex: 1; }
.app-footer { padding: 1rem 1.6rem; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--border); }

.imp-bar {
  background: repeating-linear-gradient(45deg, #2b1a10, #2b1a10 12px, #33200f 12px, #33200f 24px);
  color: #ffd9a8; padding: .5rem 1.6rem; font-size: .83rem; display: flex; align-items: center; gap: .75rem;
}

.dropdown-menu {
  border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: .4rem;
  background: var(--surface); --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface-2);
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .88rem; }
.dropdown-item i { width: 20px; color: var(--muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  --bs-card-bg: var(--surface); --bs-card-cap-bg: transparent;
}
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; }
.card-header h5, .card-header .h5 { margin: 0; font-size: 1rem; font-weight: 700; }
.card-body { padding: 1.25rem; }

.stat {
  padding: 1.15rem 1.25rem; display: flex; flex-direction: row; align-items: center; gap: 1rem; height: 100%;
  position: relative; overflow: hidden;
}
.stat .ico {
  width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; flex-shrink: 0;
}
.stat .lbl { color: var(--muted); font-size: .8rem; font-weight: 500; margin-bottom: .2rem; }
.stat .val { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.stat .sub { font-size: .76rem; color: var(--muted); margin-top: .25rem; }
.stat-hero { background: var(--brand-grad); color: #fff; border: 0; box-shadow: 0 14px 30px rgba(var(--brand-rgb), .3); }
.stat-hero .lbl, .stat-hero .sub { color: rgba(255, 255, 255, .85); }
.stat-hero .ico { background: rgba(255, 255, 255, .2); color: #fff; }
.stat-hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}

.tint-orange { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.tint-green { background: rgba(22, 163, 74, .12); color: #16a34a; }
.tint-blue { background: rgba(37, 99, 235, .12); color: #2563eb; }
.tint-purple { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.tint-red { background: rgba(220, 38, 38, .12); color: #dc2626; }
.tint-amber { background: rgba(217, 119, 6, .14); color: #d97706; }
.tint-teal { background: rgba(13, 148, 136, .12); color: #0d9488; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); margin: 0; }
.table > :not(caption) > * > * { padding: .75rem 1rem; border-bottom-color: var(--border); vertical-align: middle; }
.table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600;
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
html[lang="bn"] .table thead th { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: var(--surface-2); --bs-table-bg-state: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-main { font-weight: 600; }
.table .cell-sub { font-size: .76rem; color: var(--muted); }
.table-card { overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.msg-cell { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge-soft {
  display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .6rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.badge-soft::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-soft.no-dot::before { display: none; }
.bs-success { background: rgba(22, 163, 74, .12); color: #16a34a; }
.bs-danger { background: rgba(220, 38, 38, .12); color: #dc2626; }
.bs-warning { background: rgba(217, 119, 6, .14); color: #c2410c; }
.bs-info { background: rgba(37, 99, 235, .12); color: #2563eb; }
.bs-muted { background: rgba(107, 113, 133, .14); color: var(--muted); }
.bs-brand { background: rgba(var(--brand-rgb), .12); color: var(--brand); }

.amount-pos { color: #16a34a; font-weight: 600; }
.amount-neg { color: #dc2626; font-weight: 600; }

/* ---------- Page header / filters / misc ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.35rem; }
.page-head h1 { font-size: 1.45rem; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.page-head p { color: var(--muted); margin: .25rem 0 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.filter-bar .form-control, .filter-bar .form-select { padding: .42rem .7rem; font-size: .85rem; }
.filter-bar .btn { padding: .42rem .9rem; }
.empty { text-align: center; padding: 3.2rem 1rem; color: var(--muted); }
.empty i { font-size: 2.4rem; display: block; margin-bottom: .6rem; opacity: .5; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.25rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--text); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-hover-bg: var(--surface-2); --bs-pagination-focus-box-shadow: none; margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.2rem; font-size: .88rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; }
.progress { background: var(--surface-2); border-radius: 20px; height: 8px; }
.progress-bar { background: var(--brand-grad); }
.divider-label { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; margin: 1.2rem 0 .8rem; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

.modal-content { border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); padding: 1.1rem 1.4rem; }
.modal-header .modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { border-top: 1px solid var(--border); padding: .9rem 1.4rem; }

.nav-tabs-soft { border: 0; gap: .35rem; background: var(--surface-2); padding: .3rem; border-radius: 12px; display: inline-flex; }
.nav-tabs-soft .nav-link { border: 0; border-radius: 9px; color: var(--muted); font-weight: 600; padding: .45rem .95rem; font-size: .85rem; }
.nav-tabs-soft .nav-link.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

/* ---------- Composer ---------- */
.composer textarea { min-height: 170px; resize: vertical; }
.counter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.counter-bar .chip { font-size: .76rem; padding: .28rem .65rem; }
.phone-preview {
  width: 100%; max-width: 300px; margin: 0 auto; border-radius: 32px; padding: 14px; background: #1b1c26;
  box-shadow: var(--shadow-lg);
}
.phone-screen { background: #f2f3f7; border-radius: 22px; min-height: 360px; padding: 1rem .9rem; display: flex; flex-direction: column; }
[data-bs-theme="dark"] .phone-screen { background: #262837; }
.phone-sender { text-align: center; font-weight: 700; font-size: .85rem; color: #1c2033; margin-bottom: .8rem; }
[data-bs-theme="dark"] .phone-sender { color: #e7e9f2; }
.bubble { align-self: flex-start; background: #fff; color: #1c2033; border-radius: 16px 16px 16px 4px; padding: .6rem .8rem; font-size: .84rem; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.06); max-width: 92%; }
[data-bs-theme="dark"] .bubble { background: #353849; color: #e7e9f2; }
.cost-box { border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border); padding: .9rem 1rem; }
.cost-box .big { font-size: 1.4rem; font-weight: 750; color: var(--brand); }
.ph-tags .btn { font-size: .75rem; padding: .2rem .55rem; }

/* ---------- API docs ---------- */
.code {
  background: #12131c; color: #e3e6f3; border-radius: 12px; padding: 1rem 1.1rem; font-size: .8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; position: relative;
}
.code .k { color: #ffb547; } .code .s { color: #8fe3a9; } .code .c { color: #6f7590; }
.method { font-weight: 700; font-size: .72rem; padding: .2rem .5rem; border-radius: 6px; font-family: ui-monospace, monospace; }
.method.get { background: rgba(22, 163, 74, .14); color: #16a34a; }
.method.post { background: rgba(37, 99, 235, .14); color: #2563eb; }
.endpoint { display: flex; align-items: center; gap: .6rem; font-family: ui-monospace, monospace; font-size: .88rem; font-weight: 600; }
.api-key-box { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .55rem .8rem; }
.api-key-box code { flex: 1; color: var(--text); font-size: .88rem; word-break: break-all; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-side {
  position: relative; overflow: hidden; color: #fff; padding: 3rem 3.5rem; display: flex; flex-direction: column;
  background: radial-gradient(90% 70% at 100% 0%, rgba(255, 122, 47, .35), transparent 60%),
              radial-gradient(70% 60% at 0% 100%, rgba(232, 69, 44, .3), transparent 60%), #12131c;
}
.auth-side .logo-big { width: 230px; margin-bottom: 2.2rem; }
/* Empty block where the big logo used to be, so the headline keeps its position (logo was 230x197). */
.auth-side .logo-space { height: 197px; margin-bottom: 2.2rem; flex-shrink: 0; }
.auth-side h2 { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.auth-side h2 span { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-side p.lead { color: #b9bdd0; font-size: 1rem; max-width: 460px; }
.auth-feat { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: 2rem; max-width: 520px; }
.auth-feat div { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: .85rem 1rem; font-size: .85rem; color: #d7d9e6; }
.auth-feat i { color: var(--brand-1); margin-right: .4rem; }
.auth-side .foot { margin-top: auto; color: #6f7590; font-size: .8rem; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.auth-card .form-control { padding: .75rem .9rem; }
.auth-card .btn-primary { padding: .75rem; font-size: .95rem; }

.toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }
.toast-x {
  min-width: 290px; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid #16a34a;
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: .8rem 1rem; display: flex; gap: .7rem; align-items: flex-start;
  animation: slideIn .25s ease;
}
.toast-x.error { border-left-color: #dc2626; } .toast-x.warning { border-left-color: #d97706; } .toast-x.info { border-left-color: #2563eb; }
.toast-x i { font-size: 1.15rem; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.side-open .sidebar { transform: none; }
  body.side-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1030; }
  .main { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .content { padding: 1rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .hide-sm { display: none !important; }
}
@media (max-width: 575.98px) {
  .topbar .page-title { font-size: .95rem; }
  .user-btn .nm, .user-btn .rl { display: none; }
}
