@font-face {

  font-family: "Instrument Serif";

  src: url("/static/fonts/instrument-serif-400.woff2") format("woff2");

  font-weight: 400;

  font-style: normal;

  font-display: swap;

}



@font-face {

  font-family: "Inter";

  src: url("/static/fonts/inter-400.woff2") format("woff2");

  font-weight: 400;

  font-display: swap;

}



@font-face {

  font-family: "Inter";

  src: url("/static/fonts/inter-400.woff2") format("woff2");

  font-weight: 500;

  font-display: swap;

}



@font-face {

  font-family: "Inter";

  src: url("/static/fonts/inter-400.woff2") format("woff2");

  font-weight: 600;

  font-display: swap;

}



@font-face {

  font-family: "Inter";

  src: url("/static/fonts/inter-400.woff2") format("woff2");

  font-weight: 700;

  font-display: swap;

}



@font-face {

  font-family: "JetBrains Mono";

  src: url("/static/fonts/jetbrains-mono-400.woff2") format("woff2");

  font-weight: 400;

  font-display: swap;

}



:root {

  /* tinta */ --ink: #0a1b20;

  --ink-2: #3b5157;

  --ink-3: #4e646a;

  --ink-inv: #eef4f3;

  /* terreno */ --ground: #dde8e5;

  --ground-2: #cfdfdb;

  --ground-3: #e6e2ec;

  /* vidrio y hojas */ --glass: rgba(255, 255, 255, 0.62);

  --glass-strong: rgba(255, 255, 255, 0.82);

  --glass-line: rgba(255, 255, 255, 0.55);

  --rail: rgba(9, 27, 32, 0.78);

  --rail-2: rgba(9, 27, 32, 0.92);

  --sheet: rgba(255, 255, 255, 0.9);

  --paper: #ffffff;

  --surface: #ffffff;

  --line: rgba(10, 27, 32, 0.1);

  --line-soft: rgba(10, 27, 32, 0.06);

  /* acentos */ --lens: #14666b;

  --lens-deep: #0d4b50;

  --lens-soft: rgba(20, 102, 107, 0.1);

  --amber: #a9661d;

  --amber-soft: rgba(169, 102, 29, 0.12);

  --ok: #14684f;

  --ok-soft: rgba(20, 104, 79, 0.12);

  --danger: #9e2f27;

  --danger-soft: rgba(158, 47, 39, 0.1);

  --radius-xs: 8px;

  --radius: 12px;

  --radius-md: 16px;

  --radius-lg: 22px;

  --radius-xl: 28px;

  --shadow-1: 0 1px 2px rgba(10, 27, 32, 0.06), 0 2px 8px rgba(10, 27, 32, 0.04);

  --shadow-2: 0 2px 4px rgba(10, 27, 32, 0.05), 0 12px 28px -8px rgba(10, 27, 32, 0.16);

  --shadow-3: 0 24px 60px -20px rgba(10, 27, 32, 0.35);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.68, 0.18, 1);

  --fast: 140ms var(--ease);

  --med: 240ms var(--ease);

}



* {

  box-sizing: border-box;

}



html, body {

  margin: 0;

  padding: 0;

  min-height: 100%;

}



body {

  font-family: var(--sans);

  font-size: 15.5px;

  line-height: 1.55;

  color: var(--ink);

  background-color: var(--ground);

  -webkit-font-smoothing: antialiased;

  text-rendering: optimizeLegibility;

}



body::before {

  content: "";

  position: fixed;

  inset: 0;

  z-index: -1;

  background: radial-gradient(1100px 700px at 12% -10%, #eaf3ef 0%, rgba(234, 243, 239, 0) 60%), radial-gradient(900px 600px at 92% 0%, rgba(224, 219, 236, 0.9) 0%, rgba(224, 219, 236, 0) 55%), radial-gradient(1000px 800px at 60% 110%, rgba(202, 226, 220, 0.9) 0%, rgba(202, 226, 220, 0) 60%), linear-gradient(180deg, var(--ground) 0%, var(--ground-2) 100%);

}



h1, h2, h3, h4 {

  font-family: var(--sans);

  font-weight: 600;

  letter-spacing: -0.018em;

  color: var(--ink);

  margin: 0 0 0.35em;

  line-height: 1.2;

}



h1 {

  font-size: 2.05rem;

}



h2 {

  font-size: 1.38rem;

}



h3 {

  font-size: 1.12rem;

}



p {

  margin: 0 0 1em;

}



a {

  color: var(--lens);

  text-decoration: none;

  transition: color var(--fast);

}



a:hover {

  color: var(--lens-deep);

}



small, .muted {

  color: var(--ink-3);

}



hr {

  border: 0;

  border-top: 1px solid var(--line);

  margin: 1.5rem 0;

}



::selection {

  background: rgba(20, 102, 107, 0.18);

}



:focus-visible {

  outline: 2px solid var(--lens-deep);

  outline-offset: 2px;

  border-radius: var(--radius-xs);

}



.shell {

  display: flex;

  min-height: 100vh;

  gap: 0;

}



.sidebar, .rail {

  width: 250px;

  flex: 0 0 250px;

  margin: 14px 0 14px 14px;

  padding: 1.1rem 0.9rem;

  border-radius: var(--radius-xl);

  background: var(--rail);

  border: 1px solid rgba(255, 255, 255, 0.09);

  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.08);

  -webkit-backdrop-filter: blur(28px) saturate(140%);

  backdrop-filter: blur(28px) saturate(140%);

  color: var(--ink-inv);

  display: flex;

  flex-direction: column;

  gap: 1.25rem;

  position: sticky;

  top: 52px;

  height: calc(100vh - 66px);

  overflow: hidden;

}



.brand {

  display: flex;

  align-items: center;

  gap: 0.7rem;

  padding: 0.15rem 0.35rem 0.9rem;

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

}



.brand-mark {

  width: 38px;

  height: 38px;

  border-radius: 12px;

  display: grid;

  place-items: center;

  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));

  border: 1px solid rgba(255, 255, 255, 0.18);

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);

  color: #eaf6f4;

  font-family: var(--serif);

  font-size: 1.25rem;

  line-height: 1;

  position: relative;

  overflow: hidden;

}



.brand-mark svg {

  width: 24px;

  height: 24px;

  display: block;

}



.brand-mark .pulse {

  stroke-dasharray: 120;

  stroke-dashoffset: 120;

  animation: pulse-draw 1400ms var(--ease) 200ms forwards;

}



@keyframes pulse-draw {

  to { stroke-dashoffset: 0;

  };

}



.brand-name {

  font-family: var(--serif);

  font-size: 1.2rem;

  line-height: 1.05;

  color: #f2f7f6;

}



.brand-sub {

  font-size: 0.68rem;

  letter-spacing: 0.14em;

  text-transform: uppercase;

  color: rgba(238, 244, 243, 0.52);

  margin-top: 0.15rem;

}



.nav {

  display: flex;

  flex-direction: column;

  gap: 2px;

}



.nav a {

  display: flex;

  align-items: center;

  gap: 0.65rem;

  padding: 0.58rem 0.7rem;

  border-radius: 11px;

  color: rgba(238, 244, 243, 0.72);

  font-size: 0.93rem;

  font-weight: 500;

  border: 1px solid transparent;

  transition: background var(--fast), color var(--fast), border-color var(--fast);

}



.nav a:hover {

  background: rgba(255, 255, 255, 0.07);

  color: #f4f9f8;

}



.nav a.active {

  background: rgba(255, 255, 255, 0.13);

  border-color: rgba(255, 255, 255, 0.14);

  color: #ffffff;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);

}



.nav-icon {

  width: 18px;

  height: 18px;

  flex: 0 0 18px;

  opacity: 0.85;

}



.nav-icon svg {

  width: 100%;

  height: 100%;

  display: block;

  stroke: currentColor;

  fill: none;

  stroke-width: 1.6;

  stroke-linecap: round;

  stroke-linejoin: round;

}



.sidebar-foot {

  margin-top: auto;

  padding-top: 0.9rem;

  border-top: 1px solid rgba(255, 255, 255, 0.08);

  font-size: 0.82rem;

  color: rgba(238, 244, 243, 0.66);

}



.sidebar-foot strong {

  color: #f2f7f6;

  font-weight: 600;

}



.main {

  flex: 1;

  min-width: 0;

  padding: 1.6rem 2.5rem 4rem;

  width: 100%;

}



.topbar {

  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  gap: 1.25rem;

  margin-bottom: 1.6rem;

  flex-wrap: wrap;

}



.topbar h1 {

  margin-bottom: 0.1rem;

}



.topbar .subtitle {

  color: var(--ink-2);

  font-size: 0.92rem;

  display: flex;

  align-items: center;

  gap: 0.85rem;

  flex-wrap: wrap;

}



.crumbs {

  font-size: 0.78rem;

  letter-spacing: 0.1em;

  text-transform: uppercase;

  color: var(--ink-3);

  margin-bottom: 0.5rem;

}



.crumbs a {

  color: var(--ink-3);

}



.crumbs a:hover {

  color: var(--lens);

}



.card, .sheet, .panel {

  border-radius: var(--radius-lg);

  padding: 1.3rem 1.4rem;

  position: relative;

}



.card, .sheet {

  background: var(--sheet);

  border: 1px solid var(--glass-line);

  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.9);

  -webkit-backdrop-filter: blur(18px) saturate(130%);

  backdrop-filter: blur(18px) saturate(130%);

}



.panel {

  background: var(--paper);

  border: 1px solid var(--line);

  box-shadow: var(--shadow-1);

}



.card + .card, .sheet + .sheet, .card + .sheet, .sheet + .card {

  margin-top: 1rem;

}



.card-head {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 1rem;

  margin-bottom: 1rem;

}



.card-head h2, .card-head h3 {

  margin: 0;

}



.card-head .hint {

  margin: 0;

}



.grid {

  display: grid;

  gap: 1rem;

  align-items: start;

}



.grid-2 {

  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));

}



.grid-3 {

  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));

}



.grid-4 {

  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));

}



.stat {

  background: var(--glass);

  border: 1px solid var(--glass-line);

  border-radius: var(--radius-md);

  padding: 1rem 1.05rem 1.05rem;

  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.85);

  -webkit-backdrop-filter: blur(16px) saturate(140%);

  backdrop-filter: blur(16px) saturate(140%);

  position: relative;

  overflow: hidden;

  animation: rise 520ms var(--ease) both;

}



.stat::after {

  content: "";

  position: absolute;

  inset: 0 0 auto;

  height: 1px;

  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);

}



.stat:nth-child(2) {

  animation-delay: 60ms;

}



.stat:nth-child(3) {

  animation-delay: 120ms;

}



.stat:nth-child(4) {

  animation-delay: 180ms;

}



@keyframes rise {

  from { opacity: 0;

  transform: translateY(8px);

  } to { opacity: 1;

  transform: none;

  };

}



.stat-value {

  font-family: var(--sans);

  font-weight: 600;

  font-size: 2.5rem;

  line-height: 1;

  color: var(--ink);

  letter-spacing: -0.02em;

}



.stat-label {

  font-size: 0.72rem;

  letter-spacing: 0.12em;

  text-transform: uppercase;

  color: var(--ink-3);

  margin-top: 0.5rem;

}



label {

  display: block;

  font-size: 0.78rem;

  font-weight: 600;

  letter-spacing: 0.04em;

  text-transform: uppercase;

  color: var(--ink-2);

  margin-bottom: 0.35rem;

}



input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="tel"], input[type="search"], select, textarea {

  width: 100%;

  padding: 0.62rem 0.8rem;

  border: 1px solid rgba(10, 27, 32, 0.14);

  border-radius: var(--radius);

  background: rgba(255, 255, 255, 0.82);

  color: var(--ink);

  font-family: inherit;

  font-size: 0.95rem;

  box-shadow: inset 0 1px 2px rgba(10, 27, 32, 0.04);

  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);

}



textarea {

  min-height: 116px;

  resize: vertical;

  line-height: 1.5;

}



input:hover, select:hover, textarea:hover {

  border-color: rgba(10, 27, 32, 0.24);

}



input:focus, select:focus, textarea:focus {

  outline: none;

  background: #fff;

  border-color: var(--lens);

  box-shadow: 0 0 0 3px rgba(20, 102, 107, 0.14);

}



input[readonly] {

  background: rgba(10, 27, 32, 0.03);

  color: var(--ink-2);

  font-family: var(--mono);

  font-size: 0.82rem;

}



.field {

  margin-bottom: 1rem;

}



.row {

  display: grid;

  gap: 1rem;

  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));

}



.hint {

  font-size: 0.78rem;

  color: var(--ink-3);

  margin-top: 0.35rem;

}



.btn {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 0.45rem;

  min-height: 42px;

  padding: 0.6rem 1.05rem;

  border-radius: var(--radius);

  border: 1px solid transparent;

  cursor: pointer;

  font-family: inherit;

  font-size: 0.92rem;

  font-weight: 600;

  white-space: nowrap;

  background: var(--lens);

  color: #fff;

  text-decoration: none;

  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.18);

  transition: transform var(--fast), background var(--fast), box-shadow var(--fast);

}



.btn:hover {

  background: var(--lens-deep);

  color: #fff;

  text-decoration: none;

}



.btn:active {

  transform: translateY(1px);

}



.btn-ghost {

  background: rgba(255, 255, 255, 0.6);

  color: var(--ink-2);

  border-color: rgba(10, 27, 32, 0.14);

  box-shadow: none;

  -webkit-backdrop-filter: blur(10px);

  backdrop-filter: blur(10px);

}



.btn-ghost:hover {

  background: #fff;

  color: var(--ink);

  border-color: rgba(10, 27, 32, 0.24);

}



.btn-soft {

  background: var(--lens-soft);

  color: var(--lens-deep);

  border-color: rgba(20, 102, 107, 0.18);

  box-shadow: none;

}



.btn-soft:hover {

  background: rgba(20, 102, 107, 0.18);

  color: var(--lens-deep);

}



.btn-amber {

  background: var(--amber);

}



.btn-amber:hover {

  background: #8f5617;

}



.btn-danger {

  background: transparent;

  color: var(--danger);

  border-color: rgba(158, 47, 39, 0.28);

  box-shadow: none;

}



.btn-danger:hover {

  background: var(--danger-soft);

  color: var(--danger);

}



.btn-sm {

  min-height: 34px;

  padding: 0.34rem 0.7rem;

  font-size: 0.82rem;

  border-radius: 10px;

}



.btn-block {

  width: 100%;

}



.btn[disabled] {

  opacity: 0.45;

  cursor: not-allowed;

  transform: none;

}



.btn-icon {

  padding: 0.5rem;

  width: 36px;

  height: 36px;

}



.ico {

  flex: none;

  display: block;

}



.btn .ico {

  opacity: 0.92;

}



.table-wrap {

  overflow-x: auto;

  border-radius: var(--radius);

}



.table {

  width: 100%;

  border-collapse: collapse;

  font-size: 0.9rem;

}



.table th {

  text-align: left;

  font-size: 0.68rem;

  text-transform: uppercase;

  letter-spacing: 0.1em;

  color: var(--ink-3);

  font-weight: 600;

  padding: 0.55rem 0.7rem;

  border-bottom: 1px solid var(--line);

  white-space: nowrap;

}



.table td {

  padding: 0.72rem 0.7rem;

  border-bottom: 1px solid var(--line-soft);

  vertical-align: middle;

}



.table tbody tr {

  transition: background var(--fast);

}



.table tbody tr:hover {

  background: rgba(20, 102, 107, 0.045);

}



.table tr:last-child td {

  border-bottom: 0;

}



.table td .mono {

  color: var(--ink-2);

}



.badge {

  display: inline-flex;

  align-items: center;

  gap: 0.3rem;

  padding: 0.16rem 0.55rem;

  border-radius: 999px;

  font-size: 0.72rem;

  font-weight: 600;

  background: var(--lens-soft);

  color: var(--lens-deep);

  border: 1px solid rgba(20, 102, 107, 0.14);

  white-space: nowrap;

}



.badge-draft {

  background: var(--amber-soft);

  color: #7d4a13;

  border-color: rgba(169, 102, 29, 0.2);

}



.badge-final {

  background: var(--ok-soft);

  color: var(--ok);

  border-color: rgba(20, 104, 79, 0.18);

}



.avatar {

  width: 52px;

  height: 52px;

  flex: 0 0 52px;

  border-radius: 16px;

  display: grid;

  place-items: center;

  font-family: var(--serif);

  font-size: 1.35rem;

  color: #fff;

  background: linear-gradient(150deg, var(--lens), var(--lens-deep));

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), var(--shadow-1);

}



.segmented {

  display: inline-flex;

  gap: 0.25rem;

  padding: 0.25rem;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.55);

  border: 1px solid var(--glass-line);

  -webkit-backdrop-filter: blur(14px);

  backdrop-filter: blur(14px);

  box-shadow: var(--shadow-1);

  flex-wrap: wrap;

}



.segmented button, .segmented a {

  border: 0;

  background: transparent;

  color: var(--ink-2);

  font-family: inherit;

  font-size: 0.85rem;

  font-weight: 600;

  padding: 0.42rem 0.9rem;

  border-radius: 999px;

  cursor: pointer;

  text-decoration: none;

  transition: background var(--fast), color var(--fast), box-shadow var(--fast);

}



.segmented button:hover, .segmented a:hover {

  color: var(--ink);

  background: rgba(255, 255, 255, 0.6);

}



.segmented [aria-selected="true"], .segmented .active {

  background: #fff;

  color: var(--ink);

  box-shadow: 0 1px 3px rgba(10, 27, 32, 0.14);

}



.empty {

  text-align: center;

  padding: 2.75rem 1.25rem;

  color: var(--ink-3);

  border-radius: var(--radius-md);

  border: 1px dashed rgba(10, 27, 32, 0.16);

  background: rgba(255, 255, 255, 0.4);

}



.empty h3 {

  color: var(--ink-2);

  margin-bottom: 0.35rem;

}



.empty .btn {

  margin-top: 0.75rem;

}



.alert {

  padding: 0.8rem 1rem;

  border-radius: var(--radius);

  font-size: 0.9rem;

  margin-bottom: 1rem;

  border: 1px solid transparent;

  border-left-width: 4px;

}



.alert-error {

  background: #fbeceb;

  color: #7d221c;

  border-color: rgba(158, 47, 39, 0.22);

  border-left-color: var(--danger);

}



.alert-ok {

  background: #e9f4ef;

  color: #0d4a37;

  border-color: rgba(20, 104, 79, 0.22);

  border-left-color: var(--ok);

}



.auth-wrap {

  min-height: 100vh;

  display: grid;

  place-items: center;

  padding: 2.5rem 1rem;

}



.auth-card {

  width: 100%;

  max-width: 410px;

  padding: 2.1rem;

  border-radius: var(--radius-xl);

  background: var(--glass-strong);

  border: 1px solid var(--glass-line);

  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.9);

  -webkit-backdrop-filter: blur(26px) saturate(140%);

  backdrop-filter: blur(26px) saturate(140%);

  animation: rise 480ms var(--ease) both;

}



.auth-card h1 {

  font-size: 1.95rem;

}



.auth-foot {

  text-align: center;

  font-size: 0.83rem;

  color: var(--ink-3);

  margin-top: 1.1rem;

  line-height: 1.6;

}



.thumbs {

  display: grid;

  gap: 0.65rem;

  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));

}



figure {

  margin: 0;

}



.thumb a {

  display: block;

  line-height: 0;

}



.thumb {

  position: relative;

  border: 1px solid rgba(10, 27, 32, 0.12);

  border-radius: var(--radius);

  overflow: hidden;

  background: #fff;

  box-shadow: var(--shadow-1);

  transition: transform var(--fast), box-shadow var(--fast);

}



.thumb:hover {

  transform: translateY(-1px);

  box-shadow: var(--shadow-2);

}



.thumb img {

  display: block;

  width: 100%;

  height: 112px;

  object-fit: cover;

}



.thumb form {

  position: absolute;

  top: 5px;

  right: 5px;

}



.thumb .del {

  background: rgba(9, 27, 32, 0.72);

  color: #fff;

  border: 0;

  border-radius: 8px;

  width: 32px;

  height: 32px;

  cursor: pointer;

  font-size: 0.9rem;

  -webkit-backdrop-filter: blur(6px);

  backdrop-filter: blur(6px);

}



.flex {

  display: flex;

  align-items: center;

  gap: 0.6rem;

}



.flex-between {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 1rem;

}



.wrap {

  flex-wrap: wrap;

}



.grow {

  flex: 1;

}



.right {

  margin-left: auto;

}



.stack > * + * {

  margin-top: 1rem;

}



.mt-0 {

  margin-top: 0;

}



.mt-1 {

  margin-top: 1rem;

}



.mt-2 {

  margin-top: 2rem;

}



.mb-0 {

  margin-bottom: 0;

}



.mb-1 {

  margin-bottom: 1rem;

}



.text-sm {

  font-size: 0.88rem;

}



.nowrap {

  white-space: nowrap;

}



.mono {

  font-family: var(--mono);

  font-size: 0.84rem;

  letter-spacing: -0.01em;

}



[hidden] {

  display: none !important;

}



.hr-soft {

  height: 1px;

  background: var(--line);

  border: 0;

  margin: 1rem 0;

}



@media (max-width: 899px) {

  body::before {

    background: radial-gradient(700px 500px at 20% -10%, #eaf3ef 0%, rgba(234, 243, 239, 0) 60%), linear-gradient(180deg, var(--ground) 0%, var(--ground-2) 100%);

  }

  .shell {

    flex-direction: column;

  }

  .sidebar, .rail {

    width: auto;

    flex: none;

    height: auto;

    position: static;

    margin: 10px 10px 0;

    padding: 0.75rem 0.8rem;

    border-radius: var(--radius-lg);

    flex-direction: row;

    align-items: center;

    gap: 0.75rem;

    overflow-x: auto;

  }

  .brand {

    border-bottom: 0;

    padding: 0;

    flex: 0 0 auto;

  }

  .brand-sub {

    display: none;

  }

  .nav {

    flex-direction: row;

    gap: 0.2rem;

  }

  .nav a {

    padding: 0.45rem 0.6rem;

    font-size: 0.85rem;

    white-space: nowrap;

  }

  .nav a .nav-label {

    display: none;

  }

  .sidebar-foot {

    display: none;

  }

  .main {

    padding: 1.15rem 0.9rem 3rem;

  }

  h1 {

    font-size: 1.75rem;

  }

  .stat-value {

    font-size: 2rem;

  }

  .topbar {

    align-items: flex-start;

  }

  .topbar .btn {

    flex: 0 0 auto;

  }

  .table {

    font-size: 0.86rem;

  }

}



@media (prefers-reduced-motion: reduce) {

  *, *::before, *::after {

    animation-duration: 1ms !important;

    animation-iteration-count: 1 !important;

    transition-duration: 1ms !important;

  }

  .stat {

    opacity: 1;

    transform: none;

  }

}



@media print {

  body {

    background: #fff;

  }

  body::before {

    display: none;

  }

  .sidebar, .rail, .topbar .btn, .no-print, .segmented {

    display: none !important;

  }

  .main {

    padding: 0;

    max-width: none;

  }

  .card, .sheet, .panel {

    background: #fff;

    border: 1px solid #ddd;

    box-shadow: none;

    -webkit-backdrop-filter: none;

    backdrop-filter: none;

  }

}



.visor {

  background: #0a1418;

  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: var(--radius-lg);

  padding: 0.85rem;

  box-shadow: var(--shadow-3);

}



.visor-top {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 0.75rem;

  flex-wrap: wrap;

  margin-bottom: 0.6rem;

}



.visor-meta {

  color: rgba(238, 244, 243, 0.7);

  font-size: 0.82rem;

  font-family: var(--mono);

}



.visor-acciones {

  display: flex;

  gap: 0.3rem;

  flex-wrap: wrap;

}



.visor-btn {

  background: rgba(255, 255, 255, 0.08);

  border: 1px solid rgba(255, 255, 255, 0.12);

  color: #eaf2f1;

  border-radius: 9px;

  padding: 0.35rem 0.6rem;

  font-size: 0.82rem;

  font-family: inherit;

  cursor: pointer;

  transition: background 140ms ease;

}



.visor-btn:hover {

  background: rgba(255, 255, 255, 0.16);

}



.visor-btn.activo {

  background: var(--lens);

  border-color: var(--lens);

}



.visor-lienzo {

  height: 62vh;

  min-height: 380px;

  background: #000;

  border-radius: var(--radius);

  cursor: grab;

  outline: none;

}



.visor-lienzo:active {

  cursor: grabbing;

}



.visor-pie {

  display: flex;

  align-items: center;

  gap: 0.75rem;

  margin-top: 0.6rem;

}



.visor-pie input[type="range"] {

  flex: 1;

  accent-color: var(--lens);

}



.visor-pie .mono {

  color: rgba(238, 244, 243, 0.75);

  font-size: 0.8rem;

  white-space: nowrap;

}



.visor-ayuda {

  margin: 0.5rem 0 0;

  font-size: 0.78rem;

  color: rgba(238, 244, 243, 0.45);

}



.portal-cabecera {

  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  gap: 1rem;

  flex-wrap: wrap;

  margin-bottom: 1.5rem;

  padding: 0 .2rem;

}



.portal-datos h1 {

  font-size: clamp(1.8rem, 4vw, 2.4rem);

  margin: .55rem 0 .15rem;

}



.portal-cuerpo {

  display: grid;

  gap: 1rem;

  grid-template-columns: 1fr;

  align-items: start;

}



.portal-lateral {

  display: flex;

  flex-direction: column;

  gap: 1rem;

}



.portal-lista {

  display: flex;

  flex-direction: column;

  gap: .8rem;

}



.portal-estudio {

  display: flex;

  align-items: center;

  gap: 1rem;

  flex-wrap: wrap;

  padding: 1.05rem 1.15rem;

}



.portal-estudio-datos {

  flex: 1 1 260px;

  min-width: 0;

}



.portal-estudio-acciones {

  display: flex;

  gap: .45rem;

  flex-wrap: wrap;

  margin-left: auto;

}



.portal-pie {

  margin-top: 2rem;

  padding-top: 1rem;

  border-top: 1px solid var(--line);

  text-align: center;

  font-size: .82rem;

  color: var(--ink-3);

}



@media (min-width: 860px) {

  .portal-cuerpo {

    grid-template-columns: 300px 1fr;

  }

  .portal-cabecera {

    align-items: center;

  }

  .portal-datos {

    text-align: right;

  }

  .portal-datos h1 {

    margin-top: 0;

  }

}



.visor-cuerpo {

  display: grid;

  gap: .6rem;

  grid-template-columns: 1fr;

}



.visor-series {

  display: flex;

  gap: .4rem;

  overflow-x: auto;

  padding-bottom: .15rem;

}



.visor-serie {

  flex: 0 0 auto;

  text-align: left;

  background: rgba(255, 255, 255, 0.06);

  border: 1px solid rgba(255, 255, 255, 0.1);

  color: #e6eeed;

  border-radius: 10px;

  padding: .5rem .7rem;

  cursor: pointer;

  font-family: inherit;

  min-width: 150px;

  transition: background 140ms ease, border-color 140ms ease;

}



.visor-serie:hover {

  background: rgba(255, 255, 255, 0.12);

}



.visor-serie.activo {

  background: rgba(20, 102, 107, 0.5);

  border-color: rgba(120, 220, 220, 0.45);

}



.visor-serie-nombre {

  display: block;

  font-size: .84rem;

  font-weight: 600;

  line-height: 1.25;

}



.visor-serie-meta {

  display: block;

  font-size: .72rem;

  color: rgba(238, 244, 243, 0.55);

  margin-top: .15rem;

  font-family: var(--mono);

}



@media (min-width: 900px) {

  .visor-cuerpo {

    grid-template-columns: 210px 1fr;

  }

  .visor-series {

    flex-direction: column;

    overflow-x: visible;

    overflow-y: auto;

    max-height: 62vh;

  }

  .visor-serie {

    min-width: 0;

    width: 100%;

  }

}



.table td, .table th {

  vertical-align: top;

}



.table td:nth-child(2) {

  min-width: 190px;

}



.table td:first-child, .table th:first-child {

  white-space: nowrap;

}



.table td:last-child, .table th:last-child {

  text-align: right;

}



@media (max-width: 720px) {

  .table td:nth-child(2) {

    min-width: 140px;

  }

}



/* Cinta de marca: misma piel que la barra inferior y siempre visible */

.cinta-sistema {

  position: sticky;

  top: 0;

  z-index: 60;

  background: rgba(9, 27, 32, 0.96);

  color: #ffffff;

  text-align: center;

  font-family: var(--sans);

  font-size: 0.74rem;

  font-weight: 600;

  letter-spacing: 0.18em;

  text-transform: uppercase;

  padding: 0.6rem 1rem;

  border-bottom: 1px solid rgba(255, 255, 255, 0.1);

  -webkit-backdrop-filter: blur(18px) saturate(150%);

  backdrop-filter: blur(18px) saturate(150%);

  box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.6);

}

@media print {

  .cinta-sistema {

    background: #ffffff;

    color: var(--ink);

    border-bottom: 1px solid #cccccc;

  }

}



.tabbar {

  display: none;

}



@media (max-width: 899px) {

  .rail, .sidebar {

    display: none;

  }

  .shell {

    display: block;

  }

  .main {

    padding: 1rem 0.9rem calc(6rem + env(safe-area-inset-bottom, 0px));

    width: 100%;

  }

  .tabbar {

    position: fixed;

    left: 0;

    right: 0;

    bottom: 0;

    z-index: 40;

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 0.15rem;

    padding: 0.4rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));

    border-radius: 18px 18px 0 0;

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-bottom: 0;

    background: rgba(9, 27, 32, 0.94);

    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.1);

    -webkit-backdrop-filter: blur(22px) saturate(150%);

    backdrop-filter: blur(22px) saturate(150%);

    transition: transform 180ms var(--ease);

  }

  /* Con el teclado abierto la barra se esconde para no montarse sobre el contenido */

  body.teclado .tabbar {

    transform: translateY(120%);

  }

  .tabbar .tab {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 0.15rem;

    padding: 0.4rem 0.2rem;

    border: 0;

    background: transparent;

    color: rgba(238, 244, 243, 0.62);

    font-family: inherit;

    font-size: 0.66rem;

    font-weight: 600;

    text-decoration: none;

    border-radius: 13px;

    cursor: pointer;

  }

  .tabbar .tab svg {

    width: 20px;

    height: 20px;

    stroke: currentColor;

    fill: none;

    stroke-width: 1.7;

    stroke-linecap: round;

    stroke-linejoin: round;

  }

  .tabbar .tab.on {

    background: rgba(255, 255, 255, 0.14);

    color: #ffffff;

  }

  .drawer {

    position: fixed;

    inset: 0;

    z-index: 60;

    background: rgba(6, 18, 22, 0.55);

    -webkit-backdrop-filter: blur(4px);

    backdrop-filter: blur(4px);

    display: flex;

    align-items: flex-end;

    animation: fade 160ms ease;

  }

  .drawer[hidden] {

    display: none;

  }

  .drawer-panel {

    width: 100%;

    background: var(--paper);

    border-radius: 22px 22px 0 0;

    padding: 0.9rem 1rem calc(1.2rem + env(safe-area-inset-bottom));

    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.3);

    animation: subir 220ms var(--ease);

  }

  .drawer-cabeza {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding-bottom: 0.6rem;

    border-bottom: 1px solid var(--line);

    margin-bottom: 0.4rem;

  }

  .drawer-cerrar {

    border: 0;

    background: rgba(10, 27, 32, 0.06);

    width: 32px;

    height: 32px;

    border-radius: 10px;

    font-size: 0.9rem;

    cursor: pointer;

  }

  .drawer-panel a,

  .drawer-instalar {

    display: flex;

    align-items: center;

    gap: 0.5rem;

    padding: 0.8rem 0.4rem;

    border-bottom: 1px solid var(--line-soft);

    color: var(--ink);

    font-weight: 500;

    text-decoration: none;

  }

  .drawer-panel a:last-child {

    border-bottom: 0;

  }

  .drawer-panel a.on {

    color: var(--lens-deep);

    background: var(--lens-soft);

    border-radius: 10px;

    font-weight: 650;

  }

  .drawer-salir {

    color: var(--danger) !important;

    font-weight: 600;

  }

}



@keyframes subir {

  from { transform: translateY(24px);

  opacity: 0;

  } to { transform: none;

  opacity: 1;

  };

}



@keyframes fade {

  from { opacity: 0;

  } to { opacity: 1;

  };

}



@media (max-width: 899px) {

  .segmented {

    flex-wrap: nowrap;

    overflow-x: auto;

    max-width: 100%;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;

  }

  .segmented::-webkit-scrollbar {

    display: none;

  }

  .segmented button, .segmented a {

    flex: 0 0 auto;

  }

  .topbar .flex.wrap {

    flex-wrap: nowrap;

    overflow-x: auto;

    scrollbar-width: none;

  }

  .topbar .flex.wrap::-webkit-scrollbar {

    display: none;

  }

}



@media (max-width: 720px) {

  .table-wrap {

    overflow-x: visible;

  }

  .table {

    min-width: 0;

  }

  .table thead {

    display: none;

  }

  .table tbody tr {

    display: block;

    padding: 0.7rem 0.2rem;

    border-bottom: 1px solid var(--line);

  }

  .table tbody tr:last-child {

    border-bottom: 0;

  }

  .table tbody th {

    display: block;

    padding: 0.25rem 0.2rem 0;

    border: 0;

    font-size: 0.68rem;

    letter-spacing: 0.08em;

    text-transform: uppercase;

    color: var(--ink-3);

  }

  .table td {

    display: flex;

    flex-direction: column;

    align-items: flex-start;

    gap: 0.12rem;

    padding: 0.2rem 0.2rem;

    border: 0;

    text-align: left;

    min-width: 0 !important;

    overflow-wrap: anywhere;

  }

  .table td::before {

    content: attr(data-etiqueta);

    font-size: 0.68rem;

    letter-spacing: 0.08em;

    text-transform: uppercase;

    color: var(--ink-3);

    text-align: left;

    flex: 0 0 auto;

  }

  .table td:not([data-etiqueta])::before {

    content: none;

  }

  .table td:last-child {

    text-align: right;

    justify-content: flex-end;

    padding-top: 0.45rem;

  }

  .table td.mono {

    font-size: 0.8rem;

    word-break: break-word;

  }

  .table .badge {

    white-space: nowrap;

  }

}



@media (max-width: 899px) {

  .segmented {

    width: 100%;

    justify-content: flex-start;

    padding: 0.2rem;

    gap: 0.1rem;

  }

  .segmented button, .segmented a {

    font-size: 0.78rem;

    padding: 0.35rem 0.55rem;

  }

  .card-head {

    flex-wrap: wrap;

    gap: 0.5rem;

  }

}



@media (max-width: 899px) {

  .card-head:has(.segmented) {

    flex-direction: column;

    align-items: stretch;

  }

  .card-head:has(.segmented) .segmented {

    margin-top: 0.4rem;

  }

}



@media (max-width: 899px) {

  .topbar {

    align-items: flex-start;

  }

  .topbar .avatar {

    display: none;

  }

  .topbar h1 {

    font-size: 1.55rem;

    line-height: 1.15;

  }

  .topbar .subtitle {

    font-size: 0.86rem;

    gap: 0.3rem;

  }

  .topbar .flex.wrap {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 0.4rem;

    width: 100%;

    overflow-x: visible;

  }

  .topbar .flex.wrap > * {

    width: 100%;

    min-width: 0;

    justify-content: center;

  }

  .topbar .flex.wrap > .btn {

    font-size: 0.85rem;

    padding: 0.55rem 0.6rem;

    line-height: 1.2;

    white-space: normal;

    overflow-wrap: anywhere;

  }

  .topbar .flex.wrap > .btn:nth-child(3):last-child,

  .topbar .flex.wrap > .btn:only-child {

    grid-column: 1 / -1;

  }

  .stat-label {

    min-height: 2.1em;

  }

  .stat-value {

    font-size: 1.9rem;

  }

  .grid-4 {

    grid-template-columns: repeat(2, minmax(0, 1fr));

  }

  .card, .sheet, .panel {

    padding: 1.05rem 1rem;

  }

  h2 {

    font-size: 1.2rem;

  }

}



.row-acciones {

  display: inline-flex;

  align-items: center;

  gap: 0.35rem;

  flex-wrap: nowrap;

}



@media (max-width: 720px) {

  .table td:last-child {

    flex-direction: row;

    flex-wrap: wrap;

    justify-content: flex-start;

    gap: 0.35rem;

    padding-top: 0.55rem;

  }

  .row-acciones {

    width: 100%;

    flex-wrap: wrap;

  }

  .row-acciones .btn {

    flex: 1 1 auto;

    justify-content: center;

  }

}



@media (min-width: 721px) {

  .table th:last-child, .table td:last-child {

    padding-left: 1.2rem;

  }

}





/* --------------------------------------------------------------------------

   Tarjetas de paciente (móvil) y visibilidad por tamaño

   -------------------------------------------------------------------------- */

.solo-movil {

  display: none;

}



.solo-movil.lista-tarjetas {

  display: none;

}



.lista-tarjetas {

  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));

  gap: 0.75rem;

}



.tarjeta-item {

  display: flex;

  flex-direction: column;

  gap: 0.55rem;

  padding: 1rem 1.05rem;

  border-radius: var(--radius-md);

  background: var(--surface, #fff);

  border: 1px solid var(--line);

  box-shadow: var(--shadow-1);

  text-decoration: none;

  color: inherit;

  transition: border-color 140ms ease, box-shadow 140ms ease;

}



.tarjeta-item:active {

  border-color: var(--lens);

  box-shadow: var(--shadow-2);

}



.tarjeta-item-titulo {

  font-size: 1.02rem;

  font-weight: 600;

  line-height: 1.25;

  color: var(--ink);

}



.tarjeta-item-datos {

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 0.5rem 0.85rem;

}



.tarjeta-item-datos small {

  display: block;

  font-size: 0.66rem;

  letter-spacing: 0.08em;

  text-transform: uppercase;

  color: var(--ink-3);

}



.tarjeta-item-datos strong {

  display: block;

  font-size: 0.88rem;

  font-weight: 600;

  color: var(--ink-2);

}



.tarjeta-item .btn {

  margin-top: auto;

  background: var(--lens-soft);

  color: var(--lens-deep);

  border-color: rgba(20, 102, 107, 0.16);

  box-shadow: none;

}



.tarjeta-item:hover .btn,

.tarjeta-item:focus-visible .btn {

  background: var(--lens);

  color: #fff;

}



@media (max-width: 899px) {

  .solo-movil {

    display: block;

  }

  .solo-movil.lista-tarjetas {

    display: grid;

  }

  .solo-escritorio {

    display: none !important;

  }

}





/* Cámara en pantalla para las fotos del estudio */

.camara-capa {

  position: fixed;

  inset: 0;

  z-index: 90;

  background: rgba(6, 18, 22, 0.86);

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 1rem;

  -webkit-backdrop-filter: blur(6px);

  backdrop-filter: blur(6px);

}



.camara-caja {

  width: 100%;

  max-width: 620px;

  background: #0b1418;

  border: 1px solid rgba(255, 255, 255, 0.12);

  border-radius: var(--radius-lg);

  padding: 0.75rem;

  box-shadow: var(--shadow-3);

}



.camara-video {

  width: 100%;

  max-height: 62vh;

  border-radius: var(--radius);

  background: #000;

  display: block;

  object-fit: cover;

}



.camara-acciones {

  display: flex;

  gap: 0.5rem;

  margin-top: 0.7rem;

}



.camara-acciones .btn {

  flex: 1;

}



.camara-aviso {

  margin: 0.6rem 0 0;

  font-size: 0.85rem;

  color: #cfe6e3;

}





/* --------------------------------------------------------------------------

   Cámara a pantalla completa y editor de fotos

   -------------------------------------------------------------------------- */

.camara-pantalla {

  position: fixed;

  inset: 0;

  z-index: 90;

  background: #05090b;

  display: flex;

  flex-direction: column;

}



.camara-video {

  flex: 1;

  width: 100%;

  height: 100%;

  object-fit: cover;

  background: #000;

  min-height: 0;

}



.camara-barra {

  position: absolute;

  left: 0;

  right: 0;

  bottom: 0;

  padding: 0.7rem 0.8rem calc(0.8rem + env(safe-area-inset-bottom, 0px));

  background: linear-gradient(180deg, rgba(5, 9, 11, 0) 0%, rgba(5, 9, 11, 0.85) 45%);

}



.camara-tiras {

  display: flex;

  gap: 0.4rem;

  overflow-x: auto;

  padding-bottom: 0.5rem;

  min-height: 0;

}



.camara-tiras img {

  width: 54px;

  height: 54px;

  object-fit: cover;

  border-radius: 8px;

  border: 1px solid rgba(255, 255, 255, 0.25);

  flex: 0 0 auto;

}



.camara-botones {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 1rem;

}



.camara-disparo {

  width: 68px;

  height: 68px;

  border-radius: 50%;

  border: 4px solid rgba(255, 255, 255, 0.9);

  background: rgba(255, 255, 255, 0.25);

  cursor: pointer;

}



.camara-disparo:active {

  background: #ffffff;

}



.camara-disparo[disabled] {

  opacity: 0.4;

}



.camara-cerrar {

  width: 42px;

  height: 42px;

  border-radius: 50%;

  border: 1px solid rgba(255, 255, 255, 0.3);

  background: rgba(0, 0, 0, 0.35);

  color: #fff;

  font-size: 1rem;

  cursor: pointer;

}



.camara-aviso {

  position: absolute;

  top: 1rem;

  left: 1rem;

  right: 1rem;

  margin: 0;

  padding: 0.7rem 0.9rem;

  border-radius: 10px;

  background: rgba(158, 47, 39, 0.9);

  color: #fff;

  font-size: 0.85rem;

}



/* Editor de brillo y contraste */

.editor-pantalla {

  position: fixed;

  inset: 0;

  z-index: 95;

  background: #05090b;

  display: flex;

  flex-direction: column;

  padding: 0.8rem;

  gap: 0.6rem;

}



.editor-arriba {

  display: flex;

  align-items: center;

  justify-content: space-between;

  color: #dfeae8;

  font-size: 0.82rem;

  font-family: var(--mono);

}



.editor-lienzo {

  flex: 1;

  min-height: 0;

  display: flex;

  align-items: center;

  justify-content: center;

  overflow: hidden;

}



.editor-lienzo canvas {

  max-width: 100%;

  max-height: 100%;

  border-radius: 10px;

  touch-action: none;

  cursor: ew-resize;

}



.editor-ayuda {

  margin: 0;

  text-align: center;

  font-size: 0.78rem;

  color: rgba(238, 244, 243, 0.55);

}



.editor-abajo {

  display: flex;

  gap: 0.5rem;

}



.editor-abajo .btn {

  flex: 1;

}





/* Herramientas del editor: girar y recortar */

.editor-herramientas {

  display: flex;

  gap: 0.4rem;

  flex-wrap: wrap;

  justify-content: center;

}



.editor-herramientas .btn {

  flex: 1 1 auto;

}



.editor-lienzo {

  position: relative;

}



.recorte {

  position: absolute;

  border: 2px solid #ffffff;

  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);

  border-radius: 4px;

  touch-action: none;

  cursor: move;

}



.recorte-asir {

  position: absolute;

  right: -10px;

  bottom: -10px;

  width: 22px;

  height: 22px;

  border-radius: 50%;

  background: #ffffff;

  border: 2px solid var(--lens);

  cursor: nwse-resize;

  touch-action: none;

}





/* El lienzo del editor ocupa todo el espacio disponible */

.editor-lienzo canvas {

  width: 100%;

  height: 100%;

  max-width: 100%;

  max-height: 100%;

  object-fit: contain;

}



.editor-lienzo.recortando canvas {

  cursor: default;

}



/* Vista previa del recorte */

.recorte-previa-caja {

  position: absolute;

  right: 0.5rem;

  bottom: 0.5rem;

  background: rgba(5, 9, 11, 0.85);

  border: 1px solid rgba(255, 255, 255, 0.25);

  border-radius: 10px;

  padding: 0.35rem;

  display: flex;

  flex-direction: column;

  gap: 0.25rem;

  pointer-events: none;

}



.recorte-previa-caja span {

  font-size: 0.62rem;

  letter-spacing: 0.08em;

  text-transform: uppercase;

  color: rgba(238, 244, 243, 0.6);

  text-align: center;

}



.recorte-previa-caja canvas {

  display: block;

  border-radius: 6px;

  background: #000;

  width: auto;

  height: auto;

  max-width: 132px;

  max-height: 132px;

}





/* Tutorial de primera vez en el editor */

.tutorial-editor {

  position: absolute;

  inset: 0;

  z-index: 5;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 0.6rem;

  text-align: center;

  color: #ffffff;

  background: rgba(5, 9, 11, 0.62);

  -webkit-backdrop-filter: blur(3px);

  backdrop-filter: blur(3px);

  border-radius: 10px;

  cursor: pointer;

  animation: fade 200ms ease;

}



.tutorial-editor[hidden] {

  display: none;

}



.tutorial-editor svg {

  width: 92px;

  height: 92px;

  color: #7fe3dd;

  animation: flotar 1.8s ease-in-out infinite;

}



.tutorial-editor p {

  margin: 0;

  font-size: 0.95rem;

  font-weight: 600;

  line-height: 1.35;

}



.tutorial-toca {

  font-size: 0.75rem;

  letter-spacing: 0.06em;

  text-transform: uppercase;

  color: rgba(255, 255, 255, 0.6);

}



@keyframes flotar {

  0%, 100% { transform: translateY(-4px); }

  50% { transform: translateY(4px); }

}





/* Paciente dentro de los formularios y acciones del formulario */

.paciente-en-form {

  display: flex;

  align-items: center;

  gap: 0.8rem;

  padding: 0.85rem 0.95rem;

  border: 1px solid var(--line);

  border-radius: var(--radius);

  background: rgba(20, 102, 107, 0.045);

  margin-bottom: 1rem;

}



.paciente-en-form-datos {

  min-width: 0;

  flex: 1;

  text-decoration: none;

  color: inherit;

}



.paciente-en-form-datos:hover .paciente-en-form-nombre {

  color: var(--lens);

}



.paciente-en-form-nombre {

  display: block;

  font-size: 1.18rem;

  font-weight: 600;

  line-height: 1.25;

  color: var(--ink);

}



.paciente-en-form-meta {

  display: flex;

  flex-wrap: wrap;

  align-items: baseline;

  gap: 0.55rem;

  font-size: 0.92rem;

  color: var(--ink-2);

  margin-top: 0.15rem;

}



.acciones-form {

  display: flex;

  flex-direction: column;

  gap: 0.5rem;

  align-items: stretch;

}



.acciones-form .btn-sm {

  align-self: center;

}





.acciones-form .btn-block {

  width: 100%;

}



/* --------------------------------------------------------------------------

   Accesibilidad, foco y ajustes de lectura

   -------------------------------------------------------------------------- */

.skip {

  position: absolute;

  left: -9999px;

  top: 0;

  z-index: 100;

  padding: 0.65rem 1rem;

  border-radius: 10px;

  background: var(--lens-deep);

  color: #fff;

  font-weight: 600;

  text-decoration: none;

}



.skip:focus {

  left: 0.6rem;

  top: 0.6rem;

  color: #fff;

}



input:focus-visible,

select:focus-visible,

textarea:focus-visible {

  outline: 2px solid var(--lens-deep);

  outline-offset: 1px;

}



input[type="file"] {

  width: 100%;

  max-width: 100%;

  min-width: 0;

  overflow: hidden;

}



input[type="file"]::file-selector-button {

  font: inherit;

  font-weight: 600;

  padding: 0.45rem 0.8rem;

  margin-right: 0.7rem;

  border-radius: 10px;

  border: 1px solid rgba(20, 102, 107, 0.2);

  background: var(--lens-soft);

  color: var(--lens-deep);

  cursor: pointer;

}



.rail .badge-draft,

.sidebar .badge-draft {

  background: #f6e7d2;

  color: #6b3d0e;

  border-color: #e5c9a3;

}



.card > p,

.panel > p {

  max-width: 72ch;

}



.subtitle-link {

  display: inline-flex;

  align-items: center;

  gap: 0.3rem;

  margin-left: 0.55rem;

  padding: 0.25rem 0.5rem;

  border-radius: 8px;

  color: var(--lens-deep);

  font-weight: 600;

  text-decoration: none;

}



.subtitle-link:hover {

  background: var(--lens-soft);

  text-decoration: none;

}



.field,

.row {

  min-width: 0;

}



.field input,

.field select,

.field textarea {

  max-width: 100%;

  min-width: 0;

}



@media (max-width: 899px) {

  .btn {

    min-height: 44px;

  }

  .btn-sm {

    min-height: 40px;

  }

  input,

  select,

  textarea {

    font-size: 16px;

  }

  .crumbs a {

    padding-block: 0.35rem;

  }

  summary {

    min-height: 40px;

    display: flex;

    align-items: center;

    gap: 0.4rem;

  }

  .tarjeta-item-datos small {

    font-size: 0.72rem;

  }

}



@media (min-width: 900px) {
  .plantillas-grid {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  }
}



@media (max-width: 359px) {

  .topbar .flex.wrap {

    grid-template-columns: 1fr;

  }

}



.archivo-caja {

  display: flex;

  flex-wrap: wrap;

  align-items: center;

  gap: 0.55rem;

  min-width: 0;

}



.archivo-caja input[type="file"] {

  position: absolute;

  width: 1px;

  height: 1px;

  opacity: 0;

  overflow: hidden;

}



.archivo-nombre {

  font-size: 0.82rem;

  color: var(--ink-3);

  overflow-wrap: anywhere;

}



.resumen-filas {

  display: grid;

  gap: 0.55rem;

}



.resumen-filas > div {

  display: flex;

  align-items: baseline;

  justify-content: space-between;

  gap: 0.8rem;

  padding-bottom: 0.45rem;

  border-bottom: 1px solid var(--line-soft);

}



.resumen-filas > div:last-child {

  border-bottom: 0;

  padding-bottom: 0;

}



.resumen-filas span {

  font-size: 0.78rem;

  color: var(--ink-3);

}



.resumen-filas strong {

  font-size: 0.9rem;

  text-align: right;

}



[id] {

  scroll-margin-top: 72px;

}


@media (min-width: 900px) {
  .cinta-sistema {
    display: none;
  }
}


@media (min-width: 900px) {
  .plantillas-grid {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  }
}


.tabla-plantillas {
  table-layout: fixed;
}

.tabla-plantillas td:first-child,
.tabla-plantillas th:first-child {
  white-space: normal;
}

.tabla-plantillas th:nth-child(2) {
  width: 110px;
}

.tabla-plantillas th:nth-child(3) {
  width: 112px;
}


@media (min-width: 900px) {
  .seccion-historia {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-1);
  }

  .seccion-historia .table thead th {
    background: rgba(20, 102, 107, 0.05);
    border-bottom-color: rgba(20, 102, 107, 0.14);
  }
}

tr[data-href],
tr[data-fila-consulta] {
  cursor: pointer;
}

tr[data-href]:focus-visible,
tr[data-fila-consulta]:focus-visible {
  outline: 2px solid var(--lens-deep);
  outline-offset: -2px;
}

.fila-nota td {
  background: rgba(20, 102, 107, 0.04);
}


.fila-nota td {
  text-align: left !important;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}


.install-ayuda {
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(20, 102, 107, 0.18);
  border-radius: 12px;
  background: var(--lens-soft);
  color: var(--ink-2);
  font-size: 0.84rem;
}

.install-ayuda[hidden] {
  display: none;
}

.install-ayuda strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ink);
}

.install-ayuda p {
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.drawer-instalar {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}


/* El inicio de sesi�n debe caber en una pantalla de tel�fono. */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 4vh, 2.5rem) 1rem;
}

@media (max-height: 720px) {
  .auth-wrap {
    padding: 0.8rem 0.9rem;
  }

  .auth-wrap > div > .flex:first-child {
    margin-bottom: 0.65rem !important;
  }

  .auth-wrap > div > .flex:first-child .brand-mark {
    width: 40px !important;
    height: 40px !important;
  }

  .auth-card {
    padding: 1.25rem 1.15rem;
  }

  .auth-card h1 {
    font-size: 1.55rem;
  }

  .auth-card .muted.text-sm {
    margin-top: 0.2rem;
    margin-bottom: 0.6rem;
  }

  .auth-card .btn {
    min-height: 40px;
  }

  .auth-card .auth-foot {
    margin-top: 0.55rem;
    font-size: 0.76rem;
  }

  .auth-wrap > div > p.auth-foot:last-child {
    display: none;
  }
}


/* --------------------------------------------------------------------------
   Odontograma
   -------------------------------------------------------------------------- */
.odonto-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.odonto-leyenda li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.odonto-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(10, 27, 32, 0.18);
  flex: none;
}

.odonto-mapa {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.odonto-cuadrante {
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(20, 102, 107, 0.035);
  min-width: 0;
}

.odonto-cuadrante-titulo {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

.odonto-dientes {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.diente {
  aspect-ratio: 0.82;
  min-width: 0;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 44% 44% 32% 32%;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.diente:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.4);
}

.diente:focus-visible {
  outline: 2px solid var(--lens-deep);
  outline-offset: 2px;
}

.diente.estado-sano {
  background: #fff;
  border-color: #b9c9c6;
  color: var(--ink-3);
}

.diente.estado-caries,
.odonto-color.estado-caries {
  background: #f8dcd7;
  border-color: #a9463b;
  color: #6e2018;
}

.diente.estado-obturado,
.odonto-color.estado-obturado {
  background: #dbe8f5;
  border-color: #356f9e;
  color: #1e4c70;
}

.diente.estado-corona,
.odonto-color.estado-corona {
  background: #f5e7c6;
  border-color: #9b7424;
  color: #6b4d0e;
}

.diente.estado-endodoncia,
.odonto-color.estado-endodoncia {
  background: #e8ddf3;
  border-color: #775096;
  color: #4c2e66;
}

.diente.estado-ausente,
.odonto-color.estado-ausente {
  background: #e7e7e2;
  border-color: #8b8b84;
  border-style: dashed;
  color: #6f6f69;
  text-decoration: line-through;
}

.diente.estado-implante,
.odonto-color.estado-implante {
  background: #d9eee2;
  border-color: #2f7d56;
  color: #1a5738;
}

.diente.estado-extraccion,
.odonto-color.estado-extraccion {
  background: #fbe6cf;
  border-color: #b36a1e;
  border-style: dashed;
  color: #7a4410;
}

.odonto-color.estado-sano {
  background: #fff;
  border-color: #b9c9c6;
}

@media (max-width: 899px) {
  .odonto-mapa {
    grid-template-columns: 1fr;
  }

  .odonto-dientes {
    gap: 0.28rem;
  }

  .diente {
    font-size: 0.68rem;
  }
}


/* Periodontograma */
.tabla-periodonto input[type="number"] {
  width: 54px;
  padding: 0.3rem 0.2rem;
  text-align: center;
}

.tabla-periodonto select {
  min-width: 62px;
  padding: 0.3rem 0.35rem;
}

.tabla-periodonto th[scope="row"] {
  white-space: nowrap;
}


.tabbar-dental {
  grid-template-columns: repeat(5, 1fr);
}


@media (max-width: 720px) {
  .tabla-periodonto-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tabla-periodonto {
    display: table;
    min-width: 760px;
  }

  .tabla-periodonto thead {
    display: table-header-group;
  }

  .tabla-periodonto tbody {
    display: table-row-group;
  }

  .tabla-periodonto tr {
    display: table-row;
  }

  .tabla-periodonto th,
  .tabla-periodonto td {
    display: table-cell;
    width: auto;
    text-align: center;
  }

  .tabla-periodonto th::before,
  .tabla-periodonto td::before {
    content: none;
  }
}


.periodonto-selector {
  display: none;
}

@media (max-width: 720px) {
  .periodonto-selector {
    display: block;
  }
}


.tabla-periodonto {
  width: 100%;
}


/* Agenda */
input[type="time"] {
  width: 100%;
  min-width: 0;
  padding: 0.62rem 0.8rem;
  min-height: 44px;
  border: 1px solid rgba(10, 27, 32, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
}

.agenda-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.agenda-cabecera,
.agenda-cuerpo {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  min-width: 760px;
}

.agenda-timeline {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-1);
  padding: 0.7rem;
}

.agenda-cabecera {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem;
}

.agenda-dia-cab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.35rem 0.2rem;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.75rem;
}

.agenda-dia-cab strong {
  font-size: 1.1rem;
  color: var(--ink);
}

.agenda-dia-cab small {
  font-size: 0.62rem;
  color: var(--ink-3);
}

.agenda-dia-cab.hoy,
.agenda-dia-cab.sel {
  background: var(--lens-soft);
  color: var(--lens-deep);
}

.agenda-dia-cab.sel strong {
  color: var(--lens-deep);
}

.agenda-cuerpo {
  height: 672px;
}

.agenda-horas {
  display: grid;
  grid-template-rows: repeat(12, 56px);
  font-size: 0.64rem;
  color: var(--ink-3);
  text-align: right;
  padding-right: 0.45rem;
}

.agenda-horas > div {
  transform: translateY(-0.35rem);
}

.agenda-col {
  position: relative;
  height: 672px;
  border-left: 1px solid var(--line-soft);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 55px,
    var(--line-soft) 55px,
    var(--line-soft) 56px
  );
}

.agenda-col.sel {
  background-color: rgba(20, 102, 107, 0.035);
}

.agenda-cita {
  position: absolute;
  left: 3px;
  right: 3px;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.25rem 0.35rem;
  border-left: 3px solid var(--lens);
  border-radius: 7px;
  background: var(--lens-soft);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.66rem;
  line-height: 1.2;
  overflow: hidden;
  z-index: 2;
}

.agenda-cita:hover {
  text-decoration: none;
  box-shadow: 0 4px 12px -8px rgba(0, 0, 0, 0.45);
}

.agenda-cita-hora {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--lens-deep);
}

.agenda-cita-nombre {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-cita-motivo {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-cita--confirmada {
  background: #d9eee2;
  border-left-color: #2f7d56;
}

.agenda-cita--atendida {
  background: #e7e7e2;
  border-left-color: #6f6f69;
  color: var(--ink-2);
}

.agenda-cita--cancelada {
  background: #f8dcd7;
  border-left-color: #a9463b;
  opacity: 0.8;
}

.agenda-mes-cab,
.agenda-mes {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.agenda-mes-cab {
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}

.agenda-mes-dia {
  position: relative;
  min-height: 62px;
  padding: 0.4rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
}

.agenda-mes-dia:hover {
  border-color: var(--lens);
  text-decoration: none;
}

.agenda-mes-dia.fuera {
  opacity: 0.35;
}

.agenda-mes-dia.hoy {
  outline: 2px solid var(--lens);
  outline-offset: -2px;
}

.agenda-mes-dia.sel {
  background: var(--lens-soft);
}

.agenda-mes-num {
  font-weight: 600;
  font-size: 0.82rem;
}

.agenda-mes-cuenta {
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--lens);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
}

@media (max-width: 899px) {
  .agenda-timeline {
    display: none;
  }

  .agenda-lista-dia .lista-tarjetas {
    gap: 0.6rem;
  }
}

@media (max-width: 720px) {
  .agenda-form .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agenda-form .row .field:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .tabla-periodonto-wrap {
    overflow-x: visible;
  }

  .tabla-periodonto {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  .tabla-periodonto th,
  .tabla-periodonto td {
    padding: 0.1rem;
    font-size: 0.66rem;
    width: auto;
  }

  .tabla-periodonto input[type="number"] {
    width: 100%;
    padding: 0.22rem 0.05rem;
    font-size: 0.72rem;
    -moz-appearance: textfield;
  }

  .tabla-periodonto input[type="number"]::-webkit-inner-spin-button,
  .tabla-periodonto input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  .tabla-periodonto select {
    width: 100%;
    min-width: 0;
    padding: 0.22rem 0.05rem;
    font-size: 0.68rem;
  }

  .tabla-periodonto th[scope="row"] {
    font-size: 0.64rem;
  }
}

@media (max-width: 720px) {
  .tabla-periodonto-wrap {
    overflow-x: visible;
  }

  .tabla-periodonto {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    table-layout: auto;
  }

  .tabla-periodonto thead {
    display: none;
  }

  .tabla-periodonto tbody,
  .tabla-periodonto tr,
  .tabla-periodonto th,
  .tabla-periodonto td {
    display: block;
    width: auto;
  }

  .tabla-periodonto tr {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .tabla-periodonto th[scope="row"] {
    grid-column: 1 / -1;
    padding: 0 0 0.15rem;
    border: 0;
    font-size: 1.05rem;
    text-align: left;
  }

  .tabla-periodonto td {
    padding: 0;
    border: 0;
    min-width: 0;
  }

  .tabla-periodonto td::before {
    content: attr(data-etiqueta);
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: left;
  }

  .tabla-periodonto td:nth-child(8),
  .tabla-periodonto td:nth-child(9),
  .tabla-periodonto td:nth-child(10) {
    grid-column: span 2;
  }

  .tabla-periodonto input[type="number"] {
    width: 100%;
    height: 40px;
    padding: 0.2rem;
    font-size: 0.85rem;
  }

  .tabla-periodonto select {
    width: 100%;
    height: 40px;
    min-width: 0;
    padding: 0.2rem;
    font-size: 0.8rem;
  }

  .tabla-periodonto input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 0.2rem;
  }
}

@media (max-width: 720px) {
  .tabla-periodonto tbody tr {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .odonto-dientes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .diente {
    font-size: 0.8rem;
  }
}

@media (max-width: 899px) {
  .crumbs a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0;
  }
}
