:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0b1728;
  --panel: rgba(15, 29, 48, .92);
  --panel-strong: #11223a;
  --line: rgba(148, 173, 207, .16);
  --line-strong: rgba(107, 155, 218, .3);
  --text: #edf5ff;
  --muted: #91a4bc;
  --blue: #55a7ff;
  --green: #27da8d;
  --green-soft: #78e6b5;
  --amber: #ff9d3d;
  --amber-soft: #ffd27a;
  --red: #ff5d68;
  --red-soft: #ff8f98;
  --purple: #aa89ff;
  --cyan: #43d7e5;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(39, 218, 141, .09), transparent 28rem),
    radial-gradient(circle at 85% 12%, rgba(85, 167, 255, .10), transparent 35rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.auth-boot-view { display: none; }
html.auth-restoring,
html.auth-restoring body { background: #07111f; }
html.auth-restoring #loginView,
html.auth-restoring #appView { display: none !important; }
html.auth-restoring .auth-boot-view {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: var(--text);
  background: #07111f;
}
.auth-boot-view strong { font-size: 18px; letter-spacing: .08em; }
.auth-boot-view small { color: var(--muted); font-size: 11px; }
.auth-boot-spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 5px;
  border: 3px solid rgba(85, 167, 255, .18);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: cvdbAuthBootSpin .75s linear infinite;
}
@keyframes cvdbAuthBootSpin { to { transform: rotate(360deg); } }
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.1; }
h2 { margin-bottom: 0; font-size: 22px; }
h3 { margin-bottom: 0; font-size: 17px; }


.form-error { min-height: 20px; margin: 14px 0 0; color: var(--red); font-size: 12px; }
.password-input-wrap { position: relative; display: block; }
.password-input-wrap input { width: 100%; padding-right: 48px; }
.password-toggle {
  position: absolute; top: 50%; right: 8px; display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0; color: var(--muted);
  border: 0; border-radius: 9px; background: transparent; cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { color: var(--text); background: rgba(85,167,255,.12); }
.password-toggle svg { width: 19px; height: 19px; fill: currentColor; }
.password-toggle[aria-pressed="true"] { color: var(--green-soft); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 42px; padding: 0 17px; border: 1px solid transparent;
  border-radius: 12px; cursor: pointer; font-weight: 800; font-size: 12px;
  transition: transform .2s, border-color .2s, background .2s, opacity .2s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { color: #041522; background: linear-gradient(135deg, #43d7e5, #27da8d); }
.button.secondary { color: var(--text); border-color: var(--line-strong); background: rgba(85,167,255,.09); }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.button.wide { width: 100%; }
.icon-button {
  width: 42px; height: 42px; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; background: var(--panel);
}

.app-shell { display: grid; grid-template-columns: 22px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 10;
  display: flex; flex-direction: column; width: 22px; padding: 26px 0;
  overflow: hidden;
  border-right: 1px solid rgba(85, 167, 255, .30);
  background: linear-gradient(180deg, rgba(8, 23, 40, .98), rgba(4, 13, 25, .98));
  box-shadow: inset -1px 0 0 rgba(85, 167, 255, .09), 4px 0 16px rgba(8, 74, 126, .13);
  backdrop-filter: blur(18px);
  transition: width .24s ease, padding .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 12% 0 12% auto;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(85,167,255,.50), transparent);
  opacity: .58;
  pointer-events: none;
}
.sidebar:hover {
  width: 230px;
  padding: 26px 12px;
  border-right-color: rgba(85, 167, 255, .38);
  box-shadow: 18px 0 45px rgba(0,0,0,.24), 4px 0 22px rgba(31, 122, 188, .15);
}
.sidebar:hover::after { opacity: .18; }
.sidebar-peek {
  position: absolute;
  top: 50%; right: 0;
  display: grid; place-items: center;
  width: 18px; height: 42px;
  color: #78bdff;
  border: 1px solid rgba(85,167,255,.18);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  background: linear-gradient(180deg, rgba(31, 91, 143, .34), rgba(14, 51, 87, .24));
  box-shadow: 0 0 14px rgba(85,167,255,.16), inset 0 0 10px rgba(85,167,255,.06);
  font-size: 18px;
  opacity: .96;
  transform: translateY(-50%);
  transition: opacity .15s, background .18s, box-shadow .18s, color .18s;
}
.sidebar:not(:hover) .sidebar-peek:hover {
  color: #b7dcff;
  background: linear-gradient(180deg, rgba(48, 122, 185, .45), rgba(21, 69, 112, .34));
  box-shadow: 0 0 18px rgba(85,167,255,.28), inset 0 0 12px rgba(85,167,255,.09);
}
.sidebar:hover .sidebar-peek { opacity: 0; }
.sidebar-brand, .sidebar nav, .sidebar-footer { opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.sidebar:hover .sidebar-brand, .sidebar:hover nav, .sidebar:hover .sidebar-footer { opacity: 1; pointer-events: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 7px; width: 200px; margin: 0 4px 38px; }
.sidebar-brand > div:last-child { opacity: 0; transform: translateX(-6px); transition: opacity .18s, transform .18s; }
.sidebar:hover .sidebar-brand > div:last-child { opacity: 1; transform: translateX(0); }
.sidebar-brand strong { display: block; font-size: 19px; letter-spacing: .08em; }
.sidebar-brand small { color: var(--green); font-size: 9px; letter-spacing: .24em; }
.sidebar nav { display: grid; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 206px; padding: 12px 12px;
  color: var(--muted); border: 0; border-radius: 11px; background: transparent;
  cursor: pointer; text-align: left; font-weight: 700;
}
.nav-icon { display: grid; place-items: center; flex: 0 0 24px; width: 24px; color: var(--blue); font-size: 17px; }
.nav-label { opacity: 0; white-space: nowrap; transform: translateX(-5px); transition: opacity .18s, transform .18s; }
.sidebar:hover .nav-label { opacity: 1; transform: translateX(0); }
.nav-item:hover, .nav-item.active { color: var(--text); background: rgba(85,167,255,.11); }
.sidebar-footer {
  display: flex; align-items: center; gap: 10px; width: 206px; margin-top: 0; padding: 14px;
  border: 1px solid var(--line); border-radius: 13px; background: rgba(17,34,58,.7);
}
.sidebar-status-copy { opacity: 0; white-space: nowrap; transition: opacity .18s; }
.sidebar:hover .sidebar-status-copy { opacity: 1; }
.sidebar-footer strong, .sidebar-footer small { display: block; font-size: 10px; }
.sidebar-footer small { margin-top: 4px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.content { position: relative; grid-column: 2; width: 100%; max-width: 1650px; padding: 30px clamp(20px, 3vw, 52px) 40px; }
.topbar, .section-heading, .panel-heading, .dialog-heading, .dialog-actions, .table-footer, .table-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-badge { padding: 7px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(15,29,48,.7); font-size: 10px; font-weight: 800; white-space: nowrap; }
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 36, 59, .93), rgba(11, 24, 41, .93));
  box-shadow: 0 15px 44px rgba(0,0,0,.12);
}
.filters {
  display: grid; grid-template-columns: 160px minmax(220px, 1fr) minmax(180px, .7fr) minmax(180px, .6fr) auto;
  gap: 12px; align-items: end; margin: 28px 0 38px; padding: 16px;
}
.filters select { height: 42px; }
.section-block { scroll-margin-top: 28px; margin-bottom: 42px; }
.section-heading { margin-bottom: 18px; }
.period-chip, .live-badge {
  padding: 7px 11px; color: var(--blue); border: 1px solid rgba(85,167,255,.25);
  border-radius: 999px; background: rgba(85,167,255,.08); font-size: 11px; font-weight: 800;
}
.live-badge { color: var(--green); border-color: rgba(39,218,141,.25); background: rgba(39,218,141,.08); }
.kpi-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 14px; }
.kpi-card {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 132px; padding: 21px;
  overflow: hidden; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 36, 59, .96), rgba(11, 24, 41, .96));
}
.kpi-card.featured { border-color: rgba(85,167,255,.34); background: linear-gradient(145deg, rgba(23,56,87,.92), rgba(11,28,48,.95)); }
.kpi-card span, .kpi-card small { display: block; color: var(--muted); }
.kpi-card strong { display: block; margin: 7px 0 3px; font-size: 31px; line-height: 1; letter-spacing: -.03em; }
.kpi-card small { font-size: 11px; }
.kpi-icon {
  display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px;
  border-radius: 13px; font-size: 18px; font-weight: 900;
}
.kpi-icon.blue { color: var(--blue); background: rgba(85,167,255,.12); }
.kpi-icon.green { color: var(--green); background: rgba(39,218,141,.12); }
.kpi-icon.amber { color: var(--amber); background: rgba(255,157,61,.12); }
.kpi-icon.red { color: var(--red); background: rgba(255,93,104,.12); }
.dashboard-grid { display: grid; gap: 14px; margin-top: 14px; }
.primary-grid { grid-template-columns: 1.25fr .75fr; }
.secondary-grid { grid-template-columns: 1.3fr .7fr; }
.split-grid { grid-template-columns: 1.35fr .65fr; }
.dashboard-grid > .panel { min-height: 330px; padding: 22px; }
.donut-layout { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 36px; padding: 26px 8px 8px; }
.donut, .progress-ring {
  display: grid; place-items: center; width: 196px; height: 196px; border-radius: 50%;
  position: relative;
}
.progress-ring {
  background: conic-gradient(var(--blue) 0 58%, rgba(85,167,255,.12) 58% 100%);
}
.progress-ring::after {
  content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #10213a;
  box-shadow: inset 0 0 30px rgba(0,0,0,.25);
}
.donut-svg { width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: rgba(85,167,255,.09); stroke-width: 36; }
.donut-segment {
  fill: none; stroke-width: 36; cursor: pointer; outline: none;
  transform-origin: 100px 100px;
  transition: stroke-width .18s ease, opacity .18s ease, filter .18s ease, transform .18s ease;
}
.donut-segment.green { color: var(--green); stroke: var(--green); }
.donut-segment.amber { color: var(--amber); stroke: var(--amber); }
.donut-segment.red { color: var(--red); stroke: var(--red); }
.donut-segment.is-active, .donut-segment:focus-visible {
  stroke-width: 44; filter: drop-shadow(0 0 8px currentColor); transform: scale(1.018);
}
.donut-segment.is-muted { opacity: .28; }
.donut-center {
  position: absolute; z-index: 2; width: 116px; text-align: center; pointer-events: none;
}
.donut-center strong { display: block; font-size: 32px; line-height: 1.08; }
.donut-center span {
  display: block; margin-top: 6px; color: var(--muted); font-size: 11px;
  white-space: normal; line-height: 1.25;
}
.progress-ring strong { position: relative; z-index: 1; text-align: center; }
.legend { display: grid; gap: 16px; }
.legend > div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend i.green { background: var(--green); }
.legend i.amber { background: var(--amber); }
.legend i.red { background: var(--red); }
.legend span { color: var(--muted); }
.client-progress { display: flex; align-items: center; gap: 22px; padding: 27px 4px; }
.progress-ring { width: 112px; height: 112px; }
.progress-ring strong { font-size: 20px; }
.client-progress > div:last-child strong { display: block; font-size: 32px; }
.client-progress > div:last-child span { color: var(--muted); font-size: 12px; }
.mini-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-kpis div { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5,16,29,.35); }
.mini-kpis span, .mini-kpis strong { display: block; }
.mini-kpis span { min-height: 29px; color: var(--muted); font-size: 10px; }
.mini-kpis strong { margin-top: 5px; font-size: 20px; }
.aging-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.aging-card { min-height: 126px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.aging-card i { display: block; width: 34px; height: 4px; margin-bottom: 18px; border-radius: 999px; background: var(--blue); }
.aging-card.danger i { background: var(--red); }
.aging-card.warning i { background: var(--amber); }
.aging-card span { display: block; min-height: 31px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.aging-card strong { display: block; margin-top: 8px; font-size: 25px; }
.bar-list { display: grid; gap: 13px; margin-top: 24px; }
.bar-row { display: grid; grid-template-columns: minmax(140px, 42%) 1fr 54px; align-items: center; gap: 12px; }
.bar-row span { overflow: hidden; color: #c8d4e2; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(148,173,207,.1); }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #27da8d, #43d7e5); }
.bar-row strong { text-align: right; font-size: 11px; }
.family-bars .bar-fill { background: linear-gradient(90deg, #55a7ff, #aa89ff); }
.compact .bar-row { grid-template-columns: 80px 1fr 54px; }
.trend-chart { position: relative; height: 245px; margin-top: 22px; }
.trend-chart svg { width: 100%; height: 100%; overflow: visible; }
.trend-chart .grid-line { stroke: rgba(148,173,207,.11); stroke-width: 1; }
.trend-chart .area { fill: url(#trendGradientBlue); }
.trend-chart .line { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-chart circle { fill: #0e2138; stroke: var(--green); stroke-width: 3; cursor: pointer; transition: r .15s ease, fill .15s ease; }
.trend-chart circle:hover, .trend-chart circle:focus { r: 7px; fill: var(--blue); outline: none; }
.trend-chart text { fill: var(--muted); font-size: 10px; }
.table-heading { align-items: end; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(380px, 100%); padding-left: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.search-box input { height: 42px; padding-left: 0; border: 0; background: transparent; box-shadow: none; }
.table-panel { overflow: hidden; }
.table-meta { padding: 16px 20px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 11px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: rgba(5,16,29,.38); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { max-width: 300px; overflow: hidden; color: #c8d4e2; font-size: 11px; text-overflow: ellipsis; }
.status-badge { display: inline-flex; padding: 6px 8px; border-radius: 8px; font-size: 9px; font-weight: 900; }
.status-badge.found { color: var(--green); background: rgba(39,218,141,.1); }
.status-badge.segregated { color: var(--amber); background: rgba(255,157,61,.1); }
.status-badge.not-found { color: var(--red); background: rgba(255,93,104,.1); }
.delete-row { color: var(--red); border: 0; cursor: pointer; background: none; }
.table-footer { padding: 14px 18px; }
footer { display: flex; justify-content: space-between; color: #60758f; font-size: 10px; }

.section-description { margin: -8px 0 18px; color: var(--muted); font-size: 12px; }
.monitoring-heading { align-items: flex-end; }
.monitor-actions { display: flex; align-items: center; gap: 10px; }
.health-chip { padding: 7px 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(148,173,207,.07); font-size: 11px; font-weight: 800; }
.health-chip.healthy { color: var(--green); border-color: rgba(39,218,141,.28); background: rgba(39,218,141,.08); }
.health-chip.attention { color: var(--amber); border-color: rgba(255,157,61,.3); background: rgba(255,157,61,.08); }
.monitor-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.monitor-kpi { min-height: 150px; padding: 20px; }
.monitor-kpi > span, .monitor-kpi > small { display: block; color: var(--muted); }
.monitor-kpi > strong { display: block; margin: 10px 0 16px; font-size: 30px; letter-spacing: -.03em; }
.usage-track { height: 10px; overflow: hidden; margin-bottom: 12px; border-radius: 999px; background: rgba(148,173,207,.1); }
.usage-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .35s ease, background .2s; }
.usage-track i.warning { background: var(--amber); }
.usage-track i.danger { background: var(--red); }
.monitor-alerts { display: grid; gap: 8px; margin-top: 14px; }
.monitor-alert { padding: 11px 14px; border: 1px solid rgba(255,157,61,.28); border-radius: 12px; color: #ffd5ad; background: rgba(255,157,61,.08); }
.monitor-alert.critical { color: #ffd0d4; border-color: rgba(255,93,104,.32); background: rgba(255,93,104,.08); }
.monitor-grid { grid-template-columns: repeat(3, 1fr); }
.monitor-panel, .services-panel { padding: 22px; }
.detail-list { display: grid; gap: 0; margin: 18px 0 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; max-width: 58%; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.services-panel { margin-top: 14px; }
.services-panel .panel-heading > small { color: var(--muted); }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 18px; }
.service-item { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5,16,29,.34); }
.service-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.service-dot.online { background: var(--green); box-shadow: 0 0 12px rgba(39,218,141,.55); }
.service-item strong, .service-item small { display: block; }
.service-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.service-item b { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.dialog-copy { margin: 14px 0 0; color: var(--muted); line-height: 1.6; }
.password-fields { display: grid; gap: 15px; margin-top: 22px; }
.security-warning { color: #ffd5ad; border-color: rgba(255,157,61,.34); background: rgba(255,157,61,.09); }
.password-rules { margin-top: 14px; padding: 11px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: rgba(5,16,29,.35); font-size: 11px; }

dialog { width: min(650px, calc(100% - 28px)); padding: 0; color: var(--text); border: 1px solid var(--line-strong); border-radius: 22px; background: #0d1d31; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(1, 8, 16, .76); backdrop-filter: blur(6px); }
.dialog-card { padding: 26px; }
.dialog-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: transparent; font-size: 20px; }
.dropzone { display: grid; place-items: center; min-height: 180px; margin: 22px 0 17px; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 16px; background: rgba(5,16,29,.45); text-align: center; }
.dropzone > span { color: var(--blue); font-size: 28px; }
.dropzone small { color: var(--muted); }
.dropzone input { height: auto; margin-top: 14px; padding: 10px; }
.notice { margin-top: 16px; padding: 12px; color: #aec1d6; border: 1px solid rgba(85,167,255,.18); border-radius: 11px; background: rgba(85,167,255,.07); font-size: 11px; }
.dialog-actions { margin-top: 22px; }
.progress-message { margin-top: 14px; color: var(--green); font-size: 12px; }
.wide-dialog { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 22px; }
.form-grid .span-2 { grid-column: span 2; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 380px; padding: 14px 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: #11243b; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { color: #ffd4d8; border-color: rgba(255,93,104,.38); }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .aging-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters .button { align-self: end; }
  .split-grid { grid-template-columns: 1fr; }
  .monitor-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .monitor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-shell { padding: 24px; }
  .login-visual { display: none; }
  .mobile-brand { display: flex; }
  .sidebar, .sidebar:hover { position: fixed; inset: auto 0 0 0; width: auto; height: 64px; padding: 8px 12px; overflow: visible; border: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: none; transition: none; }
  .sidebar-peek { display: none; }
  .sidebar-brand, .sidebar-footer { display: none; }
  .sidebar nav { display: flex; width: 100%; opacity: 1; pointer-events: auto; }
  .nav-item { flex: 1 1 0; justify-content: center; width: auto; padding: 10px; }
  .nav-label { display: none; }
  .nav-icon { font-size: 20px; }
  .user-badge { display: none; }
  .content { grid-column: 1; padding-bottom: 90px; }
  .primary-grid, .secondary-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .content { padding: 20px 14px 86px; }
  .topbar { align-items: flex-start; }
  .top-actions .button.secondary { display: none; }
  .monitoring-heading { align-items: stretch; flex-direction: column; }
  .monitor-actions { justify-content: space-between; }
  .monitor-kpi-grid { grid-template-columns: 1fr 1fr; }
  .top-actions .button.primary { width: 42px; padding: 0; overflow: hidden; font-size: 0; }
  .top-actions .button.primary::before { content: "+"; font-size: 20px; }
  .filters { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 112px; padding: 16px; }
  .kpi-card.featured { grid-column: span 2; }
  .kpi-card strong { font-size: 25px; }
  .donut-layout { grid-template-columns: 1fr; justify-items: center; gap: 22px; }
  .legend { width: 100%; }
  .mini-kpis { grid-template-columns: repeat(2, 1fr); }
  .aging-grid { grid-template-columns: repeat(2, 1fr); }
  .table-heading { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .login-card { padding: 28px; }
  footer { flex-direction: column; gap: 6px; }
}
@media (max-width: 460px) {
  .monitor-kpi-grid { grid-template-columns: 1fr; }
  .monitor-actions { align-items: stretch; flex-direction: column; }
}


.page-view.hidden { display: none; }
.system-pendencies-page { margin-top: 28px; }
.system-pendency-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(7, 18, 32, .55);
}
.system-pendency-tab {
  min-height: 40px;
  padding: 0 16px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.system-pendency-tab:hover,
.system-pendency-tab:focus-visible {
  color: var(--text);
  border-color: rgba(85, 167, 255, .28);
  outline: none;
}
.system-pendency-tab.active {
  color: var(--text);
  border-color: rgba(85, 167, 255, .46);
  background: rgba(85, 167, 255, .14);
  box-shadow: inset 0 0 18px rgba(85, 167, 255, .05);
}
.system-pendency-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 20px;
  margin-left: 7px;
  padding: 0 6px;
  color: var(--text);
  border: 1px solid rgba(85, 167, 255, .24);
  border-radius: 999px;
  background: rgba(5, 16, 29, .52);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.system-pendencies-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
  align-items: stretch;
  gap: 18px;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 36, 59, .93), rgba(11, 24, 41, .93));
  box-shadow: 0 15px 44px rgba(0,0,0,.12);
}
.system-pendencies-hero h2 { font-size: clamp(22px, 3vw, 30px); }
.system-pendencies-hero .section-description {
  max-width: 760px;
  margin: 10px 0 0;
  line-height: 1.55;
}
.system-pendencies-total {
  display: grid;
  align-content: center;
  min-height: 120px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 93, 104, .30);
  border-radius: 15px;
  background: rgba(255, 93, 104, .07);
}
.system-pendencies-total span,
.system-pendencies-total small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.system-pendencies-total strong {
  margin: 7px 0 5px;
  color: var(--red-soft);
  font-size: 42px;
  line-height: 1;
}
.remaining-audits-hero { border-color: rgba(85, 167, 255, .25); }
.remaining-audits-total {
  border-color: rgba(85, 167, 255, .34);
  background: rgba(85, 167, 255, .07);
}
.remaining-audits-total strong { color: var(--blue); }
.auditable-management-hero { border-color: rgba(48, 213, 159, .28); }
.auditable-management-total {
  border-color: rgba(48, 213, 159, .34);
  background: rgba(48, 213, 159, .07);
}
.auditable-management-total strong { color: var(--green); }
.auditable-period-commandbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
}
.auditable-period-selectors,
.auditable-period-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}
.auditable-period-selectors label,
.auditable-client-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.auditable-period-selectors select { min-width: 120px; }
.auditable-roster-status {
  align-self: center;
  max-width: 360px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.auditable-client-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(190px, 1fr) minmax(190px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
}
.auditable-client-form input,
.auditable-period-selectors select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: rgba(5, 16, 29, .62);
}
.auditable-client-form input:focus,
.auditable-period-selectors select:focus {
  border-color: rgba(85, 167, 255, .58);
  box-shadow: 0 0 0 3px rgba(85, 167, 255, .09);
}
.auditable-management-table table { min-width: 1250px; }
.auditable-remove-button {
  color: var(--red-soft);
  border-color: rgba(255, 93, 104, .30);
}
.system-pendencies-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.system-pendencies-search { width: min(560px, 100%); }
.system-pendencies-table table { min-width: 1180px; }
.remaining-audits-table table { min-width: 2100px; }
.system-pendencies-table td:first-child strong { color: var(--text); }
.system-pendency-qty {
  min-width: 86px;
  color: var(--red-soft);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.system-pendency-company,
.system-pendency-notes {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: rgba(5, 16, 29, .44);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.system-pendency-company {
  min-width: 180px;
  height: 36px;
  padding: 0 10px;
}
.system-pendency-notes {
  min-width: 260px;
  min-height: 58px;
  padding: 9px 10px;
  line-height: 1.4;
  resize: vertical;
}
.system-pendency-company:focus,
.system-pendency-notes:focus {
  border-color: rgba(85,167,255,.58);
  background: rgba(7, 22, 39, .78);
  box-shadow: 0 0 0 3px rgba(85,167,255,.09);
}
.system-pendency-updated span,
.system-pendency-updated small {
  display: block;
  white-space: nowrap;
}
.system-pendency-updated small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.system-pendency-save {
  min-height: 36px;
  padding: 0 13px;
}
.remaining-client-company,
.remaining-client-notes {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: rgba(5, 16, 29, .44);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.remaining-client-company {
  min-width: 190px;
  height: 36px;
  padding: 0 10px;
}
.remaining-client-notes {
  min-width: 270px;
  min-height: 58px;
  padding: 9px 10px;
  line-height: 1.4;
  resize: vertical;
}
.remaining-client-company:focus,
.remaining-client-notes:focus {
  border-color: rgba(85, 167, 255, .58);
  background: rgba(7, 22, 39, .78);
  box-shadow: 0 0 0 3px rgba(85, 167, 255, .09);
}
.remaining-audit-detail span,
.remaining-audit-detail small {
  display: block;
  white-space: nowrap;
}
.remaining-audit-detail small {
  max-width: 240px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
}
.sidebar-main-nav { display: grid; gap: 6px; }
.mobile-account, .mobile-logout { display: none; }
.sidebar-admin {
  margin-top: 0;
  margin-bottom: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.sidebar:hover .sidebar-admin {
  opacity: 1;
  pointer-events: auto;
}
.nav-section-label {
  display: block;
  margin: 0 12px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.sidebar-admin nav { display: grid; gap: 6px; }
.nav-item-danger { color: #c6d2df; }
.nav-item-danger .nav-icon { color: var(--amber); }
.nav-item-danger:hover, .nav-item-danger:focus-visible {
  color: var(--text);
  background: rgba(255, 157, 61, .10);
}
.sidebar-brand.text-only { gap: 0; }
.profile-grid { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); }
.profile-form-panel, .profile-list-panel, .password-page-panel { padding: 22px; }
.admin-form { margin-top: 0; }
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5,16,29,.28);
}
.checkbox-field input { width: auto; height: auto; margin: 0; }
.compact-table table { min-width: 760px; }
.small-button { padding: 8px 12px; min-height: 34px; }
.password-page-form { max-width: 620px; }
.password-page-panel { max-width: 760px; }
.account-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(85, 167, 255, .28);
  border-radius: 14px;
  background: rgba(85, 167, 255, .06);
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: var(--green);
  border: 1px solid rgba(39, 218, 141, .34);
  border-radius: 50%;
  background: rgba(39, 218, 141, .09);
}
.account-identity div { display: grid; gap: 2px; }
.account-identity small {
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}
.account-identity strong { font-size: 17px; }
.account-identity div span { color: var(--muted); font-size: 12px; }
.account-password-heading { margin: 0 0 16px; }
.account-password-heading h3 { margin: 0 0 5px; }
.section-description { margin: -6px 0 20px; color: var(--muted); }
.monitor-actions { display: flex; align-items: center; gap: 12px; }

@media (max-width: 1180px) {
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar-admin { display: none !important; }
  .sidebar-lower { display: none !important; }
  .mobile-account { display: flex; }
  .mobile-logout { display: flex; }
}
@media (max-width: 700px) {
  .system-pendencies-page { margin-top: 20px; }
  .system-pendency-tabs { width: 100%; }
  .system-pendency-tab { flex: 1; padding: 0 10px; }
  .system-pendencies-hero { grid-template-columns: 1fr; padding: 18px; }
  .system-pendencies-total { min-height: 104px; }
  .system-pendencies-toolbar { align-items: stretch; flex-direction: column; }
  .system-pendencies-search,
  .system-pendencies-toolbar .button { width: 100%; }
}

.trend-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 112px;
  padding: 9px 11px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(7, 18, 32, .97);
  box-shadow: 0 10px 28px rgba(0,0,0,.34);
  pointer-events: none;
  transform: translate(-50%, -100%);
}
.trend-tooltip strong, .trend-tooltip span { display: block; }
.trend-tooltip strong { color: var(--blue); font-size: 11px; }
.trend-tooltip span { margin-top: 3px; color: #c8d4e2; font-size: 11px; }
.monitor-read-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  color: #ffd0d4;
  border: 1px solid rgba(255,93,104,.34);
  border-radius: 12px;
  background: rgba(255,93,104,.08);
  font-size: 11px;
  line-height: 1.5;
}
.presence-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 900;
}
.presence-badge i { width: 7px; height: 7px; border-radius: 50%; }
.presence-badge.online { color: var(--green); background: rgba(39,218,141,.10); }
.presence-badge.online i { background: var(--green); box-shadow: 0 0 10px rgba(39,218,141,.7); }
.presence-badge.offline { color: var(--muted); background: rgba(148,173,207,.08); }
.presence-badge.offline i { background: var(--muted); }

.sidebar-lower {
  display: flex;
  flex-direction: column;
  width: 206px;
  margin-top: auto;
}
.sidebar:hover .sidebar-lower {
  pointer-events: auto;
}

.sidebar-bottom-actions {
  margin-top: 0;
  margin-bottom: 10px;
  display: grid;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.sidebar:hover .sidebar-bottom-actions {
  opacity: 1;
  pointer-events: auto;
}


.records-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 18px;
}
.records-search {
  flex: 1 1 420px;
  width: auto;
  max-width: 560px;
  background: linear-gradient(145deg, rgba(18,36,59,.90), rgba(10,24,41,.90));
}
.records-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}
.records-page-actions .button {
  min-height: 44px;
  min-width: 154px;
}
.records-page-actions .action-green { min-width: 172px; }
.records-only-panel { margin-bottom: 42px; }
.records-only-panel table { min-width: 840px; }
.records-only-panel th:first-child,
.records-only-panel td:first-child { width: 32%; }
.records-only-panel th:nth-child(2),
.records-only-panel td:nth-child(2) { width: 18%; }
.records-only-panel th:nth-child(3),
.records-only-panel td:nth-child(3) { width: 18%; }
.button.action-soft-blue {
  color: #dbe9ff;
  border-color: rgba(111,176,255,.34);
  background: linear-gradient(180deg, rgba(96,169,255,.22), rgba(46,105,191,.18));
}
.button.action-soft-blue:hover,
.button.action-soft-blue:focus-visible {
  border-color: rgba(132,192,255,.42);
  background: linear-gradient(180deg, rgba(112,181,255,.30), rgba(52,115,204,.24));
}

@media (max-width: 760px) {
  .records-commandbar { align-items: stretch; flex-direction: column; }
  .records-search { flex-basis: auto; max-width: none; }
  .records-page-actions { width: 100%; margin-left: 0; }
  .records-page-actions .button { flex: 1 1 0; min-width: 0; }
}

@media (max-width: 900px) {
  .auditable-period-commandbar,
  .auditable-period-actions { align-items: stretch; flex-direction: column; }
  .auditable-period-selectors { width: 100%; }
  .auditable-period-selectors label { flex: 1; }
  .auditable-client-form { grid-template-columns: 1fr; }
}


.date-picker-field { position: relative; }
.date-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 46px;
  padding: 0 13px 0 14px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(5, 16, 29, .8);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.date-picker-button:hover { background: rgba(9, 24, 42, .92); }
.date-picker-field.open .date-picker-button,
.date-picker-button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(85,167,255,.12);
  outline: none;
}
.date-picker-icon { color: var(--blue); font-size: 15px; }
.date-calendar {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 38;
  width: 300px;
  padding: 14px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(12, 22, 37, .99);
  box-shadow: 0 20px 52px rgba(0, 0, 0, .46);
}
.date-calendar-header {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.date-calendar-header strong {
  text-align: center;
  font-size: 13px;
  text-transform: capitalize;
}
.date-nav-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--text);
  border: 1px solid rgba(107,155,218,.22);
  border-radius: 10px;
  background: rgba(85,167,255,.07);
  cursor: pointer;
  font-size: 20px;
}
.date-nav-button:hover,
.date-nav-button:focus-visible {
  border-color: rgba(85,167,255,.42);
  background: rgba(85,167,255,.15);
  outline: none;
}
.date-weekdays,
.date-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.date-weekdays { margin-bottom: 5px; }
.date-weekdays span {
  display: grid;
  place-items: center;
  height: 26px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.date-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  color: #dce7f3;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  transition: background .16s, border-color .16s, color .16s;
}
.date-day:hover,
.date-day:focus-visible {
  color: #fff;
  border-color: rgba(85,167,255,.26);
  background: rgba(85,167,255,.15);
  outline: none;
}
.date-day.outside { color: #60758f; }
.date-day.today { border-color: rgba(39,218,141,.36); color: var(--green); }
.date-day.selected {
  color: #f6fbff;
  border-color: rgba(85,167,255,.7);
  background: linear-gradient(145deg, rgba(85,167,255,.38), rgba(56,126,218,.28));
  box-shadow: inset 0 0 0 1px rgba(151,205,255,.13);
}
.date-calendar-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.date-calendar-footer button {
  padding: 7px 9px;
  color: var(--blue);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.date-calendar-footer button:hover,
.date-calendar-footer button:focus-visible {
  background: rgba(85,167,255,.11);
  outline: none;
}
@media (max-width: 650px) {
  .date-calendar { left: 0; right: auto; width: min(300px, calc(100vw - 56px)); }
}

.master-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.master-summary-card {
  min-height: 116px;
  padding: 20px;
}
.master-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.master-summary-card strong {
  display: block;
  margin-top: 14px;
  font-size: 30px;
}
.master-summary-card.warning strong { color: var(--amber); }
.master-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 20, 34, .72);
}
.master-tab {
  min-height: 38px;
  padding: 0 15px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}
.master-tab:hover,
.master-tab:focus-visible,
.master-tab.active {
  color: var(--text);
  border-color: rgba(85,167,255,.25);
  background: rgba(85,167,255,.12);
  outline: none;
}
.master-data-grid { grid-template-columns: minmax(350px, 430px) minmax(0, 1fr); }
.master-correction-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.master-correction-grid .span-all { grid-column: 1 / -1; }
.master-form-panel,
.master-list-panel { padding: 22px; }
.master-search { width: 100%; margin: 16px 0; }
.master-list-panel .compact-table { max-height: 520px; overflow: auto; }
.master-list-panel .dialog-actions { align-items: center; gap: 12px; }
.master-list-panel .dialog-actions input { min-width: 240px; }
.master-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.master-row-actions .button { white-space: nowrap; }
input[readonly] {
  color: #b8c7d9;
  background: rgba(5,16,29,.5);
  cursor: default;
}

@media (max-width: 1180px) {
  .master-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .master-data-grid,
  .master-correction-grid { grid-template-columns: 1fr; }
  .master-correction-grid .span-all { grid-column: auto; }
}
@media (max-width: 650px) {
  .master-summary-grid { grid-template-columns: 1fr 1fr; }
  .master-tabs { display: grid; grid-template-columns: 1fr; }
  .master-list-panel .dialog-actions { align-items: stretch; flex-direction: column; }
  .master-list-panel .dialog-actions input { min-width: 0; width: 100%; }
}

/* Agenda operacional 1.4.0 — calendário, filas, filtros e ações rápidas */
.agenda-top-action {
  position: absolute;
  top: 44px;
  right: clamp(20px, 3vw, 52px);
  z-index: 3;
  min-width: 190px;
  min-height: 46px;
}

.agenda-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.agenda-summary-card {
  min-height: 116px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  border-left: 3px solid rgba(106, 172, 255, .55);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.agenda-summary-card:hover { transform: translateY(-2px); background: rgba(19, 48, 79, .68); }
.agenda-summary-card.active { box-shadow: inset 0 0 0 1px rgba(85, 167, 255, .48), 0 8px 24px rgba(0, 0, 0, .12); }
.agenda-summary-card span { color: var(--muted); font-size: .82rem; }
.agenda-summary-card strong { font-size: 2rem; color: var(--text); line-height: 1; }
.agenda-summary-card small { color: #6f88a4; font-size: .67rem; line-height: 1.25; }
.agenda-summary-card.blue { border-left-color: #55a7ff; }
.agenda-summary-card.green { border-left-color: #2bdc96; }
.agenda-summary-card.warning { border-left-color: #ffab4c; }
.agenda-summary-card.muted { border-left-color: #8495ad; }

.agenda-filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(180px, .8fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 16px;
}
.agenda-filter-panel label { min-width: 0; margin: 0; }
.agenda-filter-panel select,
.agenda-filter-panel input { width: 100%; }
.agenda-filter-search .search-box { margin-top: 7px; }
.agenda-filter-actions { display: flex; gap: 8px; align-items: center; }

.agenda-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(310px, .72fr);
  gap: 16px;
  align-items: stretch;
}
.agenda-user-basic .agenda-main-grid {
  grid-template-columns: minmax(0, 1fr);
}
.agenda-calendar-panel,
.agenda-upcoming-panel,
.agenda-unscheduled-panel { padding: 20px; min-width: 0; }
.agenda-calendar-toolbar,
.agenda-month-controls,
.agenda-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.agenda-calendar-toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.agenda-month-controls strong {
  min-width: 200px;
  text-transform: capitalize;
  font-size: 1.05rem;
}
.agenda-toolbar-right { margin-left: auto; }
.icon-button { min-width: 42px; padding-inline: 0; font-size: 1.25rem; }

.agenda-view-switch,
.agenda-side-tabs {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 17, 31, .62);
}
.agenda-view-switch button,
.agenda-side-tabs button {
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}
.agenda-view-switch button.active,
.agenda-side-tabs button.active {
  color: #dff1ff;
  background: rgba(85, 167, 255, .15);
  box-shadow: inset 0 0 0 1px rgba(85, 167, 255, .24);
}
.agenda-side-tabs { width: 100%; margin-bottom: 14px; }
.agenda-side-tabs button { flex: 1; display: flex; justify-content: center; gap: 7px; }
.agenda-side-tabs b { color: #8fc5ff; }

.agenda-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(89, 125, 161, .18);
  border-radius: 10px;
  background: rgba(5, 17, 31, .35);
}
.agenda-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}
.agenda-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: #8495ad; }
.agenda-legend .scheduled::before { background: #ffab4c; }
.agenda-legend .confirmed::before { background: #55a7ff; }
.agenda-legend .progress::before { background: #a575ff; }
.agenda-legend .completed::before { background: #2bdc96; }
.agenda-legend .overdue::before,
.agenda-legend .cancelled::before { background: #ff5b67; }

.agenda-view-panel { min-width: 0; }
.agenda-weekdays,
.agenda-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.agenda-weekdays {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.agenda-weekdays span {
  padding: 10px 6px;
  color: var(--muted);
  font-size: .74rem;
  text-align: center;
  background: rgba(5, 19, 35, .38);
}
.agenda-calendar {
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}
.agenda-day {
  min-height: 122px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 23, 41, .32);
  transition: background .16s ease, box-shadow .16s ease;
  overflow: hidden;
}
.agenda-day:not(.outside):hover { background: rgba(29, 91, 151, .12); box-shadow: inset 0 0 0 1px rgba(85, 167, 255, .18); }
.agenda-day.outside { opacity: .35; background: rgba(3, 13, 25, .35); }
.agenda-day.today { box-shadow: inset 0 0 0 2px rgba(43, 220, 150, .48); }
.agenda-day-number { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; color: var(--text); font-size: .78rem; }
.agenda-day-number b {
  min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 999px;
  color: #8fc5ff; background: rgba(85, 167, 255, .12); font-size: .66rem;
}
.agenda-day-events { display: grid; gap: 4px; }
.agenda-event,
.agenda-more {
  width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 7px; padding: 6px 7px;
  text-align: left; color: var(--text); background: rgba(132, 149, 173, .12); font: inherit;
  font-size: .67rem; line-height: 1.18; cursor: pointer; overflow: hidden;
}
.agenda-event { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 6px; }
.agenda-event strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.agenda-event small { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(211, 226, 242, .7); font-size: .58rem; }
.agenda-event-time { grid-row: 1 / 3; align-self: center; color: #a9bfd6; font-size: .6rem; }
.agenda-event.compact small { display: none; }
.agenda-event.pending { background: rgba(132, 149, 173, .14); border-color: rgba(132, 149, 173, .22); }
.agenda-event.scheduled { background: rgba(255, 171, 76, .14); border-color: rgba(255, 171, 76, .25); }
.agenda-event.confirmed { background: rgba(85, 167, 255, .15); border-color: rgba(85, 167, 255, .28); }
.agenda-event.progress { background: rgba(165, 117, 255, .15); border-color: rgba(165, 117, 255, .28); }
.agenda-event.completed { background: rgba(43, 220, 150, .14); border-color: rgba(43, 220, 150, .26); }
.agenda-event.cancelled { background: rgba(255, 91, 103, .1); border-color: rgba(255, 91, 103, .2); opacity: .7; }
.agenda-event.overdue { background: rgba(255, 91, 103, .16); border-color: rgba(255, 91, 103, .34); }
.agenda-event:hover { transform: translateY(-1px); filter: brightness(1.15); }
.agenda-more { background: transparent; color: #75b6ff; text-align: center; white-space: nowrap; text-overflow: ellipsis; }

.agenda-week-calendar { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; min-height: 460px; }
.agenda-week-day { display: flex; min-width: 0; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 23, 41, .30); overflow: hidden; }
.agenda-week-day.today { box-shadow: inset 0 0 0 2px rgba(43, 220, 150, .42); }
.agenda-week-day > header { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.agenda-week-day > header span { color: var(--muted); text-transform: capitalize; font-size: .7rem; }
.agenda-week-day > header strong { font-size: 1.35rem; }
.agenda-week-day > header b { grid-column: 1 / -1; color: #75b6ff; font-size: .65rem; }
.agenda-week-events { display: grid; align-content: start; gap: 6px; padding: 8px; min-height: 300px; max-height: 480px; overflow-y: auto; }
.agenda-week-add { margin: auto 8px 8px; border: 1px dashed rgba(85, 167, 255, .32); border-radius: 8px; padding: 8px; color: #8fc5ff; background: transparent; cursor: pointer; }

.agenda-upcoming-panel { display: flex; flex-direction: column; min-height: 0; }
.agenda-side-heading { margin-bottom: 4px; }
.agenda-upcoming-list { display: grid; align-content: start; gap: 7px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.agenda-upcoming-item { padding: 10px 0; border-bottom: 1px solid rgba(89, 125, 161, .18); }
.agenda-side-main {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; border: 0; padding: 0; color: var(--text); background: transparent; text-align: left; cursor: pointer;
}
.agenda-side-main > i { width: 8px; height: 8px; border-radius: 999px; background: #8495ad; }
.agenda-side-main > i.scheduled { background: #ffab4c; }
.agenda-side-main > i.confirmed { background: #55a7ff; }
.agenda-side-main > i.progress { background: #a575ff; }
.agenda-side-main > i.completed { background: #2bdc96; }
.agenda-side-main > i.overdue { background: #ff5b67; }
.agenda-side-main span { min-width: 0; display: grid; gap: 3px; }
.agenda-side-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-side-main small { color: var(--muted); }
.agenda-side-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0 19px; }

.agenda-list-scroll { max-height: 620px; overflow: auto; }
.agenda-table td { vertical-align: middle; }
.agenda-actions { min-width: 230px; }
.agenda-actions .button { margin: 2px; }
.table-subline { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.agenda-row-overdue { background: rgba(255, 91, 103, .045); }
.agenda-status-pill {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(132, 149, 173, .25);
  border-radius: 999px; padding: 5px 9px; color: #c4d0df; background: rgba(132, 149, 173, .1);
  font-size: .68rem; font-weight: 700; white-space: nowrap;
}
.agenda-status-pill.scheduled { color: #ffc47e; background: rgba(255, 171, 76, .12); border-color: rgba(255, 171, 76, .24); }
.agenda-status-pill.confirmed { color: #8fc5ff; background: rgba(85, 167, 255, .12); border-color: rgba(85, 167, 255, .24); }
.agenda-status-pill.progress { color: #c1a4ff; background: rgba(165, 117, 255, .12); border-color: rgba(165, 117, 255, .24); }
.agenda-status-pill.completed { color: #63e9b3; background: rgba(43, 220, 150, .12); border-color: rgba(43, 220, 150, .24); }
.agenda-status-pill.cancelled,
.agenda-status-pill.overdue { color: #ff8d96; background: rgba(255, 91, 103, .12); border-color: rgba(255, 91, 103, .24); }
.complete-button { color: #63e9b3; }
.danger-button { color: #ff8d96; }
.empty-state { padding: 22px 8px; color: var(--muted); text-align: center; }
.empty-state.compact { padding: 12px 4px; font-size: .68rem; }

.agenda-unscheduled-panel { margin-top: 16px; }
.agenda-unscheduled-panel .panel-heading { align-items: center; }
.agenda-unscheduled-panel .section-description { margin: 5px 0 0; }
.agenda-unscheduled-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.agenda-unscheduled-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 23, 41, .32); }
.agenda-unscheduled-item > div:first-child { min-width: 0; display: grid; gap: 4px; }
.agenda-unscheduled-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-unscheduled-item small { color: var(--muted); }
.agenda-unscheduled-actions { display: flex; gap: 6px; flex-shrink: 0; }

.agenda-details-card { width: min(760px, calc(100vw - 28px)); }
.agenda-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.agenda-details-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 23, 41, .35); }
.agenda-details-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.agenda-details-grid strong { display: block; overflow-wrap: anywhere; }
.agenda-details-grid .span-2 { grid-column: 1 / -1; }
.agenda-details-actions { flex-wrap: wrap; }
.agenda-start-help {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin: 2px 4px; border-radius: 999px;
  border: 1px solid rgba(85,167,255,.42); background: rgba(85,167,255,.12);
  color: #9dceff; cursor: help; vertical-align: middle; flex: 0 0 auto;
}
.agenda-start-help-badge { font-size: 12px; font-weight: 800; line-height: 1; text-transform: lowercase; }
.agenda-start-help-popup {
  position: absolute; right: -8px; bottom: calc(100% + 10px); z-index: 40;
  width: min(340px, calc(100vw - 44px)); padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(85,167,255,.35); background: #0b2139; color: #dceafb;
  box-shadow: 0 14px 36px rgba(0,0,0,.35); font-size: 11px; font-weight: 600; line-height: 1.45;
  text-align: left; white-space: normal; opacity: 0; visibility: hidden; transform: translateY(4px);
  pointer-events: none; transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.agenda-start-help:hover .agenda-start-help-popup,
.agenda-start-help:focus .agenda-start-help-popup,
.agenda-start-help:focus-within .agenda-start-help-popup {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.agenda-start-help:focus-visible { outline: 2px solid #57aaff; outline-offset: 2px; }

textarea { width: 100%; resize: vertical; min-height: 78px; }

@media (max-width: 1380px) {
  .agenda-filter-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .agenda-filter-search { grid-column: span 2; }
  .agenda-filter-actions { grid-column: span 2; justify-content: flex-end; }
  .agenda-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .agenda-main-grid { grid-template-columns: 1fr; }
  .agenda-upcoming-panel { max-height: 540px; }
  .agenda-unscheduled-list { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .agenda-top-action { position: static; display: block; width: 100%; margin: 14px 0 18px; }
  .agenda-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-filter-search { grid-column: 1 / -1; }
  .agenda-filter-actions { grid-column: 1 / -1; justify-content: stretch; }
  .agenda-filter-actions .button { flex: 1; }
  .agenda-calendar-toolbar { align-items: stretch; }
  .agenda-month-controls, .agenda-toolbar-right { width: 100%; justify-content: space-between; }
  .agenda-toolbar-right { margin-left: 0; flex-wrap: wrap; }
  .agenda-calendar-panel { padding: 12px; overflow: hidden; }
  .agenda-view-panel { overflow-x: auto; }
  .agenda-weekdays, .agenda-calendar { min-width: 720px; }
  .agenda-week-calendar { min-width: 980px; }
  .agenda-details-grid { grid-template-columns: 1fr; }
  .agenda-details-grid .span-2 { grid-column: auto; }
}

@media (max-width: 560px) {
  .agenda-summary-grid { grid-template-columns: 1fr; }
  .agenda-summary-card { min-height: 96px; }
  .agenda-filter-panel { grid-template-columns: 1fr; }
  .agenda-filter-panel > *, .agenda-filter-search, .agenda-filter-actions { grid-column: auto; }
  .agenda-filter-actions { flex-direction: column; }
  .agenda-filter-actions .button { width: 100%; }
  .agenda-month-controls { flex-wrap: wrap; }
  .agenda-month-controls strong { order: -1; width: 100%; min-width: 0; }
  .agenda-view-switch { width: 100%; }
  .agenda-view-switch button { flex: 1; }
  .agenda-unscheduled-item { align-items: stretch; flex-direction: column; }
  .agenda-unscheduled-actions { width: 100%; }
  .agenda-unscheduled-actions .button { flex: 1; }
  .agenda-details-actions .button { width: 100%; }
}


/* Backup e restauração — fonte operacional em /amb/backup-archive */
.backup-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 18px;
}
.backup-location {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
}
.backup-location span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.backup-location strong { overflow-wrap: anywhere; color: var(--text); font-size: .92rem; }
.backup-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-left: auto; }
.backup-actions .button { min-height: 44px; }
.backup-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.backup-summary-card { min-height: 126px; padding: 20px; display: grid; align-content: center; gap: 7px; }
.backup-summary-card span { color: var(--muted); font-size: .82rem; }
.backup-summary-card strong { color: var(--text); font-size: clamp(1.35rem, 2.2vw, 2rem); line-height: 1.1; overflow-wrap: anywhere; }
.backup-summary-card small { color: var(--muted); }
.backup-summary-card.green { box-shadow: inset 0 2px 0 rgba(43,220,150,.38), 0 15px 44px rgba(0,0,0,.12); }
.backup-summary-card.blue { box-shadow: inset 0 2px 0 rgba(85,167,255,.38), 0 15px 44px rgba(0,0,0,.12); }
.backup-summary-card.warning { box-shadow: inset 0 2px 0 rgba(255,171,76,.38), 0 15px 44px rgba(0,0,0,.12); }
.backup-settings-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 16px; margin-bottom: 16px; }
.backup-settings-panel,
.backup-protection-panel,
.backup-list-panel { padding: 22px; }
.backup-settings-form { display: grid; gap: 18px; margin-top: 18px; }
.toggle-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7,19,33,.44);
}
.toggle-line input { width: 18px; height: 18px; accent-color: var(--green); }
.toggle-line span { color: var(--text); font-weight: 700; }
.input-suffix { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.input-suffix input { border-radius: 12px 0 0 12px; }
.input-suffix span {
  display: grid;
  place-items: center;
  height: 46px;
  padding: 0 13px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: rgba(9,22,38,.85);
  font-size: .78rem;
  font-weight: 700;
}
.backup-schedule-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(85,167,255,.22);
  border-radius: 12px;
  background: rgba(85,167,255,.07);
}
.backup-schedule-preview span { color: var(--muted); }
.backup-schedule-preview strong { text-align: right; }
.backup-protection-list { display: grid; gap: 12px; margin: 18px 0; }
.backup-protection-list > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(89,125,161,.18);
  border-radius: 12px;
  background: rgba(7,19,33,.36);
}
.backup-protection-list i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--green);
  border-radius: 9px;
  background: rgba(43,220,150,.12);
  font-style: normal;
  font-weight: 900;
}
.backup-protection-list span { display: grid; gap: 4px; }
.backup-protection-list small { color: var(--muted); line-height: 1.45; }
.warning-notice { color: #ffd59f; border-color: rgba(255,171,76,.28); background: rgba(255,171,76,.08); }
.backup-list-heading { margin-bottom: 14px; }
.backup-table { min-width: 920px; }
.backup-table td { vertical-align: middle; }
.backup-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 5px 9px;
  border: 1px solid rgba(132,149,173,.25);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}
.backup-status-pill.success { color: #63e9b3; border-color: rgba(43,220,150,.25); background: rgba(43,220,150,.1); }
.backup-status-pill.failed { color: #ff8d96; border-color: rgba(255,91,103,.25); background: rgba(255,91,103,.1); }
.backup-status-pill.running { color: #8fc5ff; border-color: rgba(85,167,255,.25); background: rgba(85,167,255,.1); }
.backup-status-pill.queued { color: #ffc47e; border-color: rgba(255,171,76,.25); background: rgba(255,171,76,.1); }
.restore-backup-button { min-height: 36px; }
.button.danger-action {
  color: #fff;
  border-color: rgba(255,91,103,.5);
  background: linear-gradient(180deg, #ff6974, #d9414e);
}
.button.danger-action:hover { filter: brightness(1.05); }
.restore-backup-summary {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7,19,33,.52);
}
.restore-backup-summary span,
.restore-backup-summary small { color: var(--muted); }
.restore-backup-summary strong { overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .backup-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backup-settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .backup-commandbar { align-items: stretch; flex-direction: column; }
  .backup-actions { width: 100%; margin-left: 0; }
  .backup-actions .button { flex: 1 1 0; min-width: 0; }
  .backup-summary-grid { grid-template-columns: 1fr; }
  .backup-schedule-preview { align-items: flex-start; flex-direction: column; }
  .backup-schedule-preview strong { text-align: left; }
}

/* Dashboard 1.3.1 — organização espacial baseada no painel gerencial de referência */
#dashboardPage {
  --dashboard-indicator-card-height: 88px;
  --dashboard-indicator-card-padding: 10px 12px;
  --dashboard-indicator-grid-gap: 8px;
  --dashboard-indicator-label-size: clamp(8px, .55vw, 9px);
  --dashboard-indicator-label-line-height: 1.25;
  --dashboard-indicator-value-size: 24px;
  --dashboard-indicator-value-line-height: 1.05;
}
.reference-filters {
  grid-template-columns: 100px 110px 125px minmax(190px,1fr) minmax(170px,.8fr) minmax(170px,.75fr) auto;
  gap: 10px;
  margin: 22px 0 20px;
  padding: 14px 16px;
}
.reference-filters label { min-width: 0; }
.reference-filters select { width: 100%; min-width: 0; }
.reference-dashboard-grid {
  display: grid;
  grid-template-columns: 150px minmax(420px, 1.35fr) minmax(280px, .78fr) minmax(300px, .9fr);
  grid-template-areas:
    "rail stock found ranking"
    "rail lower lower lower";
  gap: 12px;
  align-items: stretch;
  margin-bottom: 40px;
}
.reference-dashboard-grid > .panel { padding: 18px; min-width: 0; }
.reference-percent-rail { grid-area: rail; display: flex; flex-direction: column; gap: 12px; justify-content: flex-start; }
.reference-percent-rail > div:not(.donut):not(.reference-rail-kpis) { padding: 15px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.reference-percent-rail span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.reference-percent-rail > div > strong { display: block; margin-top: 7px; font-size: 25px; }
#dashboardPage .reference-percent-rail #foundPct { color: var(--green-soft); }
#dashboardPage .reference-percent-rail #notFoundPct { color: var(--red-soft); }
#dashboardPage .reference-percent-rail #segregatedPct { color: var(--amber-soft); }
#dashboardPage .reference-rail-kpis #excludedClients { color: var(--red-soft); }
.reference-mini-donut { width: 116px; height: 116px; margin: 6px auto 0; }
.reference-mini-donut .donut-center strong { font-size: 18px; }
.reference-mini-donut .donut-center span { font-size: 8px; }
.reference-rail-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.reference-rail-kpis > div,
.reference-rail-kpis > .rail-kpi-action {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(7,18,32,.38);
  text-align: left;
}
.reference-rail-kpis span,
.reference-rail-kpis strong {
  display: block;
}
.reference-rail-kpis > .rail-kpi-action {
  width: 100%;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.reference-rail-kpis > .rail-kpi-action:hover,
.reference-rail-kpis > .rail-kpi-action:focus-visible {
  border-color: rgba(85, 167, 255, .48);
  outline: none;
  background: rgba(85, 167, 255, .09);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12), 0 0 12px rgba(85, 167, 255, .08);
  transform: translateY(-1px);
}
.reference-rail-kpis span {
  min-height: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.reference-rail-kpis strong {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.05;
}
.reference-stock-panel,
.reference-found-panel,
.reference-ranking-panel {
  height: 580px;
}
.reference-stock-panel {
  grid-area: stock;
  border-color: rgba(85, 167, 255, .40);
}
.reference-found-panel {
  grid-area: found;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(43, 220, 150, .44);
}
.reference-ranking-panel {
  grid-area: ranking;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.reference-ranking-panel .panel-heading { flex: 0 0 auto; }
.reference-ranking-list {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 18px;
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(85,167,255,.45) rgba(148,173,207,.08);
}
.reference-ranking-list::-webkit-scrollbar { width: 9px; }
.reference-ranking-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(148,173,207,.08);
}
.reference-ranking-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(85,167,255,.42);
  background-clip: padding-box;
}
.reference-ranking-list::-webkit-scrollbar-thumb:hover {
  background: rgba(85,167,255,.62);
  background-clip: padding-box;
}
.reference-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.reference-stock-main { position: relative; min-height: 110px; padding: 10px 0 4px; }
.reference-stock-main > strong { display: block; font-size: clamp(48px, 5vw, 78px); line-height: .95; }
.reference-stock-main > small { color: var(--muted); }
.reference-stock-main .stock-mini-trend {
  position: absolute;
  top: 50%;
  bottom: auto;
  left: 56%;
  right: auto;
  width: min(38%, 228px);
  height: 96px;
  transform: translateY(-50%);
}
.reference-stock-main .stock-mini-trend svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.stock-trend-grid {
  stroke: rgba(148, 173, 207, .12);
  stroke-width: 1;
}
.stock-trend-area {
  fill: url(#stockTrendGradientGreen);
}
.stock-trend-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stock-trend-dot {
  fill: #10213a;
  stroke: var(--green);
  stroke-width: 2;
}
.stock-trend-label {
  fill: rgba(188, 214, 247, .74);
  font-size: 8px;
  letter-spacing: .01em;
}
.reference-aging-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: var(--dashboard-indicator-card-height);
  gap: var(--dashboard-indicator-grid-gap);
  margin-top: 10px;
}
.reference-aging-grid .aging-card {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: var(--dashboard-indicator-card-height);
  padding: var(--dashboard-indicator-card-padding);
  overflow: hidden;
}
.reference-aging-grid .aging-card i {
  width: 32px;
  height: 4px;
  margin-bottom: 9px;
}
.reference-big-number { display: block; margin: 18px 0 15px; font-size: clamp(42px, 4vw, 64px); line-height: 1; }
.reference-title-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 900;
  line-height: 1.1;
}
.reference-title-badge.badge-blue {
  color: #d8ebff;
  border: 1px solid rgba(85, 167, 255, .48);
  background: rgba(85, 167, 255, .11);
}
.reference-title-badge.badge-green {
  background: rgba(43, 220, 150, .14);
  color: #ccffe9;
  border: 1px solid rgba(43, 220, 150, .28);
}
.reference-title-badge.badge-amber {
  background: rgba(255, 171, 76, .14);
  color: #ffe4b8;
  border: 1px solid rgba(255, 171, 76, .60);
}
.reference-title-badge.badge-red {
  background: rgba(255, 90, 105, .14);
  color: #ffd4da;
  border: 1px solid rgba(255, 90, 105, .64);
}
.reference-title-badge.badge-gray {
  background: rgba(148, 173, 207, .08);
  color: #e5edf8;
  border: 1px solid rgba(148, 173, 207, .52);
}
.reference-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: var(--dashboard-indicator-card-height);
  gap: var(--dashboard-indicator-grid-gap);
  align-content: start;
}
.reference-breakdown > div {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: var(--dashboard-indicator-card-height);
  padding: var(--dashboard-indicator-card-padding);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(7,18,32,.38);
}
.reference-aging-grid .aging-card span,
.reference-breakdown span {
  display: block;
  min-width: 0;
  min-height: 22px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--dashboard-indicator-label-size);
  font-weight: 800;
  line-height: var(--dashboard-indicator-label-line-height);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.reference-aging-grid .aging-card strong,
.reference-breakdown strong {
  display: block;
  margin-top: 4px;
  font-size: var(--dashboard-indicator-value-size);
  line-height: var(--dashboard-indicator-value-line-height);
}
#dashboardPage .out-of-validity strong { color: var(--red-soft); }
.reference-aging-grid strong.indicator-value-red,
.reference-breakdown strong.indicator-value-red { color: var(--red-soft); }
.reference-aging-grid strong.indicator-value-orange,
.reference-breakdown strong.indicator-value-orange { color: var(--amber); }
.reference-aging-grid strong.indicator-value-blue,
.reference-breakdown strong.indicator-value-blue { color: var(--blue); }
#dashboardPage .reference-aging-grid strong.indicator-value-default,
#dashboardPage .reference-breakdown strong.indicator-value-default { color: var(--text); }
.reference-bottom-card { min-height: 285px; }
.reference-segregated { border-color: rgba(255,169,58,.38); }
.reference-not-found, .reference-expired { border-color: rgba(255,90,105,.40); }

/* r24 — realce temporário dos painéis sem alterar dimensões ou bordas fixas */
#dashboardPage .reference-percent-rail,
#dashboardPage .reference-stock-panel,
#dashboardPage .reference-found-panel,
#dashboardPage .reference-segregated,
#dashboardPage .reference-not-found,
#dashboardPage .reference-ranking-panel,
#dashboardPage .reference-expired,
#dashboardPage .reference-secondary-grid > .panel {
  transition: border-color .24s ease, box-shadow .24s ease, transform .24s ease;
}
@media (hover: hover) and (pointer: fine) {
  #dashboardPage .reference-percent-rail:hover {
    border-color: rgba(85, 167, 255, .58);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18), 0 0 18px rgba(85, 167, 255, .12), inset 0 0 30px rgba(85, 167, 255, .035);
    transform: translateY(-2px);
  }
  #dashboardPage .reference-stock-panel:hover {
    border-color: rgba(85, 167, 255, .68);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18), 0 0 18px rgba(85, 167, 255, .12);
    transform: translateY(-2px);
  }
  #dashboardPage .reference-found-panel:hover {
    border-color: rgba(43, 220, 150, .66);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18), 0 0 18px rgba(43, 220, 150, .11);
    transform: translateY(-2px);
  }
  #dashboardPage .reference-segregated:hover {
    border-color: rgba(255, 169, 58, .62);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18), 0 0 18px rgba(255, 169, 58, .10);
    transform: translateY(-2px);
  }
  #dashboardPage .reference-not-found:hover {
    border-color: rgba(255, 90, 105, .64);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18), 0 0 18px rgba(255, 90, 105, .10);
    transform: translateY(-2px);
  }
  #dashboardPage .reference-ranking-panel:hover,
  #dashboardPage .reference-secondary-grid > .panel:hover {
    border-color: rgba(85, 167, 255, .54);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18), 0 0 18px rgba(85, 167, 255, .11);
    transform: translateY(-2px);
  }
  #dashboardPage .reference-expired:hover {
    border-color: rgba(255, 90, 105, .64);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18), 0 0 18px rgba(255, 90, 105, .10);
    transform: translateY(-2px);
  }
}
.reference-secondary-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; margin-bottom: 40px; }
.reference-secondary-grid > .panel { min-height: 330px; padding: 20px; }
@media (max-width: 1350px) {
  .reference-filters { grid-template-columns: repeat(4, minmax(140px,1fr)); }
  .reference-filters .button { min-height: 42px; }
  .reference-dashboard-grid {
    grid-template-columns: 130px 1.25fr .85fr;
    grid-template-areas:
      "rail stock found"
      "rail ranking ranking"
      "rail lower lower";
  }
}
@media (max-width: 980px) {
  .reference-stock-panel,
  .reference-found-panel,
  .reference-ranking-panel { height: auto; }
  .reference-dashboard-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "rail rail" "stock stock" "found ranking" "lower lower"; }
  .reference-percent-rail { flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
  .reference-percent-rail > div:not(.donut):not(.reference-rail-kpis) { flex: 1; border-bottom: 0; border-right: 1px solid var(--line); }
  .reference-rail-kpis { width: 100%; grid-template-columns: repeat(5, minmax(0,1fr)); }
  .reference-secondary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .reference-ranking-list { max-height: 440px; }
  .reference-filters { grid-template-columns: 1fr 1fr; }
  .reference-filters .button { grid-column: 1 / -1; }
  .reference-dashboard-grid { grid-template-columns: 1fr; grid-template-areas: "rail" "stock" "found" "ranking" "lower"; }
  .reference-percent-rail { flex-direction: column; }
  .reference-percent-rail > div:not(.donut):not(.reference-rail-kpis) { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .reference-rail-kpis { width: 100%; grid-template-columns: 1fr; }
  .reference-aging-grid, .reference-breakdown { grid-template-columns: 1fr; }
}

.backup-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 190px;
}
.backup-row-actions .button {
  min-height: 36px;
  padding-inline: 13px;
}
.download-backup-button {
  color: #cfe8ff;
  border-color: rgba(85, 167, 255, .32);
  background: rgba(85, 167, 255, .08);
}
.download-backup-button:hover:not(:disabled),
.download-backup-button:focus-visible:not(:disabled) {
  color: #ffffff;
  background: rgba(85, 167, 255, .16);
}
.download-backup-button:disabled {
  opacity: .55;
  cursor: wait;
}
.backup-upload-dropzone {
  margin-bottom: 16px;
}
#restoreBackupUploadProgress {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .backup-actions { flex-wrap: wrap; }
  .backup-row-actions { justify-content: flex-start; min-width: 0; }
}


/* Dashboard 1.3.8/r11 — Estoque e Encontrados preservados; Ranking com 10 linhas visíveis */
@media (min-width: 1351px) {
  .reference-stock-panel,
  .reference-found-panel {
    height: 580px;
    min-height: 580px;
    max-height: 580px;
    align-self: start;
  }

  .reference-ranking-panel {
    height: 480px;
    min-height: 480px;
    max-height: 480px;
    align-self: start;
    overflow: hidden;
  }

  .reference-ranking-list {
    flex: 0 0 auto;
    height: 362px;
    max-height: 362px;
    min-height: 0;
    grid-auto-rows: 29px;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .reference-ranking-list .bar-row {
    min-height: 29px;
    height: 29px;
  }
}

@media (max-width: 1350px) {
  .reference-stock-panel,
  .reference-found-panel,
  .reference-ranking-panel {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .reference-ranking-list {
    max-height: 362px;
  }
}


/* Dashboard 1.3.9 — filtro fixo do painel de vencidos */
.expired-panel-heading {
  align-items: flex-start;
  gap: 12px;
}
.fixed-filter-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #ffd8dd;
  border: 1px solid rgba(255, 90, 105, .34);
  border-radius: 999px;
  background: rgba(255, 90, 105, .12);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .expired-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .fixed-filter-chip {
    align-self: flex-start;
  }
}

/* CVDB LOGIN FIX V1.3.15 START */
/* A tela de login deve desaparecer imediatamente após autenticação. */
#loginView.hidden {
  display: none !important;
}
/* Fundo e centralização exclusivos da tela de login/logout. */
#loginView.login-shell:not(.hidden) {
  position: relative !important;
  isolation: isolate;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  min-height: 100vh;
  padding: clamp(20px, 4vw, 56px) !important;
  overflow: hidden;
  background: #020b12;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(1, 8, 14, .20), rgba(1, 8, 14, .34)),
    url('/static/assets/background-auditoria.png?v=1.3.15');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: .70;
  transform: scale(1.01);
  pointer-events: none;
}

/* Linha de leitura: um percurso contínuo de cima para baixo em 30 segundos. */
.login-shell::after {
  content: "";
  position: absolute;
  top: 0;
  left: -6%;
  z-index: 1;
  width: 112%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 28, 28, 0) 18%,
    rgba(255, 42, 42, .14) 35%,
    rgba(255, 58, 58, .72) 50%,
    rgba(255, 42, 42, .14) 65%,
    rgba(255, 28, 28, 0) 82%,
    transparent 100%
  );
  box-shadow:
    0 0 6px 1px rgba(255, 42, 42, .25),
    0 0 14px 3px rgba(255, 42, 42, .10);
  opacity: .42;
  transform: translate3d(0, -8vh, 0);
  pointer-events: none;
  will-change: transform, opacity;
  animation: cvdbLoginLaserScan 30s linear infinite;
}
.login-shell > * {
  position: relative;
  z-index: 2;
}
.login-visual {
  display: none !important;
}

/* Card preservado, centralizado e sem alterar a autenticação. */
#loginForm.login-card {
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: min(440px, calc(100vw - 36px)) !important;
  max-width: 440px !important;
  margin: 0 auto !important;
  padding: clamp(30px, 4vw, 42px) !important;
  border: 1px solid rgba(107, 155, 218, .40);
  border-radius: 26px;
  background: rgba(5, 18, 31, .88);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .44);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: left;
}
#loginForm.login-card h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}
#loginForm.login-card > p:not(.eyebrow):not(.form-error) {
  margin: 9px 0 28px;
  color: var(--muted);
}
#loginForm .mobile-brand {
  display: none !important;
}

/* Usuário e Senha: mesma largura, mesma altura e espaçamento uniforme. */
#loginForm > label {
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  color: #d3deea;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}
#loginForm > label + label {
  margin-top: 18px !important;
}
#loginForm > label > input,
#loginForm > label > .password-input-wrap > input {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 50px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  color: var(--text);
  border: 1px solid rgba(107, 155, 218, .34);
  border-radius: 12px;
  outline: none;
  background: rgba(3, 13, 24, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
#loginForm > label > input::placeholder,
#loginForm > label > .password-input-wrap > input::placeholder {
  color: #73879f;
  opacity: 1;
}
#loginForm > label > input:hover,
#loginForm > label > .password-input-wrap > input:hover {
  border-color: rgba(107, 155, 218, .52);
  background: rgba(4, 16, 29, .87);
}
#loginForm > label > input:focus,
#loginForm > label > .password-input-wrap > input:focus {
  border-color: var(--blue);
  background: rgba(4, 16, 29, .95);
  box-shadow: 0 0 0 3px rgba(85, 167, 255, .12);
}
#loginForm > label > .password-input-wrap > input { padding-right: 50px !important; }
#loginForm > .button {
  box-sizing: border-box;
  width: 100% !important;
  min-height: 48px;
  margin-top: 24px !important;
}
#loginForm > .form-error {
  min-height: 20px;
  margin: 14px 0 0;
}

@keyframes cvdbLoginLaserScan {
  0% {
    transform: translate3d(0, -8vh, 0);
    opacity: .20;
  }
  4% { opacity: .42; }
  96% { opacity: .42; }
  100% {
    transform: translate3d(0, 108vh, 0);
    opacity: .20;
  }
}

@media (max-width: 640px) {
  #loginView.login-shell:not(.hidden) {
    padding: 18px !important;
  }
  #loginForm.login-card {
    width: 100% !important;
    padding: 28px 22px !important;
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell::after {
    display: none;
    animation: none;
  }
}
/* CVDB LOGIN FIX V1.3.15 END */

/* CVDB FORM SYSTEM FIX V1.3.16 START */
/*
 * Sistema visual único para formulários internos.
 * Escopo restrito ao aplicativo autenticado e aos dialogs para não competir
 * com a tela de login, que possui regras próprias.
 */
#appView label:not(.checkbox-field),
dialog label:not(.checkbox-field) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  color: #b8c7d9;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

#appView input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
#appView select,
#appView textarea,
dialog input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
dialog select,
dialog textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: rgba(5, 16, 29, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .018);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#appView input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
#appView select,
dialog input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
dialog select {
  height: 46px;
  padding: 0 14px;
}

#appView textarea,
dialog textarea {
  min-height: 92px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
}

#appView input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):hover,
#appView select:hover,
#appView textarea:hover,
dialog input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):hover,
dialog select:hover,
dialog textarea:hover {
  border-color: rgba(107, 155, 218, .48);
  background: rgba(7, 20, 35, .90);
}

#appView input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus,
#appView select:focus,
#appView textarea:focus,
dialog input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus,
dialog select:focus,
dialog textarea:focus {
  border-color: var(--blue);
  background: rgba(7, 20, 35, .96);
  box-shadow: 0 0 0 3px rgba(85, 167, 255, .12);
}

#appView input::placeholder,
#appView textarea::placeholder,
dialog input::placeholder,
dialog textarea::placeholder {
  color: #71859d;
  opacity: 1;
}

#appView select option,
dialog select option {
  color: var(--text);
  background: #0d1d31;
}

#appView input[type="file"],
dialog input[type="file"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(5, 16, 29, .72);
}

/* Grades: nenhuma coluna pode crescer além do card. */
#appView .form-grid,
dialog .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 17px;
}
#appView .form-grid > *,
dialog .form-grid > * { min-width: 0; }
#appView .form-grid .span-2,
dialog .form-grid .span-2 { grid-column: 1 / -1; }

/* Checkboxes consistentes e alinhados com os campos de 46 px. */
#appView .checkbox-field,
dialog .checkbox-field {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;
  color: #c8d5e4;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 16, 29, .35);
  font-size: 12px;
  font-weight: 700;
}
#appView .checkbox-field input[type="checkbox"],
dialog .checkbox-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--green);
}

/* Gestão de usuários: cards independentes, sem sobreposição. */
#profilePage .profile-grid {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
#profilePage .profile-grid > .panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
#profilePage .profile-form-panel,
#profilePage .profile-list-panel { overflow: hidden; }
#profilePage .profile-list-panel .table-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
}
#userForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}
#userForm .dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 7px;
}
#userForm .dialog-actions .button { min-width: 124px; }

/* Alteração de senha: coluna única, largura regular e botões alinhados. */
#passwordPage .password-page-panel { overflow: hidden; }
#passwordForm.password-page-form {
  width: min(100%, 620px);
  max-width: 620px;
}
#passwordForm .password-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
#passwordForm .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
#passwordForm .dialog-actions .button { min-width: 128px; }

/* Modais de cadastro: sem scroll horizontal e com proporção estável. */
dialog {
  max-width: calc(100vw - 28px);
  overflow: hidden;
}
#recordDialog,
#agendaDialog {
  width: min(760px, calc(100vw - 28px));
}
dialog .dialog-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: calc(100vh - 28px);
  overflow-x: hidden;
  overflow-y: auto;
}
dialog .dialog-heading { align-items: flex-start; }
dialog .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}
dialog .dialog-actions .button { min-width: 118px; }

/* Filtros: restaura labels e seletores sem alterar a grade do dashboard. */
#dashboardPage .reference-filters label {
  display: grid;
  gap: 7px;
  min-width: 0;
}
#dashboardPage .reference-filters select {
  width: 100%;
  min-width: 0;
  height: 42px;
}

/* Datas e controles especiais continuam usando o componente próprio. */
#appView .date-picker-field,
dialog .date-picker-field { width: 100%; min-width: 0; }
#appView .date-picker-button,
dialog .date-picker-button { min-width: 0; }

@media (max-width: 1260px) {
  #profilePage .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  #appView .form-grid,
  dialog .form-grid,
  #userForm { grid-template-columns: minmax(0, 1fr); }
  #appView .form-grid .span-2,
  dialog .form-grid .span-2,
  #userForm .dialog-actions { grid-column: 1; }
  #userForm .dialog-actions,
  #passwordForm .dialog-actions,
  dialog .dialog-actions { align-items: stretch; flex-direction: column; }
  #userForm .dialog-actions .button,
  #passwordForm .dialog-actions .button,
  dialog .dialog-actions .button { width: 100%; }
}
/* CVDB FORM SYSTEM FIX V1.3.16 END */

/* CVDB RESPONSIVE SYSTEM V1.3.18 START */
/* Camada responsiva final. Mantém a identidade visual e sobrescreve somente
   dimensões, grades, espaçamentos e comportamento de overflow. */
:root {
  --cvdb-fluid-gap: clamp(10px, .9vw, 16px);
  --cvdb-fluid-panel-padding: clamp(14px, 1.25vw, 20px);
  --cvdb-fluid-page-padding: clamp(14px, 2.7vw, 52px);
}

#appView,
#appView .content,
#appView .page-view,
#appView .panel,
#appView .dashboard-grid,
#appView .reference-dashboard-grid,
#appView .reference-secondary-grid {
  min-width: 0;
}

#appView .content {
  width: min(100%, 1920px);
  max-width: none;
  margin-inline: auto;
  padding-inline: var(--cvdb-fluid-page-padding);
  transition: padding .22s ease;
}

#appView .panel,
#appView .button,
#appView input,
#appView select,
#appView textarea,
#appView .reference-dashboard-grid,
#appView .reference-filters {
  transition: padding .22s ease, gap .22s ease, border-radius .22s ease;
}

#appView img,
#appView canvas,
#appView svg {
  max-width: 100%;
}

#appView .table-scroll,
#appView .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

#dashboardPage .reference-filters {
  gap: var(--cvdb-fluid-gap);
}

#dashboardPage .reference-dashboard-grid,
#dashboardPage .reference-secondary-grid {
  gap: var(--cvdb-fluid-gap);
}

#dashboardPage .reference-dashboard-grid > .panel,
#dashboardPage .reference-secondary-grid > .panel {
  padding: var(--cvdb-fluid-panel-padding);
}

#dashboardPage .reference-stock-main > strong,
#dashboardPage .reference-big-number,
#dashboardPage .reference-breakdown strong,
#dashboardPage .reference-rail-kpis strong {
  font-variant-numeric: tabular-nums;
}

#dashboardPage .reference-ranking-list,
#dashboardPage .bar-list {
  min-width: 0;
}

#dashboardPage .bar-row {
  min-width: 0;
}

#dashboardPage .bar-row > span,
#dashboardPage .bar-row > strong {
  min-width: 0;
}

/* Monitor grande: preserva exatamente a hierarquia visual de quatro colunas. */
@media (min-width: 1501px) {
  #dashboardPage .reference-dashboard-grid {
    grid-template-columns: 150px minmax(420px, 1.35fr) minmax(280px, .78fr) minmax(300px, .9fr);
    grid-template-areas:
      "rail stock found ranking"
      "rail lower lower lower";
  }

  #dashboardPage .reference-stock-panel,
  #dashboardPage .reference-found-panel,
  #dashboardPage .reference-ranking-panel {
    height: 580px;
    min-height: 580px;
    max-height: 580px;
  }
}

/* Notebook e desktop compacto: mantém a prioridade, usando três colunas. */
@media (min-width: 1181px) and (max-width: 1500px) {
  #dashboardPage .reference-filters {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  #dashboardPage .reference-filters > label:nth-child(1),
  #dashboardPage .reference-filters > label:nth-child(2),
  #dashboardPage .reference-filters > label:nth-child(3) {
    grid-column: span 1;
  }

  #dashboardPage .reference-filters > label:nth-child(4) {
    grid-column: span 3;
  }

  #dashboardPage .reference-filters > label:nth-child(5) {
    grid-column: span 3;
  }

  #dashboardPage .reference-filters > label:nth-child(6) {
    grid-column: span 2;
  }

  #dashboardPage .reference-filters > .button {
    grid-column: span 1;
    width: 100%;
  }

  #dashboardPage .reference-dashboard-grid {
    grid-template-columns: 130px minmax(440px, 1.3fr) minmax(285px, .8fr);
    grid-template-areas:
      "rail stock found"
      "rail ranking ranking"
      "rail lower lower";
  }

  #dashboardPage .reference-stock-panel,
  #dashboardPage .reference-found-panel,
  #dashboardPage .reference-ranking-panel {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #dashboardPage .reference-ranking-list {
    max-height: 420px;
  }
}

/* Tablet em paisagem e notebook estreito: duas colunas equilibradas. */
@media (min-width: 841px) and (max-width: 1180px) {
  #dashboardPage .reference-filters {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  #dashboardPage .reference-filters > label:nth-child(1),
  #dashboardPage .reference-filters > label:nth-child(2),
  #dashboardPage .reference-filters > label:nth-child(3) {
    grid-column: span 2;
  }

  #dashboardPage .reference-filters > label:nth-child(4),
  #dashboardPage .reference-filters > label:nth-child(5),
  #dashboardPage .reference-filters > label:nth-child(6) {
    grid-column: span 2;
  }

  #dashboardPage .reference-filters > .button {
    grid-column: 1 / -1;
    justify-self: end;
    width: min(100%, 180px);
  }

  #dashboardPage .reference-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "rail rail"
      "stock stock"
      "found ranking"
      "lower lower";
  }

  #dashboardPage .reference-percent-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
  }

  #dashboardPage .reference-percent-rail > div:not(.donut):not(.reference-rail-kpis) {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  #dashboardPage .reference-percent-rail > div:nth-child(3) {
    border-right: 0;
  }

  #dashboardPage .reference-mini-donut,
  #dashboardPage .reference-rail-kpis {
    grid-column: 1 / -1;
  }

  #dashboardPage .reference-rail-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #dashboardPage .reference-stock-panel,
  #dashboardPage .reference-found-panel,
  #dashboardPage .reference-ranking-panel {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #dashboardPage .reference-ranking-list {
    max-height: 390px;
  }

  #dashboardPage .reference-secondary-grid,
  #appView .primary-grid,
  #appView .secondary-grid,
  #appView .split-grid,
  #appView .master-data-grid,
  #appView .agenda-main-grid,
  #appView .backup-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* O menu vira barra inferior abaixo de 900px; o conteúdo precisa ocupar a coluna inteira. */
@media (max-width: 900px) {
  #appView.app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  #appView .content {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Tablet em retrato e celular: leitura vertical por prioridade. */
@media (max-width: 840px) {
  #appView .content {
    padding-top: clamp(18px, 3vw, 26px);
    padding-bottom: 88px;
  }

  #appView .topbar,
  #appView .section-heading,
  #appView .panel-heading,
  #appView .table-meta,
  #appView .table-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #dashboardPage .reference-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-block: 18px;
    padding: 14px;
  }

  #dashboardPage .reference-filters > label,
  #dashboardPage .reference-filters > .button {
    grid-column: span 1;
  }

  #dashboardPage .reference-filters > label:nth-child(4),
  #dashboardPage .reference-filters > label:nth-child(5),
  #dashboardPage .reference-filters > label:nth-child(6),
  #dashboardPage .reference-filters > .button {
    grid-column: 1 / -1;
  }

  #dashboardPage .reference-filters > .button {
    width: 100%;
  }

  #dashboardPage .reference-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "rail"
      "stock"
      "found"
      "ranking"
      "lower";
  }

  #dashboardPage .reference-percent-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  #dashboardPage .reference-percent-rail > div:not(.donut):not(.reference-rail-kpis) {
    width: auto;
    padding: 10px 6px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  #dashboardPage .reference-percent-rail > div:nth-child(3) {
    border-right: 0;
  }

  #dashboardPage .reference-mini-donut,
  #dashboardPage .reference-rail-kpis {
    grid-column: 1 / -1;
  }

  #dashboardPage .reference-rail-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #dashboardPage .reference-stock-panel,
  #dashboardPage .reference-found-panel,
  #dashboardPage .reference-ranking-panel {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #dashboardPage .reference-ranking-list {
    height: auto;
    max-height: 420px;
  }

  #dashboardPage .reference-stock-main > strong {
    font-size: clamp(48px, 12vw, 72px);
  }

  #dashboardPage .reference-stock-main .stock-mini-trend {
    width: min(40%, 184px);
    height: 88px;
  }

  #dashboardPage .reference-aging-grid,
  #dashboardPage .reference-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboardPage .reference-secondary-grid,
  #appView .primary-grid,
  #appView .secondary-grid,
  #appView .split-grid,
  #appView .master-data-grid,
  #appView .master-correction-grid,
  #appView .agenda-main-grid,
  #appView .backup-settings-grid,
  #appView .profile-grid,
  #appView .monitor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #appView .kpi-grid,
  #appView .monitor-kpi-grid,
  #appView .backup-summary-grid,
  #appView .agenda-summary-grid,
  #appView .master-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #appView .service-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #appView .records-commandbar,
  #appView .backup-commandbar,
  #appView .monitoring-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #appView .records-actions,
  #appView .backup-actions,
  #appView .monitor-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  #appView dialog,
  dialog {
    width: min(100% - 20px, 760px);
    max-width: calc(100vw - 20px);
  }
}

/* Celular estreito: uma coluna, sem cortes e sem sobreposição. */
@media (max-width: 520px) {
  #appView .content {
    padding-inline: 12px;
  }

  #appView h1 {
    font-size: clamp(24px, 8vw, 31px);
  }

  #appView h2 {
    font-size: clamp(19px, 6vw, 23px);
  }

  #dashboardPage .reference-filters {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  #dashboardPage .reference-filters > label,
  #dashboardPage .reference-filters > .button {
    grid-column: 1;
  }

  #dashboardPage .reference-percent-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #dashboardPage .reference-percent-rail > div > strong {
    font-size: clamp(19px, 6vw, 24px);
  }

  #dashboardPage .reference-rail-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboardPage .reference-aging-grid,
  #dashboardPage .reference-breakdown {
    grid-template-columns: minmax(0, 1fr);
  }

  #dashboardPage .reference-stock-main {
    min-height: 96px;
  }

  #dashboardPage .reference-stock-main > strong {
    font-size: clamp(44px, 16vw, 62px);
  }

  #dashboardPage .reference-stock-main .stock-mini-trend {
    left: auto;
    right: 8px;
    width: min(40%, 132px);
    height: 74px;
  }

  #dashboardPage .reference-title-row,
  #dashboardPage .expired-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  #dashboardPage .reference-ranking-list {
    max-height: 390px;
    padding-right: 4px;
  }

  #dashboardPage .bar-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(58px, .75fr) 44px;
    gap: 7px;
  }

  #dashboardPage .bar-row > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #appView .kpi-grid,
  #appView .monitor-kpi-grid,
  #appView .backup-summary-grid,
  #appView .agenda-summary-grid,
  #appView .master-summary-grid,
  #appView .mini-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  #appView .form-grid,
  #appView #userForm,
  dialog .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #appView .top-actions,
  #appView .dialog-actions,
  #appView .records-actions,
  #appView .backup-actions,
  #appView .monitor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #appView .top-actions .button,
  #appView .dialog-actions .button,
  #appView .records-actions .button,
  #appView .backup-actions .button,
  #appView .monitor-actions .button {
    width: 100%;
  }

  #appView footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  #appView .toast {
    right: 12px;
    bottom: 78px;
    left: 12px;
    max-width: none;
  }
}

/* Evita animações abruptas para usuários que preferem menos movimento. */
@media (prefers-reduced-motion: reduce) {
  #appView .content,
  #appView .panel,
  #appView .button,
  #appView input,
  #appView select,
  #appView textarea,
  #appView .reference-dashboard-grid,
  #appView .reference-filters {
    transition: none !important;
  }
}
/* CVDB RESPONSIVE SYSTEM V1.3.18 END */

/* Agenda inteligente 1.5.0 — automações, conflitos, histórico e integrações */
.agenda-top-actions {
  position: absolute;
  top: 42px;
  right: clamp(20px, 3vw, 52px);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.agenda-top-actions .button { min-height: 42px; }
.agenda-notification-button { position: relative; }
.notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff5b67;
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
}

.agenda-filter-panel {
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(150px, .75fr)) auto;
}
.agenda-drag-hint {
  margin-left: auto;
  color: #6f88a4;
  font-size: .65rem;
}

.agenda-event { position: relative; cursor: grab; }
.agenda-event:active { cursor: grabbing; }
.agenda-event.dragging { opacity: .35; transform: scale(.98); }
.agenda-event em {
  grid-column: 1 / -1;
  justify-self: end;
  color: #9cb1c8;
  font-size: .5rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}
.agenda-event.compact em { display: none; }
.agenda-day.drag-over,
.agenda-week-day.drag-over {
  background: rgba(43, 220, 150, .12) !important;
  box-shadow: inset 0 0 0 2px rgba(43, 220, 150, .65) !important;
}

.agenda-priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(132, 149, 173, .24);
  border-radius: 999px;
  color: #aebed0;
  background: rgba(132, 149, 173, .10);
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
}
.agenda-priority-pill.priority-baixa,
.priority-baixa .agenda-priority-pill { color: #aebed0; border-color: rgba(132, 149, 173, .26); background: rgba(132, 149, 173, .10); }
.agenda-priority-pill.priority-normal,
.priority-normal .agenda-priority-pill { color: #8fc5ff; border-color: rgba(85, 167, 255, .28); background: rgba(85, 167, 255, .11); }
.agenda-priority-pill.priority-alta,
.priority-alta .agenda-priority-pill { color: #ffc47e; border-color: rgba(255, 171, 76, .32); background: rgba(255, 171, 76, .12); }
.agenda-priority-pill.priority-urgente,
.priority-urgente .agenda-priority-pill { color: #ff929b; border-color: rgba(255, 91, 103, .38); background: rgba(255, 91, 103, .14); }
.agenda-upcoming-item.priority-urgente { border-left: 3px solid #ff5b67; padding-left: 9px; }
.agenda-upcoming-item.priority-alta { border-left: 3px solid #ffab4c; padding-left: 9px; }

.agenda-unscheduled-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.checkbox-field.compact { min-height: 38px; padding: 8px 10px; }
.agenda-unscheduled-list {
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: rgba(85, 167, 255, .55) rgba(7, 23, 41, .35);
}
.agenda-unscheduled-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
}
.agenda-unscheduled-item > div:nth-of-type(1) { min-width: 0; display: grid; gap: 4px; }
.agenda-batch-checkbox { margin: 0; padding: 0; }
.agenda-batch-checkbox input { width: 18px; height: 18px; accent-color: #2bdc96; }

.agenda-checker-load-panel { margin-top: 16px; padding: 20px; }
.agenda-checker-load-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.agenda-checker-load-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 23, 41, .34);
}
.agenda-checker-load-card > div:first-child { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.agenda-checker-load-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-checker-load-card span,
.agenda-checker-load-card small { color: var(--muted); font-size: .68rem; }
.agenda-load-bar { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(76, 111, 146, .22); }
.agenda-load-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2bdc96, #4ed9ed); }
.agenda-checker-load-card.medium .agenda-load-bar i { background: linear-gradient(90deg, #55a7ff, #4ed9ed); }
.agenda-checker-load-card.high .agenda-load-bar i { background: linear-gradient(90deg, #ffab4c, #ff5b67); }

.agenda-history-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.agenda-history-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.agenda-history-heading small { color: var(--muted); }
.agenda-history-timeline { display: grid; gap: 0; max-height: 280px; overflow-y: auto; padding-right: 5px; }
.agenda-history-item { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 0 0 15px; }
.agenda-history-item::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: -1px; width: 1px; background: var(--line); }
.agenda-history-item:last-child::before { display: none; }
.agenda-history-item > i { width: 15px; height: 15px; margin-top: 2px; border: 3px solid #10233a; border-radius: 999px; background: #55a7ff; box-shadow: 0 0 0 1px rgba(85, 167, 255, .35); }
.agenda-history-item div { min-width: 0; }
.agenda-history-item p { margin: 4px 0; color: #c2d1e1; line-height: 1.4; }
.agenda-history-item small { color: var(--muted); }
.agenda-calendar-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.agenda-conflict-card { width: min(680px, calc(100vw - 28px)); }
.agenda-conflict-list { display: grid; gap: 9px; max-height: 360px; overflow-y: auto; }
.agenda-conflict-item { display: grid; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 23, 41, .36); }
.agenda-conflict-item span,
.agenda-conflict-item small { color: var(--muted); }
.agenda-conflict-item.danger { border-color: rgba(255, 91, 103, .35); background: rgba(255, 91, 103, .07); }
.agenda-conflict-item.warning { border-color: rgba(255, 171, 76, .35); background: rgba(255, 171, 76, .07); }

.agenda-notifications-card { width: min(760px, calc(100vw - 28px)); }
.agenda-notifications-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.agenda-notifications-list { display: grid; gap: 9px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.agenda-notification-item { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 23, 41, .35); }
.agenda-notification-item.unread { box-shadow: inset 3px 0 0 #55a7ff; }
.agenda-notification-item.severity-warning { box-shadow: inset 3px 0 0 #ffab4c; }
.agenda-notification-item.severity-critical { box-shadow: inset 3px 0 0 #ff5b67; }
.agenda-notification-item.read { opacity: .7; }
.agenda-notification-main { flex: 1; min-width: 0; display: grid; gap: 4px; border: 0; padding: 0; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.agenda-notification-main p { margin: 0; color: #c1cede; }
.agenda-notification-main small { color: var(--muted); }

@media (max-width: 1500px) {
  .agenda-filter-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agenda-filter-search { grid-column: span 2; }
  .agenda-filter-actions { justify-content: flex-end; }
}

@media (max-width: 1100px) {
  .agenda-top-actions { position: static; justify-content: stretch; margin: 12px 0 16px; }
  .agenda-top-actions .button { flex: 1 1 180px; }
  .agenda-unscheduled-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .agenda-unscheduled-actions { grid-column: 2 / -1; justify-content: flex-end; }
}

@media (max-width: 760px) {
  .agenda-filter-panel { grid-template-columns: 1fr 1fr; }
  .agenda-filter-panel > *, .agenda-filter-search, .agenda-filter-actions { grid-column: auto; }
  .agenda-filter-search, .agenda-filter-actions { grid-column: 1 / -1; }
  .agenda-unscheduled-toolbar { width: 100%; justify-content: stretch; }
  .agenda-unscheduled-toolbar > * { flex: 1 1 180px; }
  .agenda-unscheduled-item { grid-template-columns: auto minmax(0, 1fr); }
  .agenda-unscheduled-item .agenda-priority-pill { grid-column: 2; }
  .agenda-unscheduled-actions { grid-column: 1 / -1; }
  .agenda-history-heading { align-items: flex-start; flex-direction: column; }
  .agenda-notifications-toolbar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 520px) {
  .agenda-top-actions { display: grid; grid-template-columns: 1fr; }
  .agenda-filter-panel { grid-template-columns: 1fr; }
  .agenda-filter-panel > *, .agenda-filter-search, .agenda-filter-actions { grid-column: auto; }
  .agenda-calendar-actions,
  .agenda-calendar-actions .button { width: 100%; }
  .agenda-notification-item { align-items: stretch; flex-direction: column; }
}

/* CVDB 1.5.1 — confirmação segura para substituição da base */
.import-replace-confirmation {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 90, 105, .28);
  border-radius: 14px;
  background: rgba(255, 90, 105, .045);
}
.import-replace-confirmation.hidden { display: none !important; }
.import-replace-confirmation .notice {
  display: grid;
  gap: 5px;
  margin-top: 0;
}
.import-replace-confirmation .notice strong { color: #ffd3d9; }
.import-replace-confirmation .notice span { color: #c9d6e5; }
#importReplaceConfirmationInput[aria-invalid="true"]:not(:placeholder-shown) {
  border-color: rgba(255, 90, 105, .72);
  box-shadow: 0 0 0 3px rgba(255, 90, 105, .09);
}
#importReplaceConfirmationInput[aria-invalid="false"] {
  border-color: rgba(43, 220, 150, .62);
  box-shadow: 0 0 0 3px rgba(43, 220, 150, .08);
}
.import-confirmation-status {
  display: block;
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
}
.import-confirmation-status.is-valid { color: #63e6b4; }
.import-confirmation-status.is-invalid { color: #ff9aa5; }
#importSubmit:disabled {
  cursor: not-allowed;
  opacity: .55;
  filter: saturate(.65);
}


/* CVDB Agenda Operational Intelligence v1.6.0 */
.agenda-priority-center-panel,
.agenda-capacity-map-panel,
.agenda-checker-quality-panel { margin-top: 16px; }
.agenda-priority-center {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.agenda-priority-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 18, 34, .48);
}
.agenda-priority-item.score-critical { border-color: rgba(255, 90, 105, .5); }
.agenda-priority-item.score-high { border-color: rgba(255, 171, 76, .4); }
.agenda-priority-item > div:first-child { min-width: 0; }
.agenda-priority-item strong,
.agenda-priority-item small { display: block; }
.agenda-priority-item strong { margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-priority-item small { margin-top: 4px; color: var(--muted); }
.agenda-priority-issue { color: #72b7ff; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.agenda-priority-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }

.agenda-capacity-map { overflow: auto; max-height: 440px; }
.agenda-capacity-table { min-width: 900px; width: 100%; border-collapse: separate; border-spacing: 5px; }
.agenda-capacity-table th,
.agenda-capacity-table td { padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 18, 32, .55); text-align: center; }
.agenda-capacity-table th:first-child { position: sticky; left: 0; z-index: 2; min-width: 170px; text-align: left; background: var(--panel); }
.agenda-capacity-table th small,
.agenda-capacity-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.agenda-capacity-table td.capacity-moderate { border-color: rgba(83, 168, 255, .4); background: rgba(83, 168, 255, .08); }
.agenda-capacity-table td.capacity-full { border-color: rgba(255, 171, 76, .55); background: rgba(255, 171, 76, .11); }
.agenda-capacity-table td.capacity-over { border-color: rgba(255, 90, 105, .65); background: rgba(255, 90, 105, .13); }

.agenda-checker-duplicates { display: grid; gap: 9px; }
.agenda-checker-duplicate-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,18,32,.42); }
.agenda-checker-duplicate-item > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.agenda-checker-duplicate-item span,
.agenda-checker-duplicate-item small { color: var(--muted); }

.input-action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.input-action-row > input { min-width: 0; }
.input-action-row > .button { min-height: 46px; }
.form-inline-action { display: flex; align-items: end; }
.form-hint { align-self: end; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 11px; }
.agenda-checker-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agenda-checker-suggestion { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,18,32,.55); color: var(--text); text-align: left; cursor: pointer; }
.agenda-checker-suggestion:hover { border-color: var(--accent); }
.agenda-checker-suggestion.has-conflict { border-color: rgba(255,90,105,.45); }
.agenda-checker-suggestion strong,
.agenda-checker-suggestion span,
.agenda-checker-suggestion small { display: block; }
.agenda-checker-suggestion span { color: var(--accent); font-size: 11px; }
.agenda-checker-suggestion small { margin-top: 3px; color: var(--muted); }

.agenda-batch-preview-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.agenda-batch-preview { margin-top: 10px; max-height: 300px; overflow: auto; }
.agenda-batch-preview-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.agenda-batch-preview-table th,
.agenda-batch-preview-table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; }
.agenda-batch-preview-table tr.has-conflict { background: rgba(255,90,105,.08); }
.agenda-batch-preview-table tr.has-warning { background: rgba(255,171,76,.08); }
.agenda-batch-preview-table tr.is-valid { background: rgba(43,220,150,.05); }

.agenda-preparation-section,
.agenda-attachments-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.agenda-preparation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.agenda-preparation-grid .checkbox-field { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,18,32,.42); }
.agenda-attachment-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 8px; align-items: end; margin: 12px 0; }
.agenda-attachments-list { display: grid; gap: 8px; }
.agenda-attachment-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,18,32,.42); }
.agenda-attachment-item strong,
.agenda-attachment-item small { display: block; }
.agenda-attachment-item small { margin-top: 3px; color: var(--muted); }
.agenda-attachment-item > div:last-child { display: flex; gap: 6px; }

@media (max-width: 1100px) {
  .agenda-priority-center { grid-template-columns: 1fr; }
  .agenda-checker-suggestions { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .agenda-preparation-grid { grid-template-columns: 1fr; }
  .agenda-attachment-form { grid-template-columns: 1fr; }
  .agenda-attachment-item,
  .agenda-checker-duplicate-item { align-items: stretch; flex-direction: column; }
  .input-action-row { grid-template-columns: 1fr; }
}
.agenda-checker-manual-merge { display:grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap:10px; align-items:end; margin-bottom:14px; }
@media (max-width:720px){ .agenda-checker-manual-merge{grid-template-columns:1fr;} }

/* CVDB Agenda Capacity Header Fix v1.6.2 START */
.agenda-priority-center-panel,
.agenda-capacity-map-panel,
.agenda-checker-quality-panel {
  position: relative;
  margin-top: 18px;
  padding: clamp(18px, 1.7vw, 24px);
  overflow: hidden;
  border-color: rgba(43, 220, 150, .16);
  background: linear-gradient(180deg, rgba(18, 40, 64, .97), rgba(12, 29, 48, .97));
}

.agenda-priority-center-panel::before,
.agenda-capacity-map-panel::before,
.agenda-checker-quality-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  width: 78px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(43, 220, 150, .88), rgba(78, 217, 237, .34));
}

.agenda-priority-center-panel > .panel-heading,
.agenda-checker-quality-panel > .panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
}

/*
 * Cabeçalho exclusivo do Mapa de Capacidade.
 * A descrição permanece na metade esquerda e o controle começa depois
 * do centro do painel, sem sobrepor o título em monitores largos.
 */
.agenda-capacity-map-panel > .panel-heading {
  display: grid;
  grid-template-columns: minmax(320px, 46%) minmax(320px, 1fr);
  align-items: start;
  column-gap: clamp(34px, 6vw, 96px);
  row-gap: 14px;
  margin: 0 0 18px;
}

.agenda-priority-center-panel > .panel-heading > div:first-child,
.agenda-capacity-map-panel > .panel-heading > div:first-child,
.agenda-checker-quality-panel > .panel-heading > div:first-child {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.agenda-capacity-map-panel > .panel-heading > div:first-child {
  grid-column: 1;
  max-width: 620px;
  align-self: start;
}

.agenda-priority-center-panel .panel-heading .eyebrow,
.agenda-capacity-map-panel .panel-heading .eyebrow,
.agenda-checker-quality-panel .panel-heading .eyebrow {
  margin: 0;
  color: #67dfb2;
  line-height: 1.2;
  letter-spacing: .1em;
}

.agenda-priority-center-panel .panel-heading h3,
.agenda-capacity-map-panel .panel-heading h3,
.agenda-checker-quality-panel .panel-heading h3 {
  margin: 0;
  color: #f1f7ff;
  font-size: clamp(18px, 1.35vw, 22px);
  line-height: 1.25;
  letter-spacing: -.02em;
}

.agenda-capacity-map-panel .panel-heading h3 {
  max-width: none;
  white-space: nowrap;
}

.agenda-priority-center-panel .panel-heading .section-description,
.agenda-capacity-map-panel .panel-heading .section-description,
.agenda-checker-quality-panel .panel-heading .section-description {
  max-width: 72ch;
  margin: 0;
  color: #91a6bd;
  font-size: 12px;
  line-height: 1.5;
}

.agenda-capacity-map-panel > .panel-heading .checkbox-field {
  grid-column: 2;
  align-self: start;
  justify-self: stretch;
  width: 100%;
  max-width: none;
  min-height: 44px;
  margin: 8px 0 0;
  padding: 10px 14px;
  border-color: rgba(43, 220, 150, .16);
  background: rgba(43, 220, 150, .045);
}

.agenda-capacity-map-panel > .panel-heading .checkbox-field:hover {
  border-color: rgba(43, 220, 150, .30);
  background: rgba(43, 220, 150, .065);
}

.agenda-priority-center-panel #agendaPriorityRefresh {
  flex: 0 0 auto;
  min-height: 42px;
  border-color: rgba(43, 220, 150, .19);
}

.agenda-priority-center {
  gap: 12px;
  max-height: 390px;
  padding: 2px 5px 2px 0;
}

.agenda-priority-item {
  gap: 9px 12px;
  padding: 15px;
  border-radius: 14px;
  background: rgba(5, 18, 32, .52);
}

.agenda-priority-item strong {
  margin-top: 5px;
  line-height: 1.25;
}

.agenda-priority-item small {
  margin-top: 5px;
  line-height: 1.4;
}

.agenda-priority-actions { padding-top: 2px; }

.agenda-capacity-map {
  max-height: 420px;
  padding: 2px 2px 4px;
  border-radius: 13px;
}

.agenda-capacity-table { border-spacing: 7px; }

.agenda-capacity-table th,
.agenda-capacity-table td {
  padding: 11px 12px;
  line-height: 1.35;
}

.agenda-capacity-table td:not(.capacity-moderate):not(.capacity-full):not(.capacity-over) {
  border-color: rgba(43, 220, 150, .11);
  background: rgba(43, 220, 150, .025);
}

.agenda-checker-manual-merge {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(43, 220, 150, .11);
  border-radius: 14px;
  background: rgba(5, 18, 32, .34);
}

.agenda-checker-manual-merge label { gap: 7px; }
.agenda-checker-duplicates { gap: 10px; }

.agenda-checker-duplicate-item {
  min-height: 64px;
  padding: 14px 16px;
  border-color: rgba(148, 173, 207, .15);
  background: rgba(5, 18, 32, .42);
}

.agenda-checker-duplicate-item > div {
  gap: 6px 8px;
  line-height: 1.4;
}

.agenda-checker-duplicate-item strong { color: #eff6ff; }

.agenda-checker-duplicate-item .button:hover,
.agenda-priority-center-panel .button:hover,
.agenda-capacity-map-panel .button:hover {
  border-color: rgba(43, 220, 150, .42);
}

/* Em notebooks menores, o controle desce para uma segunda linha limpa. */
@media (max-width: 1100px) {
  .agenda-capacity-map-panel > .panel-heading {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  .agenda-capacity-map-panel > .panel-heading > div:first-child,
  .agenda-capacity-map-panel > .panel-heading .checkbox-field {
    grid-column: 1;
  }

  .agenda-capacity-map-panel .panel-heading h3 {
    white-space: normal;
  }

  .agenda-capacity-map-panel > .panel-heading .checkbox-field {
    width: 100%;
    margin-top: 4px;
  }
}

@media (max-width: 900px) {
  .agenda-priority-center-panel > .panel-heading,
  .agenda-checker-quality-panel > .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .agenda-priority-center-panel #agendaPriorityRefresh { width: 100%; }
}

@media (max-width: 640px) {
  .agenda-priority-center-panel,
  .agenda-capacity-map-panel,
  .agenda-checker-quality-panel {
    padding: 16px;
  }

  .agenda-priority-center {
    grid-template-columns: 1fr;
    max-height: 460px;
  }

  .agenda-priority-item { grid-template-columns: minmax(0, 1fr); }
  .agenda-priority-item > .agenda-priority-pill { justify-self: start; }
}
/* CVDB Agenda Capacity Header Fix v1.6.2 END */

/* CVDB Agenda Side Panel Height Fix v1.6.3 START */
/*
 * Em desktop, o painel lateral ocupa exatamente a mesma linha do calendário.
 * A rolagem permanece somente na lista, preservando as abas e o cabeçalho.
 */
@media (min-width: 1181px) {
  .agenda-main-grid {
    align-items: stretch;
  }

  .agenda-main-grid > .agenda-calendar-panel,
  .agenda-main-grid > .agenda-upcoming-panel {
    align-self: stretch;
    min-height: 0;
  }

  .agenda-main-grid > .agenda-upcoming-panel {
    height: auto;
    max-height: none;
    overflow: hidden;
  }

  .agenda-main-grid > .agenda-upcoming-panel .agenda-side-tabs,
  .agenda-main-grid > .agenda-upcoming-panel .agenda-side-heading {
    flex: 0 0 auto;
  }

  .agenda-main-grid > .agenda-upcoming-panel .agenda-upcoming-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}
/* CVDB Agenda Side Panel Height Fix v1.6.3 END */

/* CVDB Dashboard Indicator Sizing Fix 1.7.0-r10 START */
#dashboardPage .reference-stock-panel {
  padding-bottom: max(20px, var(--cvdb-fluid-panel-padding));
  overflow: hidden;
}

#dashboardPage .reference-stock-panel,
#dashboardPage .reference-found-panel {
  align-content: start;
}

#dashboardPage .reference-aging-grid,
#dashboardPage .reference-breakdown {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 520px) {
  #dashboardPage {
    --dashboard-indicator-card-height: 84px;
    --dashboard-indicator-card-padding: 9px 11px;
    --dashboard-indicator-value-size: 22px;
  }
}
/* CVDB Dashboard Indicator Sizing Fix 1.7.0-r10 END */

/* CVDB Ranking Compact Height Fix 1.7.0-r11 START */
@media (min-width: 1181px) {
  #dashboardPage .reference-ranking-panel {
    height: 480px;
    min-height: 480px;
    max-height: 480px;
    align-self: start;
    overflow: hidden;
  }

  #dashboardPage .reference-ranking-panel .panel-heading {
    flex: 0 0 auto;
    min-height: 0;
  }

  #dashboardPage .reference-ranking-list {
    flex: 0 0 auto;
    height: 362px;
    min-height: 0;
    max-height: 362px;
    margin-top: 14px;
    grid-auto-rows: 29px;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #dashboardPage .reference-ranking-list .bar-row {
    height: 29px;
    min-height: 29px;
  }
}
/* CVDB Ranking Compact Height Fix 1.7.0-r11 END */

/* CVDB Dashboard Alignment and Compact Ranking 1.7.0-r12 START */
@media (min-width: 1181px) {
  #dashboardPage {
    --dashboard-indicator-card-height: 82px;
    --dashboard-indicator-card-padding: 9px 11px;
    --dashboard-indicator-grid-gap: 7px;
  }

  #dashboardPage .reference-stock-panel,
  #dashboardPage .reference-found-panel,
  #dashboardPage .reference-ranking-panel {
    height: 480px;
    min-height: 480px;
    max-height: 480px;
    align-self: start;
    overflow: hidden;
  }

  #dashboardPage .reference-stock-main {
    min-height: 92px;
    padding: 6px 0 2px;
  }

  #dashboardPage .reference-aging-grid {
    margin-top: 8px;
  }

  #dashboardPage .reference-ranking-list {
    height: 288px;
    max-height: 288px;
    grid-auto-rows: 29px;
    gap: 8px;
  }
}
/* CVDB Dashboard Alignment and Compact Ranking 1.7.0-r12 END */

/* CVDB Users, Records and Ranking 1.7.0-r13 START */
@media (min-width: 1181px) {
  #dashboardPage .reference-ranking-list {
    height: 362px;
    max-height: 362px;
    grid-auto-rows: 29px;
    gap: 8px;
    overflow-y: auto;
  }
}

#recordsPage .records-only-panel table { min-width: 1540px; }
#recordsPage .record-expiry-days { font-weight: 800; color: var(--text); }
#recordsPage .record-expiry-days.expired { color: var(--red-soft); }

#profilePage .user-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
#profilePage .user-row-actions .danger-button:not(:disabled) {
  border-color: rgba(255, 93, 108, .36);
  background: rgba(255, 93, 108, .08);
}
#profilePage .user-row-actions .danger-button:not(:disabled):hover {
  border-color: rgba(255, 93, 108, .58);
  background: rgba(255, 93, 108, .15);
}
/* CVDB Users, Records and Ranking 1.7.0-r13 END */

/* CVDB Dashboard Export Header 1.7.0-r16 START */
#appView .topbar {
  align-items: flex-end;
  flex-wrap: wrap;
}
#appView .topbar-heading { min-width: 0; }
#appView .topbar .dashboard-export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  padding: 0 0 3px;
}
#appView .topbar .dashboard-export-actions > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
#appView .topbar .dashboard-export-actions .button {
  min-height: 36px;
  padding-inline: 14px;
  white-space: nowrap;
}
@media (max-width: 820px) {
  #appView .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  #appView .topbar .dashboard-export-actions {
    justify-content: flex-start;
    width: 100%;
    margin: 4px 0 0;
    padding: 0;
    flex-wrap: wrap;
  }
}
@media (max-width: 480px) {
  #appView .topbar .dashboard-export-actions {
    align-items: stretch;
  }
  #appView .topbar .dashboard-export-actions > span {
    flex-basis: 100%;
    margin: 0 0 2px;
  }
  #appView .topbar .dashboard-export-actions .button { flex: 1; }
}
/* CVDB Dashboard Export Header 1.7.0-r16 END */

/* CVDB Protected Export 1.7.0-r17 START */
#exportPasswordDialog { width: min(520px, calc(100% - 28px)); }
#exportPasswordDialog .export-password-field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}
#exportPasswordDialog .security-warning { line-height: 1.55; }
#exportPasswordDialog .form-error:empty { min-height: 0; margin-top: 0; }
/* CVDB Protected Export 1.7.0-r17 END */

/* r30 — listas oficiais por período (PIVOT N, Q:R e U:V). */
.system-pendency-tabs { flex-wrap: wrap; }
.audited-clients-table table { min-width: 980px; }
.audited-clients-table .system-pendency-qty { color: var(--green-soft); }
.audited-clients-total strong { color: var(--green-soft); }
.audited-clients-hero { border-color: rgba(39, 218, 141, .18); }


/* CVDB 1.7.0-r35 — correção segura de importações por cliente/período */
.inventory-reset-fields { margin-top: 4px; }
.inventory-reset-toolbar { display: flex; justify-content: flex-end; margin-top: 2px; }
.inventory-reset-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(85, 167, 255, .28);
  border-radius: 14px;
  background: rgba(85, 167, 255, .055);
}
.inventory-reset-preview > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(129, 162, 198, .14);
  border-radius: 11px;
  background: rgba(8, 24, 43, .45);
}
.inventory-reset-preview span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.inventory-reset-preview strong { overflow-wrap: anywhere; color: #eef7ff; }
.inventory-reset-preview p { grid-column: 1 / -1; margin: 0; color: #c9d6e5; font-size: 12px; }
#inventoryResetConfirmation[aria-invalid="true"]:not(:placeholder-shown) {
  border-color: rgba(255, 90, 105, .72);
  box-shadow: 0 0 0 3px rgba(255, 90, 105, .09);
}
#inventoryResetConfirmation[aria-invalid="false"] {
  border-color: rgba(43, 220, 150, .62);
  box-shadow: 0 0 0 3px rgba(43, 220, 150, .08);
}
@media (max-width: 760px) {
  .inventory-reset-preview { grid-template-columns: 1fr; }
  .inventory-reset-preview p { grid-column: auto; }
  .inventory-reset-toolbar, .inventory-reset-toolbar .button { width: 100%; }
}


/* CVDB Dashboard Equal Columns and Sidebar Height 1.7.0-r43 START */
#dashboardPage .reference-lower-row {
  grid-area: lower;
  display: grid;
  grid-template-columns: minmax(0, .675fr) minmax(0, .675fr) minmax(0, .78fr) minmax(0, .9fr);
  gap: var(--cvdb-fluid-gap, 12px);
  min-width: 0;
  margin: 0;
  align-items: stretch;
}

#dashboardPage .reference-lower-row > .panel {
  min-width: 0;
  min-height: 330px;
  height: 100%;
  padding: var(--cvdb-fluid-panel-padding, 18px);
  overflow: hidden;
  transition: border-color .24s ease, box-shadow .24s ease, transform .24s ease;
}

#dashboardPage .reference-lower-row .reference-segregated,
#dashboardPage .reference-lower-row .reference-not-found {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

#dashboardPage .reference-lower-row .reference-segregated .reference-breakdown,
#dashboardPage .reference-lower-row .reference-not-found .reference-breakdown {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--dashboard-indicator-grid-gap);
}

#dashboardPage .reference-lower-row .reference-family-panel {
  display: flex;
  flex-direction: column;
  border-color: rgba(85, 167, 255, .30);
}

#dashboardPage .reference-lower-row .reference-family-panel .panel-heading {
  flex: 0 0 auto;
}

#dashboardPage .reference-lower-row .reference-family-panel .family-bars {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 310px;
  margin-top: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

#dashboardPage .reference-lower-row .reference-expired .expired-panel-heading {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

#dashboardPage .reference-lower-row .reference-expired .reference-title-badge {
  max-width: 100%;
}

#dashboardPage .reference-lower-row .reference-expired .fixed-filter-chip {
  flex: 0 0 auto;
}

@media (min-width: 981px) {
  #dashboardPage .reference-percent-rail {
    min-height: 0;
  }

  #dashboardPage .reference-rail-kpis {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: repeat(5, minmax(0, 1fr));
  }

  #dashboardPage .reference-rail-kpis > div,
  #dashboardPage .reference-rail-kpis > .rail-kpi-action {
    display: flex;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
  }
}

@media (hover: hover) and (pointer: fine) {
  #dashboardPage .reference-lower-row .reference-family-panel:hover {
    border-color: rgba(85, 167, 255, .54);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18), 0 0 18px rgba(85, 167, 255, .11);
    transform: translateY(-2px);
  }
}

@media (min-width: 1181px) and (max-width: 1500px) {
  #dashboardPage .reference-lower-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 701px) and (max-width: 1180px) {
  #dashboardPage .reference-lower-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #dashboardPage .reference-lower-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* CVDB Dashboard Equal Columns and Sidebar Height 1.7.0-r43 END */

/* CVDB Expired Year Cards Style 1.7.0-r47 START */
#dashboardPage .reference-expired .fixed-filter-chip {
  display: none;
}

#dashboardPage .reference-expired .expired-year-carousel {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin-top: 18px;
  padding: 0 2px;
}

#dashboardPage .reference-expired .expired-year-viewport {
  display: grid;
  grid-template-rows: repeat(2, minmax(92px, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 10px) / 2);
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  padding: 2px;
}

#dashboardPage .reference-expired .expired-year-viewport::-webkit-scrollbar {
  display: none;
}

#dashboardPage .reference-expired .expired-year-card {
  display: flex;
  min-width: 0;
  min-height: 92px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  padding: 14px 13px;
  border: 1px solid rgba(148, 173, 207, .18);
  border-radius: 13px;
  background: rgba(8, 24, 41, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .018);
  scroll-snap-align: start;
}

#dashboardPage .reference-expired .expired-year-card span {
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .045em;
}

#dashboardPage .reference-expired .expired-year-card strong {
  color: var(--red-soft);
  font-size: clamp(28px, 2.15vw, 38px);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.035em;
}

#dashboardPage .reference-expired .expired-year-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(148, 173, 207, .25);
  border-radius: 999px;
  color: rgba(222, 238, 255, .88);
  background: rgba(8, 24, 41, .92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .24);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity .18s ease, border-color .18s ease, background .18s ease;
}

#dashboardPage .reference-expired .expired-year-nav-prev { left: -8px; }
#dashboardPage .reference-expired .expired-year-nav-next { right: -8px; }

#dashboardPage .reference-expired .expired-year-nav:hover:not(:disabled) {
  border-color: rgba(85, 167, 255, .52);
  background: rgba(16, 43, 70, .96);
}

#dashboardPage .reference-expired .expired-year-nav:disabled {
  opacity: .24;
  cursor: default;
}

#dashboardPage .reference-expired .expired-year-nav.hidden {
  display: none;
}

@media (max-width: 700px) {
  #dashboardPage .reference-expired .expired-year-viewport {
    grid-template-rows: repeat(2, minmax(86px, 1fr));
  }

  #dashboardPage .reference-expired .expired-year-card {
    min-height: 86px;
  }

  #dashboardPage .reference-expired .expired-year-card strong {
    font-size: 28px;
  }
}
/* CVDB Expired Year Cards Style 1.7.0-r47 END */

/* CVDB Dashboard Fixed Column Guides 1.7.0-r51 START */
/*
  Desktop: a grade externa continua exatamente igual à linha superior:
  150px | ESTOQUE | ENCONTRADOS | RANKING.

  Na linha inferior:
  - SEGREGADOS + ITENS NÃO ENCONTRADOS ocupam juntos somente a coluna do ESTOQUE;
  - VENCIDOS ocupa somente a coluna de ITENS ENCONTRADOS;
  - PORTFÓLIO ocupa somente a coluna do RANKING.
  Dessa forma, as bordas verticais coincidem rigorosamente entre as duas linhas.
*/
#dashboardPage .reference-lower-row {
  grid-area: lower;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--cvdb-fluid-gap, 12px);
  min-width: 0;
  margin: 0;
  align-items: stretch;
}

#dashboardPage .reference-lower-stock-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--cvdb-fluid-gap, 12px);
  min-width: 0;
  align-items: stretch;
}

#dashboardPage .reference-lower-stock-split > .panel,
#dashboardPage .reference-lower-row > .reference-expired,
#dashboardPage .reference-lower-row > .reference-family-panel {
  min-width: 0;
  min-height: 330px;
  height: 100%;
  padding: var(--cvdb-fluid-panel-padding, 18px);
  overflow: hidden;
  transition: border-color .24s ease, box-shadow .24s ease, transform .24s ease;
}

#dashboardPage .reference-lower-stock-split > .reference-segregated,
#dashboardPage .reference-lower-stock-split > .reference-not-found {
  width: 100%;
  display: flex;
  flex-direction: column;
}

#dashboardPage .reference-lower-stock-split .reference-breakdown {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--dashboard-indicator-grid-gap);
}

#dashboardPage .reference-lower-row > .reference-family-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
}

#dashboardPage .reference-lower-row > .reference-family-panel .family-bars {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

@media (min-width: 1501px) {
  #dashboardPage .reference-lower-row {
    display: contents;
  }

  #dashboardPage .reference-lower-stock-split {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: 100%;
    align-self: stretch;
  }

  #dashboardPage .reference-lower-row > .reference-expired {
    grid-column: 3;
    grid-row: 2;
    width: 100%;
    height: 100%;
    align-self: stretch;
  }

  #dashboardPage .reference-lower-row > .reference-family-panel {
    grid-column: 4;
    grid-row: 2;
    width: 100%;
    height: 100%;
    align-self: stretch;
  }
}

@media (min-width: 701px) and (max-width: 1500px) {
  #dashboardPage .reference-lower-stock-split {
    grid-column: 1 / -1;
  }

  #dashboardPage .reference-lower-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #dashboardPage .reference-lower-row,
  #dashboardPage .reference-lower-stock-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* CVDB Dashboard Fixed Column Guides 1.7.0-r51 END */

/* CVDB Security, Migration and Header Logo 1.7.0-r52 START */
#appView .topbar {
  position: relative;
}
#appView .dashboard-header-logo {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: auto;
  height: 46px;
  max-width: 128px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
  transform: translate(-50%, -50%);
}
.auditable-row-input {
  width: 100%;
  min-width: 170px;
  padding: 9px 10px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font: inherit;
}
.auditable-row-input:disabled {
  color: var(--text);
  opacity: 1;
  cursor: default;
  -webkit-text-fill-color: var(--text);
}
tr.is-editing .auditable-row-input {
  border-color: rgba(85, 167, 255, .52);
  background: rgba(7, 20, 35, .72);
  box-shadow: 0 0 0 2px rgba(85, 167, 255, .08);
}
.auditable-row-actions,
.system-pendency-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 300px;
}
.auditable-row-actions .button,
.system-pendency-actions .button {
  min-height: 34px;
  padding: 8px 10px;
  white-space: nowrap;
}
.pendency-origin {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
}
@media (max-width: 1100px) {
  #appView .dashboard-header-logo {
    height: 38px;
    max-width: 105px;
  }
}
@media (max-width: 820px) {
  #appView .dashboard-header-logo {
    display: none;
  }
}
/* CVDB Security, Migration and Header Logo 1.7.0-r52 END */

/* CVDB Agenda Owner Permissions 1.7.0-r53 START */
#agendaDialog .dialog-close,
#agendaDetailsDialog .dialog-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 93, 104, .42);
  border-radius: 999px;
  color: #ff7d86;
  background: rgba(255, 93, 104, .07);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
#agendaDialog .dialog-close:hover,
#agendaDetailsDialog .dialog-close:hover {
  color: #ff9aa1;
  border-color: rgba(255, 93, 104, .72);
  background: rgba(255, 93, 104, .13);
  transform: scale(1.04);
}
/* CVDB Agenda Owner Permissions 1.7.0-r53 END */


/* CVDB Minha conta limpa e centralizada 1.7.0-r56 START */
#passwordPage:not(.hidden) {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 170px);
  min-height: calc(100dvh - 170px);
  padding: clamp(22px, 4vh, 48px) 0;
}
#passwordPage .password-page-panel {
  width: min(100%, 760px);
  max-width: 760px;
  margin-inline: auto;
}
#passwordPage .account-password-heading {
  margin: 0 0 20px;
}
#passwordPage .account-password-heading h3 {
  margin: 0;
}
@media (max-width: 700px) {
  #passwordPage:not(.hidden) {
    min-height: 0;
    place-items: start stretch;
    padding: 20px 0 32px;
  }
  #passwordPage .password-page-panel {
    width: 100%;
  }
}
/* CVDB Minha conta limpa e centralizada 1.7.0-r56 END */

/* CVDB backup/restore resilience r57 START */
.restore-reconnect-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 12, 23, .88);
  backdrop-filter: blur(8px);
}
.restore-reconnect-overlay.hidden { display: none; }
.restore-reconnect-card {
  width: min(560px, 100%);
  padding: 32px;
  border: 1px solid rgba(85, 167, 255, .34);
  border-radius: 20px;
  background: #0e2138;
  text-align: center;
}
.restore-reconnect-card h2 { margin: 6px 0 12px; }
.restore-reconnect-card p:not(.eyebrow) { color: var(--text); }
.restore-reconnect-card small { display: block; margin-top: 10px; color: var(--muted); }
.restore-reconnect-card .button { margin-top: 20px; }
.restore-reconnect-spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 18px;
  border: 3px solid rgba(85, 167, 255, .18);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: restore-reconnect-spin .9s linear infinite;
}
@keyframes restore-reconnect-spin { to { transform: rotate(360deg); } }
/* CVDB backup/restore resilience r57 END */

/* CVDB r58 — estados dos serviços de backup e restauração */
.service-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.service-dot.running,
.service-dot.online {
  background: var(--green);
  box-shadow: 0 0 12px rgba(39, 218, 141, .55);
}
.service-dot.idle {
  background: var(--blue);
  box-shadow: 0 0 10px rgba(85, 167, 255, .40);
}
.service-dot.failed,
.service-dot.offline,
.service-dot.unavailable {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 93, 104, .38);
}
.service-item b.running,
.service-item b.online { color: var(--green); }
.service-item b.idle { color: var(--blue); }
.service-item b.failed,
.service-item b.offline,
.service-item b.unavailable { color: var(--red); }

/* ========================================================================
   Agenda profissional r62
   ======================================================================== */
.agenda-permission-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(87, 166, 255, .32);
  border-radius: 12px;
  background: rgba(35, 104, 172, .12);
}
.agenda-permission-banner strong { color: var(--text); }
.agenda-permission-banner span { color: var(--muted); text-align: right; }
.agenda-permission-banner.readonly { border-color: rgba(255, 190, 80, .38); background: rgba(174, 111, 20, .12); }
.agenda-permission-banner.readonly strong { color: #ffd477; }
.agenda-owner-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin: 4px 0 0 7px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(130, 177, 230, .28);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.4;
}
.agenda-owner-badge.mine { color: #5de6b5; border-color: rgba(49, 215, 158, .35); }
.agenda-owner-badge.readonly { color: #ffd477; border-color: rgba(255, 190, 80, .4); }
.agenda-readonly-label { color: #ffc964; font-size: 11px; white-space: nowrap; }
.agenda-row-readonly { background: rgba(255, 190, 80, .025); }
.agenda-event.is-readonly, .agenda-hourly-event.is-readonly { cursor: pointer; opacity: .88; border-style: dashed; }
.agenda-event.is-readonly::after { content: "🔒"; margin-left: auto; font-size: 10px; }

.agenda-hourly-week {
  --agenda-hour-height: 63px;
  min-width: 1050px;
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(132px, 1fr));
  grid-template-rows: 54px auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(3, 17, 34, .34);
}
.agenda-hourly-corner, .agenda-hourly-day-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 54px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #0d2138;
}
.agenda-hourly-corner { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.agenda-hourly-day-header span { color: var(--muted); text-transform: capitalize; font-size: 11px; }
.agenda-hourly-day-header strong { font-size: 18px; }
.agenda-hourly-day-header button {
  width: 25px; height: 25px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--accent); cursor: pointer;
}
.agenda-hourly-day-header.today { box-shadow: inset 0 -2px #39dba3; }
.agenda-hour-labels { grid-column: 1; grid-row: 2; background: rgba(5, 20, 36, .8); }
.agenda-hour-label {
  height: var(--agenda-hour-height);
  padding: 4px 7px 0 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid rgba(83, 125, 169, .16);
  color: var(--muted); font-size: 10px; text-align: right;
}
.agenda-hourly-column {
  position: relative; grid-row: 2; min-height: calc(var(--agenda-hour-height) * 13);
  border-right: 1px solid var(--border); outline: none;
}
.agenda-hourly-column:nth-of-type(2) { grid-column: 2; }
.agenda-hourly-column:nth-of-type(3) { grid-column: 3; }
.agenda-hourly-column:nth-of-type(4) { grid-column: 4; }
.agenda-hourly-column:nth-of-type(5) { grid-column: 5; }
.agenda-hourly-column:nth-of-type(6) { grid-column: 6; }
.agenda-hourly-column:nth-of-type(7) { grid-column: 7; }
.agenda-hourly-column:nth-of-type(8) { grid-column: 8; }
.agenda-hourly-column.today { background: rgba(34, 161, 121, .035); }
.agenda-hourly-column:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.agenda-hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(83, 125, 169, .16); pointer-events: none; }
.agenda-hourly-event {
  position: absolute; left: 4px; right: 4px; z-index: 2; display: flex; flex-direction: column;
  overflow: hidden; padding: 5px 7px; border: 1px solid rgba(89, 166, 245, .38);
  border-radius: 8px; background: rgba(21, 67, 111, .94); color: var(--text); text-align: left; cursor: pointer;
}
.agenda-hourly-event time { color: #89c4ff; font-size: 10px; }
.agenda-hourly-event strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.agenda-hourly-event small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.agenda-hourly-event.completed { border-color: rgba(49, 215, 158, .55); background: rgba(13, 94, 73, .94); }
.agenda-hourly-event.cancelled { border-color: rgba(255, 102, 123, .45); background: rgba(90, 36, 48, .9); }
.agenda-week-calendar { overflow-x: auto; }

.agenda-preparation-item {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(4, 18, 34, .38);
}
.agenda-preparation-item input { width: 18px; height: 18px; }
.agenda-preparation-item span { display: flex; flex-direction: column; gap: 3px; }
.agenda-preparation-item small { color: var(--muted); }
.agenda-preparation-item.required { border-left: 3px solid #ffbd57; }
.agenda-execution-section, .agenda-series-section {
  padding-top: 16px; border-top: 1px solid var(--border);
}
.compact-grid { gap: 10px; }

.agenda-coverage-summary {
  display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px;
}
.agenda-coverage-summary article {
  display: flex; flex-direction: column; gap: 5px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(5, 20, 37, .45);
}
.agenda-coverage-summary span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.agenda-coverage-summary strong { font-size: 22px; }
.agenda-coverage-list, .agenda-availability-list { display: grid; gap: 8px; }
.agenda-coverage-item, .agenda-availability-item, .agenda-checklist-template-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: rgba(5, 20, 37, .42);
}
.agenda-coverage-item div, .agenda-availability-item div, .agenda-checklist-template-card div { display: flex; flex-direction: column; gap: 4px; }
.agenda-coverage-item small, .agenda-availability-item small, .agenda-checklist-template-card small { color: var(--muted); }
.agenda-availability-item.type-vacation, .agenda-availability-item.type-leave { border-left: 3px solid #ffbd57; }
.agenda-availability-item.type-blocked { border-left: 3px solid #ff667b; }
.agenda-availability-item.type-available { border-left: 3px solid #39dba3; }

#agendaChecklistTemplatesDialog {
  width: min(1040px, calc(100vw - 28px));
}
.agenda-checklist-dialog-card {
  width: 100%;
  max-height: min(860px, calc(100vh - 28px));
  overflow: auto;
}
.agenda-checklist-manager-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
  gap: 16px;
  align-items: start;
}
.agenda-checklist-template-form,
.agenda-checklist-library {
  min-width: 0;
}
.agenda-checklist-template-form {
  display: grid;
  gap: 18px;
  padding: 18px;
}
.agenda-checklist-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.agenda-checklist-name-field {
  grid-column: 1 / -1;
}
.agenda-checklist-field {
  display: grid !important;
  gap: 7px !important;
  min-width: 0;
  margin: 0 !important;
  white-space: normal !important;
}
.agenda-checklist-field > span,
.agenda-checklist-item-description > span,
.agenda-checklist-deadline > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}
.agenda-checklist-field > input,
.agenda-checklist-field > select,
.agenda-checklist-item-description > input,
.agenda-checklist-deadline > select {
  width: 100%;
  min-width: 0;
  margin: 0 !important;
}
.agenda-checklist-items-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.agenda-checklist-section-title,
.agenda-checklist-library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.agenda-checklist-section-title h3,
.agenda-checklist-library-heading h3 {
  margin: 0;
  font-size: 16px;
}
.agenda-checklist-template-items,
.agenda-checklist-templates-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.agenda-checklist-editor-row {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(5, 20, 37, .30);
}
.agenda-checklist-item-description {
  display: grid !important;
  gap: 7px !important;
  min-width: 0;
  margin: 0 !important;
}
.agenda-checklist-item-controls {
  display: grid;
  grid-template-columns: minmax(130px, .9fr) minmax(130px, .9fr) minmax(165px, 1fr) auto;
  gap: 9px;
  align-items: end;
  min-width: 0;
}
.agenda-checklist-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0;
  min-height: 44px;
  margin: 0 !important;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(5, 20, 37, .32);
  white-space: nowrap !important;
  cursor: pointer;
}
.agenda-checklist-toggle input {
  flex: 0 0 auto;
  margin: 0 !important;
}
.agenda-checklist-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 10px;
  font-weight: 750;
}
.agenda-checklist-deadline {
  display: grid !important;
  gap: 7px !important;
  min-width: 0;
  margin: 0 !important;
}
.agenda-checklist-remove {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  align-self: end;
  font-size: 17px;
}
.agenda-checklist-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.agenda-checklist-library {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
}
.agenda-checklist-template-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(5, 20, 37, .35);
}
.agenda-checklist-template-summary {
  display: grid !important;
  gap: 4px !important;
  min-width: 0;
}
.agenda-checklist-template-summary strong,
.agenda-checklist-template-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agenda-checklist-template-summary small {
  color: var(--muted);
  font-size: 10px;
}
.agenda-checklist-template-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}
#agendaChecklistCustomAuditTypeField[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .agenda-checklist-manager-grid { grid-template-columns: 1fr; }
  .agenda-checklist-library { order: 2; }
}
@media (max-width: 680px) {
  #agendaChecklistTemplatesDialog { width: calc(100vw - 14px); }
  .agenda-checklist-fields-grid { grid-template-columns: 1fr; }
  .agenda-checklist-name-field { grid-column: 1; }
  .agenda-checklist-item-controls { grid-template-columns: 1fr 1fr; }
  .agenda-checklist-deadline { grid-column: 1 / -1; }
  .agenda-checklist-remove { grid-column: 2; justify-self: end; }
  .agenda-checklist-form-actions { flex-direction: column-reverse; }
  .agenda-checklist-form-actions .button { width: 100%; }
}
@media (max-width: 430px) {
  .agenda-checklist-item-controls { grid-template-columns: 1fr; }
  .agenda-checklist-deadline,
  .agenda-checklist-remove { grid-column: 1; }
  .agenda-checklist-remove { width: 100%; }
}

.agenda-batch-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.agenda-batch-kpis span { padding: 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); }
.agenda-batch-kpis b { display: block; color: var(--text); font-size: 20px; }

[data-view-agenda]:focus-visible, [data-agenda-date]:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #57aaff !important; outline-offset: 2px;
}

@media (max-width: 1180px) {
  .agenda-coverage-summary { grid-template-columns: repeat(3, 1fr); }
  .agenda-checklist-manager-grid { grid-template-columns: 1fr; }
  .agenda-checklist-editor-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-checklist-item-description { grid-column: 1 / -1; }
  .agenda-checklist-deadline { grid-column: 1 / 2; }
  .agenda-checklist-remove { grid-column: 2 / 3; justify-self: end; }
}
@media (max-width: 720px) {
  .agenda-permission-banner { align-items: flex-start; flex-direction: column; }
  .agenda-permission-banner span { text-align: left; }
  .agenda-coverage-summary { grid-template-columns: repeat(2, 1fr); }
  .agenda-coverage-item, .agenda-availability-item, .agenda-checklist-template-card { align-items: flex-start; flex-direction: column; }
  .agenda-details-card .agenda-details-actions, dialog .dialog-actions {
    position: sticky; bottom: -1px; z-index: 8; padding: 10px 0 2px;
    background: linear-gradient(180deg, rgba(9, 27, 47, 0), #091b2f 20%);
  }
  .agenda-details-actions .button, .agenda-calendar-actions .button { min-height: 44px; }
  .agenda-checklist-editor-row { grid-template-columns: 1fr; }
  .agenda-checklist-item-description, .agenda-checklist-deadline, .agenda-checklist-remove { grid-column: 1; }
  .agenda-checklist-remove { width: 100%; justify-self: stretch; }
  .agenda-checklist-form-actions { align-items: stretch; flex-direction: column; }
  .agenda-checklist-form-actions .button { width: 100%; }
  #agendaChecklistTemplatesDialog { width: calc(100vw - 16px); }
  .agenda-top-actions { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .agenda-top-actions .button { min-height: 42px; white-space: nowrap; }
}

/* CVDB r68 — Tarefas */
:root { --border: var(--line); }
.tasks-top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 16px;
}
.tasks-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.task-summary-card {
  min-height: 112px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 7px;
  text-align: left;
  cursor: pointer;
  border-top: 2px solid transparent;
}
.task-summary-card span { color: var(--muted); font-size: .78rem; }
.task-summary-card strong { font-size: clamp(1.7rem, 2.6vw, 2.45rem); line-height: 1; }
.task-summary-card small { color: var(--muted); }
.task-summary-card.active { border-color: #55a7ff; box-shadow: inset 0 0 0 1px rgba(85,167,255,.25); }
.task-summary-card.today { border-top-color: #46d7ca; }
.task-summary-card.overdue { border-top-color: #ff6574; }
.task-summary-card.progress { border-top-color: #aa81ff; }
.task-summary-card.completed { border-top-color: #2bdc96; }

.task-quick-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(150px, .65fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 16px;
}
.task-quick-panel label { min-width: 0; }
.task-search-field { grid-column: span 1; }
.task-quick-panel .task-filter-actions { display: flex; gap: 8px; }
.task-quick-add {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(89,125,161,.18);
}
.task-quick-add input { flex: 1; min-width: 0; }

.tasks-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
}
.tasks-main-panel { min-width: 0; padding: 16px; }
.tasks-view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.tasks-view-toolbar h3 { margin: 0; }
.task-view-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6,19,34,.42);
}
.task-view-switch button {
  border: 0;
  border-radius: 7px;
  padding: 8px 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.task-view-switch button.active { color: var(--text); background: rgba(85,167,255,.16); box-shadow: inset 0 0 0 1px rgba(85,167,255,.28); }

.task-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 12px;
  min-height: 480px;
  overflow-x: auto;
}
.task-column {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5,18,33,.34);
  transition: border-color .18s ease, background .18s ease;
}
.task-column.drag-over { border-color: #55a7ff; background: rgba(85,167,255,.08); }
.task-column > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 4px 11px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.task-column > header b { min-width: 25px; text-align: center; padding: 3px 7px; border-radius: 999px; background: rgba(85,167,255,.12); color: #8fc5ff; }
.task-column-list { display: grid; align-content: start; gap: 9px; }

.task-card {
  min-width: 0;
  border: 1px solid rgba(89,125,161,.25);
  border-left: 3px solid #55a7ff;
  border-radius: 12px;
  background: rgba(10,30,52,.86);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  transition: transform .16s ease, border-color .16s ease, opacity .16s ease;
}
.task-card:hover { transform: translateY(-1px); border-color: rgba(85,167,255,.45); }
.task-card.dragging { opacity: .38; }
.task-card.priority-urgente { border-left-color: #ff6574; }
.task-card.priority-alta { border-left-color: #ffab4c; }
.task-card.priority-normal { border-left-color: #55a7ff; }
.task-card.priority-baixa { border-left-color: #8495ad; }
.task-card.is-overdue { box-shadow: inset 0 0 0 1px rgba(255,101,116,.18), 0 8px 24px rgba(0,0,0,.12); }
.task-card-main {
  width: 100%;
  display: grid;
  gap: 9px;
  padding: 13px;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.task-card-main strong { font-size: .91rem; line-height: 1.3; overflow-wrap: anywhere; }
.task-card-main p { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card-top, .task-card-meta, .task-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card footer { padding: 9px 13px; border-top: 1px solid rgba(89,125,161,.16); color: var(--muted); font-size: .66rem; }
.task-category { color: #8fc5ff; font-size: .61rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.task-permission { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: .58rem; font-weight: 800; }
.task-permission.mine { color: #63e9b3; border-color: rgba(43,220,150,.24); background: rgba(43,220,150,.08); }
.task-permission.assigned { color: #ffc47e; border-color: rgba(255,171,76,.28); background: rgba(255,171,76,.08); }
.task-permission.readonly { color: #aebed0; }
.task-due { display: inline-flex; align-items: center; min-width: 0; color: var(--muted); font-size: .64rem; }
.task-due.overdue { color: #ff8d96; font-weight: 800; }
.task-due.today { color: #63e9b3; font-weight: 800; }
.task-priority { font-size: .61rem; font-weight: 800; }
.task-priority.priority-urgente { color: #ff8d96; }
.task-priority.priority-alta { color: #ffc47e; }
.task-priority.priority-normal { color: #8fc5ff; }
.task-priority.priority-baixa { color: #aebed0; }
.task-progress { height: 4px; border-radius: 999px; overflow: hidden; background: rgba(89,125,161,.18); }
.task-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#2bdc96,#46d7ca); }
.task-card-main > small { color: var(--muted); font-size: .61rem; }
.task-agenda-link { max-width: 58%; padding: 0; border: 0; color: #8fc5ff; background: transparent; font-size: .64rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }

.tasks-side-panel { display: grid; gap: 16px; }
.task-focus-panel, .task-upcoming-panel { padding: 16px; }
.task-side-heading { display: grid; gap: 3px; margin-bottom: 11px; }
.task-side-heading p { margin: 0; }
.task-side-heading h3 { margin: 0; }
.task-focus-list, .task-upcoming-list { display: grid; gap: 8px; }
.task-focus-item, .task-upcoming-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  color: inherit;
  background: rgba(5,20,37,.34);
  cursor: pointer;
}
.task-focus-item span, .task-upcoming-item span { color: #8fc5ff; font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.task-focus-item small { color: var(--muted); }
.task-focus-item.priority-urgente span { color: #ff8d96; }
.task-focus-item.priority-alta span { color: #ffc47e; }
.task-upcoming-item { grid-template-columns: 78px 1fr; align-items: center; }
.task-upcoming-item strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.task-list-scroll { max-height: 650px; overflow: auto; }
.task-table-title { display: grid; gap: 3px; min-width: 200px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.task-table-title small { color: var(--muted); }
.task-status-pill { display: inline-flex; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: .64rem; font-weight: 800; }
.task-status-pill.status-em-andamento { color: #c1a4ff; border-color: rgba(165,117,255,.28); background: rgba(165,117,255,.10); }
.task-status-pill.status-concluida { color: #63e9b3; border-color: rgba(43,220,150,.28); background: rgba(43,220,150,.10); }
.task-row-overdue { background: rgba(255,101,116,.04); }

.task-dialog-card { width: min(900px, calc(100vw - 28px)); }
.task-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.task-form-grid .span-2 { grid-column: 1 / -1; }
.task-step-editor { display: grid; gap: 8px; }
.task-step-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-step-editor-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.task-detail-card { width: min(780px, calc(100vw - 28px)); }
.task-detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.task-detail-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(5,20,37,.30); }
.task-detail-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.task-detail-description { margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); white-space: pre-wrap; }
.task-detail-section { margin-top: 15px; padding-top: 14px; border-top: 1px solid rgba(89,125,161,.18); }
.task-detail-section > header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.task-detail-steps { display: grid; gap: 7px; }
.task-detail-step { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 9px !important; margin: 0 !important; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5,20,37,.26); }
.task-detail-step input { margin: 0 !important; }
.task-detail-step.done span { text-decoration: line-through; color: var(--muted); }
.task-activity { display: grid; gap: 8px; }
.task-activity-item { display: grid; grid-template-columns: 10px 1fr; gap: 9px; align-items: start; }
.task-activity-item i { width: 8px; height: 8px; margin-top: 5px; border-radius: 999px; background: #55a7ff; }
.task-activity-item div { display: grid; gap: 2px; }
.task-activity-item span { color: var(--muted); font-size: .65rem; }

.agenda-linked-tasks-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(89,125,161,.18); }
.agenda-linked-tasks-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.agenda-linked-tasks-heading > div { display: flex; align-items: center; gap: 8px; }
.agenda-linked-task-count { display: inline-flex; min-width: 24px; justify-content: center; padding: 3px 7px; border-radius: 999px; color: #8fc5ff; background: rgba(85,167,255,.12); font-size: .62rem; }
.agenda-linked-tasks-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.agenda-linked-task { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: inherit; background: rgba(5,20,37,.28); text-align: left; cursor: pointer; }
.agenda-linked-task span { color: #8fc5ff; font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.agenda-linked-task small { color: var(--muted); }
.agenda-linked-task.done { opacity: .68; }

@media (max-width: 1280px) {
  .tasks-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .task-quick-panel { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .task-search-field { grid-column: span 2; }
  .task-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .tasks-workspace { grid-template-columns: 1fr; }
  .tasks-side-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .task-board { min-width: 860px; }
  #taskBoardView { overflow-x: auto; }
}
@media (max-width: 720px) {
  .tasks-top-actions { justify-content: stretch; }
  .tasks-top-actions .button { width: 100%; }
  .tasks-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .task-summary-card { min-height: 92px; }
  .task-quick-panel { grid-template-columns: 1fr; }
  .task-quick-add { flex-direction: column; }
  .task-search-field, .task-filter-actions { grid-column: auto; }
  .task-filter-actions { flex-direction: column; }
  .tasks-side-panel { grid-template-columns: 1fr; }
  .task-form-grid, .task-detail-grid { grid-template-columns: 1fr; }
  .task-form-grid .span-2 { grid-column: auto; }
  .agenda-linked-tasks-list { grid-template-columns: 1fr; }
  .task-upcoming-item { grid-template-columns: 70px 1fr; }
  .task-detail-card .dialog-actions { position: sticky; bottom: 0; padding-top: 10px; background: var(--panel); }
}

/* CVDB r70 — tarefas na Agenda e avisos acima de modais */
.toast {
  z-index: 2147483647;
}
.toast[popover] {
  inset: auto 22px 22px auto;
  width: min(420px, calc(100vw - 28px));
  margin: 0;
  color: var(--text);
}
.toast[popover]::backdrop { background: transparent; }
.toast.show { pointer-events: auto; }

.agenda-day.has-task-deadline {
  box-shadow: inset 0 -2px 0 rgba(166, 120, 255, .45);
}
.agenda-task-deadlines {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.agenda-task-deadlines.month { margin-top: 4px; }
.agenda-task-deadline-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  color: #e9e5ff;
  border: 1px solid rgba(166, 120, 255, .32);
  border-radius: 9px;
  background: rgba(116, 78, 190, .17);
  text-align: left;
  cursor: pointer;
}
.agenda-task-deadline-chip:hover,
.agenda-task-deadline-chip:focus-visible {
  border-color: rgba(177, 139, 255, .68);
  background: rgba(116, 78, 190, .28);
}
.agenda-task-deadline-chip.priority-alta,
.agenda-task-deadline-chip.priority-urgente {
  border-color: rgba(255, 157, 61, .48);
}
.agenda-task-deadline-chip.compact {
  gap: 5px;
  padding: 5px 6px;
  border-radius: 7px;
}
.agenda-task-deadline-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #c8b5ff;
  border-radius: 6px;
  background: rgba(166, 120, 255, .18);
  font-size: 11px;
  font-weight: 900;
}
.agenda-task-deadline-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.agenda-task-deadline-copy strong,
.agenda-task-deadline-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agenda-task-deadline-copy strong { font-size: 10px; }
.agenda-task-deadline-copy small { color: #b9addc; font-size: 8px; }
.agenda-task-deadline-more {
  color: #b9addc;
  font-size: 8px;
  font-weight: 750;
}
.agenda-task-week-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin-top: 3px;
  padding: 3px 7px;
  color: #e9e5ff;
  border: 1px solid rgba(166, 120, 255, .35);
  border-radius: 999px;
  background: rgba(116, 78, 190, .17);
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 900px) {
  .toast[popover] {
    right: 12px;
    bottom: 78px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

/* CVDB-R78-LOGIN-PASSWORD-EYE-BEGIN */
#loginView #loginForm .password-input-wrap {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 50px !important;
  line-height: 0 !important;
}
#loginView #loginForm .password-input-wrap #toggleLoginPassword {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  bottom: auto !important;
  width: 34px !important;
  height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translateY(calc(-50% - 3px)) !important;
}
#loginView #loginForm .password-input-wrap #toggleLoginPassword svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
}
/* CVDB-R78-LOGIN-PASSWORD-EYE-END */


/* CVDB Ranking Client Details 1.7.0-r84 START */
#dashboardPage .ranking-client-row {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
#dashboardPage .ranking-client-row .bar-track,
#dashboardPage .ranking-client-row .bar-fill { display: block; }
#dashboardPage .ranking-client-row .bar-track { width: 100%; }
#dashboardPage .ranking-client-row:hover > span:first-child,
#dashboardPage .ranking-client-row:hover > strong,
#dashboardPage .ranking-client-row:focus-visible > span:first-child,
#dashboardPage .ranking-client-row:focus-visible > strong { color: var(--blue); }
#dashboardPage .ranking-client-row:hover .bar-track,
#dashboardPage .ranking-client-row:focus-visible .bar-track { box-shadow: 0 0 0 1px rgba(85, 167, 255, .45); }
#dashboardPage .ranking-client-row:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 7px; }

.ranking-client-details { min-width: 0; }
.ranking-client-details-shell { padding: 22px; }
.ranking-client-details-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.ranking-client-details-heading h2 { margin: 2px 0 0; }
.ranking-client-details-heading .section-description { margin: 5px 0 0; }
.ranking-client-detail-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ranking-client-detail-kpis > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(6, 22, 39, .42); }
.ranking-client-detail-kpis span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.ranking-client-detail-kpis strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.ranking-client-detail-controls { display: grid; grid-template-columns: minmax(260px, 1.7fr) minmax(180px, .8fr) minmax(180px, .8fr) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.ranking-client-detail-controls label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.ranking-client-detail-controls input,
.ranking-client-detail-controls select { width: 100%; min-height: 43px; }
.ranking-client-detail-notice { margin: 0 0 12px; padding: 10px 12px; border: 1px solid rgba(85, 167, 255, .35); border-radius: 10px; color: #c9def8; background: rgba(85, 167, 255, .08); font-size: 12px; }
.ranking-client-detail-table-scroll { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; scrollbar-gutter: stable; }
.ranking-client-detail-table { width: 100%; min-width: 1640px; border-collapse: collapse; }
.ranking-client-detail-table thead { position: sticky; top: 0; z-index: 2; background: var(--panel); }
.ranking-client-detail-table th,
.ranking-client-detail-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 11px; }
.ranking-client-detail-table th { color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.ranking-client-detail-table td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-client-detail-table th button { padding: 0; border: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; background: transparent; cursor: pointer; }
.ranking-client-detail-table th button:hover,
.ranking-client-detail-table th button:focus-visible { color: var(--blue); }
.ranking-client-detail-table th button[data-sort-direction="asc"]::after { content: "  ↑"; color: var(--blue); }
.ranking-client-detail-table th button[data-sort-direction="desc"]::after { content: "  ↓"; color: var(--blue); }
.ranking-client-detail-table tbody tr:hover { background: rgba(85, 167, 255, .045); }
.ranking-detail-number { text-align: right; font-variant-numeric: tabular-nums; }
.ranking-client-detail-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.ranking-client-detail-pagination > div { display: flex; gap: 8px; }
@media (max-width: 980px) {
  .ranking-client-details-heading { flex-direction: column; }
  .ranking-client-detail-kpis { grid-template-columns: 1fr; }
  .ranking-client-detail-controls { grid-template-columns: 1fr; }
  .ranking-client-detail-pagination { align-items: stretch; flex-direction: column; }
}
/* CVDB Ranking Client Details 1.7.0-r84 END */
