:root {
  --ink: #17313b;
  --ink-soft: #5c6b70;
  --teal: #0e7480;
  --teal-deep: #075c68;
  --teal-pale: #e8f3f2;
  --coral: #d96c52;
  --coral-pale: #fff0ea;
  --paper: #f8faf8;
  --surface: #ffffff;
  --line: #dde7e5;
  --line-dark: #c9d8d5;
  --shadow: 0 18px 48px rgba(24, 64, 71, .07);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(14, 116, 128, .24); outline-offset: 2px; }
.app-shell { min-height: 100vh; }
.topbar { height: 78px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(248, 250, 248, .9); }
.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 9px 9px 9px 2px; font-size: 20px; font-weight: 700; }
.brand strong { display: block; font-size: 15px; line-height: 1.1; }
.brand small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.top-actions, .inventory-actions { display: flex; gap: 9px; align-items: center; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font-size: 13px; font-weight: 700; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--teal); box-shadow: 0 6px 14px rgba(14, 116, 128, .15); }
.button-primary:hover { background: var(--teal-deep); }
.button-quiet { color: var(--ink-soft); background: transparent; border-color: var(--line); }
.button-quiet:hover { color: var(--ink); background: white; border-color: var(--line-dark); }
.button-danger-quiet { color: var(--coral); background: transparent; border-color: transparent; }
.button-danger-quiet:hover { background: var(--coral-pale); }
.page-content { width: min(1240px, calc(100% - 10vw)); margin: 0 auto; padding: 58px 0 32px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 40px; }
.eyebrow { margin: 0 0 9px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(36px, 4.3vw, 62px); line-height: .98; letter-spacing: -.06em; font-weight: 780; }
h1 em { color: var(--teal); font-style: normal; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: -.02em; }
.hero-copy { max-width: 550px; margin-bottom: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.hero-status { display: inline-flex; align-items: center; gap: 9px; padding: 10px 13px; color: var(--ink-soft); background: var(--teal-pale); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #59a896; box-shadow: 0 0 0 4px rgba(89, 168, 150, .13); }
.metrics-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 13px; margin-bottom: 18px; }
.metric-card { min-height: 140px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-main { background: var(--teal); color: white; border-color: var(--teal); }
.metric-label { color: var(--ink-soft); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.metric-main .metric-label, .metric-main .metric-helper { color: rgba(255,255,255,.72); }
.metric-value { margin-top: 20px; font-size: clamp(26px, 3vw, 38px); font-weight: 770; letter-spacing: -.055em; }
.metric-helper { margin-top: 6px; color: var(--ink-soft); font-size: 12px; }
.metric-alert-card .metric-value { color: var(--coral); }
.insights-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; margin-bottom: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.category-panel, .attention-panel { min-height: 338px; padding: 25px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel-caption { color: var(--ink-soft); font-size: 11px; }
.category-chart { display: flex; min-height: 238px; flex-direction: column; justify-content: center; gap: 16px; padding-top: 24px; }
.chart-row { display: grid; grid-template-columns: 140px 1fr 82px; align-items: center; gap: 12px; font-size: 12px; }
.chart-label { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; overflow: hidden; background: var(--teal-pale); border-radius: 99px; }
.bar-fill { height: 100%; min-width: 3px; background: var(--teal); border-radius: inherit; }
.chart-value { color: var(--ink); text-align: right; font-size: 12px; font-weight: 750; }
.attention-list { display: flex; min-height: 238px; flex-direction: column; justify-content: center; gap: 9px; padding-top: 20px; }
.attention-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.attention-item:last-child { border-bottom: 0; }
.attention-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 750; }
.attention-detail { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.attention-tag { flex: 0 0 auto; padding: 5px 8px; color: var(--coral); background: var(--coral-pale); border-radius: 7px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; min-height: 170px; color: var(--ink-soft); text-align: center; font-size: 12px; }
.empty-state strong { color: var(--ink); font-size: 14px; }
.empty-state span:last-of-type { max-width: 330px; line-height: 1.5; }
.empty-icon { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 4px; color: var(--teal); background: var(--teal-pale); border-radius: 11px; font-size: 19px; font-weight: 800; }
.empty-state.compact { min-height: 220px; }
.subscriptions-panel { padding: 25px; }
.subscriptions-heading { align-items: center; }
.toolbar { display: flex; gap: 9px; margin: 25px 0 9px; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.search-box { display: flex; min-width: 220px; flex: 1; align-items: center; gap: 8px; padding: 0 10px; color: var(--ink-soft); }
.search-box span { font-size: 23px; line-height: 0; transform: rotate(-15deg); }
.search-box input, .select-box select { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.select-box { display: flex; min-width: 140px; flex-direction: column; gap: 3px; padding: 0 10px; border-left: 1px solid var(--line); }
.select-box span { color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.table-wrap { position: relative; min-height: 160px; }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 10px; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 16px 10px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; vertical-align: middle; }
td:first-child { color: var(--ink); font-weight: 760; }
.service-meta { margin-top: 4px; color: var(--ink-soft); font-size: 10px; font-weight: 400; }
.money { color: var(--ink); font-weight: 760; }
.status-badge, .action-badge { display: inline-block; padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-badge { color: var(--teal-deep); background: var(--teal-pale); }
.status-badge.warning { color: var(--coral); background: var(--coral-pale); }
.action-badge { background: #eef1f0; color: var(--ink-soft); text-transform: uppercase; }
.action-badge.cancelar { color: var(--coral); background: var(--coral-pale); }
.action-badge.manter { color: var(--teal-deep); background: var(--teal-pale); }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.icon-button { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; color: var(--ink-soft); background: transparent; border: 0; border-radius: 8px; font-size: 17px; }
.icon-button:hover { color: var(--teal); background: var(--teal-pale); }
.icon-button.delete:hover { color: var(--coral); background: var(--coral-pale); }
.table-empty { padding: 38px 0; }
.page-footer { display: flex; justify-content: space-between; padding: 22px 2px 0; color: var(--ink-soft); font-size: 11px; }
.page-footer strong { color: var(--coral); }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; overflow: auto; place-items: center; padding: 22px; background: rgba(22, 48, 57, .36); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(640px, 100%); padding: 27px; background: var(--surface); border-radius: 20px; box-shadow: 0 30px 90px rgba(18, 51, 59, .23); }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.modal-heading h2 { font-size: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field-wide { grid-column: span 2; }
.field > span { color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.field b { color: var(--coral); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; color: var(--ink); background: #fbfcfb; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px rgba(14, 116, 128, .1); }
.currency-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; }
.currency-input span { padding-left: 12px; color: var(--ink-soft); font-size: 12px; }
.currency-input input { border: 0; background: transparent; }
.form-hint { margin: -3px 0 20px; color: var(--ink-soft); font-size: 11px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: 320px; padding: 13px 16px; color: white; background: var(--ink); border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 960px) { .metrics-grid { grid-template-columns: 1fr 1fr; } .insights-grid { grid-template-columns: 1fr; } .hero-row { align-items: flex-start; flex-direction: column; } .hero-status { margin-top: 3px; } }
@media (max-width: 720px) { .topbar { height: auto; min-height: 72px; padding: 14px 5vw; align-items: flex-start; flex-direction: column; gap: 13px; } .top-actions { width: 100%; } .top-actions .button { flex: 1; } .page-content { width: min(100% - 32px, 620px); padding-top: 38px; } .metrics-grid { grid-template-columns: 1fr; } .metric-card { min-height: 120px; } .toolbar { align-items: stretch; flex-direction: column; } .search-box { min-height: 34px; } .select-box { border-top: 1px solid var(--line); border-left: 0; padding: 8px 10px 0; } .table-wrap { overflow-x: auto; } table { min-width: 720px; } .subscriptions-heading { align-items: flex-start; flex-direction: column; } .inventory-actions { width: 100%; } .inventory-actions .button { flex: 1; } .page-footer { gap: 8px; align-items: flex-start; flex-direction: column; } .form-grid { grid-template-columns: 1fr; } .field-wide { grid-column: auto; } .modal { padding: 21px; } }
