﻿:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #0b1220;
  --muted: #5e716d;
  --line: #d8e5e2;
  --primary: #0f766e;
  --primary-strong: #0b1220;
  --danger: #b42318;
  --node: #ffffff;
  --node-alt: #e8f7f3;
  --radius: 8px;
  --font-xs: 12px;
  --font-sm: 13px;
  --font-md: 14px;
  --font-lg: 18px;
  --font-xl: 21px;
  --control-height: 36px;
  --control-pad-x: 10px;
  --control-pad-y: 8px;
  --control-gap: 8px;
  --panel-gap: 16px;
  --panel-pad: 14px;
  --toolbar-pad-y: 8px;
  --toolbar-pad-x: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-md);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.file-button {
  align-items: center;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-size: var(--font-sm);
  font-weight: 700;
  justify-content: center;
  line-height: 1.2;
  min-height: var(--control-height);
  padding: var(--control-pad-y) var(--control-pad-x);
  text-align: center;
  white-space: normal;
}

button:hover,
.file-button:hover {
  background: var(--primary-strong);
}

button.ghost,
.ghost {
  background: #e5f3f1;
  color: var(--primary-strong);
}

button.danger {
  background: #fff1f0;
  color: var(--danger);
}

button.active {
  background: #ccfbf1;
  color: var(--primary-strong);
  outline: 2px solid var(--primary);
}

.topbar {
  align-items: center;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  display: flex;
  gap: 24px;
  justify-content: flex-start;
  min-height: 76px;
  padding: 12px 18px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg,#0b1220,#0f766e 58%,#84cc16);
  border-radius: var(--radius);
  color: white;
  display: inline-flex;
  font-size: var(--font-md);
  font-weight: 800;
  height: 46px;
  justify-content: center;
  width: 46px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: var(--font-xl);
  gap: calc(var(--control-gap) - 2px);
}

.version-badge {
  background: #e5f3f1;
  border-radius: 999px;
  color: var(--primary-strong);
  font-size: var(--font-xs);
  font-weight: 800;
  padding: 3px 8px;
}

h2 {
  font-size: var(--font-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.brand p,
.hint,
#statusText {
  color: var(--muted);
  font-size: var(--font-sm);
}

.session-box {
  align-items: center;
  display: flex;
  gap: var(--control-gap);
  margin-left: auto;
}

.session-label {
  background: #f1f5f3;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: var(--font-xs);
  font-weight: 800;
  max-width: 220px;
  overflow: hidden;
  padding: 7px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-label.active {
  background: #e5f3f1;
  color: var(--primary-strong);
}

.session-select {
  min-height: var(--control-height);
  min-width: 190px;
  width: auto;
}

.menu-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--control-gap);
  justify-content: flex-start;
}

.menu {
  position: relative;
}

.menu-trigger {
  gap: 8px;
  min-width: 106px;
}

.cmd-icon {
  color: currentColor;
  display: inline-block;
  flex: 0 0 auto;
  height: 18px;
  position: relative;
  width: 18px;
}

.cmd-file,
.cmd-new,
.cmd-pdf {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.cmd-file::before,
.cmd-new::before,
.cmd-pdf::before {
  background: currentColor;
  content: "";
  height: 2px;
  left: 4px;
  position: absolute;
  top: 5px;
  width: 8px;
}

.cmd-file::after,
.cmd-pdf::after {
  background: currentColor;
  content: "";
  height: 2px;
  left: 4px;
  position: absolute;
  top: 10px;
  width: 10px;
}

.cmd-new::after {
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  content: "";
  height: 10px;
  left: 8px;
  position: absolute;
  top: 4px;
  width: 2px;
}

.cmd-new {
  box-shadow: inset 0 0 0 999px rgba(15, 118, 110, .05);
}

.cmd-new::before {
  height: 2px;
  left: 4px;
  top: 8px;
  width: 10px;
}

.cmd-open {
  border: 2px solid currentColor;
  border-radius: 3px 3px 4px 4px;
  height: 13px;
  margin-top: 3px;
}

.cmd-open::before {
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  content: "";
  height: 5px;
  left: 1px;
  position: absolute;
  top: -7px;
  width: 8px;
}

.cmd-save,
.cmd-save-as {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.cmd-save::before,
.cmd-save-as::before {
  background: currentColor;
  content: "";
  height: 5px;
  left: 3px;
  position: absolute;
  top: 2px;
  width: 9px;
}

.cmd-save::after,
.cmd-save-as::after {
  border: 2px solid currentColor;
  border-bottom: 0;
  content: "";
  height: 5px;
  left: 4px;
  position: absolute;
  top: 11px;
  width: 7px;
}

.cmd-save-as {
  color: #0f766e;
}

.cmd-edit::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 5px;
  left: 3px;
  position: absolute;
  top: 8px;
  transform: rotate(-35deg);
  width: 15px;
}

.cmd-edit::after {
  border-left: 5px solid currentColor;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  content: "";
  left: 1px;
  position: absolute;
  top: 10px;
  transform: rotate(-35deg);
}

.cmd-select {
  border: 2px dashed currentColor;
  border-radius: 3px;
}

.cmd-connect::before {
  background: currentColor;
  content: "";
  height: 2px;
  left: 2px;
  position: absolute;
  top: 8px;
  transform: rotate(28deg);
  width: 14px;
}

.cmd-connect::after {
  border-bottom: 4px solid transparent;
  border-left: 7px solid currentColor;
  border-top: 4px solid transparent;
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  transform: rotate(28deg);
}

.cmd-copy::before,
.cmd-duplicate::before,
.cmd-image::before {
  border: 2px solid currentColor;
  border-radius: 3px;
  content: "";
  height: 11px;
  left: 5px;
  position: absolute;
  top: 2px;
  width: 10px;
}

.cmd-copy::after,
.cmd-duplicate::after {
  border: 2px solid currentColor;
  border-radius: 3px;
  content: "";
  height: 11px;
  left: 1px;
  position: absolute;
  top: 6px;
  width: 10px;
}

.cmd-paste {
  border: 2px solid currentColor;
  border-radius: 3px;
  margin-top: 2px;
}

.cmd-paste::before {
  background: #ffffff;
  border: 2px solid currentColor;
  border-radius: 3px;
  content: "";
  height: 5px;
  left: 4px;
  position: absolute;
  top: -6px;
  width: 6px;
}

.cmd-duplicate::after {
  box-shadow: inset 5px 0 0 transparent;
}

.cmd-image::after {
  border-bottom: 6px solid currentColor;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  bottom: 3px;
  content: "";
  left: 4px;
  position: absolute;
}

.cmd-delete::before {
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
  content: "";
  height: 12px;
  left: 4px;
  position: absolute;
  top: 5px;
  width: 10px;
}

.cmd-delete::after {
  background: currentColor;
  box-shadow: 4px -3px 0 -1px currentColor;
  content: "";
  height: 2px;
  left: 2px;
  position: absolute;
  top: 3px;
  width: 14px;
}

.cmd-theme {
  border: 2px solid currentColor;
  border-radius: 50% 50% 45% 45%;
}

.cmd-theme::before {
  background: currentColor;
  border-radius: 50%;
  box-shadow: 6px 1px 0 currentColor, 3px 7px 0 currentColor;
  content: "";
  height: 3px;
  left: 4px;
  position: absolute;
  top: 4px;
  width: 3px;
}

.cmd-theme::after {
  background: #ffffff;
  border-radius: 50%;
  bottom: 1px;
  content: "";
  height: 5px;
  position: absolute;
  right: 1px;
  width: 5px;
}

.theme-dropdown button {
  grid-template-columns: 26px minmax(0, 1fr);
}

.theme-swatch {
  border: 2px solid var(--swatch-stroke);
  border-radius: 999px;
  box-shadow: inset 10px 0 0 var(--swatch-fill-1), inset -10px 0 0 var(--swatch-fill-2);
  height: 20px;
  width: 20px;
}

.swatch-sgi {
  --swatch-stroke: #0f766e;
  --swatch-fill-1: #e8f7f3;
  --swatch-fill-2: #f0fdf4;
}

.swatch-blue {
  --swatch-stroke: #2563eb;
  --swatch-fill-1: #dbeafe;
  --swatch-fill-2: #e0f2fe;
}

.swatch-amber {
  --swatch-stroke: #d97706;
  --swatch-fill-1: #fef3c7;
  --swatch-fill-2: #fed7aa;
}

.swatch-slate {
  --swatch-stroke: #475569;
  --swatch-fill-1: #f1f5f9;
  --swatch-fill-2: #e2e8f0;
}

.swatch-rose {
  --swatch-stroke: #be123c;
  --swatch-fill-1: #ffe4e6;
  --swatch-fill-2: #fff1f2;
}

.menu-dropdown {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  display: none;
  gap: 4px;
  min-width: 210px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.menu:hover .menu-dropdown,
.menu:focus-within .menu-dropdown {
  display: grid;
}

.menu-dropdown button {
  background: transparent;
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  justify-content: flex-start;
  min-height: 34px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.menu-dropdown kbd {
  background: #f1f5f3;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  white-space: nowrap;
}

.menu-dropdown button:hover,
.menu-dropdown button:focus {
  background: #e5f3f1;
  color: var(--primary-strong);
}

.canvas-menu {
  flex: 0 0 auto;
}

.canvas-menu .menu-dropdown {
  left: 0;
  right: auto;
}

.hidden-command-buttons {
  display: none !important;
}

.file-button input {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(360px, 1fr) 280px;
  height: calc(100vh - 76px);
  min-height: 620px;
}

.panel {
  background: var(--panel);
  border-color: var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
  overflow: auto;
  padding: var(--panel-pad);
}

.left-panel {
  border-right: 1px solid var(--line);
}

.right-panel {
  border-left: 1px solid var(--line);
}

.panel section {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
}

.panel section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tool-grid,
.action-grid {
  display: grid;
  gap: var(--control-gap);
  grid-template-columns: 1fr;
}

.compact-grid,
.action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.left-panel button {
  width: 100%;
}

.action-grid button,
.compact-grid button {
  font-size: var(--font-xs);
}
.shape-palette {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shape-card {
  align-items: center;
  background: #f8fffd;
  border: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 7px;
  min-height: 78px;
  padding: 8px 6px;
}

.shape-card:hover {
  background: #ecfdf8;
  border-color: #8dd8cd;
}

.shape-card span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.shape-icon {
  display: block;
  height: 34px;
  justify-self: center;
  position: relative;
  width: 58px;
}

.icon-terminator {
  background: #e8f7f3;
  border: 2px solid #0f766e;
  border-radius: 999px;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .14);
}

.icon-process {
  background: #ffffff;
  border: 2px solid #0f766e;
  border-radius: 5px;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .14);
}
.icon-subprocess {
  background: #ffffff;
  border: 2px solid #0f766e;
  border-radius: 5px;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .14);
}

.icon-subprocess::before,
.icon-subprocess::after {
  background: #0f766e;
  content: "";
  height: 25px;
  position: absolute;
  top: 4px;
  width: 2px;
}

.icon-subprocess::before {
  left: 10px;
}

.icon-subprocess::after {
  right: 10px;
}

.icon-data {
  background: #f0fdf4;
  border: 2px solid #0f766e;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .14);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}

.icon-decision::before {
  background: #fff7ed;
  border: 2px solid #f59e0b;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .12);
  content: "";
  height: 28px;
  left: 14px;
  position: absolute;
  top: 2px;
  transform: rotate(45deg);
  width: 28px;
}

.icon-document {
  background: #eff6ff;
  border: 2px solid #0f766e;
  border-radius: 5px 5px 12px 12px;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .14);
}

.icon-document::after {
  border-bottom: 2px solid #0f766e;
  border-radius: 50%;
  bottom: 3px;
  content: "";
  height: 12px;
  left: 7px;
  position: absolute;
  width: 44px;
}

.icon-text {
  border-bottom: 2px dashed #0f766e;
  color: #0f766e;
  font-size: 25px;
  font-weight: 900;
  line-height: 34px;
  text-align: center;
}

.icon-text::before {
  content: "T";
}

.stack-actions {
  display: grid;
  gap: var(--control-gap);
}

.wide {
  width: 100%;
}

.canvas-wrap {
  display: grid;
  position: relative;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.canvas-toolbar {
  align-items: center;
  background: #fbfefd;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  padding: var(--toolbar-pad-y) var(--toolbar-pad-x);
}

.workspace-tools {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: calc(var(--control-gap) - 2px);
  margin-left: auto;
}

.icon-button {
  min-width: var(--control-height);
  padding-left: 0;
  padding-right: 0;
}

.zoom-level {
  color: var(--muted);
  font-size: var(--font-sm);
  font-weight: 800;
  min-width: 48px;
  text-align: center;
}

#diagramTitle {
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  flex: 0 1 320px;
  font-size: var(--font-md);
  font-weight: 800;
  min-width: 180px;
  padding: var(--control-pad-y) var(--control-pad-x);
  width: min(320px, 30vw);
}

#diagramTitle:focus,
textarea:focus,
input:focus,
select:focus {
  border-color: var(--primary);
  outline: 3px solid #bce8e1;
}

#flowCanvas {
  background: #eef6f4;
  cursor: grab;
  height: 100%;
  min-height: 0;
  touch-action: none;
  width: 100%;
}

#flowCanvas:active {
  cursor: grabbing;
}
.canvas-wrap:fullscreen {
  background: #eef6f4;
  height: 100vh;
  width: 100vw;
}

.canvas-wrap:fullscreen .canvas-toolbar {
  background: rgba(255, 255, 255, .94);
}

.canvas-wrap:fullscreen #flowCanvas {
  height: calc(100vh - 54px);
}

.segmented-control {
  display: grid;
  gap: var(--control-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented-control button {
  font-size: var(--font-xs);
}

.check-row {
  align-items: center;
  display: flex;
  gap: var(--control-gap);
}

.check-row input {
  width: auto;
}

label {
  color: var(--muted);
  display: grid;
  font-size: var(--font-sm);
  font-weight: 700;
  gap: calc(var(--control-gap) - 2px);
}

textarea,
input,
select {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: var(--control-pad-y) var(--control-pad-x);
  width: 100%;
}

.node text {
  pointer-events: none;
  user-select: none;
}

.node-shape {
  cursor: grab;
  filter: url(#shadow);
  stroke: var(--node-stroke, #0f766e);
  stroke-width: 3;
}

.node.selected .node-shape {
  stroke: #f59e0b;
  stroke-width: 5;
}
.node-shape-detail {
  fill: none;
  pointer-events: none;
  stroke: var(--node-stroke, #0f766e);
  stroke-width: 3;
}

.node.selected .node-shape-detail {
  stroke: #f59e0b;
  stroke-width: 4;
}

.text-box-shape {
  filter: none;
  opacity: 0;
  stroke: transparent;
  stroke-dasharray: 8 6;
}

.node.selected .text-box-shape {
  opacity: 1;
  stroke: #f59e0b;
  stroke-width: 2;
}

.field-grid {
  display: grid;
  gap: var(--control-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logo-upload-grid {
  display: grid;
  gap: var(--control-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logo-upload {
  font-size: var(--font-xs);
  min-height: 34px;
}

.doc-header-box {
  fill: rgba(255, 255, 255, .94);
  stroke: #334155;
  stroke-width: 2;
}

.doc-header-line {
  stroke: #334155;
  stroke-width: 2;
}

.doc-header-company {
  fill: #111827;
  font-size: 34px;
  font-weight: 900;
}

.doc-header-document {
  fill: #111827;
  font-size: 28px;
  font-weight: 500;
}

.doc-header-logo {
  fill: #111827;
  font-size: 25px;
  font-weight: 900;
}

.doc-header-info {
  fill: #111827;
  font-size: 24px;
  font-weight: 700;
}

.doc-header-period {
  fill: #334155;
}

.doc-header-period-text {
  fill: #ffffff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .18em;
}

.watermark { fill: rgba(11,18,32,.46); font-size: 26px; font-weight: 800; letter-spacing: .01em; pointer-events: none; }

.watermark-overlay { background: rgba(255,255,255,.76); border: 1px solid rgba(216,229,226,.95); border-radius: 999px; bottom: 14px; color: rgba(11,18,32,.76); font-size: var(--font-xs); font-weight: 850; letter-spacing: 0; padding: 7px 11px; pointer-events: none; position: absolute; right: 14px; z-index: 2; box-shadow: 0 10px 24px rgba(16,24,40,.1); backdrop-filter: blur(10px); }

.lane-bg {
  fill: rgba(15, 118, 110, .06);
  pointer-events: none;
}

.lane-bg-1 {
  fill: rgba(15, 118, 110, .025);
  pointer-events: none;
}

.lane-line {
  pointer-events: none;
  stroke: rgba(15, 118, 110, .24);
  stroke-width: 2;
}

.lane-resize-handle {
  opacity: 0;
  pointer-events: stroke;
  stroke: #0f766e;
  stroke-linecap: round;
  stroke-width: 18;
}

.lane-resize-handle:hover {
  opacity: .28;
}

.lane-resize-vertical {
  cursor: col-resize;
}

.lane-resize-horizontal {
  cursor: row-resize;
}

.lane-label {
  fill: rgba(16, 32, 29, .52);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .04em;
  pointer-events: none;
  text-transform: uppercase;
}

.lane-label-vertical {
  dominant-baseline: hanging;
}

.selection-box {
  fill: rgba(15, 118, 110, .12);
  stroke: #0f766e;
  stroke-dasharray: 12 8;
  stroke-width: 3;
}

.edge {
  fill: none;
  marker-end: url(#arrow);
  stroke: #334155;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.edge.selected {
  stroke: #f59e0b;
}

.edge-anchor-group {
  cursor: crosshair;
}

.edge-anchor-hit {
  fill: transparent;
  pointer-events: all;
  stroke: transparent;
}

.edge-anchor {
  fill: #ffffff;
  pointer-events: none;
  stroke: #334155;
  stroke-width: 3;
}

.edge-anchor-group:hover .edge-anchor,
.edge-anchor-group.active .edge-anchor {
  fill: #fef3c7;
  stroke: #f59e0b;
  stroke-width: 4;
}

.owner {
  fill: #64748b;
  font-size: 18px;
  font-weight: 700;
}

.label {
  fill: #10201d;
  font-weight: 800;
}

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .panel {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .canvas-wrap {
    height: 68vh;
    min-height: 520px;
  }

  .canvas-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .workspace-tools {
    margin-left: 0;
  }

  #diagramTitle {
    flex-basis: 100%;
    width: 100%;
  }

  .right-panel {
    border-top: 1px solid var(--line);
  }
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 10px;
  max-width: calc(100vw - 40px);
  padding: 20px;
  width: min(760px, 92vw);
}

#recordsSelect {
  font-family: Consolas, "Courier New", monospace;
  font-size: var(--font-sm);
  height: 320px;
  margin: 10px 0;
  overflow-x: auto;
  white-space: nowrap;
  width: 100%;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}














/* Caborca Flow branding */
.brand-mark{position:relative;overflow:hidden;box-shadow:0 12px 26px rgba(11,18,32,.18)}
.brand-mark:after{content:"";position:absolute;inset:6px;border:1px solid rgba(255,255,255,.34);border-radius:inherit}
.version-badge{background:#d9f99d;color:#0b1220}.session-label.active{background:#ecfeff;color:#0b1220}.menu-dropdown button:hover,.menu-dropdown button:focus{background:#ecfeff;color:#0b1220}
@media(max-width:960px){.watermark-overlay{right:10px;bottom:10px;max-width:calc(100vw - 20px);font-size:11px}}

[hidden] {
  display: none !important;
}

.primary {
  background: linear-gradient(135deg, #0b1220, #0f766e 58%, #84cc16);
  box-shadow: 0 10px 22px rgba(15, 118, 110, .2);
  color: #ffffff;
}

.eyebrow {
  color: var(--primary-strong);
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .1em;
  margin: 0 0 3px;
  text-transform: uppercase;
}

.auth-view {
  background:
    radial-gradient(circle at 20% 15%, rgba(20, 184, 166, .22), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(37, 99, 235, .18), transparent 28%),
    linear-gradient(135deg, #f8fafc, #eef6f4);
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.auth-card {
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .84);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(16, 24, 40, .16);
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr minmax(320px, 420px);
  min-height: 560px;
  padding: 22px;
  width: min(980px, 100%);
}

.auth-brand {
  align-content: end;
  background:
    radial-gradient(circle at 20% 20%, rgba(132, 204, 22, .38), transparent 28%),
    linear-gradient(135deg, #0b1220, #0f766e 62%, #84cc16);
  border-radius: 14px;
  color: #ffffff;
  display: grid;
  gap: 18px;
  min-height: 420px;
  padding: 28px;
}

.auth-brand > span {
  background: rgba(255, 255, 255, .18);
  border-radius: 14px;
  display: grid;
  font-size: 1.2rem;
  font-weight: 950;
  height: 54px;
  place-items: center;
  position: relative;
  overflow: hidden;
  width: 54px;
}

.auth-brand > span::after {
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: inherit;
  content: "";
  inset: 5px;
  position: absolute;
}

.auth-brand .eyebrow {
  color: #ccfbf1;
}

.auth-brand h1 {
  font-size: 2.2rem;
  line-height: 1;
  margin: 0;
}

.auth-brand p {
  color: rgba(255, 255, 255, .82);
  margin: 0;
}

.auth-form {
  align-self: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 13px;
  padding: 24px;
}

.auth-form h2 {
  font-size: 1.35rem;
  letter-spacing: 0;
  margin: 0;
  text-transform: none;
}

.auth-form label {
  color: var(--muted);
  display: grid;
  font-size: .82rem;
  font-weight: 850;
  gap: 6px;
}

.auth-message {
  color: var(--danger);
  font-size: .82rem;
  font-weight: 850;
  margin: 0;
  min-height: 18px;
}

.auth-message[data-tone="info"] {
  color: var(--primary-strong);
}

.auth-switch {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
}

.auth-switch button {
  background: transparent;
  color: var(--primary-strong);
  min-height: auto;
  padding: 0;
  font-weight: 950;
}

.auth-switch button:hover {
  background: transparent;
}

.auth-view:not([hidden]) ~ #appShell {
  display: none !important;
}

@media (max-width: 980px) {
  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .auth-view {
    padding: 12px;
  }

  .auth-card {
    border-radius: 12px;
    padding: 12px;
  }

  .auth-brand {
    min-height: 220px;
    padding: 20px;
  }

  .auth-brand h1 {
    font-size: 1.65rem;
  }
}

dialog {
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: min(760px, calc(100vw - 28px));
}

dialog::backdrop {
  backdrop-filter: blur(4px);
  background: rgba(16, 24, 40, .42);
}

dialog form {
  background: #ffffff;
  border: 1px solid rgba(216, 229, 226, .95);
  border-radius: var(--radius);
  box-shadow: 0 28px 70px rgba(16, 24, 40, .18);
  display: grid;
  gap: 12px;
  padding: 18px;
}

.dialog-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.dialog-head h2 {
  font-size: 1.16rem;
  letter-spacing: 0;
  margin: 0;
  text-transform: none;
}

.dialog-head button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--primary-strong);
  font-size: 1.3rem;
  height: 34px;
  padding: 0;
  width: 34px;
}

.dialog-note {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
}

.dialog-actions {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto;
}

.users-list {
  display: grid;
  gap: 9px;
  max-height: 54vh;
  overflow: auto;
  padding-right: 3px;
}

.user-row {
  align-items: end;
  background: #f8fffd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr) auto;
  padding: 10px;
}

.user-row strong {
  display: block;
  font-size: .9rem;
}

.user-row p {
  color: var(--muted);
  font-size: .78rem;
  margin: 2px 0 0;
}

.user-row label {
  color: var(--muted);
  display: grid;
  font-size: .72rem;
  font-weight: 850;
  gap: 5px;
}

.role-pill {
  align-self: center;
  background: #eef2f6;
  border-radius: 999px;
  color: #475467;
  font-size: .72rem;
  font-weight: 900;
  padding: 7px 9px;
}

.role-pill[data-role="admin"] {
  background: #dcfce7;
  color: #166534;
}

.role-pill[data-role="usuario"] {
  background: #ecfeff;
  color: #155e75;
}

@media (max-width: 640px) {
  .user-row,
  .dialog-actions {
    grid-template-columns: 1fr;
  }
}
