/* bos404 customer panel. Bootstrap + icons come from the shared vendor folder; everything custom is here
   (no inline styles anywhere: the CSP forbids them). */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/manager/assets/fonts/montserrat-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/manager/assets/fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bs-font-sans-serif: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --p-bg: #f3f6fd;
  --p-bg2: #e8eefb;
  --p-card: #ffffff;
  --p-card-soft: #f2f5fb;
  --p-border: rgba(47, 102, 240, .16);
  --p-accent: #2f66f0;
  --p-accent-soft: rgba(47, 102, 240, .1);
  --p-text-dim: #6b7690;
  --p-radius: 22px;
  --p-shadow: 0 12px 34px rgba(31, 64, 150, .08);
}
[data-bs-theme="dark"] {
  --p-bg: #0c111f;
  --p-bg2: #101830;
  --p-card: #151c30;
  --p-card-soft: #1b2440;
  --p-border: rgba(120, 150, 255, .18);
  --p-accent: #6b93ff;
  --p-accent-soft: rgba(107, 147, 255, .14);
  --p-text-dim: #98a4c4;
  --p-shadow: 0 12px 34px rgba(0, 0, 0, .35);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--bs-font-sans-serif);
  background: radial-gradient(1200px 500px at 15% -10%, var(--p-bg2), transparent 60%), var(--p-bg);
}
.panel-main { flex: 1 0 auto; padding-top: 2rem; padding-bottom: 2.5rem; }
.text-accent { color: var(--p-accent) !important; }
.min-w-0 { min-width: 0; }
.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }

/* Header */
.panel-header {
  background: color-mix(in srgb, var(--p-card) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--p-border);
  padding: .65rem 0;
  position: sticky; top: 0; z-index: 1030;
}
.panel-brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
.panel-brand-name { display: block; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; color: var(--p-accent); line-height: 1.1; }
.panel-brand-tag { display: block; font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; color: var(--p-text-dim); }
.panel-user { color: var(--p-text-dim); font-size: .85rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 12px; border: 1px solid var(--p-border); background: var(--p-card); color: var(--bs-body-color); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.dropdown-toggle { width: auto; padding: 0 .75rem; gap: .35rem; }
.btn-icon.dropdown-toggle::after { margin-left: .15rem; }
.dropdown-menu { border: 1px solid var(--p-border); border-radius: 12px; box-shadow: var(--p-shadow); background: var(--p-card); padding: .35rem; min-width: 130px; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; font-weight: 500; font-size: .9rem; }
.dropdown-item.active { background: var(--p-accent-soft); color: var(--p-accent); }
[data-bs-theme="light"] .theme-light-icon, [data-bs-theme="dark"] .theme-dark-icon { display: none; }
.btn-logout { background: rgba(220, 53, 69, .1); color: #dc3545; border: 1px solid rgba(220, 53, 69, .25); font-weight: 600; }
.btn-logout:hover { background: rgba(220, 53, 69, .18); color: #dc3545; }
.btn-soft { background: var(--p-accent-soft); color: var(--p-accent); border: 1px solid var(--p-border); font-weight: 600; letter-spacing: .02em; }
.btn-soft:hover { background: var(--p-accent); color: #fff; }
.panel-footer { padding: 1.25rem 0; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--p-text-dim); }

/* Cards & labels */
.panel-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 1.15rem 1.25rem;
}
.panel-label { font-size: .65rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--p-text-dim); margin-bottom: .4rem; display: block; }
.form-control, .form-select { border-radius: 14px; background-color: var(--p-card-soft); border-color: var(--p-border); }
.form-control:focus, .form-select:focus { border-color: var(--p-accent); box-shadow: 0 0 0 .2rem var(--p-accent-soft); }
.btn { border-radius: 14px; font-weight: 600; }
.btn-primary { background: var(--p-accent); border-color: var(--p-accent); }
.input-group > .btn { border-radius: 0 14px 14px 0; }

/* Dashboard */
.avatar-square { width: 42px; height: 42px; border-radius: 10px; background: var(--p-accent); color: #fff; font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.plan-pill { display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--p-accent); }
.expiry-line { font-size: .68rem; color: var(--p-accent); font-weight: 600; }
.info-box, .info-list { margin: 0; }
.info-box { background: var(--p-card-soft); border: 1px solid var(--p-border); border-radius: 12px; padding: .25rem .85rem; }
.info-box > div { display: flex; justify-content: space-between; align-items: center; padding: .45rem 0; }
.info-box > div + div { border-top: 1px solid var(--p-border); }
.info-box dt { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--p-text-dim); font-weight: 600; margin: 0; }
.info-box dd { margin: 0; font-size: .8rem; }
.info-box code, .whitelist-list code { background: var(--p-accent-soft); color: var(--p-accent); padding: .1rem .4rem; border-radius: 6px; font-size: .8rem; }
.whitelist-list li { display: flex; justify-content: space-between; align-items: center; padding: .3rem 0; border-bottom: 1px dashed var(--p-border); }
.whitelist-list li:last-child { border-bottom: 0; }
.coming-soon { opacity: .85; }

/* IP lookup result */
.ip-result dl { margin: 0; font-size: .85rem; }
.ip-result dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--p-border); }
.ip-result dl > div:last-child { border-bottom: 0; }
.ip-result dt { color: var(--p-text-dim); font-weight: 600; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.ip-result dd { margin: 0; text-align: right; word-break: break-word; }

/* Register: plan + channel pickers (radio buttons styled as cards) */
.plan-option, .channel-option {
  display: block; width: 100%; cursor: pointer; background: var(--p-card-soft);
  border: 1.5px solid var(--p-border); border-radius: 16px; padding: .9rem 1rem; transition: border-color .15s, background .15s;
}
.plan-option { height: 100%; }
.plan-name { display: block; font-weight: 700; }
.plan-price { display: block; color: var(--p-accent); font-weight: 800; font-size: 1.1rem; }
.plan-meta, .plan-desc { display: block; font-size: .78rem; color: var(--p-text-dim); }
.channel-option { padding: .6rem .85rem; font-size: .88rem; }
.channel-option small { display: block; font-size: .7rem; }
.btn-check:checked + .plan-option, .btn-check:checked + .channel-option { border-color: var(--p-accent); background: var(--p-accent-soft); }
.btn-check:focus-visible + .plan-option, .btn-check:focus-visible + .channel-option { box-shadow: 0 0 0 .2rem var(--p-accent-soft); }
.btn-check:disabled + .plan-option { opacity: .5; cursor: not-allowed; }

/* Checkout layout */
.checkout { max-width: 1120px; margin: 0 auto; }
.checkout-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.checkout-steps { list-style: none; display: flex; gap: .5rem; margin: 0; padding: 0; flex-wrap: wrap; }
.checkout-steps li { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; color: var(--p-text-dim); padding: .35rem .75rem .35rem .4rem; border-radius: 999px; border: 1px solid var(--p-border); background: var(--p-card); }
.checkout-steps li span { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--p-card-soft); font-size: .72rem; }
.checkout-steps li.is-current { color: var(--p-accent); border-color: var(--p-accent); }
.checkout-steps li.is-current span { background: var(--p-accent); color: #fff; }
.checkout-section + .checkout-section { margin-top: 1.25rem; }
.checkout-section[hidden] { display: none; }
.checkout-h { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.checkout-no { width: 28px; height: 28px; border-radius: 9px; background: var(--p-accent-soft); color: var(--p-accent); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800; }
.channel-block + .channel-block { margin-top: 1rem; }
.plan-option { position: relative; padding: 1rem 2.6rem 1rem 1.1rem; }
.plan-price small { font-size: .78rem; font-weight: 600; color: var(--p-text-dim); }
.plan-feats { display: block; margin-top: .5rem; font-size: .72rem; color: var(--p-text-dim); }
.plan-check { position: absolute; top: 1rem; right: 1rem; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--p-border); }
.btn-check:checked + .plan-option .plan-check { border-color: var(--p-accent); background: radial-gradient(circle, var(--p-accent) 45%, transparent 50%); }
.summary-card { position: sticky; top: 84px; }
.summary-plan { padding: .85rem 1rem; border-radius: 14px; background: var(--p-card-soft); border: 1px solid var(--p-border); }
.summary-plan-name { font-weight: 700; }
.summary-lines { margin: 1.1rem 0 0; }
.summary-lines > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--p-border); font-size: .9rem; }
.summary-lines > div[hidden] { display: none; }
.summary-lines dt { font-weight: 500; color: var(--p-text-dim); margin: 0; }
.summary-lines dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.summary-lines .summary-total { border-bottom: 0; padding-top: .8rem; }
.summary-lines .summary-total dt { color: var(--bs-body-color); font-weight: 700; }
.summary-lines .summary-total dd { font-size: 1.35rem; font-weight: 800; color: var(--p-accent); }
.summary-trust { list-style: none; margin: 1.1rem 0 0; padding: 0; font-size: .78rem; color: var(--p-text-dim); }
.summary-trust li { display: flex; gap: .5rem; align-items: center; padding: .2rem 0; }
.summary-trust i { color: var(--p-accent); font-size: 1rem; }
@media (max-width: 991.98px) { .summary-card { position: static; } }

/* Order page */
.info-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--p-border); }
.info-list dt { color: var(--p-text-dim); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; margin: 0; }
.info-list dd { margin: 0; text-align: right; word-break: break-word; }
.qr-box img { width: 220px; height: 220px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 14px; }
.cred-line { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--p-border); }

/* Form helpers */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-box { display: flex; justify-content: center; min-height: 65px; }
.toast-container { z-index: 2200; }

/* Admin viewing the panel as a customer */
.impersonation-bar { background: #fff3cd; color: #664d03; border-bottom: 1px solid #ffecb5; padding: .5rem 1rem; font-size: .85rem; }
[data-bs-theme="dark"] .impersonation-bar { background: #3a2f0b; color: #ffda6a; border-color: #664d03; }

/* Uploaded brand logo: light-background variant by default, dark-background variant in dark theme */
.brand-logo { max-height: 38px; width: auto; }
[data-bs-theme="light"] .brand-logo-ondark, [data-bs-theme="dark"] .brand-logo-onlight { display: none; }

/* Proxy credentials card - compact 2x2 grid */
.proxy-credentials { margin: 0; background: var(--p-card-soft); border: 1px solid var(--p-border); border-radius: 12px; padding: .5rem .75rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.proxy-credentials .cred-row { display: flex; justify-content: space-between; align-items: center; padding: .45rem .25rem; }
.proxy-credentials .cred-row:nth-child(1), .proxy-credentials .cred-row:nth-child(2) { border-bottom: 1px solid var(--p-border); }
.proxy-credentials .cred-row:nth-child(odd) { border-right: 1px solid var(--p-border); }
.proxy-credentials dt { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--p-text-dim); font-weight: 600; margin: 0; }
.proxy-credentials dd { margin: 0; display: flex; align-items: center; gap: .15rem; }
.proxy-credentials code { background: var(--p-accent-soft); color: var(--p-accent); padding: .12rem .4rem; border-radius: 6px; font-size: .78rem; font-weight: 600; }
.copy-btn { color: var(--p-text-dim); transition: color .15s; padding: 0 !important; }
.copy-btn:hover { color: var(--p-accent); }
.copy-btn.copied { color: #198754; }
.copy-btn.copied i::before { content: "\eb7a"; }
@media (max-width: 400px) { .proxy-credentials { grid-template-columns: 1fr; } .proxy-credentials .cred-row:nth-child(odd) { border-right: 0; } .proxy-credentials .cred-row:nth-child(2) { border-bottom: 1px solid var(--p-border); } .proxy-credentials .cred-row:nth-child(3) { border-bottom: 1px solid var(--p-border); } }

/* Proxy search */
.lookup-result-box { background: var(--p-card-soft); border: 1px solid var(--p-border); border-radius: 14px; padding: .75rem 1rem; min-height: 60px; font-size: .85rem; }
.lookup-result-box .lookup-row { display: flex; justify-content: space-between; gap: .5rem; }
.lookup-result-box .lookup-row + .lookup-row { margin-top: .25rem; padding-top: .25rem; border-top: 1px dashed var(--p-border); }
.lookup-result-box dt { color: var(--p-text-dim); font-size: .7rem; text-transform: uppercase; font-weight: 600; }
.lookup-result-box dd { margin: 0; text-align: right; font-weight: 600; }
#results-table { font-size: .8rem; }
#results-table th { font-size: .65rem; text-transform: uppercase; color: var(--p-text-dim); font-weight: 600; border-bottom-width: 1px; padding: .5rem .4rem; }
#results-table td { vertical-align: middle; padding: .4rem; }
#results-table .badge { font-size: .65rem; }

/* Compact dashboard */
.panel-card-compact { padding: 1rem; }
.panel-card-compact .panel-label { font-size: .62rem; margin-bottom: .35rem; }

/* Profile header */
.profile-header { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.avatar-sm { width: 38px; height: 38px; border-radius: 10px; background: var(--p-accent); color: #fff; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-weight: 700; font-size: .95rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-meta { display: flex; flex-direction: column; gap: .15rem; margin-top: .2rem; }
.plan-pill { display: inline-block; font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--p-accent); background: var(--p-accent-soft); padding: .08rem .38rem; border-radius: 4px; width: fit-content; }
.expiry-countdown { color: var(--p-accent); font-weight: 600; font-family: var(--bs-font-monospace); font-size: .7rem; white-space: nowrap; }
.btn-icon-sm { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--p-border); background: var(--p-card-soft); color: var(--p-text-dim); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; flex-shrink: 0; }
.btn-icon-sm:hover { background: var(--p-accent-soft); color: var(--p-accent); border-color: var(--p-accent); }
.profile-stats { display: flex; gap: .5rem; font-size: .72rem; }
.profile-stats > div { flex: 1; background: var(--p-card-soft); border-radius: 8px; padding: .5rem .6rem; text-align: center; }
.profile-stats span { display: block; font-size: .55rem; text-transform: uppercase; letter-spacing: .06em; color: var(--p-text-dim); margin-bottom: .15rem; }
.profile-stats strong { color: var(--p-accent); }

/* Credentials grid */
.creds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--p-border); border-radius: 10px; overflow: hidden; margin-bottom: .5rem; }
.cred-row { display: flex; align-items: center; gap: .4rem; padding: .45rem .6rem; background: var(--p-card-soft); min-width: 0; }
.cred-label { font-size: .55rem; text-transform: uppercase; color: var(--p-text-dim); letter-spacing: .05em; width: 32px; flex-shrink: 0; font-weight: 700; }
.cred-row code { flex: 1; background: transparent; color: var(--p-accent); font-size: .75rem; font-weight: 600; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.btn-copy { background: none; border: none; color: var(--p-text-dim); padding: 0; cursor: pointer; font-size: .75rem; line-height: 1; transition: color .15s; flex-shrink: 0; }
.btn-copy:hover { color: var(--p-accent); }
.cred-full { display: flex; align-items: center; gap: .4rem; background: var(--p-accent-soft); border-radius: 8px; padding: .4rem .6rem; }
.cred-full code { flex: 1; color: var(--p-accent); font-size: .7rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Whitelist form */
.whitelist-form { display: flex; gap: 6px; margin-bottom: .5rem; }
.whitelist-form input { flex: 1; min-width: 0; }
.btn-add { width: 38px; height: 31px; border-radius: 10px; border: none; background: var(--p-accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .95rem; transition: all .15s; flex-shrink: 0; }
.btn-add:hover { background: #1a4fd8; }
.whitelist-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.wl-tag { display: inline-flex; align-items: center; gap: .25rem; background: var(--p-card-soft); border: 1px solid var(--p-border); border-radius: 8px; padding: .2rem .55rem; font-size: .72rem; }
.wl-tag code { background: transparent; color: var(--p-accent); padding: 0; font-weight: 600; }
.wl-tag button { background: none; border: none; color: var(--p-text-dim); padding: 0; cursor: pointer; font-size: .7rem; line-height: 1; display: inline-flex; align-items: center; }
.wl-tag button:hover { color: #dc3545; }

/* IP lookup form */
.ip-lookup-form { display: flex; gap: 6px; }
.ip-lookup-form input { flex: 1; min-width: 0; }
.btn-lookup { width: 38px; height: 31px; border-radius: 10px; border: none; background: var(--p-accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .95rem; transition: all .15s; flex-shrink: 0; }
.btn-lookup:hover { background: #1a4fd8; }

/* Proxy search bar: [mode select][target IP][search] + octet filter */
.search-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.search-main { flex: 1 1 320px; flex-wrap: nowrap; }
.search-main .search-mode-select { flex: 0 0 auto; width: auto; max-width: 9.5rem; border-radius: 14px 0 0 14px; font-size: .78rem; font-weight: 600; color: var(--p-accent); }
.search-main .form-control { min-width: 0; }
.btn-copy.copied, .btn-copy-input.copied { color: #198754; }
#results-table .col-score { width: 50px; }
#results-table .col-ms { width: 56px; }
#results-table .col-act { width: 64px; }

/* Results table */
.results-wrap { overflow: visible; }
@media (max-width: 767.98px) {
  .results-wrap { overflow-x: auto; }
}

/* Proxy pagination */
.proxy-pagination { font-size: .75rem; border-top: 1px solid var(--p-border); background: var(--p-card-soft); border-radius: 0 0 12px 12px; margin: 0 -1rem -1rem; padding: .5rem 1rem !important; }
