:root {
  --ink: #17211b;
  --muted: #637068;
  --paper: #f5f7f2;
  --surface: #ffffff;
  --line: #d9dfd9;
  --brand: #146b4a;
  --brand-dark: #0d5037;
  --accent: #d7a62a;
  --danger: #a43b37;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { min-height: 100%; font-size: 16px; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); font-family: Georgia, "Times New Roman", serif; }
a { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.topbar { min-height: 64px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 32px; padding: 0 4vw; background: var(--ink); color: #fff; }
.brand { color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.brand span { color: #f0c85a; }
.main-navigation { display: flex; align-items: stretch; min-height: 64px; }
.main-navigation a { display: flex; align-items: center; padding: 0 14px; color: #dce5df; text-decoration: none; border-bottom: 3px solid transparent; font-family: "Segoe UI", sans-serif; font-size: .9rem; }
.main-navigation a:hover { color: #fff; border-bottom-color: var(--accent); }
.session-form { display: flex; align-items: center; gap: 12px; font-family: "Segoe UI", sans-serif; font-size: .82rem; }
.session-form button, .menu-toggle { border: 1px solid #65736b; border-radius: var(--radius); padding: 7px 11px; color: #fff; background: transparent; }
.menu-toggle { display: none; }
.page-container { width: min(1400px, 92vw); margin: 0 auto; padding: 46px 0 72px; }
.public-body .page-container { width: 100%; padding: 0; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.02; }
h2 { margin-bottom: 8px; font-size: 1.5rem; }
.eyebrow { margin-bottom: 8px; color: var(--brand); font-family: "Segoe UI", sans-serif; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 36px; }
.page-description { margin-bottom: 0; color: var(--muted); font-family: "Segoe UI", sans-serif; }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.metric-item { display: flex; min-height: 124px; flex-direction: column; justify-content: space-between; padding: 24px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--line); }
.metric-item:last-child { border-right: 0; }
.metric-item span { color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: .85rem; }
.metric-item strong { font-size: 2.5rem; line-height: 1; }
.metric-item:hover { background: #eef4ed; }
.work-section { margin-top: 56px; }
.section-heading { margin-bottom: 24px; }
.workflow-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.workflow-list li { display: grid; grid-template-columns: 60px 1fr; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.workflow-list li > span { color: var(--brand); font-weight: 700; }
.workflow-list p { margin: 3px 0 0; color: var(--muted); font-family: "Segoe UI", sans-serif; }

.catalog-heading { align-items: center; }
.catalog-tools { width: min(440px, 100%); display: flex; align-items: end; gap: 12px; }
.search-form { min-width: 0; flex: 1; font-family: "Segoe UI", sans-serif; }
.search-form label { display: block; margin-bottom: 7px; font-size: .82rem; font-weight: 600; }
.search-form > div { display: grid; grid-template-columns: 1fr auto; }
.search-form input { min-width: 0; height: 42px; padding: 8px 12px; border: 1px solid #aab5ad; border-radius: var(--radius) 0 0 var(--radius); background: #fff; }
.search-form .button { border-radius: 0 var(--radius) var(--radius) 0; }
.search-form > a { display: inline-block; margin-top: 7px; font-size: .8rem; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 8px 15px; border: 1px solid transparent; border-radius: var(--radius); text-decoration: none; font-family: "Segoe UI", sans-serif; font-weight: 650; cursor: pointer; }
.button-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button-primary:hover { color: #fff; background: var(--brand-dark); }
.button-secondary { color: var(--ink); background: #fff; border-color: #aab5ad; }
.button-block { width: 100%; }

.table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-family: "Segoe UI", sans-serif; }
th { padding: 12px 16px; color: #536058; background: #edf1eb; font-size: .74rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 16px; border-top: 1px solid var(--line); font-size: .9rem; vertical-align: top; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.row-actions form { margin: 0; }
.row-actions button { padding: 0; border: 0; color: var(--danger); background: transparent; text-decoration: underline; cursor: pointer; }
.status { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.status-active { color: #0b5a3b; background: #dcefe4; }
.status-inactive { color: #6c4947; background: #f0e5e4; }
.empty-state { padding: 48px 20px; text-align: center; font-family: "Segoe UI", sans-serif; }
.empty-state p { margin: 5px 0 0; color: var(--muted); }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 16px; font-family: "Segoe UI", sans-serif; font-size: .85rem; }
.pagination-bar p { margin: 0; color: var(--muted); }
.pagination-actions { display: flex; align-items: center; gap: 14px; }
.dashboard-heading { align-items: center; }
.dashboard-as-of { display: grid; gap: 2px; min-width: 190px; padding-left: 18px; border-left: 3px solid var(--accent); font-family: "Segoe UI", sans-serif; }
.dashboard-as-of span, .dashboard-as-of small { color: var(--muted); font-size: .75rem; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--surface); }
.dashboard-metric { display: flex; min-height: 132px; flex-direction: column; justify-content: space-between; padding: 20px; border: 0; border-right: 1px solid var(--line); border-bottom: 4px solid transparent; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.dashboard-metric:last-child { border-right: 0; }
.dashboard-metric span, .dashboard-metric small { font-family: "Segoe UI", sans-serif; }
.dashboard-metric span { font-weight: 700; }
.dashboard-metric small { color: var(--muted); }
.dashboard-metric strong { font-size: 2.4rem; line-height: 1; }
.dashboard-metric:hover, .dashboard-metric.is-selected { background: #f5f7f2; }
.metric-online { border-bottom-color: #147a50; }
.metric-grace { border-bottom-color: #d7a62a; }
.metric-offline { border-bottom-color: #b9584f; }
.metric-blocked { border-bottom-color: #536058; }
.dashboard-commercial { display: grid; grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(180px, .45fr)); gap: 1px; margin-top: 28px; border: 1px solid var(--line); background: var(--line); }
.dashboard-commercial-heading { padding: 22px 24px; background: var(--surface); }
.dashboard-commercial-heading h2 { margin-bottom: 6px; font-size: 1.35rem; }
.dashboard-commercial-heading p:last-child { margin: 0; color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: .85rem; }
.commercial-indicator { display: flex; flex-direction: column; justify-content: center; padding: 18px 24px; color: var(--ink); background: var(--surface); text-decoration: none; }
.commercial-indicator:hover { color: var(--ink); background: #f5f7f2; }
.commercial-indicator span, .commercial-indicator small { font-family: "Segoe UI", sans-serif; }
.commercial-indicator span { font-weight: 700; }
.commercial-indicator strong { margin: 7px 0; font-size: 2rem; line-height: 1; }
.commercial-indicator small { color: var(--muted); }
.commercial-complete { box-shadow: inset 0 -4px #147a50; }
.commercial-pending { box-shadow: inset 0 -4px #b9584f; }
.dashboard-charts { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr); gap: 44px; margin-top: 52px; }
.dashboard-chart { min-width: 0; }
.chart-frame { position: relative; height: 300px; }
.dashboard-table-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.connection-status { display: inline-block; padding: 4px 9px; border-radius: 999px; font-family: "Segoe UI", sans-serif; font-size: .75rem; font-weight: 700; }
.connection-online { color: #0b5a3b; background: #dcefe4; }
.connection-gracia { color: #745500; background: #f8edc9; }
.connection-desconectado { color: #7f2926; background: #f7e4e2; }
.connection-bloqueado { color: #39423d; background: #e3e7e4; }
.plan-links { white-space: normal; }
.plan-links a { display: block; margin-bottom: 4px; }
.plan-links a:last-child { margin-bottom: 0; }
.license-links span { display: block; margin-bottom: 7px; }
.license-links span:last-child { margin-bottom: 0; }
.license-links .trace-link { margin-left: 6px; font-size: .78rem; }
.dt-container { font-family: "Segoe UI", sans-serif; }
.dt-container .dt-layout-row { margin: 0 0 16px; }
.dt-container .dt-layout-row:first-child { padding: 0 0 12px; }
.dt-container .dt-search input, .dt-container .dt-length select { border: 1px solid #aab5ad; border-radius: var(--radius); background: #fff; }
.dt-container .dt-paging .dt-paging-button { border-radius: var(--radius); }
.flash { margin-bottom: 24px; padding: 12px 16px; border-left: 4px solid; border-radius: var(--radius); font-family: "Segoe UI", sans-serif; }
.flash-success { color: #0b5a3b; background: #dcefe4; border-color: var(--brand); }
.flash-error { color: #7f2926; background: #f7e4e2; border-color: var(--danger); }
.edit-form { max-width: 820px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.field-wide { grid-column: 1 / -1; }
.field-group textarea { width: 100%; padding: 9px 11px; border: 1px solid #aab5ad; border-radius: var(--radius); resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 10px; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #e8eee7; }
.auth-panel { width: min(430px, 100%); padding: 42px; border-top: 5px solid var(--brand); border-radius: var(--radius); background: #fff; box-shadow: 0 18px 45px rgba(23, 33, 27, .12); }
.auth-kicker { color: var(--brand); font-weight: 700; }
.auth-panel h1 { margin-bottom: 30px; font-size: 2rem; }
.field-group { margin-bottom: 18px; font-family: "Segoe UI", sans-serif; }
.field-group label { display: block; margin-bottom: 6px; font-size: .84rem; font-weight: 650; }
.field-group input, .field-group select { width: 100%; height: 44px; padding: 9px 11px; border: 1px solid #aab5ad; border-radius: var(--radius); background: #fff; }
.field-group span, .validation-summary { color: var(--danger); font-family: "Segoe UI", sans-serif; font-size: .8rem; }
.validation-summary ul { padding-left: 18px; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 24px; font-family: "Segoe UI", sans-serif; font-size: .85rem; }
.status-page { min-height: 70vh; display: grid; place-content: center; text-align: center; }
.status-code { margin-bottom: 0; color: var(--brand); font-size: 4rem; font-weight: 700; }
.heading-actions { display: flex; align-items: center; gap: 12px; }
.activation-identifier { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; margin-bottom: 18px; padding: 18px 20px; border-left: 4px solid var(--accent); background: var(--surface); font-family: "Segoe UI", sans-serif; }
.activation-identifier div { min-width: 0; }
.activation-identifier div > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .78rem; font-weight: 650; }
.activation-identifier code { display: block; color: var(--ink); font-size: .95rem; overflow-wrap: anywhere; }
.identifier-inline { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: var(--muted); font-family: Consolas, monospace; font-size: .72rem; }
.identifier-inline button { padding: 0; border: 0; color: var(--brand-dark); background: transparent; font-family: "Segoe UI", sans-serif; font-size: .74rem; text-decoration: underline; cursor: pointer; }
.copy-feedback { min-width: 44px; color: var(--brand-dark); font-family: "Segoe UI", sans-serif; font-size: .76rem; font-weight: 650; }
.license-facts { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); background: var(--surface); }
.license-facts div { min-height: 94px; padding: 20px; border-right: 1px solid var(--line); }
.license-facts div:last-child { border-right: 0; }
.license-facts span, .license-facts strong { display: block; }
.license-facts span { margin-bottom: 12px; color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: .78rem; }
.license-facts strong { font-size: 1.2rem; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 42px; align-items: start; }
.operation-panel { position: sticky; top: 24px; margin-top: 56px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.operation-panel h2 { font-size: 1.25rem; }
.operation-panel details { padding: 14px 0; border-top: 1px solid var(--line); font-family: "Segoe UI", sans-serif; }
.operation-panel summary { cursor: pointer; font-weight: 650; }
.operation-panel form { padding-top: 16px; }
.operation-panel textarea { width: 100%; min-height: 78px; padding: 9px 11px; border: 1px solid #aab5ad; border-radius: var(--radius); resize: vertical; }
.button-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.trace-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.trace-list li { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.trace-list time, .trace-list span { color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: .8rem; }
.trace-list span { display: block; margin-top: 3px; }
.trace-list p { margin: 6px 0 0; font-family: "Segoe UI", sans-serif; }
.snapshot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.snapshot-grid > div { padding: 20px; background: var(--surface); }
.snapshot-grid h3 { font-size: 1rem; }
.snapshot-grid ul { margin: 0; padding-left: 18px; font-family: "Segoe UI", sans-serif; font-size: .85rem; }
.snapshot-grid li + li { margin-top: 8px; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding: 12px 4vw; }
  .menu-toggle { display: block; }
  .main-navigation { display: none; grid-column: 1 / -1; min-height: 0; flex-direction: column; }
  .main-navigation.is-open { display: flex; }
  .main-navigation a { min-height: 42px; padding: 0; border-bottom: 1px solid #3b4941; }
  .session-form { grid-column: 1 / -1; justify-content: space-between; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-metric:nth-child(2) { border-right: 0; }
  .dashboard-metric:nth-child(-n+2) { border-bottom-width: 4px; }
  .dashboard-commercial { grid-template-columns: repeat(2, 1fr); }
  .dashboard-commercial-heading { grid-column: 1 / -1; }
  .dashboard-charts { grid-template-columns: 1fr; }
  .metric-item:nth-child(2) { border-right: 0; }
  .metric-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .page-heading { align-items: stretch; flex-direction: column; }
  .catalog-tools { width: 100%; }
  .detail-layout { grid-template-columns: 1fr; }
  .operation-panel { position: static; margin-top: 24px; }
  .license-facts { grid-template-columns: repeat(2, 1fr); }
  .license-facts div:nth-child(2) { border-right: 0; }
  .license-facts div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .page-container { width: 92vw; padding-top: 30px; }
  h1 { font-size: 2.15rem; }
  .metric-item { min-height: 104px; padding: 18px; }
  .metric-item strong { font-size: 2rem; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .dashboard-metric { min-height: 108px; border-right: 0; border-bottom-width: 4px; }
  .dashboard-commercial { grid-template-columns: 1fr; }
  .dashboard-commercial-heading { grid-column: auto; }
  .dashboard-table-heading { align-items: stretch; flex-direction: column; }
  .chart-frame { height: 260px; }
  .table-shell { border: 0; background: transparent; overflow: visible; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { display: block; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
  td { display: grid; grid-template-columns: minmax(90px, 35%) 1fr; gap: 12px; padding: 8px 0; border: 0; overflow-wrap: anywhere; }
  td::before { content: attr(data-label); color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; }
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination-actions { justify-content: space-between; }
  .auth-panel { padding: 30px 24px; }
  .catalog-tools { align-items: stretch; flex-direction: column; }
  .catalog-tools > .button { width: 100%; }
  .edit-form { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .heading-actions { align-items: flex-start; }
  .activation-identifier { grid-template-columns: 1fr; align-items: stretch; }
  .activation-identifier .button { width: 100%; }
  .license-facts { grid-template-columns: 1fr; }
  .license-facts div, .license-facts div:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .license-facts div:last-child { border-bottom: 0; }
  .trace-list li { grid-template-columns: 1fr; gap: 5px; }
  .snapshot-grid { grid-template-columns: 1fr; }
}



.div.dt-container {
    padding-left: 10px !important;
    margin-right: 10px !important;
}

.table-shell {
    padding-left: 10px;
    padding-right: 10px;
}