/* GlobalTel web app. Builds on site.css (tokens, buttons, cards). Layout follows the Figma "Web · App ·" frames. */
body.webapp { min-height: 100vh; }
.preview-bar { background: var(--note-bg); color: var(--note-text); text-align: center; font-size: 13px; font-weight: 500; padding: 6px 12px; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px; height: 72px; padding: 0 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .brand { width: 228px; flex: none; }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-3); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: 400 14px "Fira Sans", sans-serif; color: var(--text); min-width: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; position: relative; }
.balance-chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 15px; }
.balance-chip i { color: var(--blue); font-size: 18px; }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-muted); color: var(--blue); font-size: 20px; cursor: pointer; }
.menu { position: absolute; top: 56px; right: 0; width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 8px; z-index: 40; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; border-radius: 12px; color: var(--text); font: 500 14px "Fira Sans", sans-serif; text-decoration: none; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-muted); }
.menu-name { margin: 6px 12px 8px; font-size: 13px; color: var(--text-3); }

.layout { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 72px); }
.sidebar { display: flex; flex-direction: column; gap: 4px; padding: 20px 16px; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.sidebar a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 14px; letter-spacing: .02em; }
.sidebar a i { font-size: 22px; color: var(--text-2); }
.sidebar a:hover { background: var(--surface-muted); }
.sidebar a.active { background: var(--surface); border: 1px solid var(--border); color: var(--blue); }
.sidebar a.active i { color: var(--blue); }
.side-foot { margin-top: auto; display: grid; gap: 2px; }
.side-foot a { font-weight: 400; }
.crafted-s { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin: 12px 0 0 14px; padding: 5px 12px 5px 14px; border-radius: 999px; background: linear-gradient(135deg, var(--blue), var(--sky)); }
.crafted-s span { color: #fff; font-size: 12px; font-weight: 500; }

.view { padding: 32px clamp(20px, 3vw, 40px) 60px; outline: 0; min-width: 0; }
.view h1 { font-size: clamp(32px, 3.4vw, 48px); margin-bottom: 6px; }
.view .sub { color: var(--text-2); margin: 0 0 26px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .actions { display: flex; gap: 10px; }

.dash { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.panel h2 { font-size: 24px; font-weight: 400; margin: 0 0 14px; }
.panel h3 { font-size: 18px; }
.balance-card { position: relative; overflow: hidden; border-radius: var(--radius); padding: 26px 28px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--sky)); box-shadow: 0 18px 40px rgba(20, 102, 212, .24); }
.balance-card > *:not(.constellation) { position: relative; }
.balance-card .constellation { position: absolute; inset: 0; opacity: .5; }
.balance-card small { font-size: 14px; opacity: .92; }
.balance-card .amount { font-size: 54px; font-weight: 300; margin: 2px 0 6px; }
.balance-card .row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick a { display: grid; justify-items: center; gap: 8px; padding: 16px 8px; border-radius: 18px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 500; }
.quick a i { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-muted); color: var(--blue); font-size: 22px; }
.quick a.primary i { background: linear-gradient(180deg, var(--amber), var(--orange)); color: #fff; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list b { display: block; font-weight: 500; font-size: 15px; }
.list small { color: var(--text-3); font-size: 13px; }
.amt { color: var(--orange); font-weight: 500; white-space: nowrap; }
.empty { color: var(--text-3); font-size: 15px; padding: 8px 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-muted); color: var(--blue); }
.pill.ok { background: var(--success-bg); color: var(--success-text); }
.pill.warn { background: var(--note-bg); color: var(--note-text); }

.get-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-muted); border: 1px solid var(--border); margin-bottom: 14px; }
.seg button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; font: 500 14px "Fira Sans", sans-serif; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }
.field { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border: 2px solid var(--blue); border-radius: 999px; background: var(--surface); margin: 0 0 12px; }
.field input { flex: 1; border: 0; outline: 0; background: transparent; font: 400 16px "Fira Sans", sans-serif; color: var(--text); }
.num-list { list-style: none; margin: 0; padding: 0; }
.num-list label { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; }
.num-list label:hover { background: var(--surface-muted); }
.num-list input { accent-color: var(--orange); width: 18px; height: 18px; }
.num-list input:checked + .n { color: var(--text); }
.num-list label:has(input:checked) { background: var(--note-bg); border-color: var(--orange); }
.num-list .n { font-size: 17px; font-weight: 500; }
.num-list .k { margin-left: auto; color: var(--text-3); font-size: 13px; }
.rent .line { display: flex; justify-content: space-between; padding: 8px 0; color: var(--text-2); }
.rent .total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-size: 18px; color: var(--text); }
.rent .total b { color: var(--orange); font-size: 28px; font-weight: 300; }
.note-box { margin: 14px 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--orange); background: var(--note-bg); color: var(--note-text); font-size: 13px; }
.note-box b { display: block; margin-bottom: 2px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 0 0 10px; color: var(--text-3); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--border); }
.tbl td { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.tbl th:last-child, .tbl td:last-child { text-align: right; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-b { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.plan-b h3 { font-weight: 400; font-size: 24px; margin: 0; }
.plan-b .amount { color: var(--orange); font-size: 30px; font-weight: 300; margin: 8px 0 12px; }
.plan-b .btn { margin-top: auto; }
.region-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.region-row button { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 500 14px "Fira Sans", sans-serif; cursor: pointer; }
.region-row button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.esim-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr { width: 132px; height: 132px; border-radius: 16px; background: repeating-conic-gradient(var(--navy) 0 25%, var(--surface) 0 50%) 0 0 / 22px 22px; border: 6px solid var(--surface); box-shadow: 0 0 0 1px var(--border); flex: none; }
.rows-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14px; }
.rows-kv dt { color: var(--text-3); } .rows-kv dd { margin: 0; font-weight: 500; }

.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(11, 37, 89, .55); backdrop-filter: blur(3px); }
.modal { width: min(480px, 100%); max-height: 94vh; overflow: auto; background: var(--surface); border-radius: 28px; padding: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal h2 { font-size: 34px; margin: 18px 0 10px; }
.providers { display: grid; gap: 10px; margin-top: 16px; }
.provider { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: 500 15px "Fira Sans", sans-serif; cursor: pointer; }
.provider i { margin-left: auto; color: var(--text-3); }
.provider:hover { border-color: var(--blue); }
.p-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-muted); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 18px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.email-row { display: flex; gap: 10px; }
.email-row input { flex: 1; min-width: 0; height: 48px; padding: 0 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: 400 15px "Fira Sans", sans-serif; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }

@media (max-width: 1100px) {
  .dash, .get-grid { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); gap: 6px; }
  .sidebar a { flex: none; padding: 10px 14px; }
  .side-foot { display: none; }
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar .brand { width: auto; }
  .topbar .brand-word, .search { display: none; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: 1fr; }
}
