@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

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

::-webkit-scrollbar {
    width: 10px;      /* Vertical */
    height: 10px;     /* Horizontal */
}

::-webkit-scrollbar-track {
    background: #1f2937;   /* Track color */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #6b7280;   /* Scroll thumb */
    border-radius: 10px;
    border: 2px solid #1f2937;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

::-webkit-scrollbar-corner {
    background: #1f2937;
}
:root {
  --bg:           #0B0E11;
  --panel:        #12161B;
  --panel-alt:    #161B21;
  --border:       #232932;
  --border-s:     #2E3742;
  --text-primary: #E6EDF3;
  --text-sec:     #9AA7B2;
  --text-muted:   #a3a3a3;;
  --mint:         #4FD1A5;
  --mint-dim:     #1E3A31;
  --amber:        #F0B429;
  --amber-dim:    #3A2E10;
  --red:          #E5484D;
  --red-dim:      #3A1518;
}

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
}

.pg-mono { font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; }

/* ── Layout ── */
.pg-root {  margin: 20px auto; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg); }

.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--panel);
  flex-wrap: wrap; gap: 10px;
}

.tab-bar {
  display: flex; gap: 4px; padding: 10px 20px 0;
  border-bottom: 1px solid var(--border); background: var(--panel);
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 8px 12px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  color: var(--text-sec); border-bottom: 2px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: color .12s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-active { color: var(--mint) !important; border-bottom-color: var(--mint) !important; }

.pg-content { padding: 20px; min-height: 420px; }

/* ── Buttons ── */
.pg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 6px; padding: 7px 12px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: opacity .12s;
  white-space: nowrap;
}
.pg-btn:active { opacity: .8; }
.btn-primary { background: var(--mint); color: #06231A; border: 1px solid var(--mint); }
.btn-ghost   { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-danger  { background: transparent; color: var(--red); border: 1px solid color-mix(in srgb,var(--red) 33%,transparent); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: transparent;
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; color: var(--text-sec); text-decoration: none;
}
.icon-btn-danger { color: var(--red); }

/* ── Badges ── */
.badge-base {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; font-size: 11px; letter-spacing: .4px;
  text-transform: uppercase; border-radius: 4px;
}

/* ── Cards ── */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
}
.card-alt {
  background: var(--panel-alt); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px;
}

/* ── Stat cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-bottom: 18px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.stat-card.highlight { border-color: color-mix(in srgb,var(--mint) 33%,transparent); }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.stat-value { font-size: 22px; font-weight: 600; color: var(--mint); }

/* ── Table ── */
.pg-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--panel); }
th { text-align: left; padding: 10px 12px; color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }

/* ── Forms ── */
.pg-field { margin-bottom: 14px; }
.pg-label { display: block; font-size: 12px; color: var(--text-sec); margin-bottom: 6px; font-weight: 500; }
.pg-hint  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.pg-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 9px 10px; color: var(--text-primary);
  font-size: 13px; font-family: inherit;
}
.pg-input:focus { outline: 2px solid var(--mint); outline-offset: 1px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.67);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 60px; z-index: 50;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; width: 440px; max-width: 90%;
}
.modal-box.modal-wide { width: 720px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 15px; font-weight: 600; }

/* ── Signal trace ── */
.signal-trace { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.signal-node { font-family: 'IBM Plex Mono',monospace; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-sec); white-space: nowrap; }
.signal-node-end { color: var(--mint); }
.signal-line { position: relative; width: 28px; height: 2px; background: var(--border); overflow: hidden; flex-shrink: 0; }
@keyframes pg-pulse { 0%{left:0%;opacity:0}10%{opacity:1}90%{opacity:1}100%{left:100%;opacity:0} }
.signal-dot { position: absolute; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: pg-pulse 2.2s linear infinite; }
@media (prefers-reduced-motion: reduce) { .signal-dot { animation: none; opacity: 1; left: 50%; } }

/* ── Offer group ── */
.offer-group { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.offer-group-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.rule-row { background: var(--panel-alt); border: 1px solid var(--border); border-radius: 6px; padding: 10px; margin-bottom: 8px; }

/* ── Flex utils ── */
.flex { display: flex; } .flex-center { align-items: center; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.justify-between { justify-content: space-between; } .flex-wrap { flex-wrap: wrap; } .flex-col { flex-direction: column; }
.fw-600 { font-weight: 600; } .fs-14 { font-size: 14px; } .fs-13 { font-size: 13px; } .fs-12 { font-size: 12px; } .fs-11 { font-size: 11px; }
.text-muted { color: var(--text-muted); } .text-sec { color: var(--text-sec); } .text-primary { color: var(--text-primary); }
.text-mint { color: var(--mint); } .text-red { color: var(--red); }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; } .mb-12 { margin-bottom: 12px; } .mb-14 { margin-bottom: 14px; } .mb-16 { margin-bottom: 16px; } .mb-18 { margin-bottom: 18px; } .mt-8 { margin-top: 8px; } .mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; }
.pt-8 { padding-top: 8px; } .pb-10 { padding-bottom: 10px; }
.border-top { border-top: 1px solid var(--border); }
.text-right { text-align: right; }
.w-full { width: 100%; }
.copyable-url { font-family: 'IBM Plex Mono',monospace; font-size: 12px; color: var(--text-sec); overflow-x: auto; white-space: nowrap;    max-width: fit-content; display: inline-block; vertical-align: middle; }

/* ── Column vis checkboxes ── */
.col-vis { display: flex; flex-wrap: wrap; gap: 16px; }
.col-vis label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-sec); cursor: pointer; }
input[type=checkbox] { accent-color: var(--mint); width: 14px; height: 14px; }

/* ── Search bar ── */
.search-wrap { position: relative; flex: 1; max-width: 280px; }
.search-wrap svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); }
.search-wrap .pg-input { padding-left: 28px; }

/* ── Toolbar row ── */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }

/* ── Login ── */
.login-wrap { min-height: 95vh;   display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 320px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 28px; }
.login-error { font-size: 12px; color: var(--red); margin-bottom: 12px; }

/* ── Offer modal grid ── */
.ep-grid { display: grid; grid-template-columns: 1fr 90px 90px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.ep-grid-head { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; text-align: center; }
.ep-grid-head:first-child { text-align: left; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .modal-box.modal-wide { width: 95%; }
  .ep-grid { grid-template-columns: 1fr 60px 60px 32px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

.signal-trace-mobile{
    display:none;
}

.signal-trace-mobile1{
    display:none;
}

@media (max-width:768px){

    .signal-trace{
        display:none;
    }

    .signal-trace-mobile{
        display:block;
        position:relative;
        padding-left:22px;
    }

    /* One continuous line */
    .signal-trace-mobile::before{
    content:"";
    position:absolute;
    left:7px;
    top:12px;
    bottom:12px;
    width:2px;
    background:#2f3542;
    overflow:hidden;
}

    .signal-trace-mobile1{
        display:block;
        position:relative;
        padding-left:22px;
    }

    /* One continuous line */
    .signal-trace-mobile1::before{
    content:"";
    position:absolute;
    left:7px;
    top:12px;
    bottom:12px;
    width:2px;
    background:#2f3542;
    overflow:hidden;
}

.signal-trace-mobile::after{
           content: "";
        position: absolute;
        left: 7px;
        top: 12px;
        width: 1px;
        height: 9px;
        background: #4fd1a5;
        box-shadow: 0 0 8px #4fd1a5;
        animation: flow 4s linear infinite;
}



    .signal-step{
        position:relative;
        display:flex;
        align-items:center;
        /*min-height:34px;*/
        /*margin:12px 0;*/
    }

    .dot{
      position: absolute;
        left: -18px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #4fd1a5;
        border: 2px solid #111827;
        z-index: 2;
    }
    
     .dot1{
      position: absolute;
        left: -18px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
               background: #f0b429;
        border: 2px solid #f0b429;
        z-index: 2;
    }

    .signal-text{
        margin-left:12px;
        color:#d6d9e5;
        font-size:14px;
    }

    /* Desktop જેવા node style રાખવા હોય તો */
    .signal-node{
       font-family: 'IBM Plex Mono', monospace;
    padding: 3px 7px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text-sec);
    white-space: nowrap;
        font-size: 12px;
    }
}
@keyframes flow{
    0%{
        top:12px;
    }
    100%{
        top:calc(100% - 26px);
    }
}
/* ── Loader / Spinner ──────────────────────────────────────────────────── */

/* Inline spinner shown inside buttons */
@keyframes pg-spin {
    to { transform: rotate(360deg); }
}
.pg-spinner {
    width: 13px; height: 13px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: pg-spin .6s linear infinite;
    flex-shrink: 0;
    display: inline-block;
}

/* Button loading state — keeps original size, shows spinner */
.pg-btn.is-loading {
    opacity: .7;
    pointer-events: none;
    cursor: not-allowed;
}
.pg-btn.is-loading .btn-label { display: none; }
.pg-btn.is-loading .btn-spinner { display: inline-flex !important; }
.btn-spinner { display: none; align-items: center; gap: 6px; }

/* Full-page overlay for tab / navigation changes */
#pg-page-loader {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(10,13,17,.55);
    backdrop-filter: blur(2px);
    align-items: center; justify-content: center;
    flex-direction: column; gap: 14px;
}
#pg-page-loader.active { display: flex; }
#pg-page-loader .pg-spinner {
    width: 28px; height: 28px;
    border-width: 3px;
    color: #4FD1A5;
}
#pg-page-loader p {
    font-size: 13px; color: #9AA7B2;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: .5px;
    margin: 0;
}
