/* Controle n8n — tema Zig (recuperado) */

:root {
  --zig-primary: #0050c3;
  --zig-cyan: #00f0fa;
  --zig-navy-dark: #00145f;
  --zig-navy-mid: #002d8c;
  --zig-teal: #008cb4;
  --zig-slate: #323e49;
  --zig-charcoal: #48596b;
  --zig-muted: #788ba0;
  --zig-bg-page: #f2f5f9;
  --zig-border-ui: #d6dde5;
  --accent-cyan-soft: rgba(0, 240, 250, 0.18);
  --bg: var(--zig-bg-page);
  --surface: #ffffff;
  --text: var(--zig-slate);
  --text-muted: var(--zig-muted);
  --border: var(--zig-border-ui);
  --accent: var(--zig-primary);
  --accent-soft: #e0f4ff;
  --success: var(--zig-teal);
  --success-bg: #d4f4f8;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 20, 95, 0.06), 0 4px 14px rgba(0, 20, 95, 0.05);
  --font: "Lato", Tahoma, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  color: var(--zig-navy-mid);
}

.app-header {
  color: #ffffff;
  padding: 2.35rem clamp(1.25rem, 4vw, 3rem) 2.85rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(ellipse 90% 70% at 100% -5%, rgba(0, 240, 250, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(0, 140, 180, 0.12) 0%, transparent 50%),
    linear-gradient(168deg, #001559 0%, #00256e 35%, #0a4fc4 88%, #0568c9 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.app-header::before {
  content: "";
  position: absolute;
  inset: -25% -15% auto auto;
  width: min(58vw, 440px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 0%, transparent 68%);
  pointer-events: none;
}

.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5rem;
  background: linear-gradient(to bottom, transparent, rgba(242, 245, 249, 0.22));
  pointer-events: none;
}

.app-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.app-header__brand {
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

.zig-wordmark {
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 2.65rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #ffffff;
  display: inline-flex;
  align-items: baseline;
}

.zig-w {
  display: inline-block;
}

.zig-w--i {
  position: relative;
  padding-right: 0.02em;
}

.zig-dot {
  position: absolute;
  left: 55%;
  top: 0.12em;
  transform: translateX(-50%);
  width: 0.34em;
  height: 0.34em;
  background: var(--zig-cyan);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.zig-tagline {
  margin: 0.55rem 0 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.88);
}

.app-header__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.55rem;
  color: rgba(155, 250, 255, 0.95);
  font-weight: 700;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #ffffff;
  text-wrap: balance;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.12);
}

.app-header__meta {
  font-size: 0.95rem;
  font-weight: 300;
  opacity: 0.95;
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.92);
}

.nav-tabs {
  max-width: 1280px;
  margin: -1.15rem auto 0;
  padding: 0.4rem 0.45rem 0;
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
  align-items: flex-end;
  border: 1px solid rgba(0, 45, 140, 0.08);
  border-bottom-color: var(--border);
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  box-shadow:
    0 -6px 28px rgba(0, 35, 100, 0.07),
    0 2px 8px rgba(0, 25, 80, 0.04);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-tabs button {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.9rem 1.2rem 0.85rem;
  border: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: #5a6b7c;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.nav-tabs button:hover {
  color: var(--zig-navy-mid);
  background: rgba(0, 80, 195, 0.04);
}

.nav-tabs button[aria-selected="true"] {
  color: var(--zig-primary);
  font-weight: 800;
  background: linear-gradient(180deg, rgba(0, 80, 195, 0.09) 0%, rgba(0, 80, 195, 0.02) 100%);
  border-bottom-color: var(--zig-cyan);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.nav-tabs button:focus-visible {
  outline: 2px solid var(--zig-cyan);
  outline-offset: 2px;
}

main.content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.75rem clamp(1.25rem, 4vw, 3rem) 3rem;
}

main.content.content--fluid {
  max-width: min(1920px, calc(100vw - 1.5rem));
  width: 100%;
  padding-left: clamp(0.75rem, 2vw, 2rem);
  padding-right: clamp(0.75rem, 2vw, 2rem);
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel--table {
  padding: 0;
  overflow: visible;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--zig-primary);
}

.vision-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}

.vision-list li {
  margin-bottom: 0.45rem;
}

.vision-list li:last-child {
  margin-bottom: 0;
}

.panel-subsection {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.panel-subtitle {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--zig-primary);
}

.panel-lead {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--zig-muted);
  line-height: 1.45;
  max-width: 52rem;
}

.panel-footnote {
  margin-top: 0.75rem;
  margin-bottom: 0;
  text-align: left;
}

.hidden {
  display: none !important;
}

/* —— Login —— */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(0, 240, 250, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 45% at 0% 100%, rgba(0, 80, 195, 0.08) 0%, transparent 50%),
    linear-gradient(165deg, #e8eef6 0%, var(--bg) 45%, #f0f4fa 100%);
}

.login-card {
  width: 100%;
  max-width: 34rem;
  background: var(--surface);
  border-radius: 18px;
  padding: 2.5rem 2.25rem 2.25rem;
  box-shadow:
    0 1px 3px rgba(0, 20, 95, 0.06),
    0 12px 40px rgba(0, 35, 100, 0.1);
  border: 1px solid var(--border);
}

.login-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.85rem;
  color: var(--zig-teal);
  font-weight: 700;
}

.login-wordmark {
  font-size: clamp(2.35rem, 5.5vw, 3.05rem);
}

.login-wordmark .zig-w {
  color: var(--zig-navy-dark);
}

.login-title {
  margin: 0.4rem 0 0.6rem;
  font-size: clamp(1.45rem, 3.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--zig-slate);
  line-height: 1.25;
}

.login-lead {
  margin: 0 0 1.6rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.login-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--zig-slate);
  margin-top: 0.55rem;
}

.login-label:first-of-type {
  margin-top: 0;
}

.login-input {
  font-family: var(--font);
  font-size: 1.02rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfd;
  color: var(--text);
  width: 100%;
}

.login-input:focus {
  outline: none;
  border-color: var(--zig-primary);
  box-shadow: 0 0 0 3px rgba(0, 80, 195, 0.15);
}

.login-error {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 600;
}

.login-submit {
  margin-top: 1.15rem;
  font-family: var(--font);
  font-size: 1.02rem;
  font-weight: 800;
  padding: 0.9rem 1.15rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  background: linear-gradient(168deg, var(--zig-navy-mid) 0%, var(--zig-primary) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 45, 140, 0.25);
}

.login-submit:hover {
  filter: brightness(1.05);
}

.login-submit:focus-visible {
  outline: 2px solid var(--zig-cyan);
  outline-offset: 2px;
}

.app-header__head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.app-header__session {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  flex-shrink: 0;
}

.app-header__session-email {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header__logout {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

.app-header__logout:hover {
  background: rgba(255, 255, 255, 0.18);
}

.app-header__logout:focus-visible {
  outline: 2px solid var(--zig-cyan);
  outline-offset: 2px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.kpi__value {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--zig-primary);
  line-height: 1.2;
}

.kpi__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

/** Destaque «Publicado» — mesma paleta do badge .pill--on (teal / cyan suave) */
.kpi--published {
  border: 1px solid rgba(0, 140, 180, 0.28);
  border-left: 4px solid var(--zig-teal);
  background: linear-gradient(145deg, var(--success-bg) 0%, var(--surface) 58%);
  box-shadow:
    0 1px 3px rgba(0, 120, 155, 0.08),
    0 4px 14px rgba(0, 100, 130, 0.05);
}

.kpi--published .kpi__value {
  color: var(--zig-teal);
}

.kpi--published .kpi__label {
  color: #0d677f;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.toolbar__left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

label.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

input[type="search"] {
  font-family: var(--font);
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 220px;
  font-size: 0.9rem;
}

input[type="search"]:focus {
  outline: 2px solid var(--accent-cyan-soft);
  border-color: var(--zig-primary);
}

select.filter {
  font-family: var(--font);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  background: var(--surface);
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  border-radius: 8px;
  border: 1px solid var(--border);
  max-width: 100%;
}

.table-wrap--fit {
  overflow-x: hidden;
  scrollbar-gutter: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}

table.data.data--controle {
  min-width: 0;
  table-layout: fixed;
}

table.data.data--controle th:nth-child(1),
table.data.data--controle td:nth-child(1) {
  width: 6%;
}

table.data.data--controle th:nth-child(2),
table.data.data--controle td:nth-child(2) {
  width: 10%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.data.data--controle th:nth-child(3),
table.data.data--controle td:nth-child(3) {
  width: 8%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.data.data--controle th:nth-child(4),
table.data.data--controle td:nth-child(4) {
  width: 10%;
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
}

table.data.data--controle th:nth-child(5),
table.data.data--controle td:nth-child(5),
table.data.data--controle th:nth-child(6),
table.data.data--controle td:nth-child(6) {
  width: 5%;
}

table.data.data--controle th:nth-child(7),
table.data.data--controle td:nth-child(7) {
  width: 4%;
  white-space: nowrap;
}

table.data.data--controle th:nth-child(8),
table.data.data--controle td:nth-child(8) {
  width: 32%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.data.data--controle th:nth-child(9),
table.data.data--controle td:nth-child(9) {
  width: 12%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.data.data--controle th:nth-child(10),
table.data.data--controle td:nth-child(10) {
  width: 4%;
  text-align: center;
}

table.data.data--controle code {
  font-size: 0.68rem;
}

table.data th,
table.data td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data th {
  background: var(--zig-bg-page);
  font-weight: 800;
  color: var(--zig-charcoal);
  white-space: nowrap;
}

table.data tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

table.data tbody tr:hover {
  background: rgba(0, 240, 250, 0.06);
}

table.data tbody tr:focus-visible {
  outline: 2px solid var(--zig-primary);
  outline-offset: -2px;
}

.th-sort {
  background: none;
  border: none;
  font: inherit;
  font-weight: 800;
  color: var(--zig-primary);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.th-sort:hover {
  color: var(--zig-navy-mid);
}

.th-sort:focus-visible {
  outline: 2px solid var(--zig-cyan);
  outline-offset: 2px;
}

.th-sort__icon {
  font-size: 0.75rem;
}

.td-pdf {
  text-align: center;
  vertical-align: middle;
}

.source-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
  background: rgba(0, 80, 195, 0.06);
  border: 1px solid rgba(0, 80, 195, 0.12);
  vertical-align: middle;
  white-space: nowrap;
}

.btn-pdf {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--zig-primary);
}

.btn-pdf:hover {
  border-color: var(--zig-cyan);
  color: var(--zig-teal);
}

.footer-code {
  font-size: 0.85em;
  background: var(--zig-bg-page);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill--on {
  background: var(--success-bg);
  color: var(--zig-teal);
}

.pill--off {
  background: var(--zig-bg-page);
  color: var(--zig-muted);
}

button.pill {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  border: none;
  line-height: inherit;
  cursor: pointer;
}

button.pill--published-trigger:focus-visible {
  outline: 2px solid var(--zig-cyan);
  outline-offset: 2px;
}

.crit {
  font-weight: 700;
  font-size: 0.78rem;
}

.crit--critico {
  color: var(--danger);
}
.crit--alto {
  color: #c2410c;
}
.crit--medio {
  color: var(--warning);
}
.crit--baixo {
  color: var(--zig-muted);
}

.md-body {
  font-size: 0.92rem;
  color: var(--text);
}

.md-body h2 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.75rem;
}

.md-body h2:first-child {
  margin-top: 0;
}

.md-body ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.md-body p {
  margin: 0.5rem 0;
}

.md-body code {
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 95, 0.45);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100%;
  background: var(--surface);
  z-index: 101;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.drawer__head h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.drawer__close {
  font-family: var(--font);
  border: none;
  background: #f1f5f9;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.drawer__close:hover {
  background: var(--border);
}

.drawer__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.drawer__section {
  margin-bottom: 1.25rem;
}

.drawer__section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.drawer__section p,
.drawer__section li {
  font-size: 0.88rem;
  margin: 0.35rem 0;
}

.node-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.node-list li {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.node-list li:last-child {
  border-bottom: none;
}

.node-list code {
  font-size: 0.68rem;
  color: var(--text-muted);
  word-break: break-all;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

table.data td.empty-state {
  text-align: left;
  padding: 1.25rem 1rem;
  color: var(--zig-charcoal);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: normal;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* —— Registos (API) —— */
.records-toolbar {
  margin-bottom: 1rem;
}

.records-toolbar__title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--zig-slate);
}

.records-toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.records-toolbar__search {
  flex: 1 1 12rem;
  min-width: 10rem;
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfd;
}

.records-toolbar__search:focus {
  outline: none;
  border-color: var(--zig-primary);
  box-shadow: 0 0 0 3px rgba(0, 80, 195, 0.12);
}

.records-toolbar__select {
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.records-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.records-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 52rem;
}

.records-form__row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.records-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--zig-slate);
}

.records-input,
.records-textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfd;
  color: var(--text);
  width: 100%;
}

.records-textarea {
  resize: vertical;
  min-height: 4rem;
}

.records-textarea--code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
}

.records-input:focus,
.records-textarea:focus {
  outline: none;
  border-color: var(--zig-primary);
  box-shadow: 0 0 0 3px rgba(0, 80, 195, 0.12);
}

.records-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.25rem;
}

.records-btn {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
}

.records-btn--primary {
  background: linear-gradient(168deg, var(--zig-navy-mid) 0%, var(--zig-primary) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 45, 140, 0.2);
}

.records-btn--primary:hover {
  filter: brightness(1.05);
}

.records-btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--zig-slate);
}

.records-btn--ghost:hover {
  background: #f8fafc;
}

.records-btn--danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
}

.records-btn--danger:hover {
  background: var(--danger-bg);
}

.records-btn--small {
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
}

.records-msg {
  font-size: 0.88rem;
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--zig-navy-mid);
}

.records-msg.records-msg--err {
  background: var(--danger-bg);
  color: var(--danger);
}

.data--records .th-actions {
  width: 9rem;
  text-align: right;
}

.data--records td.records-cell-preview {
  max-width: 22rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.records-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}
