
  @font-face {
    font-family:'Killa Display';
    src:url('/assets/fonts/killa-display-v1.woff2') format('woff2');
    font-display:swap;
    font-style:normal;
    font-weight:700;
  }
  * { margin:0; padding:0; box-sizing:border-box; }
  :root {
    /* Tipografia - tokens centralizados */
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    --font-size-4xl: 40px;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.055em;
    --line-height-tight: 1.12;
    --line-height-normal: 1.55;
    --line-height-relaxed: 1.7;
    --word-spacing-normal: normal;
    --word-spacing-wide: normal;

    /* Pilha local: consistente, rápida e compatível com CSP sem hosts externos. */
    --font-brand:ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display:'Killa Display', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body:ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

    /* Cores - paleta flat, default claro */
    --cream:#F6F7FB; --paper:#FFFFFF; --surface:#FFFFFF; --surface2:#F0F2F7; --ink:#121826; --sidebar:#111827; --sidebar2:#192233; --muted:#60697A; --line:#DDE2EA; --soft:#E9EDF4; --orange:#F45D3A; --orange2:#E95335; --green:#14804A; --green-bg:#E7F6ED; --yellow:#9A6700; --yellow-bg:#FFF4D6; --red:#C93636; --red-bg:#FCEAEA; --blue:#3158D4; --blue-bg:#EAF0FF; --shadow:0 1px 2px rgba(18,24,38,.05), 0 14px 36px rgba(18,24,38,.07);
    --radius:10px; --radius-lg:16px; --radius-xl:22px;
  }

  .dark-theme {
    --cream:#0E0F12; --paper:#16181D; --surface:#1A1D23; --surface2:#22252C; --ink:#F1F2F4; --sidebar:#0B0C0F; --sidebar2:#14161B; --muted:#9AA0AB; --line:#2A2E36; --soft:#22252C; --shadow:0 1px 3px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
    --green-bg:#112C1B; --yellow-bg:#2A2400; --red-bg:#3A1414; --blue-bg:#102240;
  }
  .dark-theme .btn.secondary { background:#22252C; color:#F1F2F4; border-color:#2A2E36; }
  .dark-theme table { background:var(--surface); }
  .dark-theme th { background:var(--surface2); color:#F1F2F4; }
  .dark-theme td { border-bottom:1px solid var(--line); }
  .dark-theme input, .dark-theme textarea, .dark-theme select { background:#0F1115; color:#F1F2F4; border-color:#2A2E36; }
  .dark-theme label { color:#D8D3CB; }
  .dark-theme .modal { background:var(--paper); }
  .dark-theme .quick-step { background:var(--surface2); }
  .dark-theme pre { border-color:var(--line); }
  .dark-theme .card, .dark-theme .section { background:var(--surface); }
  .dark-theme .row-actions-menu { background:var(--surface); border-color:var(--line); }
  .dark-theme .alert-banner { background:var(--surface); }
  .dark-theme .status.healthy, .dark-theme .status.active, .dark-theme .status.paid { color:#78D9A1; }
  .dark-theme .status.rate_limited, .dark-theme .status.suspended, .dark-theme .status.pending { color:#F2C94C; }
  .dark-theme .status.out_of_credit, .dark-theme .status.invalid_token, .dark-theme .status.error,
  .dark-theme .status.deleted, .dark-theme .status.revoked, .dark-theme .status.failed { color:#FF8A8A; }
  .dark-theme .status.inactive, .dark-theme .status.unknown { color:#C1C8D4; }

  html { font-family:var(--font-body); font-size:16px; scroll-behavior:smooth; }
  body { font-family:var(--font-body); min-height:100vh; color:var(--ink); background:var(--cream); font-size:16px; line-height:var(--line-height-normal); -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
  .skip-link { position:fixed; z-index:1000; top:10px; left:10px; transform:translateY(-160%); background:var(--ink); color:#fff; padding:10px 14px; border-radius:8px; text-decoration:none; font-weight:700; }
  .skip-link:focus { transform:translateY(0); }
  :where(a,button,input,textarea,select,summary):focus-visible { outline:3px solid var(--orange); outline-offset:3px; }
  .app { display:grid; grid-template-columns:260px minmax(0,1fr); min-height:100vh; }
  .sidebar { background:var(--sidebar); color:#E8E9EC; padding:24px 18px; position:sticky; top:0; height:100vh; border-right:1px solid rgba(255,255,255,.08); display:flex; flex-direction:column; gap:22px; overflow:auto; }
  .brand { display:flex; align-items:center; gap:12px; font-family:var(--font-brand); font-weight:750; font-size:19px; letter-spacing:-.02em; color:#fff; text-decoration:none; padding:2px 4px 10px; }
  .brand-mark { width:38px; height:38px; border-radius:11px; background:var(--orange); color:#fff; display:grid; place-items:center; font-weight:750; flex:0 0 auto; box-shadow:0 8px 20px rgba(244,93,58,.24); }
  .brand small { display:block; color:#9AA4B5; font-size:12px; letter-spacing:0; font-weight:500; margin-top:1px; }
  .nav { display:flex; flex-direction:column; gap:2px; }
  .nav button { min-height:44px; border:1px solid transparent; background:transparent; color:#B9C2D0; text-align:left; padding:11px 12px; border-radius:10px; font-weight:600; cursor:pointer; font-family:var(--font-brand); display:flex; gap:10px; align-items:center; width:100%; font-size:14px; }
  .nav button:hover { background:rgba(255,255,255,.06); color:#fff; }
  .nav button.active { background:var(--orange); color:#121826; }
  .side-footer { margin-top:auto; color:#9AA4B5; font-size:13px; line-height:1.55; border-top:1px solid rgba(255,255,255,.1); padding-top:16px; display:flex; flex-direction:column; gap:12px; }
  .side-footer strong { color:#fff; display:block; font-family:var(--font-brand); font-size:14px; font-weight:650; }
  .side-footer .footer-row { display:flex; gap:8px; align-items:center; }
  .theme-btn { min-height:40px; background:transparent; border:1px solid rgba(255,255,255,.16); color:#C4CAD4; border-radius:9px; padding:9px 11px; cursor:pointer; font-family:var(--font-brand); font-weight:600; font-size:13px; flex:1; }
  .theme-btn:hover { background:rgba(255,255,255,.06); color:#fff; }
  .logout-btn { min-height:40px; background:transparent; border:1px solid rgba(255,255,255,.16); color:#C4CAD4; border-radius:9px; padding:9px 11px; cursor:pointer; font-family:var(--font-brand); font-weight:600; font-size:13px; flex:1; text-decoration:none; text-align:center; }
  .logout-btn:hover { background:rgba(214,69,69,.16); color:var(--red); border-color:rgba(214,69,69,.3); }
  .main { width:min(1440px,100%); padding:36px 40px 72px; overflow:hidden; margin:0 auto; }
  .topbar { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:24px; flex-wrap:wrap; }
  .title h1 { font-family:var(--font-brand); font-size:32px; letter-spacing:-.025em; font-weight:720; line-height:1.15; }
  .title h1::after { content:'.'; color:var(--orange); }
  .title p { color:var(--muted); margin-top:7px; font-size:15px; font-weight:450; line-height:1.6; }
  .toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  input, textarea, select { min-height:44px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); font-family:var(--font-body); font-size:14px; padding:10px 13px; outline:none; width:100%; margin-bottom:10px; transition:border-color .14s, box-shadow .14s; }
  input:focus, textarea:focus, select:focus { box-shadow:0 0 0 3px rgba(255,92,40,.16); border-color:var(--orange); }
  .btn { min-height:42px; background:var(--orange); color:#121826; border:1px solid transparent; padding:10px 16px; border-radius:10px; cursor:pointer; font-weight:650; font-family:var(--font-brand); font-size:14px; line-height:1.35; transition:background .12s, transform .08s, box-shadow .12s; display:inline-flex; align-items:center; justify-content:center; text-align:center; text-decoration:none; }
  .btn:hover { background:var(--orange2); }
  .btn:active { transform:translateY(1px); }
  .btn.secondary { background:var(--surface); color:var(--ink); border:1px solid var(--line); }
  .btn.secondary:hover { background:var(--surface2); }
  .btn.dark { background:#000; color:#fff; }
  .btn.danger { background:var(--red); color:#fff; }
  .btn.small { min-height:44px; padding:8px 12px; font-size:13px; border-radius:8px; }
  .btn:disabled { opacity:.5; cursor:not-allowed; }
  .grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:18px; align-items:start; }
  .grid-2:has(#oResultBox.hide) { grid-template-columns:minmax(0,780px); }
  .grid-3 { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; margin-bottom:18px; }
  .grid-4 { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:18px; }
  .card, .section { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow); }
  .card { padding:20px; margin-bottom:16px; }
  .card h3, .card-title { font-size:13px; color:var(--muted); letter-spacing:0; margin-bottom:10px; font-weight:650; }
  .card .value { font-family:var(--font-brand); font-size:26px; line-height:1.15; font-weight:720; letter-spacing:-.02em; }
  .card .hint { margin-top:9px; color:var(--muted); font-size:14px; font-weight:450; line-height:1.6; }
  .card-primary { padding:18px; }
  .card-primary .value { font-size:28px; }
  .card-primary .label { font-size:13px; color:var(--muted); font-weight:600; letter-spacing:0; margin-bottom:7px; }
  .card-secondary { padding:14px; }
  .card-secondary .value { font-size:18px; }
  .card-secondary .label { font-size:13px; color:var(--muted); font-weight:600; letter-spacing:0; margin-bottom:5px; }
  .section { padding:22px; margin-bottom:20px; }
  .section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
  .section h2 { font-family:var(--font-brand); font-size:20px; letter-spacing:-.015em; font-weight:680; }
  .section p.sub, .sub { color:var(--muted); font-size:14px; line-height:1.6; font-weight:450; margin-top:5px; }
  .hidden, .hide { display:none !important; }
  .table-wrap { overflow:auto; border:1px solid var(--line); border-radius:var(--radius); margin-bottom:14px; background:var(--surface); }
  table { width:100%; border-collapse:collapse; background:var(--surface); }
  th { text-align:left; padding:12px 14px; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.045em; border-bottom:1px solid var(--line); background:var(--surface2); font-weight:700; white-space:nowrap; }
  td { padding:13px 14px; border-bottom:1px solid var(--line); font-size:14px; vertical-align:middle; }
  tr:last-child td { border-bottom:0; }
  tr:hover td { background:rgba(255,92,40,.03); }
  code, .mono { font-family:var(--font-mono); }
  .muted { color:var(--muted); }
  .green { color:var(--green); } .yellow { color:var(--yellow); } .red { color:var(--red); } .blue { color:var(--blue); } .orange { color:var(--orange); }
  .brand-accent { color:var(--orange); }
  .capitalize { text-transform:capitalize; }
  .status { display:inline-flex; align-items:center; gap:6px; padding:4px 9px; border-radius:999px; font-size:12px; font-weight:650; letter-spacing:0; white-space:nowrap; }
  .status::before { content:''; width:6px; height:6px; border-radius:999px; background:#999; }
  .status.healthy,.status.active,.status.paid { color:var(--green); background:var(--green-bg); }
  .status.healthy::before,.status.active::before,.status.paid::before { background:var(--green); }
  .status.rate_limited,.status.suspended,.status.pending { color:var(--yellow); background:var(--yellow-bg); }
  .status.rate_limited::before,.status.suspended::before,.status.pending::before { background:var(--yellow); }
  .status.out_of_credit,.status.invalid_token,.status.error,.status.deleted,.status.revoked,.status.failed { color:var(--red); background:var(--red-bg); }
  .status.out_of_credit::before,.status.invalid_token::before,.status.error::before,.status.deleted::before,.status.revoked::before,.status.failed::before { background:var(--red); }
  .status.inactive,.status.unknown { color:var(--muted); background:var(--surface2); }
  .empty { text-align:center; padding:28px; color:var(--muted); font-style:italic; font-weight:500; }
  pre { background:#0D111B; color:#F2F4F8; border:1px solid var(--line); border-radius:var(--radius); padding:16px; overflow:auto; line-height:1.65; font-family:var(--font-mono); font-size:13px; margin-bottom:10px; white-space:pre-wrap; word-break:break-word; }
  label { display:block; color:var(--ink); font-size:13px; font-weight:650; letter-spacing:0; margin-bottom:7px; margin-top:9px; }
  .copy-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:8px; margin:12px 0; }
  .credential-box { background:var(--green-bg); border:1px solid var(--line); border-radius:var(--radius-lg); padding:18px; margin-bottom:14px; }
  .credential-box h2 { font-family:var(--font-brand); font-size:18px; letter-spacing:-.02em; margin-bottom:6px; }
  .doc-tabs { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
  .quick-steps { counter-reset:step; display:grid; gap:8px; margin:12px 0; }
  .quick-step { display:grid; grid-template-columns:32px 1fr; gap:11px; align-items:start; padding:13px; background:var(--surface2); border:1px solid var(--line); border-radius:var(--radius); font-size:14px; line-height:1.6; }
  .quick-step::before { counter-increment:step; content:counter(step); width:24px; height:24px; display:grid; place-items:center; border-radius:999px; background:var(--orange); color:#fff; font-family:var(--font-brand); font-weight:800; font-size:12px; }

  /* Auth cards (login, forgot, reset) */
  .auth-wrapper { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:22px; background:var(--cream); }
  .auth-card { width:min(460px,100%); background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-xl); padding:42px 36px; box-shadow:var(--shadow); }
  .auth-card h1 { font-family:var(--font-brand); font-size:32px; letter-spacing:-.025em; font-weight:720; line-height:1.15; margin-bottom:8px; text-align:center; }
  .auth-card p.sub { text-align:center; margin-bottom:24px; }
  .auth-card .btn { width:100%; margin-top:10px; font-size:15px; padding:12px; }
  .auth-card .link { display:block; margin-top:20px; color:var(--blue); text-align:center; text-decoration:none; font-weight:600; font-size:14px; }
  .auth-card .link:hover { text-decoration:underline; }
  .err-msg { color:var(--red); font-weight:600; font-size:14px; text-align:center; margin-top:12px; min-height:20px; }
  .ok-msg { color:var(--green); font-weight:600; font-size:14px; text-align:center; margin-top:12px; min-height:20px; }
  .warn { color:var(--yellow); font-weight:600; }

  /* Alert banners */
  .alert-banner { display:flex; align-items:flex-start; gap:12px; padding:12px 16px; border-radius:var(--radius); margin-bottom:14px; border:1px solid var(--line); background:var(--surface); }
  .alert-banner.critical { border-color:var(--red); background:var(--red-bg); }
  .alert-banner.warning { border-color:var(--yellow); background:var(--yellow-bg); }
  .alert-banner .alert-icon { font-size:16px; flex:0 0 auto; }
  .alert-banner .alert-body { flex:1; font-size:14px; line-height:1.6; }
  .alert-banner .alert-body b { font-weight:700; }
  .alert-banner .alert-close { background:transparent; border:none; cursor:pointer; font-size:16px; color:var(--muted); flex:0 0 auto; padding:0 4px; }

  /* Row actions — kebab menu replacing the 6-button cluster */
  .row-actions { position:relative; white-space:nowrap; }
  .row-actions-trigger { min-width:44px; min-height:44px; background:transparent; border:1px solid transparent; border-radius:6px; padding:8px; cursor:pointer; font-size:15px; color:var(--muted); line-height:1; }
  .row-actions-trigger:hover { background:var(--surface2); color:var(--ink); }
  .row-actions-menu { display:none; position:absolute; right:0; top:100%; z-index:20; min-width:180px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 8px 24px rgba(0,0,0,.12); padding:4px; }
  .row-actions-menu.open { display:block; }
  .row-actions-menu button, .row-actions-menu a { display:block; width:100%; text-align:left; background:transparent; border:none; padding:10px 11px; border-radius:7px; cursor:pointer; font-family:var(--font-body); font-size:14px; color:var(--ink); text-decoration:none; }
  .row-actions-menu button:hover, .row-actions-menu a:hover { background:var(--surface2); }
  .row-actions-menu button.danger:hover, .row-actions-menu a.danger:hover { background:var(--red-bg); color:var(--red); }
  .row-primary { display:inline-flex; gap:6px; }

  /* Toasts */
  #app-toasts { position:fixed; bottom:20px; right:20px; z-index:200; display:flex; flex-direction:column; gap:8px; }
  .toast { padding:12px 15px; border-radius:var(--radius); background:var(--surface); border:1px solid var(--line); box-shadow:0 8px 24px rgba(0,0,0,.12); font-size:14px; font-weight:600; max-width:360px; }
  .toast.success { border-color:var(--green); }
  .toast.error { border-color:var(--red); }
  .toast.warning { border-color:var(--yellow); }
  .toast.info { border-color:var(--blue); }

  /* Modal */
  .modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:100; justify-content:center; align-items:center; padding:20px; }
  .modal-overlay.active { display:flex; }
  .modal { background:var(--paper); border-radius:var(--radius-xl); border:1px solid var(--line); padding:24px; max-width:560px; width:100%; box-shadow:0 16px 48px rgba(0,0,0,.2); max-height:92vh; overflow:auto; }
  .modal.modal--wide { max-width:760px; }
  .modal h3 { font-family:var(--font-brand); font-size:22px; font-weight:700; letter-spacing:-.015em; margin-bottom:8px; }
  .modal .modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }

  @media(max-width:980px){ .app{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.side-footer{display:flex}.main{padding:24px 20px 52px}.topbar{flex-direction:column}.grid-2,.grid-2:has(#oResultBox.hide){grid-template-columns:1fr}.title h1{font-size:28px} }
  @media(max-width:560px){ .auth-wrapper{padding:14px}.auth-card{padding:32px 22px}.grid-3,.grid-4{grid-template-columns:1fr}.toolbar{width:100%}.toolbar>.btn{flex:1} }
  @media(prefers-reduced-motion:reduce){ html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important} }
