/* ============ SmmPanelPilot dark minimalist theme ============ */
/* additions for icons, search results, catalog and scenario ranges */
.ni { width: 24px; height: 24px; display: block; flex: none; border-radius: 7px; }
.net-item .ni { width: 40px; height: 40px; }
select option { background: #121a2b; color: #e7ecf6; }

.search-results {
  position: absolute; left: 0; right: 0; top: 48px; background: var(--panel);
  border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 380px; overflow-y: auto; display: none; z-index: 60; padding: 6px;
}
.search-results.open { display: block; animation: pop .15s ease; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; }
.sr-item:hover { background: rgba(255,255,255,.05); }
.sr-id { color: var(--muted-2); font-family: ui-monospace, monospace; font-size: 12px; min-width: 46px; }
.sr-name { flex: 1; color: var(--text); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-net { color: var(--accent); font-size: 12px; }
.sr-empty { padding: 16px; text-align: center; color: var(--muted-2); }

.range-grid { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.range-grid > div { flex: 1; min-width: 90px; }

:root {
  --bg: #0a0e17;
  --bg-2: #0d1220;
  --panel: #121a2b;
  --panel-2: #16203400;
  --card: #141d30;
  --sidebar: #0c1220;
  --border: rgba(255, 255, 255, 0.06);
  --border-2: rgba(255, 255, 255, 0.1);
  --text: #e7ecf6;
  --muted: #8592a8;
  --muted-2: #5c677d;
  --accent: #4f8cff;
  --accent-2: #7b6bff;
  --accent-3: #17c3b2;
  --grad: linear-gradient(135deg, #4f8cff 0%, #7b6bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(79,140,255,.15), rgba(123,107,255,.15));
  --green: #26c281;
  --red: #ff5c72;
  --orange: #ff9f43;
  --yellow: #ffd166;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --sidebar-w: 248px;
  --topbar-h: 70px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 80% -10%, rgba(123,107,255,.10), transparent 60%),
              radial-gradient(900px 600px at -10% 10%, rgba(79,140,255,.08), transparent 55%),
              var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1e2942; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

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

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0c1220, #090d17);
  border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  padding: 22px 16px;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: .5px;
  padding: 4px 8px 22px;
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 900; box-shadow: 0 6px 18px rgba(79,140,255,.4);
}
.brand .grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 600; font-size: 14px;
  transition: all .18s ease; position: relative;
}
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav a.active { color: #fff; background: var(--grad-soft); }
.nav a.active::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 3px; background: var(--grad);
}
.nav .divider { height: 1px; background: var(--border); margin: 12px 6px; }
.nav .soon { margin-left: auto; font-size: 10px; color: var(--muted-2);
  border: 1px solid var(--border-2); padding: 1px 6px; border-radius: 20px; }
.sidebar .spacer { flex: 1; }
.sidebar .side-foot { color: var(--muted-2); font-size: 11.5px; padding: 8px; }
.mobile-backdrop { display: none; position: fixed; inset: 0; background: rgba(4,8,16,.62); backdrop-filter: blur(4px); z-index: 35; }
.mobile-backdrop.open { display: block; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

/* ---------- topbar ---------- */
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 0 26px; background: rgba(10,14,23,.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.search {
  flex: 1; max-width: 460px; position: relative;
}
.search input {
  width: 100%; height: 42px; border-radius: 22px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); padding: 0 18px 0 42px; outline: none;
  transition: border .18s;
}
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 14px; top: 12px; width: 18px; height: 18px; color: var(--muted); }
.topbar .grow { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 22px;
  font-weight: 600; transition: all .18s; white-space: nowrap;
}
.pill:hover { border-color: var(--border-2); }
.pill.balance b { color: #fff; }
.pill.topup { background: var(--grad); border: none; color: #fff; box-shadow: 0 6px 18px rgba(79,140,255,.35); }
.pill.topup:hover { filter: brightness(1.07); transform: translateY(-1px); }
.pill.user-pill {
  background: linear-gradient(135deg, rgba(79,140,255,.28), rgba(23,195,178,.20));
  border-color: rgba(79,140,255,.42);
  color: #fff;
  box-shadow: 0 8px 22px rgba(79,140,255,.16);
}
.pill.user-pill b { color: #fff; }
#burger { display: none; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted); position: relative;
}
.icon-btn:hover { color: var(--text); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
.discount-ring {
  width: 44px; height: 44px; border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  display: grid; place-items: center; padding: 2px;
}
.discount-ring span { width: 100%; height: 100%; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; }

/* dropdowns */
.dd { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: 52px; min-width: 220px; background: var(--panel);
  border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px; display: none; z-index: 50; animation: pop .16s ease;
}
.dd.open .dd-menu { display: block; }
.dd-menu a, .dd-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 9px; color: var(--muted); background: none; border: none; font-size: 14px; font-weight: 600;
}
.dd-menu a:hover, .dd-menu button:hover { background: rgba(255,255,255,.05); color: var(--text); }
.dd-menu .head { color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding: 8px 12px 4px; }
.notif-item { padding: 10px 12px; border-radius: 9px; }
.notif-item:hover { background: rgba(255,255,255,.04); }
.notif-item .t { font-size: 13px; color: var(--text); }
.notif-item .d { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.notif-empty { padding: 20px; text-align: center; color: var(--muted-2); }

/* ---------- content ---------- */
.content { padding: 26px; flex: 1; animation: fade .3s ease; }
.page-title { font-size: 22px; font-weight: 800; margin: 0 0 18px; }
.page-sub { color: var(--muted); margin: -10px 0 20px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: 1.6fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* stat cards */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--grad-soft); display: grid; place-items: center; color: var(--accent); margin-bottom: 6px; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 16px; }
label.field .lb { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; height: 46px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 0 14px; outline: none; transition: border .16s;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 90px; }
select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238592a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted-2); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: var(--radius-sm); border: none;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14.5px;
  transition: all .16s; box-shadow: 0 8px 22px rgba(79,140,255,.28);
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--panel); border: 1px solid var(--border-2); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { background: linear-gradient(135deg, #ff5c72, #ff3b5c); box-shadow: 0 8px 22px rgba(255,92,114,.28); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; box-shadow: none; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; box-shadow: none; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 5px; overflow-x: auto; }
.tabs a, .tabs button { padding: 9px 16px; border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap; background: none; border: none; }
.tabs a.active, .tabs button.active { background: var(--grad-soft); color: #fff; }
.tabs a:hover, .tabs button:hover { color: var(--text); }

/* ---------- network list (order) ---------- */
.net-list { display: flex; flex-direction: column; gap: 8px; }
.net-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border); transition: all .16s; cursor: pointer;
}
.net-item:hover { border-color: var(--border-2); transform: translateX(3px); }
.net-item.active { background: var(--grad-soft); border-color: rgba(79,140,255,.4); }
.net-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.net-item .nm { font-weight: 700; }
.net-item .ct { margin-left: auto; color: var(--muted-2); font-size: 12px; }
.net-item .chev { color: var(--muted-2); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted-2); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); }
table.tbl td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.tbl tr:hover td { background: rgba(255,255,255,.02); }
.svc-name { max-width: 340px; color: var(--muted); font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: 12.5px; }
.link-cell { color: var(--accent); word-break: break-all; max-width: 240px; display: inline-block; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.completed { background: rgba(38,194,129,.15); color: var(--green); }
.badge.in_progress { background: rgba(79,140,255,.15); color: var(--accent); }
.badge.processing { background: rgba(123,107,255,.15); color: var(--accent-2); }
.badge.pending { background: rgba(255,209,102,.15); color: var(--yellow); }
.badge.partial { background: rgba(255,159,67,.15); color: var(--orange); }
.badge.canceled { background: rgba(255,92,114,.15); color: var(--red); }
.badge.open { background: rgba(255,209,102,.15); color: var(--yellow); }
.badge.answered { background: rgba(38,194,129,.15); color: var(--green); }
.badge.closed { background: rgba(133,146,168,.15); color: var(--muted); }

/* ---------- order summary ---------- */
.summary { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.summary .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.summary .row:last-child { border: none; }
.summary .row .k { color: var(--muted); }
.summary .row .v { font-weight: 700; }
.summary .charge { font-size: 24px; font-weight: 800; }
.summary .charge.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { display: none; }
.switch .sl { position: absolute; inset: 0; background: #2a3550; border-radius: 20px; transition: .18s; }
.switch .sl::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s; }
.switch input:checked + .sl { background: var(--accent); }
.switch input:checked + .sl::before { transform: translateX(18px); }

/* ---------- scenario builder ---------- */
.task-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; position: relative; animation: fade .2s; }
.task-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.task-head .num { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.range-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.range-grid .lb { font-size: 12px; color: var(--muted); margin-bottom: 5px; display: block; }
.rnd-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; padding-bottom: 12px; }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 34px; box-shadow: var(--shadow); animation: rise .4s ease; }
.auth-card .brand { justify-content: center; padding-bottom: 8px; }
.auth-card h1 { font-size: 22px; text-align: center; margin: 4px 0 6px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; }

/* landing */
.hero { text-align: center; max-width: 760px; margin: 0 auto; padding: 60px 20px; animation: rise .5s ease; }
.hero h1 { font-size: 46px; font-weight: 900; line-height: 1.1; margin-bottom: 18px; }
.hero h1 .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--muted); margin-bottom: 30px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; }
.landing-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 32px; }

/* flash */
.flash { padding: 13px 18px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; animation: fade .25s; border: 1px solid var(--border-2); }
.flash.success { background: rgba(38,194,129,.12); color: var(--green); border-color: rgba(38,194,129,.3); }
.flash.error { background: rgba(255,92,114,.12); color: var(--red); border-color: rgba(255,92,114,.3); }
.flash.info { background: rgba(79,140,255,.12); color: var(--accent); border-color: rgba(79,140,255,.3); }

/* toast */
#toasts { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--panel); border: 1px solid var(--border-2); border-left: 3px solid var(--accent); border-radius: 10px; padding: 13px 18px; box-shadow: var(--shadow); animation: slidein .25s ease; max-width: 340px; font-weight: 600; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }

/* chat / tickets */
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 460px; overflow-y: auto; padding: 4px; }
.msg { max-width: 76%; padding: 12px 16px; border-radius: 14px; }
.msg .who { font-size: 11px; color: var(--muted-2); margin-bottom: 4px; }
.msg.user { align-self: flex-end; background: var(--grad-soft); border: 1px solid rgba(79,140,255,.3); }
.msg.admin { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted-2); }
.empty svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 12px; }

.mini-list { display: flex; flex-direction: column; }
.mini-list .it { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.mini-list .it:last-child { border: none; }

.coming-soon-tag { font-size: 10px; color: var(--muted-2); border: 1px solid var(--border-2); padding: 2px 8px; border-radius: 20px; margin-left: 8px; }

/* footer */
.footer { padding: 20px 26px; color: var(--muted-2); font-size: 13px; display: flex; gap: 22px; border-top: 1px solid var(--border); }
.footer a:hover { color: var(--text); }

/* pagination */
.pager { display: flex; gap: 8px; margin-top: 18px; justify-content: center; }

/* animations */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.rise-in { animation: rise .4s ease both; }

/* --- late overrides (must beat generic input rules by specificity) --- */
/* keep the magnifier clear of the text in the top search */
.topbar .search input { padding: 0 18px 0 44px; color: var(--text); }
/* browser autofill must not force black-on-yellow text (login/password) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--panel) inset !important;
  caret-color: var(--text) !important;
  transition: background-color 9999s ease-in-out 0s;
}
/* placeholders: soft grey, consistent everywhere */
::placeholder { color: var(--muted-2); opacity: 1; }

/* responsive */
@media (max-width: 1000px) {
  #burger { display: grid; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 14px; gap: 10px; }
  .search { max-width: none; min-width: 0; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .footer { padding: 16px 18px; flex-wrap: wrap; }
  .landing-top { padding: 16px; gap: 12px; }
  .hero { padding: 36px 16px; }
  .hero h1 { font-size: 34px; }
  .hero .cta { flex-wrap: wrap; }
  .grid[style*="grid-template-columns:280px"] { grid-template-columns: 1fr !important; }
  .grid[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .dd-menu { right: -8px; max-width: calc(100vw - 24px); }
}

@media (max-width: 640px) {
  .topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; padding: 10px 12px; }
  .topbar .grow { display: none; }
  .search { order: 2; flex-basis: 100%; }
  .pill.balance span, .pill.topup { display: none; }
  .pill.user-pill { max-width: 140px; overflow: hidden; }
  .pill.user-pill b { overflow: hidden; text-overflow: ellipsis; }
  .card { padding: 16px; }
  .auth-card { padding: 24px; border-radius: 14px; }
  .range-grid { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .tabs { max-width: 100%; }
}
