* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #05090a; }
body {
  font-family: 'Vazirmatn', sans-serif;
  color: #d6ffe9;
  overscroll-behavior: none;
}

:root {
  --green: #2bffa6;
  --pink: #ff2e97;
  --cyan: #22e0ff;
  --dim: #6f8c81;
  --dim2: #8fd8bd;
  --ink: #eafff4;
  --bg: #05090a;
}

@keyframes bt-grid { 0% { background-position: 0 0; } 100% { background-position: 0 -40px; } }
@keyframes bt-pulse { 0%,100% { opacity: 0.5; box-shadow: 0 0 8px rgba(43,255,166,0.5); } 50% { opacity: 1; box-shadow: 0 0 16px rgba(43,255,166,0.9); } }
@keyframes bt-sheen { 0% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes bt-spin { to { transform: rotate(360deg); } }
@keyframes bt-flicker { 0%,100% { opacity: 1; } 92% { opacity: 1; } 94% { opacity: 0.55; } 96% { opacity: 1; } }

.boot {
  height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--ink); background: #05090a;
}
.boot-logo { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 26px; letter-spacing: 1px; text-shadow: 0 0 14px rgba(43,255,166,0.6); color: var(--green); animation: bt-flicker 3s infinite; }
.boot-sub { font-size: 12px; color: var(--dim); }

.app-shell {
  width: 100%; max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; overflow: hidden;
  background: #05090a; display: flex; flex-direction: column; isolation: isolate;
}
.bg-ambient { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, rgba(43,255,166,0.14), transparent 60%), radial-gradient(90% 60% at 90% 110%, rgba(34,224,255,0.10), transparent 55%), #05090a; }
.bg-grid { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(43,255,166,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(43,255,166,0.05) 1px, transparent 1px);
  background-size: 40px 40px; animation: bt-grid 6s linear infinite;
  mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); }

.topbar { position: relative; z-index: 10; flex: 0 0 auto; padding: 14px 18px 12px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(43,255,166,0.16); background: linear-gradient(180deg, rgba(6,15,13,0.9), rgba(6,15,13,0.4)); backdrop-filter: blur(4px); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo { width: 26px; height: 26px; object-fit: contain; filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(43,255,166,0.9)); }
.brand-name { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 19px; letter-spacing: 1px; color: var(--ink); text-shadow: 0 0 10px rgba(43,255,166,0.6); }
.wallet-chip { cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid rgba(43,255,166,0.3); border-radius: 20px; background: rgba(43,255,166,0.07); }
.wallet-chip b { font-weight: 800; font-size: 13px; color: var(--ink); }
.wallet-chip span.unit { font-size: 9px; color: var(--dim); }

.content { position: relative; z-index: 10; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 16px 16px 100px; }
.section-tag { font-size: 11px; color: var(--dim); letter-spacing: 2px; margin-bottom: 2px; }
.section-title { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 16px; }

.wallet-hero { position: relative; overflow: hidden; border: 1px solid rgba(43,255,166,0.3); border-radius: 16px; padding: 18px;
  background: linear-gradient(135deg, rgba(43,255,166,0.12), rgba(34,224,255,0.05)); box-shadow: 0 0 22px rgba(43,255,166,0.18); margin-bottom: 14px; }
.wallet-hero .sheen { position: absolute; top: 0; bottom: 0; width: 60px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent); animation: bt-sheen 4s ease-in-out infinite; }
.wallet-hero-row { display: flex; justify-content: space-between; align-items: flex-start; }
.wallet-label { font-size: 11px; color: var(--dim2); letter-spacing: 1px; }
.wallet-amount { font-weight: 800; font-size: 30px; color: var(--green); text-shadow: 0 0 16px rgba(43,255,166,0.55); margin-top: 6px; }
.wallet-amount .unit { font-size: 13px; color: var(--dim2); font-weight: 500; margin-right: 6px; }
.icon-box { width: 44px; height: 44px; border: 1px solid rgba(43,255,166,0.35); border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.25); }
.btn-primary { cursor: pointer; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 11px;
  background: var(--green); color: #03130d; font-weight: 800; font-size: 14px; box-shadow: 0 0 18px rgba(43,255,166,0.5); border: none; width: 100%; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { cursor: pointer; text-align: center; padding: 10px; border-radius: 10px; background: rgba(43,255,166,0.1); border: 1px solid rgba(43,255,166,0.3); color: var(--green); font-weight: 800; font-size: 13px; }

.status-card { position: relative; overflow: hidden; border: 1px solid rgba(43,255,166,0.22); border-radius: 15px; background: rgba(6,14,11,0.75); margin-bottom: 16px; box-shadow: 0 0 18px rgba(43,255,166,0.1); }
.status-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: bt-pulse 1.6s infinite; }
.status-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.status-sub { font-size: 10.5px; color: var(--dim); font-family: 'Orbitron'; letter-spacing: 0.5px; }
.status-empty { padding: 22px 15px; text-align: center; color: var(--dim); font-size: 12px; }

.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.link-more { cursor: pointer; font-size: 11px; color: var(--green); }

.service-card { position: relative; overflow: hidden; border: 1px solid rgba(43,255,166,0.28); border-radius: 16px; padding: 16px;
  background: linear-gradient(135deg, rgba(43,255,166,0.08), rgba(10,20,17,0.7)); box-shadow: 0 0 18px rgba(43,255,166,0.14); margin-bottom: 14px; }
.service-card.usage { border-color: rgba(255,46,151,0.3); background: linear-gradient(135deg, rgba(255,46,151,0.08), rgba(10,20,17,0.7)); box-shadow: 0 0 18px rgba(255,46,151,0.12); }
.service-badge { position: absolute; top: 0; left: 0; font-size: 9.5px; font-weight: 800; letter-spacing: 0.5px; padding: 4px 12px; border-bottom-right-radius: 11px; background: rgba(43,255,166,0.9); color: #03130d; }
.service-card.usage .service-badge { background: rgba(255,46,151,0.9); }
.service-head { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.service-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.usage .service-dot { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.service-name { font-size: 15px; font-weight: 800; color: var(--ink); }
.service-loc { font-size: 10.5px; color: var(--dim); font-family: 'Orbitron'; letter-spacing: 0.5px; margin-top: 4px; margin-right: 16px; }
.bar-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; font-size: 11px; color: var(--dim2); }
.bar-row b { color: var(--green); }
.bar-track { height: 9px; border-radius: 6px; background: rgba(43,255,166,0.1); overflow: hidden; border: 1px solid rgba(43,255,166,0.2); }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg,#2bffa6,#22e0ff); box-shadow: 0 0 10px rgba(43,255,166,0.7); }
.mini-note { font-size: 10.5px; color: var(--dim); margin-top: 6px; }
.stat-grid { display: flex; gap: 10px; margin-top: 12px; }
.stat-box { flex: 1; border: 1px solid rgba(43,255,166,0.18); border-radius: 10px; padding: 9px 11px; background: rgba(0,0,0,0.2); }
.usage .stat-box { border-color: rgba(255,46,151,0.22); }
.stat-box .l { font-size: 10px; color: var(--dim); }
.stat-box .v { font-size: 14px; font-weight: 800; color: var(--ink); margin-top: 2px; }
.stat-box .v.pink { color: var(--pink); }
.rate-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 9px 11px; border: 1px dashed rgba(255,46,151,0.3); border-radius: 10px; font-size: 11px; color: var(--dim2); }
.config-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 11px; border-radius: 10px; background: rgba(0,0,0,0.35); border: 1px solid rgba(43,255,166,0.15); }
.config-row span { flex: 1; font-family: 'Orbitron'; font-size: 10px; color: #8fa79b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: left; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.action-btn { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 10px; border-radius: 10px; border: 1px solid rgba(43,255,166,0.3);
  background: rgba(43,255,166,0.07); color: var(--green); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.action-btn.primary { background: var(--green); color: #03130d; font-weight: 800; box-shadow: 0 0 14px rgba(43,255,166,0.4); border: none; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; padding: 16px; border-radius: 12px; background: rgba(0,0,0,0.4); border: 1px solid rgba(43,255,166,0.2); }
.qr-box img { width: 140px; height: 140px; border-radius: 10px; background: #e9fff5; padding: 8px; }

.tabs { display: flex; padding: 4px; background: rgba(10,20,17,0.8); border: 1px solid rgba(43,255,166,0.18); border-radius: 12px; margin-bottom: 16px; }
.tab { flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--dim2); }
.tab.active { background: var(--green); color: #03130d; box-shadow: 0 0 14px rgba(43,255,166,0.5); }

.plan-card { position: relative; overflow: hidden; border: 1px solid rgba(43,255,166,0.18); border-radius: 14px; padding: 16px; background: rgba(10,20,17,0.6); margin-bottom: 12px; }
.plan-card.popular { border-color: rgba(43,255,166,0.5); background: linear-gradient(135deg, rgba(43,255,166,0.12), rgba(34,224,255,0.04)); box-shadow: 0 0 20px rgba(43,255,166,0.2); }
.plan-popular-tag { position: absolute; top: 0; left: 0; background: var(--green); color: #03130d; font-size: 9.5px; font-weight: 800; padding: 3px 12px; border-bottom-right-radius: 10px; }
.plan-row { display: flex; justify-content: space-between; align-items: center; }
.plan-name { font-size: 16px; font-weight: 800; color: var(--ink); }
.plan-meta { display: flex; gap: 14px; margin-top: 8px; }
.plan-meta span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dim2); }
.plan-price { text-align: left; font-weight: 800; font-size: 19px; color: var(--green); text-shadow: 0 0 12px rgba(43,255,166,0.4); }
.plan-unit { font-size: 9.5px; color: var(--dim); text-align: left; }

.loc-scroll { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.loc-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; border: 1px solid rgba(43,255,166,0.25); background: rgba(43,255,166,0.06); color: var(--dim2); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.loc-chip.active { background: var(--green); color: #03130d; border-color: var(--green); }

.ticket-card { border: 1px solid rgba(43,255,166,0.18); border-radius: 13px; padding: 15px; background: rgba(10,20,17,0.6); cursor: pointer; margin-bottom: 12px; }
.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; }
.ticket-subject { font-size: 14px; font-weight: 700; color: var(--ink); flex: 1; padding-left: 10px; }
.badge { font-size: 9.5px; font-weight: 700; padding: 4px 9px; border-radius: 20px; white-space: nowrap; border: 1px solid; }
.badge.open { background: rgba(255,196,43,0.12); color: #ffc42b; border-color: rgba(255,196,43,0.35); }
.badge.answered { background: rgba(43,255,166,0.12); color: var(--green); border-color: rgba(43,255,166,0.35); }
.badge.pending { background: rgba(255,196,43,0.12); color: #ffc42b; border-color: rgba(255,196,43,0.35); }
.badge.closed { background: rgba(111,140,129,0.12); color: #8fa79b; border-color: rgba(111,140,129,0.3); }
.ticket-last { font-size: 11.5px; color: var(--dim2); margin-top: 8px; }
.ticket-meta { display: flex; justify-content: space-between; margin-top: 11px; font-size: 10px; color: var(--dim); font-family: 'Orbitron'; }

.msg-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; max-height: 50vh; overflow-y: auto; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.7; }
.msg.user { align-self: flex-end; background: rgba(43,255,166,0.15); border: 1px solid rgba(43,255,166,0.3); color: var(--ink); }
.msg.admin { align-self: flex-start; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--ink); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--dim2); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid rgba(43,255,166,0.25);
  background: rgba(0,0,0,0.3); color: var(--ink); font-family: 'Vazirmatn'; font-size: 13px; }
.field textarea { min-height: 90px; resize: vertical; }
.field input[type=file] { padding: 9px; }

.user-card { display: flex; align-items: center; gap: 13px; border: 1px solid rgba(43,255,166,0.25); border-radius: 16px; padding: 16px;
  background: linear-gradient(135deg, rgba(43,255,166,0.1), rgba(34,224,255,0.04)); margin-bottom: 14px; box-shadow: 0 0 18px rgba(43,255,166,0.12); }
.avatar { width: 54px; height: 54px; border-radius: 14px; border: 1.5px solid var(--green); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; color: var(--green); background: rgba(0,0,0,0.3); box-shadow: 0 0 14px rgba(43,255,166,0.35); }
.user-name { font-size: 16px; font-weight: 800; color: var(--ink); }
.user-username { font-size: 12px; color: var(--dim2); font-family: 'Orbitron'; letter-spacing: 0.5px; margin-top: 3px; }
.user-id { font-size: 10px; color: var(--dim); margin-top: 2px; }

.panel { border: 1px solid rgba(43,255,166,0.2); border-radius: 14px; padding: 16px; background: rgba(10,20,17,0.6); margin-bottom: 20px; }
.charge-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.charge-chip { text-align: center; padding: 9px; border-radius: 9px; border: 1px solid rgba(43,255,166,0.25); background: rgba(43,255,166,0.06); font-size: 12px; font-weight: 700; color: var(--ink); cursor: pointer; }
.charge-chip.active { background: var(--green); color: #03130d; }

.tx-list { display: flex; flex-direction: column; gap: 2px; border: 1px solid rgba(43,255,166,0.15); border-radius: 13px; overflow: hidden; background: rgba(10,20,17,0.6); }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid rgba(43,255,166,0.08); }
.tx-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(43,255,166,0.1); border: 1px solid rgba(43,255,166,0.3); font-weight: 800; color: var(--green); }
.tx-icon.neg { background: rgba(255,46,151,0.1); border-color: rgba(255,46,151,0.3); color: #ff6b8f; }
.tx-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.tx-date { font-size: 10px; color: var(--dim); margin-top: 2px; }
.tx-amount { font-weight: 800; font-size: 13px; color: var(--green); }
.tx-amount.neg { color: #ff6b8f; }

.logout-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; padding: 12px; border: 1px solid rgba(255,46,151,0.3); border-radius: 12px; color: var(--pink); font-weight: 700; font-size: 13px; cursor: pointer; background: transparent; width: 100%; }

.bottom-nav { position: relative; z-index: 20; flex: 0 0 auto; display: flex; justify-content: space-around; align-items: center; padding: 9px 6px calc(env(safe-area-inset-bottom, 0px) + 10px);
  border-top: 1px solid rgba(43,255,166,0.2); background: linear-gradient(0deg, rgba(4,10,9,0.98), rgba(6,15,13,0.82)); backdrop-filter: blur(8px); }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; padding: 4px 0; position: relative; color: var(--dim); background: none; border: none; }
.nav-item.active { color: var(--green); }
.nav-item span { font-size: 9.5px; font-weight: 500; }
.nav-item.active span { font-weight: 800; }
.nav-item.active::after { content: ''; position: absolute; top: -9px; width: 20px; height: 2px; border-radius: 2px; background: var(--green); box-shadow: 0 0 8px rgba(43,255,166,0.8); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--dim); font-size: 13px; }
.spinner { width: 22px; height: 22px; border: 2px solid rgba(43,255,166,0.2); border-top-color: var(--green); border-radius: 50%; animation: bt-spin 0.8s linear infinite; margin: 20px auto; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(10,20,17,0.95); border: 1px solid rgba(43,255,166,0.4);
  color: var(--ink); padding: 10px 18px; border-radius: 20px; font-size: 12.5px; z-index: 100; box-shadow: 0 0 20px rgba(43,255,166,0.3); max-width: 85%; text-align: center; }
.toast.error { border-color: rgba(255,46,151,0.5); color: #ffdce7; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal-sheet { width: 100%; max-width: 480px; background: #0a1512; border-top: 1px solid rgba(43,255,166,0.3); border-radius: 18px 18px 0 0; padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 18px); max-height: 85vh; overflow-y: auto; }
.modal-title { font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 14px; }
.modal-close { position: absolute; left: 14px; top: 14px; color: var(--dim); cursor: pointer; font-size: 18px; }

.admin-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--pink); border: 1px solid rgba(255,46,151,0.4); border-radius: 20px; padding: 3px 10px; margin-bottom: 10px; }
.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.stat-card { border: 1px solid rgba(43,255,166,0.2); border-radius: 12px; padding: 14px; background: rgba(10,20,17,0.6); }
.stat-card .n { font-size: 20px; font-weight: 800; color: var(--green); }
.stat-card .l { font-size: 11px; color: var(--dim); margin-top: 4px; }
.admin-list-row { border: 1px solid rgba(43,255,166,0.15); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: rgba(10,20,17,0.5); }
.admin-row-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink); font-weight: 700; }
.admin-row-sub { font-size: 11px; color: var(--dim); margin-top: 4px; }
.admin-actions { display: flex; gap: 8px; margin-top: 10px; }
.admin-actions button { flex: 1; padding: 8px; border-radius: 8px; border: none; font-size: 12px; font-weight: 700; cursor: pointer; }
.btn-approve { background: var(--green); color: #03130d; }
.btn-reject { background: rgba(255,46,151,0.15); color: var(--pink); border: 1px solid rgba(255,46,151,0.4) !important; }
.receipt-link { color: var(--cyan); font-size: 11px; text-decoration: underline; }
.switch-view { font-size: 11px; color: var(--dim2); text-decoration: underline; cursor: pointer; }
