/* Sweet Voice & SMS Gateway — brand: blue #1E88E5, red #F44336 */
:root {
  --blue: #1e88e5; --blue-d: #1565c0; --blue-l: #e8f2fd;
  --red: #f44336; --red-d: #d32f2f; --red-l: #feeceb;
  --green: #16a34a; --green-l: #e7f6ec; --amber: #b45309; --amber-l: #fdf3e2;
  --ink: #1b2330; --muted: #6b7686; --line: #e5e9f0; --bg: #f4f7fb; --card: #fff;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.05);
  --font: "Poppins", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14.5px; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.hidden { display: none !important; }
.small { font-size: 12.5px; } .hint { color: var(--muted); font-size: 12.5px; } .muted { color: var(--muted); }
.center { text-align: center; } .r { text-align: right; } .nowrap { white-space: nowrap; }
.pos { color: var(--green); } .neg { color: var(--red-d); }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 20px 18px 12px; }
.brand img { width: 100%; max-width: 210px; height: auto; display: block; }
.role-pill { margin: 0 18px 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--red); border-radius: 20px; padding: 3px 10px; align-self: flex-start; }
.sidebar nav { padding: 8px 10px; flex: 1; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #3b4656; font-weight: 500; margin-bottom: 2px; }
.sidebar nav a:hover { background: var(--bg); text-decoration: none; }
.sidebar nav a.active { background: var(--blue-l); color: var(--blue-d); }
.sidebar nav a.active .ico { stroke: var(--blue); }
.ico { width: 19px; height: 19px; fill: none; stroke: #8a95a5; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidebar-foot { padding: 16px 20px; font-size: 11px; letter-spacing: .3em; color: #9aa4b2; border-top: 1px solid var(--line); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 19px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.menu-btn { display: none; border: 0; background: none; font-size: 22px; cursor: pointer; }
.balance-chip { background: var(--blue-l); color: var(--blue-d); padding: 7px 14px; border-radius: 30px; font-size: 13px; }
.balance-chip strong { margin-left: 4px; }
.balance-chip.low { background: var(--red-l); color: var(--red-d); }
.balance-chip:hover { text-decoration: none; filter: brightness(.97); }
.who { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.who-name { font-weight: 600; font-size: 13.5px; } .who-sub { font-size: 12px; color: var(--muted); }
.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2.gap { gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-value { font-size: 25px; font-weight: 700; letter-spacing: -.01em; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-hero { background: linear-gradient(135deg, var(--blue) 0%, var(--blue-d) 100%); color: #fff; border: 0; position: relative; overflow: hidden; }
.stat-hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.08); }
.stat-hero .stat-label, .stat-hero .stat-sub, .stat-sub.light { color: rgba(255,255,255,.85); }
.stat-hero .btn { align-self: flex-start; margin-top: 6px; position: relative; z-index: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font: 600 14px var(--font); cursor: pointer; transition: .15s; text-decoration: none !important; white-space: nowrap; }
.btn-primary { background: var(--blue); color: #fff; } .btn-primary:hover { background: var(--blue-d); }
.btn-red { background: var(--red); color: #fff; } .btn-red:hover { background: var(--red-d); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); } .btn-ghost:hover { background: var(--bg); }
.btn-light { background: #fff; color: var(--blue-d); }
.btn-danger-ghost { background: #fff; border-color: #f6c3bf; color: var(--red-d); } .btn-danger-ghost:hover { background: var(--red-l); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--red-l); color: var(--red-d); }
.push-right { margin-left: auto; }
.quick { display: flex; gap: 10px; margin-top: 16px; }
.link { font-size: 13px; font-weight: 500; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form.compact { gap: 8px; margin-bottom: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; color: #344054; }
.opt { color: var(--muted); font-weight: 400; }
input, select, textarea { font: 14px var(--font); color: var(--ink); background: #fff; border: 1px solid #d5dbe4; border-radius: 10px; padding: 9px 12px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,136,229,.15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--blue); }
input[type=file] { padding: 6px; font-size: 12.5px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.checks { display: flex; gap: 18px; }
.file-inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.file-inline input { width: auto; border: 0; padding: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -6px; }
.counter { font-size: 12.5px; color: var(--muted); margin-top: -8px; }
.estimate { background: var(--blue-l); padding: 10px 14px; border-radius: 10px; color: var(--blue-d); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-direction: row; margin-top: 12px; }
.inline-form.tight { margin: 0; gap: 6px; flex-wrap: nowrap; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 120px; padding: 6px 9px; font-size: 13px; }
.inline-form.tight input, .inline-form.tight select { flex: none; min-width: 0; }
.w-80 { width: 80px !important; } .w-120 { width: 120px !important; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters input, .filters select { width: auto; padding: 7px 10px; font-size: 13px; }
.section-title { font-size: 14px; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--blue-d); }
.seg { display: inline-flex; background: var(--bg); padding: 4px; border-radius: 10px; gap: 4px; align-self: flex-start; }
.seg label { flex-direction: row; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.seg label:has(input:checked) { background: #fff; box-shadow: var(--shadow); color: var(--blue-d); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover td { background: #fafcff; }
td.trunc { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.empty { text-align: center; color: var(--muted); padding: 30px; }
.err-txt { font-size: 11.5px; color: var(--red-d); max-width: 220px; white-space: normal; }
.small-table td { padding: 6px 10px; font-size: 13px; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; padding-top: 14px; font-size: 13px; }

/* Badges & tags */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.badge-green { background: var(--green-l); color: var(--green); }
.badge-blue { background: var(--blue-l); color: var(--blue-d); }
.badge-gray { background: #eef1f5; color: #5b6676; }
.badge-amber { background: var(--amber-l); color: var(--amber); }
.badge-red { background: var(--red-l); color: var(--red-d); }
.tag { display: inline-block; background: #eef1f5; color: #46505e; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; margin: 2px 0; }
.tag-sms { background: var(--blue-l); color: var(--blue-d); }
.tag-voice { background: var(--red-l); color: var(--red-d); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--green-l); color: #14532d; border-color: #c4e8d0; }
.alert-error { background: var(--red-l); color: #7f1d1d; border-color: #f8cbc7; }
.alert-warning { background: var(--amber-l); color: #78350f; border-color: #f4dfb8; }

/* Misc components */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; }
.legend { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.dot-blue { background: var(--blue); } .dot-red { background: var(--red); }
.chart { width: 100%; height: 230px; }
.bar-blue { fill: var(--blue); } .bar-red { fill: var(--red); }
.chart-lbl { font-size: 10px; fill: #8a95a5; text-anchor: middle; }
.tips { margin: 0; padding-left: 18px; color: #475467; display: flex; flex-direction: column; gap: 8px; }
.balance-big { font-size: 22px; font-weight: 700; color: var(--blue-d); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 12px; font: 500 13px var(--font); cursor: pointer; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pay-option { flex-direction: row; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; transition: .15s; }
.pay-option:has(input:checked) { border-color: var(--blue); background: var(--blue-l); }
.pay-name { font-weight: 600; }
.pay-bkash .pay-name { color: #d12053; } .pay-nagad .pay-name { color: #ec1c24; }
.manual-box { background: var(--bg); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.instructions { margin: 0; white-space: pre-wrap; font: 13px var(--font); background: #fff; border: 1px dashed #c9d3e0; padding: 10px 12px; border-radius: 8px; }
.pay-list, .audio-list { list-style: none; padding: 0; margin: 0; }
.pay-list li, .audio-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pay-list li:last-child, .audio-list li:last-child { border-bottom: 0; }
.audio-actions { display: flex; align-items: center; gap: 4px; }
.audio-actions form { margin: 0; }
.user-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.user-row .inline-form { margin-top: 8px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-row code { background: #fff; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); word-break: break-all; flex: 1; }
.key-reveal code { font-size: 14px; }
.docs h3 { font-size: 14px; margin: 18px 0 8px; color: var(--blue-d); }
.docs p { margin: 0 0 8px; }
.docs pre { background: #0f1b2d; color: #e3ecf8; padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 0; font-size: 12.5px; line-height: 1.6; }
.docs code { background: var(--blue-l); color: var(--blue-d); padding: 1px 5px; border-radius: 4px; }
.docs pre code { background: none; color: inherit; padding: 0; }
audio { height: 32px; max-width: 240px; }

/* Auth */
.auth-body { background: linear-gradient(160deg, #eaf3fd 0%, #f7f9fc 60%, #fdf0ef 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; max-width: 1080px; margin: 0 auto; align-items: center; gap: 40px; padding: 30px; }
.auth-side { color: var(--ink); }
.auth-side-icon { width: 90px; margin-bottom: 18px; }
.auth-side h2 { font-size: 30px; line-height: 1.25; margin-bottom: 14px; }
.auth-side h2::first-line { color: var(--blue-d); }
.auth-side p { color: #475467; font-size: 15.5px; }
.auth-side ul { padding: 0; list-style: none; margin-top: 18px; }
.auth-side li { padding: 6px 0 6px 28px; position: relative; color: #344054; }
.auth-side li::before { content: ""; position: absolute; left: 0; top: 11px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px var(--red-l); }
.auth-card { background: #fff; border-radius: 20px; box-shadow: 0 10px 40px rgba(16,24,40,.08); padding: 32px 34px; border: 1px solid var(--line); }
.auth-logo { display: block; width: 170px; margin: -6px auto 10px; }
.auth-title { text-align: center; font-size: 18px; margin-bottom: 18px; }
.auth-foot { text-align: center; color: var(--muted); margin: 18px 0 0; font-size: 13.5px; }

/* Responsive */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -260px; z-index: 20; transition: left .2s; box-shadow: 0 0 30px rgba(0,0,0,.1); }
  .sidebar.open { left: 0; }
  .menu-btn { display: block; }
  .who { display: none; }
  .content { padding: 18px 14px 40px; }
  .topbar { padding: 12px 14px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .grid-2, .grid-3, .grid-2.gap, .pay-methods { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr; } }
