/* ─── Customer Portal — Dark Dashboard ─── */
:root {
  --bg: #091019;
  --surface: #11161d;
  --surface-2: #171d25;
  --surface-3: #252d37;
  --line: rgba(255,255,255,.09);
  --text: #f4f7fb;
  --muted: #95a0ad;
  --dim: #6e7884;
  --gold: #ffc107;
  --gold-2: #a68110;
  --green: #18f0a5;
  --green-soft: rgba(24,240,165,.12);
  --cyan: #4ec9ff;
  --danger: #ff5c5c;
  --radius: 28px;
  --radius-sm: 18px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, 'Noto Sans TC', 'PingFang TC', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(26,41,61,.6), transparent 26%),
              linear-gradient(180deg, #0a1018, #070b11 60%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* Layout */
.wrap { max-width: 1320px; margin: 0 auto; padding: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.35); }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Pill / Badge */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); font-weight: 700; font-size: 14px; cursor: pointer; color: var(--text); transition: background .2s; }
.pill:hover { background: rgba(255,255,255,.08); }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); font-weight: 800; font-size: 14px; }
.badge-gold { border-color: rgba(255,193,7,.35); background: rgba(255,193,7,.12); }
.badge-green { background: var(--green-soft); color: var(--green); border-color: rgba(24,240,165,.2); }

/* Avatar */
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--gold); color: #111; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; flex-shrink: 0; }

/* Big number */
.big-num { font-size: clamp(48px,10vw,84px); font-weight: 900; line-height: 1; color: var(--gold); text-shadow: 0 0 30px rgba(255,193,7,.16); }
.big-unit { font-size: 22px; color: rgba(255,193,7,.66); margin-left: 8px; }

/* Tabs */
.tab-row { display: flex; gap: 28px; padding: 0 0 16px; border-bottom: 1px solid var(--line); font-weight: 800; color: var(--muted); font-size: 15px; }
.tab-row span { cursor: pointer; position: relative; padding-bottom: 16px; transition: color .2s; }
.tab-row span.active { color: var(--text); }
.tab-row span.active::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 48px; height: 3px; border-radius: 999px; background: var(--gold); }

/* KPI row */
.kpi-row { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 15px; }
.kpi-row:last-child { border-bottom: 0; }
.kpi-label { display: flex; align-items: center; gap: 10px; color: #dce4ee; font-weight: 700; }
.kpi-value { font-size: 18px; font-weight: 900; }
.kpi-value.green { color: var(--green); }
.kpi-value.gold { color: var(--gold); }
.kpi-value.cyan { color: var(--cyan); }

/* List item */
.list-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.04); align-items: center; }
.list-item:last-child { border-bottom: 0; }
.list-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* Banner */
.banner { border-radius: 20px; background: linear-gradient(180deg, rgba(8,52,38,.9), rgba(11,35,29,.95)); border: 1px solid rgba(24,240,165,.22); display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; padding: 20px; align-items: center; }
.banner-icon { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; font-size: 28px; }

/* Buttons */
.btn { padding: 14px 24px; border: none; border-radius: 16px; font-size: 16px; font-weight: 800; transition: all .2s; }
.btn-gold { background: var(--gold); color: #111; }
.btn-gold:hover { background: #e6ad00; }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn-outline:hover { background: rgba(255,255,255,.06); }
.btn-green { background: var(--green-soft); color: var(--green); border: 1px solid rgba(24,240,165,.2); }
.btn-amber { background: rgba(149,99,27,.28); color: #ffbf53; border: 1px solid rgba(255,191,83,.22); }

/* Asset card */
.asset-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); align-items: center; cursor: pointer; transition: background .2s; }
.asset-card:last-child { border-bottom: 0; }
.asset-card:hover { background: rgba(255,255,255,.03); }
.asset-icon { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,193,7,.08); border: 1px solid rgba(255,193,7,.18); display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* Chart area */
.chart-area { min-height: 260px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); padding: 20px; position: relative; }
.chart-area canvas { width: 100% !important; height: 240px !important; }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-box { width: 100%; max-width: 420px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 32px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.login-title { font-size: 28px; font-weight: 900; text-align: center; margin-bottom: 8px; }
.login-sub { text-align: center; color: var(--muted); margin-bottom: 32px; font-size: 15px; }
.login-input { width: 100%; padding: 14px 16px; border: 1.5px solid rgba(255,255,255,.12); border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: 16px; outline: none; transition: border-color .2s; }
.login-input:focus { border-color: var(--gold); }
.login-input::placeholder { color: var(--dim); }
.login-btn { width: 100%; margin-top: 16px; padding: 16px; border: none; border-radius: 14px; font-size: 17px; font-weight: 800; cursor: pointer; }
.login-btn.gold { background: var(--gold); color: #111; }
.login-btn.gold:hover { background: #e6ad00; }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 8px; text-align: center; }
.login-back { display: block; text-align: center; margin-top: 24px; color: var(--muted); font-size: 14px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 24px; }

/* Spinner */
.spinner-overlay { position: fixed; inset: 0; background: rgba(9,16,25,.8); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.spinner { width: 48px; height: 48px; border: 4px solid rgba(255,255,255,.1); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 768px) {
  .wrap { padding: 12px; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .big-num { font-size: 48px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
}
