:root {
  --teal-700: #0f6e56;
  --teal-600: #159171;
  --teal-500: #1db589;
  --teal-100: #cdeae0;
  --teal-50: #eef8f4;
  --lime-600: #5e8c1e;
  --lime-500: #7cb026;
  --lime-50: #f3f8e8;
  --ink: #16241f;
  --gray-700: #46544e;
  --gray-500: #7a8782;
  --gray-400: #9aa6a1;
  --gray-300: #cdd6d2;
  --gray-200: #e7ece9;
  --gray-100: #f1f4f2;
  --gray-50: #f8faf9;
  --white: #ffffff;
  --bg: #f7f9f8;
  --red: #d9534f;
  --red-bg: #fcefee;
  --amber: #d99318;
  --amber-bg: #fdf5e6;
  --blue: #3a82c4;
  --blue-bg: #eef4fa;
  --green: #4a9d4e;
  --green-bg: #eef6ee;
  --teal-bg: #e8f6f3;
  --teal: #138975;
  --shadow-sm: 0 1px 2px rgba(22, 36, 31, 0.04);
  --shadow: 0 2px 8px rgba(22, 36, 31, 0.06);
  --shadow-lg: 0 12px 40px rgba(22, 36, 31, 0.12);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 8px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ===== login (pantalla dividida) ===== */
#login {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #eef2f1;
  overflow: auto;
  padding: 0;
}
#login::after {
  content: none;
}
#login {
  --lg-shell: 1040px;
}
/* contenedor que centra la "cáscara" partida */
#login {
  align-items: center;
}
/* panel de marca (izquierda) */
.login-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  flex: 0 0 auto;
  width: min(520px, 46vw);
  max-width: 520px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 44px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 255, 255, 0.14), transparent 60%),
    linear-gradient(150deg, var(--teal-700), var(--teal-500));
}
.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 22% 28%, #fff 1.5px, transparent 2px),
    radial-gradient(circle at 70% 62%, #fff 1.5px, transparent 2px),
    radial-gradient(circle at 45% 86%, #fff 1.5px, transparent 2px);
  background-size: 120px 120px;
}
.login-ekg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 130px;
  opacity: 0.22;
}
.login-ekg path {
  stroke: #fff;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: ekg 4s ease-in-out infinite;
}
@keyframes ekg {
  0% {
    stroke-dashoffset: 600;
  }
  55% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -600;
  }
}
.login-hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, #fff, #eef4f2);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.4);
}
.login-hero-logo img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  margin: 10%;
}
.login-hero-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
}
.login-hero-name span {
  color: #bff0e3;
}
.login-hero-name small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.24em;
  opacity: 0.85;
  text-transform: uppercase;
  margin-top: 7px;
}
.login-hero-mid {
  position: relative;
  z-index: 2;
  max-width: 340px;
}
.login-hero-mid h2 {
  font-size: 27px;
  line-height: 1.25;
  font-weight: 700;
}
.login-hero-mid p {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.9;
}
.login-hero-foot {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 22px;
  font-size: 12.5px;
  opacity: 0.92;
}
.login-hero-foot span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.login-hero-foot i {
  font-size: 16px;
}

/* tarjeta (derecha) */
.login-card {
  position: relative;
  z-index: 2;
  width: min(460px, 54vw);
  max-width: 460px;
  align-self: stretch;
  background: var(--white);
  border-radius: 0;
  padding: 0 clamp(30px, 5vw, 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: none;
  animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-7px);
  }
  75% {
    transform: translateX(7px);
  }
}
/* el logo (dentro de la tarjeta: crear-admin, errores, etc.) */
.login-card .login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  overflow: hidden;
}
.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-logo i {
  font-size: 32px;
  color: var(--teal-600);
}
.login-title {
  text-align: center;
  font-size: 22px;
  color: var(--ink);
  font-weight: 700;
}
.login-sub {
  text-align: center;
  font-size: 12.5px;
  color: var(--gray-400);
  margin-top: 5px;
  margin-bottom: 26px;
}

/* la "cáscara" partida: tarjeta blanca redondeada solo en desktop */
@media (min-width: 860px) {
  #login {
    padding: 32px;
  }
  .login-hero {
    border-radius: 24px 0 0 24px;
    min-height: 600px;
    box-shadow: 0 24px 60px -28px rgba(15, 42, 46, 0.4);
  }
  .login-card {
    border-radius: 0 24px 24px 0;
    min-height: 600px;
    box-shadow: 0 24px 60px -28px rgba(15, 42, 46, 0.4);
  }
}
/* móvil: se apila, el hero se compacta arriba */
@media (max-width: 859px) {
  #login {
    flex-direction: column;
    align-items: stretch;
  }
  .login-hero {
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 26px 24px;
    min-height: auto;
  }
  .login-hero-top {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }
  .login-hero-logo {
    width: 56px;
    height: 56px;
  }
  .login-hero-name {
    font-size: 19px;
  }
  .login-hero-mid,
  .login-hero-foot,
  .login-ekg {
    display: none;
  }
  .login-card {
    width: auto;
    flex: 1 1 auto;
    padding: 34px 24px;
    justify-content: flex-start;
    min-height: auto;
  }
}
.field {
  margin-bottom: 15px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  transition: 0.15s;
  outline: none;
}
.field input:focus {
  border-color: var(--teal-500);
  background: #fff;
  box-shadow: 0 0 0 3px var(--teal-50);
}
.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--teal-700);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
  transition: 0.15s;
}
.login-btn:hover {
  background: var(--teal-600);
}
.demo-zone {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}
.demo-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.demo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.demo-chip {
  padding: 6px 13px;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--gray-700);
  font-weight: 500;
  transition: 0.15s;
}
.demo-chip:hover {
  border-color: var(--teal-500);
  color: var(--teal-700);
  background: var(--teal-50);
}

/* ===== tarjeta del login: diseño alineado a la izquierda (como el original) ===== */
.login-card {
  align-items: stretch;
  text-align: left;
}
.login-card .login-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  box-shadow: 0 4px 12px rgba(15, 42, 46, 0.08);
  margin: 0 0 20px 0;
}
.login-card .login-logo img {
  width: 74%;
  height: 74%;
}
.login-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: 8px;
}
.login-card .login-title {
  text-align: left;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.login-card .login-sub {
  text-align: left;
  font-size: 13.5px;
  color: var(--gray-500);
  line-height: 1.5;
  margin-top: 8px;
  margin-bottom: 26px;
  max-width: 340px;
}
.login-card .field {
  margin-bottom: 16px;
}
.login-card .field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
  text-align: left;
}
/* input con icono + botón Ver */
.lg-inp {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 0 14px;
  transition:
    border-color 0.16s,
    box-shadow 0.16s,
    background 0.16s;
}
.lg-inp i {
  font-size: 19px;
  color: var(--gray-400);
  flex: none;
  transition: color 0.16s;
}
.lg-inp input {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 15px;
  padding: 14px 2px;
  min-height: 24px;
  box-shadow: none;
}
.lg-inp input::placeholder {
  color: #9aa8a6;
}
.lg-inp:focus-within {
  background: #fff;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(15, 110, 86, 0.1);
}
.lg-inp:focus-within i {
  color: var(--teal-600);
}
.lg-verbtn {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
  padding: 6px;
  flex: none;
  transition: color 0.16s;
}
.lg-verbtn:hover {
  color: var(--teal-700);
}
.login-card .login-btn {
  margin-top: 6px;
  padding: 15px;
  border-radius: 12px;
  min-height: 52px;
  font-size: 15px;
  box-shadow: 0 12px 24px -10px rgba(15, 110, 86, 0.5);
}
.login-secure {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
  font-size: 11.5px;
  color: var(--gray-500);
  font-weight: 500;
}
.login-secure i {
  font-size: 15px;
  color: var(--teal-600);
  flex: none;
}
.login-help {
  margin-top: 12px;
}
.login-help a {
  font-size: 11.5px;
  color: var(--gray-400);
  cursor: pointer;
}
.login-help a:hover {
  color: var(--teal-700);
}

/* estructura */
#app {
  display: none;
  height: 100vh;
  overflow: hidden;
}
.topbar {
  height: 60px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: relative;
  z-index: 50;
}
.tb-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
/* logo barra */
.tb-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.tb-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tb-logo i {
  font-size: 19px;
  color: #fff;
}
.tb-name {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.tb-name span {
  color: var(--teal-600);
}
.tb-divider {
  display: block;
  width: 1px;
  height: 26px;
  background: var(--gray-200);
  margin: 0 4px;
}
.tb-search {
  flex: 1;
  max-width: 420px;
  position: relative;
  margin-left: 14px;
}
.tb-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.tb-search i svg {
  width: 18px;
  height: 18px;
}
.tb-search input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--gray-200);
  border-radius: 22px;
  background: var(--gray-50);
  outline: none;
  transition: 0.15s;
  font-size: 13px;
}
.tb-search input:focus {
  border-color: var(--teal-400);
  background: #fff;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}
.search-results.show {
  display: block;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
}
.search-item:last-child {
  border-bottom: none;
}
.search-item:hover {
  background: var(--gray-50);
}
.search-item .si-ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--teal-50);
  color: var(--teal-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.search-cat {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  background: var(--gray-50);
}
.tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tb-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: 0.15s;
  position: relative;
}
.tb-icon:hover {
  background: var(--gray-100);
  color: var(--ink);
}
.tb-icon .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #fff;
}
.tb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--gray-200);
}
.tb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--teal-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-700);
  font-weight: 600;
  font-size: 13px;
}
.tb-uinfo {
  line-height: 1.25;
}
.tb-uname {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.tb-urole {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: capitalize;
}

.layout {
  display: flex;
  height: calc(100vh - 60px);
}
.sidebar {
  width: 230px;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 16px 14px;
  transition: 0.2s;
}
.nav-group {
  margin-bottom: 6px;
}
.nav-glabel {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.02em;
  padding: 14px 12px 7px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-size: 13.5px;
  font-weight: 500;
  transition: 0.13s;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}
.nav-item i {
  font-size: 19px;
  color: var(--gray-400);
  transition: 0.13s;
  flex-shrink: 0;
}
.nav-item:hover {
  background: var(--gray-50);
  color: var(--ink);
}
.nav-item:hover i {
  color: var(--teal-600);
}
.nav-item.active {
  background: var(--teal-50);
  color: var(--teal-700);
  font-weight: 600;
}
.nav-item.active i {
  color: var(--teal-600);
}
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--gray-100);
  color: var(--gray-500);
}
.nav-item.active .nav-badge {
  background: var(--teal-100);
  color: var(--teal-700);
}

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 30px;
  background: var(--bg);
}
.page {
  display: none;
  animation: fade 0.3s ease;
  max-width: 100%;
}
.page.active {
  display: block;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* estilos generales */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 22px;
  color: var(--ink);
  font-weight: 600;
}
.page-sub {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 4px;
}
.page-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: 0.15s;
  white-space: nowrap;
}
.btn i {
  font-size: 16px;
}
.btn-primary {
  background: var(--teal-700);
  color: #fff;
}
.btn-primary:hover {
  background: var(--teal-600);
}
.btn-light {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-light:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
.btn-lime {
  background: var(--lime-500);
  color: #fff;
}
.btn-lime:hover {
  background: var(--lime-600);
}
.btn-ghost {
  color: var(--gray-500);
  padding: 7px 10px;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--ink);
}
.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}
.btn-sm i {
  font-size: 14px;
}

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  outline: none;
  transition: 0.15s;
}
.input:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-50);
}
select.input {
  cursor: pointer;
}
.lbl {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card:has(table) {
  overflow-x: auto;
}
.card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-title i {
  font-size: 18px;
  color: var(--gray-400);
  flex-shrink: 0;
}
.card-body {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: 0.15s;
  min-width: 0;
  overflow: hidden;
}
.stat:hover {
  box-shadow: var(--shadow);
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  flex-shrink: 0;
}
.stat-ic i {
  font-size: 18px;
}
.stat-val {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 10px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-foot {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-foot.up {
  color: var(--green);
}
.stat-foot.down {
  color: var(--red);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}
thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-400);
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-200);
}
tbody td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: 0.1s;
}
tbody tr:hover {
  background: var(--gray-50);
}
.t-strong {
  font-weight: 600;
  color: var(--ink);
}
.t-mono {
  font-family: 'Sora', monospace;
  font-weight: 600;
  color: var(--teal-700);
  font-size: 12.5px;
}
.t-money {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.bg-green {
  background: var(--green-bg);
  color: var(--green);
}
.bg-amber {
  background: var(--amber-bg);
  color: var(--amber);
}
.bg-red {
  background: var(--red-bg);
  color: var(--red);
}
.bg-blue {
  background: var(--blue-bg);
  color: var(--blue);
}
.bg-teal {
  background: var(--teal-50);
  color: var(--teal-700);
}
.bg-gray {
  background: var(--gray-100);
  color: var(--gray-500);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  font-family: 'Sora', sans-serif;
}
.av-teal {
  background: var(--teal-100);
  color: var(--teal-700);
}
.av-lime {
  background: var(--lime-50);
  color: var(--lime-600);
}
.av-blue {
  background: var(--blue-bg);
  color: var(--blue);
}
.avatar-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.progress {
  height: 6px;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 6px;
  background: var(--teal-500);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 8px;
}
.alert i {
  font-size: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}
.alert-red {
  background: var(--red-bg);
  color: #a8362c;
}
.alert-amber {
  background: var(--amber-bg);
  color: #946012;
}
.alert-blue {
  background: var(--blue-bg);
  color: #1c5a8f;
}
.alert-green {
  background: var(--green-bg);
  color: #2c6e2f;
}

/* modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(22, 36, 31, 0.4);
  z-index: 150;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  backdrop-filter: blur(3px);
}
.modal-bg.open {
  display: flex;
  animation: fade 0.2s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: rise 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.lg {
  max-width: 660px;
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
}
.modal-body {
  padding: 22px;
}
.modal-foot {
  padding: 15px 22px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: 0.15s;
}
.modal-close:hover {
  background: var(--gray-100);
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-grid .full {
  grid-column: 1/-1;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 22px;
  overflow-x: auto;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: 0.15s;
  margin-bottom: -1px;
}
.tab:hover {
  color: var(--gray-700);
}
.tab.active {
  color: var(--teal-700);
  border-bottom-color: var(--teal-600);
  font-weight: 600;
}

.toast-wrap {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: rise 0.3s ease;
}
.toast i {
  font-size: 17px;
}
.toast.ok i {
  color: var(--teal-500);
}
.toast.err {
  background: var(--red);
}

.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--gray-400);
}
.empty-ic {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.empty-ic i {
  font-size: 28px;
  color: var(--gray-300);
}
.empty h4 {
  font-size: 14px;
  color: var(--gray-700);
  font-weight: 600;
  margin-bottom: 4px;
}
.empty p {
  font-size: 13px;
  color: var(--gray-400);
  max-width: 320px;
  margin: 0 auto 16px;
}

.section-divider {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  margin: 24px 0 12px;
}

.pct-input {
  width: 58px;
  text-align: center;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  padding: 6px;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  background: var(--white);
  outline: none;
}
.pct-input:focus {
  border-color: var(--teal-500);
}

.receipt {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--white);
}
.receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--gray-200);
}
/* logo recibo */
.logo-slot {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.logo-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-slot i {
  font-size: 22px;
  color: var(--teal-600);
}

/* bloques */
.block {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.block-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
}
.block-head .bh-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-50);
}
.block-head .bh-ic i {
  font-size: 17px;
  color: var(--teal-600);
}
.block-head .block-title {
  font-family: 'Sora';
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  color: var(--ink);
}
.block-head .block-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
}
.block-body {
  padding: 0;
  min-height: 90px;
}
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.mini-row:last-child {
  border-bottom: none;
}
.mini-row:hover {
  background: var(--gray-50);
}
.block-foot {
  padding: 11px 14px;
  border-top: 1px solid var(--gray-100);
}
.block-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}
.block-empty i,
.block-empty .ti-svg {
  font-size: 24px;
  color: var(--gray-300);
  display: block;
  margin: 0 auto 8px;
  width: 24px;
  height: 24px;
}
.ti-svg {
  align-items: center;
  justify-content: center;
}
.ti-svg svg {
  width: 1em;
  height: 1em;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    z-index: 60;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .tb-search {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 18px;
  }
}
.menu-btn {
  display: none;
}
@media (max-width: 900px) {
  .menu-btn {
    display: flex;
  }
}
.hide-sm {
}
@media (max-width: 600px) {
  .hide-sm {
    display: none;
  }
}

/* ═══════════════ Refinamiento de UI (aditivo, no rompe lo anterior) ═══════════════ */

/* Transiciones suaves y consistentes en elementos interactivos */
.btn,
.input,
.card,
.demo-chip,
.badge,
select,
textarea {
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.08s ease;
}

/* Feedback al presionar botones (sensación física, no plana) */
.btn:active {
  transform: translateY(1px);
}
.btn-primary:active {
  background: var(--teal-700);
}

/* Accesibilidad: anillo de foco visible solo al navegar con teclado */
.btn:focus-visible,
.demo-chip:focus-visible,
a:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}
.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}

/* Botón primario con un poco más de presencia (sombra sutil de marca) */
.btn-primary {
  box-shadow: 0 1px 2px rgba(15, 110, 86, 0.18);
}
.btn-primary:hover {
  box-shadow: 0 2px 8px rgba(15, 110, 86, 0.24);
}

/* Tarjetas: leve elevación al pasar el cursor (solo las interactivas por cursor) */
.card {
  transition:
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

/* Inputs: foco un pelín más marcado y borde más limpio en reposo */
.input:hover,
select:hover,
textarea:hover {
  border-color: var(--gray-300);
}

/* Estados deshabilitados coherentes */
.btn:disabled,
.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Color de selección de texto con la marca */
::selection {
  background: var(--teal-100);
  color: var(--ink);
}

/* Scrollbar un poco más fina y discreta */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Números tabulares para montos y turnos (se alinean mejor en tablas) */
.t-mono,
.badge,
td {
  font-variant-numeric: tabular-nums;
}

/* Tipografía de títulos un poco más apretada (se ve más intencional) */
.page-title,
.card-title,
.login-title {
  letter-spacing: -0.01em;
}

/* ═══════════════ Modo TV / kiosko para sala de espera ═══════════════ */
/* Oculta la barra de arriba y el menú lateral; deja solo la pantalla. */
body.kiosko .topbar,
body.kiosko .sidebar {
  display: none !important;
}
body.kiosko .layout {
  display: block;
}
body.kiosko .main {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100vw;
  min-height: 100vh;
  overflow-y: auto;
}
body.kiosko {
  overflow: hidden;
}

/* ===== MODO OSCURO ===== */
html[data-tema="oscuro"]{
  --ink:#e8eef0; --card:#16211f; --gray-50:#1b2725; --gray-100:#22302d;
  --gray-200:#2c3d3a; --gray-300:#3a4d49; --gray-400:#7c918c; --gray-500:#9db0ab;
  --gray-600:#c2d0cc; --gray-700:#dbe6e3;
}
html[data-tema="oscuro"] body{background:#0e1817;color:var(--ink)}
html[data-tema="oscuro"] .input,html[data-tema="oscuro"] input,html[data-tema="oscuro"] select,html[data-tema="oscuro"] textarea{background:#16211f;color:var(--ink);border-color:#2c3d3a}
html[data-tema="oscuro"] .modal,html[data-tema="oscuro"] .modal-body{background:#16211f;color:var(--ink)}
html[data-tema="oscuro"] .btn-light{background:#22302d;color:var(--gray-700);border-color:#2c3d3a}
html[data-tema="oscuro"] .sidebar,html[data-tema="oscuro"] .topbar{background:#111b1a}
