/* فونت‌ها به‌صورت محلی و افلاین بارگذاری می‌شوند — بدون CDN */
@font-face{font-family:"Vazirmatn";font-style:normal;font-weight:100;font-display:swap;src:url(/static/fonts/Vazirmatn-Thin.woff2) format("woff2")}
@font-face{font-family:"Vazirmatn";font-style:normal;font-weight:300;font-display:swap;src:url(/static/fonts/Vazirmatn-Light.woff2) format("woff2")}
@font-face{font-family:"Vazirmatn";font-style:normal;font-weight:400;font-display:swap;src:url(/static/fonts/Vazirmatn-Regular.woff2) format("woff2")}
@font-face{font-family:"Vazirmatn";font-style:normal;font-weight:500;font-display:swap;src:url(/static/fonts/Vazirmatn-Medium.woff2) format("woff2")}
@font-face{font-family:"Vazirmatn";font-style:normal;font-weight:600;font-display:swap;src:url(/static/fonts/Vazirmatn-SemiBold.woff2) format("woff2")}
@font-face{font-family:"Vazirmatn";font-style:normal;font-weight:700;font-display:swap;src:url(/static/fonts/Vazirmatn-Bold.woff2) format("woff2")}
@font-face{font-family:"Vazirmatn";font-style:normal;font-weight:800;font-display:swap;src:url(/static/fonts/Vazirmatn-ExtraBold.woff2) format("woff2")}
@font-face{font-family:"Vazirmatn";font-style:normal;font-weight:900;font-display:swap;src:url(/static/fonts/Vazirmatn-Black.woff2) format("woff2")}

:root{
  --bg:#f7eee4;
  --bg-soft:#fff8f1;
  --card:#fffdf9;
  --stroke:#edd9c4;
  --stroke-strong:#e0c3a4;
  --text:#3d2a1a;
  --muted:#8a6b52;
  --brand:#e08a45;
  --brand-dark:#c46f2f;
  --brand2:#f0a35c;
  --amber:#c98512;
  --coral:#d94866;
  --lime:#2f9e6a;
  --shadow:0 14px 36px rgba(120, 70, 30, .10);
  --radius:20px;
  --font:"Vazirmatn", Tahoma, "Segoe UI", sans-serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(circle at 92% 8%, rgba(240,163,92,.28), transparent 32%),
    radial-gradient(circle at 8% 88%, rgba(224,138,69,.16), transparent 34%),
    linear-gradient(180deg, #fff6ec 0%, var(--bg) 48%, #f3e4d4 100%);
  min-height:100vh;
  line-height:1.75;
}
.bg{display:none}
.page{
  max-width:1180px;
  margin:0 auto;
  padding:28px 16px 70px;
  position:relative;
  z-index:1;
}
.page:has(.admin-shell){
  max-width:1720px;
  width:100%;
  padding:18px 20px 40px;
}
.card{
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  padding:22px;
  margin-bottom:16px;
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
}
.card::before{
  content:"";
  position:absolute;
  top:0;right:0;left:0;
  height:3px;
  background:linear-gradient(90deg, #e08a45, #f0b27a, #ffd7a8);
}
.card-glow,.config-panel{box-shadow:var(--shadow)}
.narrow{max-width:460px;margin:48px auto}
h1,h2,h3,h4{margin:0 0 12px;font-weight:800;letter-spacing:-.02em;color:var(--text)}
h2{font-size:1.5rem}
h3{font-size:1.15rem;color:#1d334d}
.muted{color:var(--muted)}
.tiny{font-size:12px;color:var(--muted)}

.hero{
  padding:64px 36px 54px;
  text-align:center;
  background:
    linear-gradient(145deg, rgba(240,163,92,.18), rgba(255,248,241,.9)),
    #fffdf9;
}
.hero h1{
  font-size:clamp(2.1rem, 5vw, 3.3rem);
  line-height:1.25;
  margin-top:12px;
  color:#3d2a1a;
}
.hero p{max-width:720px;margin:14px auto 0;font-size:1.05rem}
.hero-badge{
  display:inline-flex;
  padding:8px 16px;
  border-radius:999px;
  border:1px solid rgba(224,138,69,.4);
  background:rgba(224,138,69,.12);
  color:var(--brand-dark);
  letter-spacing:2px;
  font-size:12px;
  font-weight:800;
}
.hero-badge.soft{letter-spacing:1px}
.actions{display:flex;gap:12px;justify-content:center;margin-top:22px;flex-wrap:wrap}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:12px;padding:11px 18px;border:1px solid transparent;
  text-decoration:none;cursor:pointer;font-weight:800;font-family:inherit;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover{transform:translateY(-1px)}
.primary{
  background:linear-gradient(120deg, #e08a45, #f0a35c);
  color:#fff;
  box-shadow:0 10px 24px rgba(192,110,40,.28);
}
.ghost{
  background:#f3f7fb;
  color:#1d3a52;
  border-color:var(--stroke-strong);
}
.danger{
  background:#fff1f3;
  color:#b4233b;
  border-color:#f3b0bc;
}
.danger-lite{
  background:#fff6f7;
  color:#c23b55;
  border-color:#f0c2cb;
}
.alert{
  background:#fff1f3;
  border:1px solid #f3b0bc;
  color:#9f1239;
  padding:12px 14px;
  border-radius:12px;
  margin-bottom:12px;
}
.alert.ok{
  border-color:#86efac;
  background:rgba(34,197,94,.12);
  color:#166534;
}
.alert.err{
  border-color:#f3b0bc;
  background:#fff1f3;
  color:#9f1239;
}

.form,.grid-form{display:grid;gap:12px}
.grid-form{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.field-label{
  display:block;
  font-size:12px;
  color:#4d657c;
  font-weight:700;
  margin-bottom:6px;
}
.field-group{display:flex;flex-direction:column}
.field-group-full{grid-column:1 / -1}
input,select,textarea{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--stroke-strong);
  background:#fbfcfe;
  color:var(--text);
  font-family:inherit;
  transition:border-color .12s, box-shadow .12s, background .12s;
}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--brand);
  background:#fff;
  box-shadow:0 0 0 3px rgba(15,154,138,.15);
}
.money-input{direction:ltr;text-align:left;font-weight:700;letter-spacing:.3px}
.inline-form{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.check{display:flex;align-items:center;gap:8px;font-size:14px}
.check input{width:auto}
code{
  background:#eef8f6;
  padding:2px 8px;
  border-radius:8px;
  color:var(--brand-dark);
  border:1px solid #c9ebe5;
}

table{width:100%;border-collapse:collapse}
th,td{padding:11px 8px;border-bottom:1px solid #e6edf5;text-align:right;font-size:13px}
th{color:#4d657c;font-weight:700}
tr:hover td{background:#f7fafc}

.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.stats-dense{grid-template-columns:repeat(auto-fit,minmax(175px,1fr))}
.stat{
  position:relative;
  border-radius:16px;
  padding:16px;
  background:linear-gradient(160deg, #fff, #f7fafc);
  border:1px solid var(--stroke);
  overflow:hidden;
  min-height:92px;
  box-shadow:0 6px 16px rgba(21,40,70,.04);
}
.stat::before{
  content:"";
  position:absolute;
  inset:auto 0 0 0;
  height:3px;
}
.stat span{
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  margin-bottom:8px;
}
.stat strong{font-size:1.25rem;font-weight:900}
.stat-cyan{border-color:#b7ebe3}
.stat-cyan::before{background:var(--brand)}
.stat-cyan strong{color:var(--brand-dark)}
.stat-blue{border-color:#bfd4ff}
.stat-blue::before{background:var(--brand2)}
.stat-blue strong{color:#1d4ed8}
.stat-amber{border-color:#f3d7a1}
.stat-amber::before{background:var(--amber)}
.stat-amber strong{color:#9a6700}
.stat-coral{border-color:#f3c1cb}
.stat-coral::before{background:var(--coral)}
.stat-coral strong{color:#be123c}
.stat-lime{border-color:#b7e7cc}
.stat-lime::before{background:var(--lime)}
.stat-lime strong{color:#166534}

.dash-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:8px;
}
.dash-head .tag,.tag{
  display:inline-flex;
  padding:6px 12px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.4px;
  background:#e8f8f5;
  border:1px solid #b7ebe3;
  color:var(--brand-dark);
}
.tag-amber{
  background:#fff8e8;
  border-color:#f3d7a1;
  color:#9a6700;
}
.tag-lime{
  background:#e7f8ee;
  border-color:#9ad7b4;
  color:#178a57;
}

.feature-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:14px;
}
.feature{
  background:#fff;
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:18px;
  transition:transform .12s ease, border-color .12s;
}
.feature:hover{
  transform:translateY(-2px);
  border-color:#9ad9cf;
}
.feature .ico{
  width:42px;height:42px;
  border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  font-size:16px;font-weight:900;
  margin-bottom:12px;
  color:#fff;
}
.feature:nth-child(1) .ico{background:linear-gradient(135deg,var(--brand),#1297d8)}
.feature:nth-child(2) .ico{background:linear-gradient(135deg,#f59e0b,#ea580c)}
.feature:nth-child(3) .ico{background:linear-gradient(135deg,#22c55e,var(--brand))}
.feature h3{margin:0 0 8px;font-size:16px}
.feature p{margin:0;color:var(--muted);font-size:13px;line-height:1.85}

.admin-shell{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  gap:16px;
  align-items:start;
  min-height:calc(100vh - 50px);
}
.admin-sidebar{
  position:sticky;
  top:14px;
  background:#fff !important;
  padding:18px 14px !important;
  border:1px solid var(--stroke) !important;
  box-shadow:var(--shadow);
}
.admin-brand{
  font-weight:900;
  letter-spacing:1.2px;
  font-size:13px;
  margin-bottom:14px;
  padding:12px;
  border-radius:14px;
  text-align:center;
  color:#fff;
  background:linear-gradient(120deg, var(--brand), #1297d8);
  box-shadow:0 8px 18px rgba(15,154,138,.22);
}
.menu-link{
  display:block;
  padding:11px 13px;
  margin:5px 0;
  border-radius:12px;
  background:#f5f8fb;
  color:#24384f;
  border:1px solid transparent;
  text-decoration:none;
  font-weight:700;
  font-size:13.5px;
  transition:background .12s, border-color .12s, color .12s;
}
.menu-link:hover{
  border-color:#c9ebe5;
  background:#eef9f6;
}
.menu-link.active{
  background:linear-gradient(105deg, var(--brand), #1297d8);
  color:#fff;
  box-shadow:0 8px 18px rgba(15,154,138,.22);
}
.admin-clock{
  margin-top:16px;
  padding:12px;
  border-radius:14px;
  border:1px solid #f3d7a1;
  background:#fff8e8;
  font-size:12px;
  color:#6b4e12;
}
.admin-clock strong{color:#9a6700}
.admin-main{min-width:0}
.admin-main .card{margin-bottom:14px;padding:18px 20px}
.admin-main .stats{
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:12px;
}
.admin-main .stats.stats-pack{
  grid-template-columns:repeat(2,minmax(140px,220px));
  justify-content:start;
  gap:10px;
  margin-top:12px;
}
.admin-main .stats.stats-pack .stat{
  min-height:auto;
  padding:10px 12px;
}
.admin-main .stat{min-height:100px}
.admin-main .stat strong{font-size:1.28rem}
.admin-main .quick-grid{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}

.quick-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px;
}
.quick-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:72px;
  border-radius:14px;
  text-decoration:none;
  font-weight:800;
  font-size:14px;
  border:1px solid transparent;
  transition:transform .12s, box-shadow .12s;
  color:#fff;
}
.quick-btn:hover{transform:translateY(-2px)}
.quick-btn.q1{background:linear-gradient(125deg,var(--brand),#1297d8);box-shadow:0 8px 18px rgba(15,154,138,.2)}
.quick-btn.q2{background:linear-gradient(125deg,#f59e0b,#ea580c);box-shadow:0 8px 18px rgba(245,158,11,.2)}
.quick-btn.q3{background:linear-gradient(125deg,#22c55e,var(--brand));box-shadow:0 8px 18px rgba(34,197,94,.18)}
.quick-btn.q4{background:linear-gradient(125deg,#fb7185,#e11d48);box-shadow:0 8px 18px rgba(225,29,72,.18)}
.quick-btn.q5{background:linear-gradient(125deg,#7c5cfc,#e08a45);box-shadow:0 8px 18px rgba(124,92,252,.22)}

.agency-menu{
  padding:0;
  margin-bottom:12px;
  overflow:hidden;
}
.agency-menu-summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  padding:14px 16px;
  background:linear-gradient(90deg,rgba(224,138,69,.10),rgba(255,255,255,.5));
}
.agency-menu-summary::-webkit-details-marker{display:none}
.agency-menu-title{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.agency-menu-title strong{font-size:15px;letter-spacing:.2px}
.agency-menu-badges{display:flex;gap:8px;flex-wrap:wrap}
.agency-menu-body{
  padding:12px 14px 16px;
  border-top:1px solid var(--stroke);
}
.agency-card.nested{
  margin:0 0 12px;
  box-shadow:none;
}
.agency-menu[open] .agency-menu-summary{
  background:linear-gradient(90deg,rgba(224,138,69,.16),rgba(255,244,229,.55));
}
.agency-card{
  border:1px solid var(--stroke);
  border-radius:14px;
  background:#fbfcfe;
  padding:14px;
  margin-bottom:12px;
}
.agency-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
  gap:8px;
  flex-wrap:wrap;
}
.agency-top strong{color:var(--brand-dark)}

.schedule-list{display:grid;gap:10px}
.clock-input{
  direction:ltr;
  text-align:left;
  font-variant-numeric:tabular-nums;
  letter-spacing:.04em;
}
.clock-picker{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}
.clock-picker .clock-wheels{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:6px;
  direction:ltr;
}
.clock-picker .clock-wheels select{
  appearance:none;
  min-width:4.4rem;
  height:44px;
  padding:0 10px;
  border:1px solid #c9dcec;
  border-radius:12px;
  background:#fff;
  color:#12314a;
  font-size:16px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  text-align:center;
  cursor:pointer;
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}
.clock-picker .clock-wheels select:hover{
  transform:translateY(-2px);
  border-color:#7ab6d9;
  box-shadow:0 8px 18px rgba(18,151,216,.16);
}
.clock-picker .clock-wheels select:focus{
  outline:none;
  transform:translateY(-3px) scale(1.04);
  border-color:#1297d8;
  box-shadow:0 0 0 4px rgba(18,151,216,.18);
}
.clock-picker .clock-sep{
  font-weight:900;
  color:#5b7c96;
  font-size:18px;
}
.clock-picker .clock-readout{
  direction:ltr;
  text-align:left;
  font-variant-numeric:tabular-nums;
  font-weight:800;
  letter-spacing:.08em;
  color:#0f4c6e;
  background:#eef7fd;
  border:1px dashed #b9d7ea;
  border-radius:10px;
  padding:6px 10px;
  animation:clockReadIn .35s ease;
}
@keyframes clockReadIn{
  from{opacity:.35;transform:translateY(4px) scale(.98)}
  to{opacity:1;transform:none}
}
.clock-picker .clock-readout.is-empty{color:#8aa3b7;font-weight:700;letter-spacing:.04em}
.schedule-row{
  display:grid;
  grid-template-columns:1fr 1fr 1fr auto;
  gap:10px;
  align-items:end;
  padding:12px;
  border:1px solid #d7e6f5;
  border-radius:14px;
  background:#f8fbfe;
}
.schedule-row.pause-row{grid-template-columns:1fr 1fr auto}
.sub-title{margin:16px 0 10px;font-size:15px;color:#1d334d}
.schedule-remove-wrap{display:flex;align-items:end}

.login-brand{text-align:center;margin-bottom:8px}
.login-brand .dot{
  width:48px;height:48px;margin:0 auto 12px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--brand),#1297d8);
  box-shadow:0 8px 18px rgba(15,154,138,.25);
}

.modal-backdrop{
  position:fixed;
  inset:0;
  z-index:80;
  background:rgba(80,45,20,.42);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  backdrop-filter:blur(6px);
}
.modal-backdrop.hidden{display:none}
.hidden{display:none !important}
.modal-card{
  width:min(440px,100%);
  margin:0;
  box-shadow:0 24px 60px rgba(120,70,30,.28);
  position:relative;
}
.agency-login-modal{padding-top:28px}
.modal-close{
  position:absolute;
  top:10px;left:12px;
  border:0;background:transparent;
  font-size:28px;line-height:1;cursor:pointer;color:var(--muted);
}
.btn-block{width:100%;margin-top:10px}
.dot.orange{background:linear-gradient(135deg,#e08a45,#f0b27a)}
.login-brand{text-align:center;margin-bottom:8px}
.login-brand .dot{
  width:14px;height:14px;border-radius:50%;margin:0 auto 10px;
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  box-shadow:0 0 0 6px rgba(224,138,69,.15);
}

.agency-hero{
  background:
    linear-gradient(120deg, rgba(240,163,92,.22), rgba(255,255,255,.7)),
    #fffdf9;
}
.agency-title{font-size:clamp(1.6rem,3vw,2.2rem);margin:8px 0 4px}
.agency-debt-pill{
  min-width:160px;
  padding:14px 16px;
  border-radius:16px;
  background:linear-gradient(160deg,#fff7ee,#ffe8d2);
  border:1px solid #f0c9a0;
  text-align:center;
}
.agency-debt-pill span{display:block;font-size:12px;color:var(--muted)}
.agency-debt-pill strong{font-size:1.15rem}
.agency-hero-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.portal-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:16px;
}
.portal-tile{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:22px 18px;
  border-radius:22px;
  text-decoration:none;
  color:var(--text);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow);
  min-height:150px;
  transition:transform .15s ease, box-shadow .15s ease;
  background:#fffdf9;
}
.portal-tile:hover{transform:translateY(-3px);box-shadow:0 18px 40px rgba(120,70,30,.16)}
.tile-kicker{font-size:11px;font-weight:800;letter-spacing:1.5px;opacity:.7}
.portal-tile strong{font-size:1.2rem}
.portal-tile p{margin:0;color:var(--muted);font-size:13px}
.tile-download{background:linear-gradient(160deg,#fff8ef,#ffe6cc)}
.tile-finance{background:linear-gradient(160deg,#fff9f2,#ffefd8)}
.tile-active{background:linear-gradient(160deg,#fff7f0,#ffe8d4)}
.tile-stopped{background:linear-gradient(160deg,#fff5f2,#ffe4df)}
.tile-muted{opacity:.72;cursor:default}

.policy-action-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
button.portal-tile{
  width:100%;
  cursor:pointer;
  font:inherit;
  text-align:right;
  appearance:none;
  -webkit-appearance:none;
}
.modal-card .sub-title{
  margin:18px 0 10px;
  font-size:1rem;
  color:var(--text);
}
.modal-card .grid-form{margin-top:8px}

.proxy-hub-card{
  width:min(640px,100%);
  max-height:90vh;
  overflow:auto;
}
.proxy-provider-list{display:flex;flex-direction:column;gap:10px;margin:14px 0}
.proxy-provider-card{
  border:1px solid var(--stroke);
  border-radius:16px;
  background:#fffdf9;
  overflow:hidden;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.proxy-provider-card.is-open{
  border-color:rgba(224,138,69,.55);
  box-shadow:0 10px 28px rgba(120,70,30,.12);
}
.proxy-provider-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  cursor:pointer;
}
.proxy-provider-toggle{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  border:0;
  background:transparent;
  font:inherit;
  text-align:right;
  cursor:pointer;
  color:var(--text);
  padding:0;
}
.proxy-provider-toggle strong{font-size:1.05rem}
.proxy-provider-sub{font-size:12px;color:var(--muted)}
.proxy-settings-chip{
  flex-shrink:0;
  font-size:12px;
  font-weight:700;
  color:#b86a2e;
  background:rgba(240,178,122,.22);
  border:1px solid rgba(224,138,69,.35);
  border-radius:999px;
  padding:6px 10px;
}
.proxy-status{
  font-size:11px;
  font-weight:800;
  margin-top:2px;
}
.proxy-status.ok{color:#1f9d72}
.proxy-status.warn{color:#c47a18}
.proxy-status.off{color:var(--muted)}
.proxy-provider-body{
  padding:0 14px 14px;
  border-top:1px dashed var(--stroke);
}
.proxy-provider-body .grid-form{margin-top:12px}
.locked-value{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(47,180,140,.1);
  color:#1f9d72;
  font-weight:800;
  border:1px solid rgba(47,180,140,.25);
}
.proxy-lock-box{
  margin-top:14px;
  padding:14px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:linear-gradient(160deg,#fff9f2,#ffefd8);
}
.proxy-lock-box .check{display:flex;align-items:center;gap:8px;font-weight:700}
.proxy-lock-box .tiny{margin:8px 0 0}
.captcha-local-box{
  margin:0 0 12px;
  padding:14px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:linear-gradient(160deg,#f3fff8,#e7f8ee);
}
.captcha-local-box .check{display:flex;align-items:center;gap:8px;font-weight:700}
.captcha-local-box .tiny{margin:8px 0 0}
#captchaRemoteFields.is-dim{
  opacity:.45;
}

.secret-field{
  display:flex;
  align-items:stretch;
  gap:8px;
}
.secret-field input{
  flex:1;
  min-width:0;
}
.eye-btn{
  flex-shrink:0;
  width:44px;
  border:1px solid var(--stroke);
  border-radius:12px;
  background:#fff8ef;
  cursor:pointer;
  font-size:16px;
  line-height:1;
}
.eye-btn.is-on{
  border-color:rgba(224,138,69,.55);
  background:rgba(240,178,122,.25);
}

@media (max-width:1000px){
  .portal-grid{grid-template-columns:1fr 1fr}
  .policy-action-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:640px){
  .portal-grid{grid-template-columns:1fr}
  .policy-action-grid{grid-template-columns:1fr}
}
.config-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.chip{
  display:inline-flex;
  align-items:center;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:#e8f8f5;
  border:1px solid #b7ebe3;
  color:var(--brand-dark);
}
.chip-amber{
  background:#fff8e8;
  border-color:#f3d7a1;
  color:#9a6700;
}

.res-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:10px;
  margin-top:8px;
  justify-content:start;
  align-content:start;
}
.res-grid > .muted{
  grid-column:1 / -1;
  margin:0;
}
.res-box{
  width:100%;
  max-width:none;
  box-sizing:border-box;
  background:linear-gradient(180deg,#fff 0%, #f7fbfd 100%);
  border:1px solid var(--stroke);
  border-radius:12px;
  padding:10px 11px;
  box-shadow:0 4px 12px rgba(21,40,70,.05);
}
@media (max-width:900px){
  .res-grid{grid-template-columns:repeat(2, minmax(0,1fr))}
  .res-box{max-width:none}
}
@media (max-width:720px){
  .res-grid{grid-template-columns:1fr}
}
.res-box-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
  padding:8px 10px;
  border-radius:10px;
  background:linear-gradient(90deg,#F5E6C8,#F8D56B);
  color:#14120A;
}
.res-box-head strong{font-size:13px;line-height:1.35;color:#14120A;font-weight:900}
.live-pager{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin:0 0 8px;
}
.live-pager select{
  min-height:34px;
  padding:4px 10px;
  border-radius:8px;
  font-weight:700;
}
.res-meta{font-size:11.5px;color:var(--muted);margin:1px 0;line-height:1.45}
.res-meta b{color:var(--text);font-weight:700}
.pill{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  background:#e8f8f5;
  color:var(--brand-dark);
  white-space:nowrap;
}
.pill-queued,.pill-refreshing,.pill-refresh,.pill-sending,.pill-online{
  background:#fff4e5;color:#9a6700;
}
.pill-done,.pill-ready{background:#e7f8ee;color:#178a57}
.pill-error,.pill-stopped{background:#fdecef;color:#b42318}
.res-pax{
  margin-top:6px;
  padding-top:6px;
  border-top:1px dashed var(--stroke);
}
.res-pax-title{font-weight:800;font-size:11px;margin-bottom:3px}
.res-pax-row{font-size:11px;color:#334155;margin:1px 0;line-height:1.4}

.live-agency{
  padding:0;
  overflow:hidden;
}
.live-agency-summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:12px 14px;
  background:linear-gradient(90deg,rgba(47,212,200,.08),rgba(255,255,255,.4));
}
.live-agency-summary::-webkit-details-marker{display:none}
.live-agency-title{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.live-agency-title strong{font-size:15px}
.live-agency-badges{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.live-agency-badges .pill{
  font-size:12px;
  font-weight:800;
  padding:4px 10px;
}
.live-agency-body{
  padding:2px 14px 14px;
  border-top:1px solid var(--stroke);
}
.live-agency-body .sub-title{
  margin:12px 0 4px;
  font-size:13px;
}
.live-agency-policy{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  align-items:flex-end;
  margin:12px 0 4px;
  padding:10px 12px;
  background:rgba(47,212,200,.08);
  border:1px solid var(--stroke);
  border-radius:12px;
}
.live-agency-policy-field{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:200px;
  flex:1;
}
.live-agency-policy-field input{
  min-height:36px;
  padding:6px 10px;
  border-radius:8px;
  border:1px solid var(--stroke);
  font-weight:700;
}
.live-agency[open] .live-agency-summary{
  background:linear-gradient(90deg,rgba(47,212,200,.14),rgba(255,244,229,.5));
}
.res-box-stopped{
  opacity:.92;
  border-color:#f3c1c6;
  background:linear-gradient(180deg,#fff8f8 0%, #fff 100%);
}
.res-box-done{
  border-color:#9ad7b4;
  background:linear-gradient(180deg,#f3fcf6 0%, #fff 100%);
}
.finance-agency-card{
  border:1px solid rgba(20,40,80,.08);
  box-shadow:0 8px 24px rgba(20,40,80,.05);
}
.finance-agency-actions .btn[disabled]{
  opacity:.45;
  cursor:not-allowed;
}
.res-stop-form{margin-top:8px}
.btn-sm{padding:8px 12px;font-size:12px;min-height:auto}

.motor-hero .stats{margin-top:8px}
.motor-warn{
  margin:12px 0 0;
  padding:10px 12px;
  border-radius:12px;
  background:#fff4e5;
  border:1px solid #f3d7a1;
  color:#9a6700;
  font-weight:700;
  font-size:13px;
}
.motor-empty{grid-column:1 / -1;margin:8px 0 0}
.motor-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:14px;
  margin-top:10px;
}
.motor-box{
  position:relative;
  overflow:hidden;
  background:
    linear-gradient(165deg, rgba(255,255,255,.92), rgba(255,248,241,.96)),
    #fffdf9;
  border:1px solid rgba(224,138,69,.28);
  border-radius:18px;
  padding:14px 14px 12px;
  box-shadow:0 12px 28px rgba(120,70,30,.10);
}
.motor-box::before{
  content:"";
  position:absolute;
  top:0;right:0;bottom:0;
  width:5px;
  background:linear-gradient(180deg,#e08a45,#f0a35c,#ffd7a8);
}
.motor-box-glow{
  position:absolute;
  inset:auto -20px -40px auto;
  width:120px;height:120px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(240,163,92,.28), transparent 68%);
  pointer-events:none;
}
.motor-box-run{
  border-color:rgba(47,158,106,.35);
  box-shadow:0 14px 32px rgba(47,158,106,.12);
}
.motor-box-run::before{
  background:linear-gradient(180deg,#2f9e6a,#7ad0a4);
  animation:motorPulse 1.6s ease-in-out infinite;
}
.motor-box-stop{
  border-color:#f3c1c6;
  background:linear-gradient(180deg,#fff8f8 0%, #fff 100%);
  opacity:.96;
}
.motor-box-stop::before{background:linear-gradient(180deg,#d94866,#f3b0bc)}
.motor-box-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
  padding-right:8px;
}
.motor-route{display:flex;flex-direction:column;gap:2px;min-width:0}
.motor-route strong{
  font-size:15px;
  line-height:1.4;
  color:#3d2a1a;
}
.motor-agency{font-size:11.5px;color:var(--muted);font-weight:700}
.motor-kpis{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:0 0 8px;
  padding-right:8px;
}
.motor-kpi{
  background:rgba(255,255,255,.72);
  border:1px solid var(--stroke);
  border-radius:12px;
  padding:8px 10px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.motor-kpi span{font-size:10.5px;color:var(--muted);font-weight:700}
.motor-kpi b{font-size:13px;color:var(--text);font-weight:800;line-height:1.4}
.motor-kpi small{font-weight:700;color:var(--muted);font-size:10px;margin-right:4px}
.motor-kpi em{font-style:normal;font-size:10.5px;font-weight:800;color:var(--muted)}
.motor-kpi-ch{grid-column:1 / -1}
.motor-kpi-up{background:#f3fcf6;border-color:#9ad7b4}
.motor-kpi-up em,.motor-kpi-up b{color:#178a57}
.motor-kpi-down{background:#fff4f6;border-color:#f3c1c6}
.motor-kpi-down em,.motor-kpi-down b{color:#b42318}
.motor-note{
  margin:8px 0 6px;
  padding:8px 10px;
  border-radius:10px;
  background:#fff8e8;
  border:1px dashed #f3d7a1;
  color:#7a5410;
  font-size:12px;
  font-weight:700;
  line-height:1.5;
}
.motor-stop-btn{width:100%;font-weight:800}
@keyframes motorPulse{
  0%,100%{opacity:1}
  50%{opacity:.45}
}
@media (max-width:1200px){
  .motor-grid{grid-template-columns:repeat(2, minmax(0,1fr))}
}
@media (max-width:720px){
  .motor-grid{grid-template-columns:1fr}
}

@media (max-width:1000px){
  .admin-shell{grid-template-columns:1fr}
  .admin-sidebar{position:relative;top:auto}
  .schedule-row{grid-template-columns:1fr}
  .hero{padding:44px 20px}
  .portal-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .agency-hero-actions{width:100%;justify-content:flex-start}
}
@media (max-width:640px){
  .portal-grid{grid-template-columns:1fr}
  .admin-main .card{padding:14px}
  .res-grid{grid-template-columns:1fr}
  .res-box{max-width:none}
}
