@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700&display=swap");

:root {
  --bg: #eef2f6;
  --bg-accent: #e8eef8;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #122033;
  --muted: #5b6b7c;
  --line: #d7e0ea;
  --line-strong: #c5d2e0;
  --primary: #0f766e;
  --primary-2: #14b8a6;
  --primary-soft: rgba(15, 118, 110, 0.1);
  --secondary: #2563eb;
  --secondary-soft: rgba(37, 99, 235, 0.1);
  --warn: #d97706;
  --danger: #e11d48;
  --ok: #059669;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(18, 32, 51, 0.06);
  --shadow-hover: 0 16px 40px rgba(18, 32, 51, 0.1);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Sora", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

/* Scroll funcional pero invisible (no rompe el estilo) */
* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none;
}

body {
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(20, 184, 166, 0.12), transparent 55%),
    radial-gradient(800px 380px at 100% 0%, rgba(37, 99, 235, 0.1), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
body.modal-open {
  overflow: hidden;
}

a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { color: #0b5f59; }

.shell {
  display: grid;
  grid-template-columns: 272px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1rem;
  background: linear-gradient(180deg, #0b1c2c 0%, #10253a 100%);
  color: #e8eef6;
  border-right: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .35rem .5rem 1.2rem;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2dd4bf, #0f766e);
  color: #042f2e;
  box-shadow: 0 8px 20px rgba(45, 212, 191, 0.25);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
}
.brand-sub {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8aa0b8;
  font-weight: 600;
}

.nav-group {
  margin: 1.1rem 0 .4rem;
  padding: 0 .75rem;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7f95ad;
  font-weight: 700;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .68rem .8rem;
  margin: .12rem 0;
  border-radius: 12px;
  color: #c9d7e6;
  font-weight: 600;
  transition: .18s ease;
}
.sidebar nav a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: .9;
}
.sidebar nav a:hover,
.sidebar nav a.is-active {
  background: rgba(45, 212, 191, 0.14);
  color: #fff;
}
.sidebar nav a.is-active {
  box-shadow: inset 3px 0 0 #2dd4bf;
}
.sidebar .nav-logout button {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .68rem .8rem;
  margin: .12rem 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #c9d7e6;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: .18s ease;
}
.sidebar .nav-logout button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: .9;
}
.sidebar .nav-logout button:hover {
  background: rgba(45, 212, 191, 0.14);
  color: #fff;
}

.rate-chip {
  margin: 1.25rem .35rem 0;
  padding: .9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: .8rem;
  color: #9db0c4;
}
.rate-chip strong {
  display: block;
  margin-top: .25rem;
  color: #5eead4;
  font-size: .95rem;
}

.content {
  padding: 1.35rem 1.6rem 2.4rem;
  min-width: 0;
}

.app-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: -.35rem 0 1rem;
  min-height: 2.25rem;
}
.app-header-actions { display: flex; align-items: center; gap: .6rem; }

.notif-bell-wrap { position: relative; }
.notif-bell {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line, #e8eef5);
  background: #fff;
  color: #0f2744;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04);
}
.notif-bell:hover { border-color: #0f766e; color: #0f766e; }
.notif-bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
}
.notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--line, #e8eef5);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 39, 68, 0.14);
  z-index: 40;
  overflow: hidden;
}
.notif-popover[hidden] { display: none !important; }
.notif-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line, #e8eef5);
}
.notif-popover-head .linkish {
  background: none;
  border: 0;
  color: #0f766e;
  font: inherit;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  padding: 0;
}
.notif-popover-list { max-height: 340px; overflow: auto; }
.notif-popover-item { margin: 0; border-bottom: 1px solid #f1f5f9; }
.notif-popover-item.is-unread { background: rgba(20,184,166,.06); }
.notif-popover-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: .8rem 1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.notif-popover-btn:hover { background: #f8fafc; }
.notif-popover-btn strong { font-size: .9rem; color: #0f2744; }
.notif-popover-btn span { font-size: .8rem; color: var(--muted); }
.notif-popover-btn em { font-size: .72rem; color: #94a3b8; font-style: normal; }
.notif-popover-empty { padding: 1.25rem 1rem; color: var(--muted); text-align: center; }
.notif-popover-foot {
  display: block;
  text-align: center;
  padding: .75rem;
  font-weight: 600;
  color: #0f766e;
  border-top: 1px solid var(--line, #e8eef5);
  text-decoration: none;
}

.appt-status { display: flex; flex-direction: column; gap: .4rem; min-width: 11rem; }
.appt-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: flex-start; }
.inline-form { display: inline; margin: 0; }
.btn-mini {
  border: 0;
  border-radius: 999px;
  padding: .28rem .65rem;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-confirm { background: #ecfdf5; color: #047857; }
.btn-complete { background: #eff6ff; color: #1d4ed8; }
.btn-cancel { background: #fff1f2; color: #be123c; }
.appt-cancel-reason { font-size: .75rem; max-width: 14rem; }
.badge.status-scheduled { background: #fef3c7; color: #92400e; }
.badge.status-confirmed { background: #ccfbf1; color: #0f766e; }
.badge.status-completed { background: #dbeafe; color: #1d4ed8; }
.badge.status-cancelled { background: #ffe4e6; color: #be123c; }

.ks-modal {
  position: fixed;
  inset: 0;
  width: min(560px, calc(100vw - 2.5rem));
  max-width: calc(100vw - 2.5rem);
  height: fit-content;
  max-height: calc(100vh - 2.5rem);
  margin: auto;
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
  z-index: 10000;
}
.ks-modal[open] {
  display: block;
}
.ks-modal::backdrop {
  background: rgba(15, 39, 68, 0.55);
  backdrop-filter: blur(3px);
}
.ks-modal-card {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line, #e8eef5);
  box-shadow: 0 24px 60px rgba(15, 39, 68, 0.28);
  padding: 1.35rem 1.4rem 1.35rem;
  overflow: hidden;
  box-sizing: border-box;
}
.ks-modal-card label,
.ks-modal-card input,
.ks-modal-card textarea,
.ks-modal-card select {
  max-width: 100%;
  box-sizing: border-box;
}
.ks-modal-card textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  margin-bottom: 0;
}
.ks-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1rem;
}
.ks-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f2744;
}
.ks-modal-head .muted { margin: .3rem 0 0; font-size: .88rem; }
.ks-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-title {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.page-sub { margin: .3rem 0 0; color: var(--muted); font-size: .92rem; font-weight: 500; }

.mobile-nav {
  display: none;
  gap: .45rem;
  overflow-x: auto;
  padding-bottom: .35rem;
  margin-bottom: 1rem;
}
.mobile-nav a {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .85rem;
  font-size: .78rem;
  color: var(--ink);
  background: var(--surface);
  font-weight: 600;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
.kpi {
  grid-column: span 3;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: .2s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: .85rem;
}
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon.teal { background: var(--primary-soft); color: var(--primary); }
.kpi-icon.blue { background: var(--secondary-soft); color: var(--secondary); }
.kpi-icon.amber { background: rgba(217, 119, 6, 0.12); color: var(--warn); }
.kpi-icon.rose { background: rgba(225, 29, 72, 0.1); color: var(--danger); }
.kpi-label {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.kpi-value {
  margin-top: .45rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.kpi-sub { margin-top: .3rem; color: var(--muted); font-size: .84rem; font-weight: 500; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  margin: 1rem 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel-head h2, .panel h2, .panel h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

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

label {
  display: block;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .35rem;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 12px;
  padding: .72rem .85rem;
  margin-bottom: .85rem;
  outline: none;
  transition: .15s ease;
  font-family: var(--font);
  font-size: .95rem;
}
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--primary) 50%),
    linear-gradient(135deg, var(--primary) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.8rem 100%;
  background-repeat: no-repeat;
  padding-right: 2.6rem;
  cursor: pointer;
}
select:hover {
  border-color: var(--primary-2);
}
select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
  background-color: #fff;
}
select option {
  background: #fff;
  color: var(--ink);
  padding: .5rem;
}
.line-card {
  background: var(--surface-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  padding: 1rem !important;
  margin-bottom: .85rem;
}
.staff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .5rem;
}
.staff-chips label {
  text-transform: none !important;
  letter-spacing: 0 !important;
  display: inline-flex !important;
  align-items: center;
  gap: .4rem;
  margin: 0 !important;
  padding: .45rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.staff-chips input {
  width: auto !important;
  margin: 0 !important;
  accent-color: var(--primary);
}
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 0;
  border-radius: 12px;
  padding: .72rem 1.05rem;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font);
  transition: .15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.25);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--primary-2); }

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f8fafc; }

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .72rem;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}
.dual { display: flex; flex-direction: column; gap: .05rem; }
.dual .main { font-weight: 700; color: var(--ink); }
.dual .alt { color: var(--muted); font-size: .82rem; font-weight: 500; }

.bar-list { display: grid; gap: .85rem; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; }
.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e8eef5;
  overflow: hidden;
  margin-top: .4rem;
}
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #2dd4bf);
}

.chart-box {
  position: relative;
  height: 280px;
  width: 100%;
}
.chart-box.sm { height: 220px; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: #065f46;
  padding: .75rem .95rem;
  border-radius: 12px;
  margin-bottom: .45rem;
  font-weight: 600;
}

.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.hero { position: relative; min-height: 100svh; overflow: hidden; background: #160d0b; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-footer {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: 2rem 1rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
}
.ig {
  display: inline-flex; gap: .5rem; align-items: center;
  border: 1px solid rgba(201,162,122,.4); background: rgba(0,0,0,.45);
  color: #e8c9a8; border-radius: 999px; padding: .55rem 1rem; font-size: .9rem;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(700px 360px at 20% 10%, rgba(20,184,166,.18), transparent 60%),
    radial-gradient(700px 360px at 90% 20%, rgba(37,99,235,.14), transparent 55%),
    var(--bg);
}
.login-card { width: min(420px, 100%); }

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: .6rem; color: #94a3b8; }

/* Logout / mobile / badges / file / notifs */
.mobile-nav .linkish,
.mobile-nav button.linkish {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #f43f5e;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  margin-left: .25rem;
}

/* Modern file upload */
.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 120px;
  padding: 1rem;
  border: 1.5px dashed #b7c5d4;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(20,184,166,.06), rgba(37,99,235,.04));
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  text-align: center;
}
.file-drop:hover,
.file-drop:focus-within {
  border-color: #0f766e;
  background: rgba(20,184,166,.1);
}
.file-drop .file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-drop { position: relative; }
.file-drop-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(15,118,110,.12);
  color: #0f766e;
}
.file-drop-icon svg { width: 22px; height: 22px; }
.file-drop-title {
  font-weight: 700;
  color: #0f2744;
  font-size: .95rem;
}
.file-drop-sub {
  font-size: .8rem;
  color: var(--muted);
  max-width: 16rem;
}

.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: #eef6f5;
  color: #0f766e;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
}
.chip-birthday { background: #fff1f2; color: #be123c; }
.birthday-banner {
  border: 1px solid rgba(244,63,94,.18);
  background: linear-gradient(90deg, rgba(255,241,242,.95), #fff);
}

.notif-row {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: .9rem 0;
  border-bottom: 1px solid var(--ks-line, #e8eef5);
}
.notif-row:last-child { border-bottom: 0; }
.notif-row.is-unread { background: rgba(20,184,166,.05); margin: 0 -.75rem; padding-inline: .75rem; border-radius: 12px; }
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eef2f7;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.notif-body { flex: 1; min-width: 0; }
.notif-body p { margin: .25rem 0 .35rem; color: var(--muted); }
.notif-actions { flex-shrink: 0; }

.create-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .5rem;
}
.create-panel-head h2 { margin: 0; font-size: 1.1rem; }
.create-panel[hidden] { display: none !important; }

.tabs {
  display: flex;
  gap: .4rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}
.tab {
  padding: .55rem 1rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #5b6b7c;
  font-weight: 600;
  text-decoration: none;
}
.tab.is-active {
  background: #0f766e;
  color: #fff;
}
.chip-active {
  background: #0f766e !important;
  color: #fff !important;
}
.perm-table th:not(:first-child),
.perm-table td:not(:first-child) { text-align: center; width: 7rem; }
.perm-check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.perm-check input { width: auto; margin: 0; }
.user-edit-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line, #e8eef5);
  margin: 0;
}

/* Flip cards — clientes / empleados */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 1rem;
}
.flip-card {
  height: 260px;
  perspective: 1100px;
  border: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  overflow: visible;
}
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
  transform-style: preserve-3d;
  border-radius: 18px;
}
.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}
@media (hover: hover) and (pointer: fine) {
  .flip-card:hover .flip-inner,
  .flip-card:focus-within .flip-inner {
    transform: rotateY(180deg);
  }
}
.flip-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  box-sizing: border-box;
  transform: translateZ(0);
}
.flip-front {
  display: flex;
  flex-direction: column;
  z-index: 1;
}
.flip-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #e2e8f0;
}
.flip-photo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}
.flip-avatar {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 700;
  color: #0f766e;
  background:
    radial-gradient(circle at 30% 20%, rgba(20,184,166,.25), transparent 55%),
    linear-gradient(160deg, #ecfeff, #eff6ff);
}
.flip-front-caption {
  flex: 0 0 auto;
  padding: .55rem .75rem .65rem;
  background: #fff;
  border-top: 1px solid #eef2f7;
}
.flip-front-caption strong {
  display: block;
  font-size: .9rem;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flip-front-caption span {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .12rem;
}
.flip-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 0;
  background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
}
.flip-back-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: .85rem .85rem .4rem;
}
.flip-back-body strong {
  display: block;
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.25;
}
.flip-meta {
  list-style: none;
  margin: .4rem 0 0;
  padding: 0;
}
.flip-meta li {
  font-size: .76rem;
  color: var(--muted);
  padding: .22rem 0;
  border-bottom: 1px dashed #e8eef5;
  word-break: break-word;
}
.flip-back-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  padding: .55rem .85rem .75rem;
  border-top: 1px solid #eef2f7;
  background: #fff;
}
.flip-link {
  margin: 0;
  padding: .32rem .7rem;
  font-size: .76rem;
  line-height: 1.2;
}
.flip-hint {
  font-size: .65rem;
  color: #94a3b8;
}
.flip-bday-badge {
  position: absolute;
  top: .45rem;
  left: .45rem;
  z-index: 3;
  background: linear-gradient(135deg, #fb7185, #f43f5e);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .02em;
  padding: .22rem .5rem;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(244, 63, 94, 0.35);
  max-width: calc(100% - .9rem);
}
.flip-card.is-birthday .flip-face {
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow:
    0 0 0 2px rgba(251, 113, 133, 0.25),
    0 12px 28px rgba(244, 63, 94, 0.18);
  animation: birthdayGlow 2.4s ease-in-out infinite;
}
.flip-card.is-birthday .flip-front {
  background:
    radial-gradient(circle at 80% 10%, rgba(251,191,36,.35), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(244,63,94,.2), transparent 45%),
    #fff;
}
@keyframes birthdayGlow {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(251, 113, 133, 0.22),
      0 10px 24px rgba(244, 63, 94, 0.14);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(251, 191, 36, 0.35),
      0 14px 32px rgba(244, 63, 94, 0.28);
  }
}
.list-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}
.list-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 800;
  color: #0f766e;
  background: #ecfeff;
}
.row-birthday td {
  background: rgba(255, 241, 242, 0.65);
}
@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
  .flip-card.is-birthday .flip-face { animation: none; }
}

@media (max-width: 1200px) {
  .kpi { grid-column: span 6; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .kpi { grid-column: span 12; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 1rem 1rem 2rem; }
}
