/* ============================================================
   SV PAG — Design System
   Cores oficiais: laranja #E87722, dark #111
   Fonte: Inter
============================================================ */

:root {
  --orange: #E87722;
  --orange-light: #FF9A40;
  --orange-dark: #c96010;
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #1a1a1a;
  --bg-4: #242424;
  --line: #2a2a2a;
  --line-soft: #1e1e1e;
  --text: #ffffff;
  --text-2: #aaaaaa;
  --text-3: #777777;
  --text-4: #555555;
  --blue: #1F3864;
  --blue-2: #2a4d8f;
  --green: #22c55e;
  --green-soft: rgba(34,197,94,.1);
  --red: #ef4444;
  --red-soft: rgba(239,68,68,.1);
  --yellow: #f59e0b;
  --yellow-soft: rgba(245,158,11,.1);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-light); }
button { font-family: inherit; cursor: pointer; }

/* ── Header ── */
.app-header {
  background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
  border-bottom: 2px solid var(--orange);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 20px rgba(232,119,34,0.12);
}
.logo {
  font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.logo .sv { color: var(--orange); }
.logo .pag { color: var(--text); }
.logo-tag {
  font-size: 10px; color: var(--text-3); font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase; margin-left: 8px;
}
.nav { display: flex; gap: 6px; margin-left: 24px; }
.nav a {
  color: var(--text-2); padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; transition: all .15s;
}
.nav a:hover { color: var(--text); background: var(--bg-3); }
.nav a.active { color: var(--orange); background: rgba(232,119,34,0.08); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-pill {
  background: var(--bg-3); padding: 6px 14px 6px 6px;
  border-radius: 99px; display: inline-flex; align-items: center;
  gap: 8px; font-size: 12px; color: var(--text-2);
}
.user-pill .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 11px;
}
.user-pill a { color: var(--text-3); margin-left: 4px; font-size: 11px; }

/* ── Container ── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 24px 20px; }

/* ── Page header ── */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.page-sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* ── Cards ── */
.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card-title {
  font-size: 11px; font-weight: 700; color: var(--orange);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── KPIs ── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.kpi {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  opacity: .6;
}
.kpi-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.kpi-value { font-size: 24px; font-weight: 800; margin-top: 6px; letter-spacing: -0.5px; }
.kpi-foot { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ── Form ── */
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) {
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
}
.field { margin-bottom: 14px; }
.field-label {
  display: block; font-size: 11px; color: var(--text-3); font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px;
}
.field-input, .field-select, .field-textarea {
  width: 100%; background: var(--bg-3); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none; transition: all .15s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,119,34,0.1);
}
.field-input::placeholder { color: var(--text-4); }
.field-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.field-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--orange); }
.checkbox-row label { font-size: 13px; color: var(--text-2); cursor: pointer; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: white; border: none; padding: 12px 22px;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 13px;
  letter-spacing: .3px; transition: all .15s;
  box-shadow: 0 4px 14px rgba(232,119,34,0.25);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(232,119,34,0.35); }
.btn:disabled, .btn.loading { opacity: .6; pointer-events: none; }
.btn.btn-block { width: 100%; padding: 14px; font-size: 14px; }
.btn.btn-lg { padding: 16px 26px; font-size: 15px; }
.btn.btn-blue { background: linear-gradient(135deg, var(--blue), #0d2040); box-shadow: 0 4px 14px rgba(31,56,100,0.3); }
.btn.btn-blue:hover { box-shadow: 0 6px 18px rgba(31,56,100,0.4); }
.btn.btn-ghost {
  background: transparent; border: 1.5px solid var(--line); color: var(--text-2);
  box-shadow: none;
}
.btn.btn-ghost:hover { border-color: var(--orange); color: var(--orange); transform: none; box-shadow: none; }
.btn.btn-danger { background: linear-gradient(135deg, var(--red), #b91c1c); box-shadow: 0 4px 14px rgba(239,68,68,0.25); }
.btn.btn-sm { padding: 7px 14px; font-size: 12px; }

/* ── Tables ── */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 540px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.table th {
  font-size: 10px; font-weight: 700; color: var(--orange);
  text-transform: uppercase; letter-spacing: 1.2px; background: var(--bg-2);
}
.table tr:hover td { background: rgba(232,119,34,0.03); }
.table .right { text-align: right; }
.table .center { text-align: center; }

/* ── Pills ── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
}
.pill.pending { background: var(--yellow-soft); color: var(--yellow); }
.pill.approved { background: var(--green-soft); color: var(--green); }
.pill.refused, .pill.cancelled, .pill.expired, .pill.refunded {
  background: var(--red-soft); color: var(--red);
}
.pill.authorized, .pill.pending_3ds { background: rgba(31,56,100,.15); color: #6588c8; }
.pill.gray { background: var(--bg-3); color: var(--text-3); }

/* ── Flash messages ── */
.flash {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px;
  margin-bottom: 14px; border: 1px solid transparent;
}
.flash.ok { background: var(--green-soft); border-color: rgba(34,197,94,.25); color: var(--green); }
.flash.err { background: var(--red-soft); border-color: rgba(239,68,68,.25); color: var(--red); }

/* ── Auth pages (login/register) ── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(232,119,34,.08), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(31,56,100,.08), transparent 50%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.auth-card .logo { font-size: 26px; margin-bottom: 4px; }
.auth-card .auth-sub { color: var(--text-3); font-size: 13px; margin-bottom: 26px; }
.auth-card h1 { font-size: 18px; margin-bottom: 18px; font-weight: 700; }
.auth-card .auth-foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }

/* ── Empty state ── */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-3);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 16px; color: var(--text-2); font-weight: 700; margin-bottom: 6px; }
.empty-sub { font-size: 13px; margin-bottom: 20px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .app-header { padding: 11px 14px; gap: 8px; flex-wrap: wrap; }
  .logo-tag { display: none; }
  .nav {
    order: 99; width: 100%; margin-left: 0; margin-top: 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; gap: 4px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; flex-shrink: 0; padding: 6px 12px; font-size: 12.5px; }
  .header-right { margin-left: auto; }
  .user-pill { font-size: 11.5px; padding: 5px 10px 5px 5px; }
  .user-pill .avatar { width: 22px; height: 22px; font-size: 10px; }
}
@media (max-width: 700px) {
  .wrap { padding: 16px 14px; }
  .page-title { font-size: 19px; }
  .page-head { gap: 10px; }
  .page-head .btn { font-size: 12px; padding: 9px 14px; }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 20px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 10px; }
  .auth-card { padding: 28px 22px; }
}
