:root {
  color-scheme: dark;
  --bg: #050507;
  --bg-soft: #0b0b10;
  --panel: #121219;
  --panel-2: #1a1a24;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f6f8;
  --muted: #aaa7b0;
  --accent: #ff3d63;
  --accent-strong: #ff7b38;
  --success: #49e277;
  --danger: #ff8f8f;
  --warning: #ffb35c;
  --radius: 24px;
  --shadow: 0 28px 80px rgba(0, 0, 0, .32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 82% -12%, rgba(255, 61, 99, .17), transparent 30rem), radial-gradient(circle at 8% 28%, rgba(255, 123, 56, .07), transparent 25rem), var(--bg); color: var(--text); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.panel-header { min-height: 72px; padding: 12px clamp(18px, 4vw, 56px); display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); background: rgba(5, 5, 7, .9); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.panel-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.1rem; }
.panel-brand strong { color: var(--accent); }
.panel-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); border-radius: 12px; box-shadow: 0 10px 28px rgba(255, 61, 99, .24); font-weight: 900; font-size: .78rem; }
.panel-nav { display: flex; gap: 8px; margin-right: auto; }
.panel-nav a { color: var(--muted); text-decoration: none; padding: 9px 12px; border-radius: 10px; }
.panel-nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.panel-user { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.panel-user form { margin: 0; }
.panel-header > .link-button { margin-left: auto; }
.link-button { appearance: none; border: 0; background: transparent; color: var(--accent); cursor: pointer; text-decoration: none; padding: 6px; }

.panel-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 70px; }
.panel-footer { padding: 28px 16px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); font-size: .88rem; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin: 5px 0 0; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; letter-spacing: -.045em; }
.page-heading > p { max-width: 480px; color: var(--muted); }
.eyebrow { color: var(--accent); margin: 0; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: .72rem; }
.muted, small { color: var(--muted); }

.primary-button, .secondary-button, .whatsapp-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid transparent; padding: 10px 16px; cursor: pointer; font-weight: 800; text-decoration: none; text-align: center; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, filter .2s ease; }
.primary-button { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); box-shadow: 0 12px 30px rgba(255, 61, 99, .2); }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 16px 36px rgba(255, 61, 99, .3); }
.secondary-button { color: var(--text); background: transparent; border-color: var(--line); }
.secondary-button:hover { border-color: rgba(255,61,99,.5); }
.whatsapp-button { color: #052014; background: #49e277; }

.flash { margin: 0 0 22px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; }
.flash-success { color: #b6f8dd; background: rgba(73,226,119,.09); border-color: rgba(73,226,119,.25); }
.flash-error { color: #ffd1d4; background: rgba(255,143,143,.09); border-color: rgba(255,143,143,.25); }

.login-page .panel-main { display: grid; place-items: center; min-height: calc(100vh - 145px); }
.auth-card, .form-card, .table-card, .subscription-card, .payment-card, .info-card, .notification-card { background: linear-gradient(145deg, rgba(26,26,36,.97), rgba(11,11,16,.98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card { width: min(440px, 100%); padding: clamp(26px, 5vw, 42px); }
.auth-card h1 { font-size: 2.2rem; margin: 8px 0 10px; }
.auth-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }

.stack-form, .form-grid { display: grid; gap: 17px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #e7e4e9; font-size: .88rem; font-weight: 700; }
input, select, textarea { width: 100%; color: var(--text); background: rgba(5,5,7,.76); border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,61,99,.14); }
textarea { resize: vertical; }
.full-field { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; }
.form-card { padding: 24px; margin-bottom: 20px; }
.form-card h2, .table-card h2 { margin-top: 0; }
.narrow-card { max-width: 620px; }
details.form-card summary { cursor: pointer; font-size: 1.12rem; font-weight: 800; }
.details-content { margin-top: 24px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 26px; }
.stats-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.stats-grid span { display: block; color: var(--muted); font-size: .84rem; }
.stats-grid strong { display: block; margin-top: 10px; font-size: 2rem; }
.stats-grid .attention { border-color: rgba(255,179,92,.3); }

.section-title { margin: 34px 0 15px; display: flex; justify-content: space-between; align-items: center; }
.section-title h2 { margin: 4px 0 0; }
.table-card { padding: 22px; margin-bottom: 22px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
td a { color: var(--accent); font-weight: 700; }
.status { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-success { color: #b6f8dd; background: rgba(73,226,119,.12); }
.status-danger { color: #ffd1d4; background: rgba(255,143,143,.13); }
.status-warning { color: #ffe2a7; background: rgba(255,179,92,.12); }
.status-neutral { color: #c5d1d0; background: rgba(255,255,255,.08); }
.search-form { display: flex; gap: 10px; margin-bottom: 15px; }
.search-form input { max-width: 380px; }

.subscription-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.subscription-card { padding: clamp(22px, 4vw, 30px); }
.card-title-row { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.card-title-row h2 { margin: 5px 0 0; }
.service-type { color: var(--accent); font-weight: 900; font-size: .68rem; letter-spacing: .13em; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.metric-row div, .summary-strip span { padding: 13px; background: rgba(0,0,0,.16); border-radius: 12px; }
.metric-row span, .summary-strip span { color: var(--muted); font-size: .72rem; }
.metric-row strong, .summary-strip strong { display: block; margin-top: 6px; color: var(--text); }
.meta-line, .deadline-note { color: var(--muted); font-size: .86rem; }
.credentials { padding: 18px 0; margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.credentials h3 { margin-top: 0; }
.credentials label + label { margin-top: 12px; }
.copy-field { display: flex; gap: 7px; }
.copy-field input { min-width: 0; }
.copy-field button { border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.04); color: var(--accent); cursor: pointer; padding: 0 10px; }
.subscription-card > .primary-button, .subscription-card > form .primary-button { width: 100%; }
.deadline-note { line-height: 1.5; margin-bottom: 0; }

.payment-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .65fr); gap: 20px; align-items: start; }
.payment-card, .info-card { padding: clamp(22px, 4vw, 32px); }
.payment-amount { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 900; letter-spacing: -.055em; margin: 28px 0; }
.qr-box { width: 252px; min-height: 252px; padding: 16px; display: grid; place-items: center; background: white; border-radius: 18px; margin: 0 auto 22px; }
.qr-box img, .qr-box canvas { max-width: 100%; height: auto; }
.pix-code { margin-top: 18px; }
.confirm-box, .process-message { margin-top: 24px; padding: 18px; border-radius: 14px; background: rgba(255,61,99,.07); border: 1px solid rgba(255,61,99,.2); }
.confirm-box p, .process-message p { color: var(--muted); line-height: 1.55; }
.info-card h2 { margin-top: 0; }
.info-card li { margin-bottom: 13px; color: var(--muted); line-height: 1.5; }
.success-panel { color: #b6f8dd; background: rgba(73,226,119,.07); border-color: rgba(73,226,119,.2); }

.two-column { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
.notification-card { padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 22px; border-color: rgba(73,226,119,.3); }
.notification-card h2 { margin: 6px 0; }
.notification-card p:last-child { color: var(--muted); }
.notification-actions { display: grid; gap: 9px; min-width: 260px; }
.notification-actions form, .notification-actions button { width: 100%; }
.confirmation-panel { padding: 20px; border-radius: 15px; background: rgba(255,179,92,.07); border: 1px solid rgba(255,179,92,.23); margin-bottom: 24px; }
.confirmation-panel h3 { margin-top: 0; }
.confirmation-panel > p { color: var(--muted); }
.summary-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.check-label input { width: 18px; height: 18px; }
.invoice-creator { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.inline-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.inline-actions form { margin: 0; }
.danger-link { color: var(--danger); }
.inline-form { display: flex; align-items: end; gap: 12px; }
.inline-form label { flex: 1; }
.empty-state { padding: 55px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state.small { padding: 24px; }

@media (max-width: 820px) {
  .panel-header { flex-wrap: wrap; gap: 10px; }
  .panel-nav { order: 3; width: 100%; overflow-x: auto; }
  .panel-user { margin-left: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .payment-layout, .two-column { grid-template-columns: 1fr; }
  .notification-card { align-items: stretch; flex-direction: column; }
  .notification-actions { min-width: 0; width: 100%; }
}

@media (max-width: 580px) {
  .panel-main { width: min(100% - 22px, 1180px); padding-top: 28px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .metric-row { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .copy-field { flex-wrap: wrap; }
  .copy-field input { flex-basis: 100%; }
  .copy-field button { min-height: 38px; flex: 1; }
}
