/* Identidad Silvestre — paneles de gestión */
:root {
  --bg: #f8f5f0;
  --surface: #fffdf9;
  --text: #1f1a17;
  --muted: #6f655e;
  --line: rgba(31, 26, 23, 0.12);
  --accent: #b39b7c;
  --accent-dark: #8e775c;
  --gold-rich: #c9a227;
  --danger: #8b3a2f;
  --ok: #3d6b4f;
  --sidebar: 200px;
  --radius: 10px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --shadow: 0 4px 14px rgba(25, 20, 16, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(201, 162, 39, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(179, 155, 124, 0.16), transparent 50%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold-rich);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-brand img {
  width: min(200px, 70%);
  height: auto;
  object-fit: contain;
}

.auth-brand h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.75rem;
  margin: 0;
}

.auth-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="text"],
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--text);
}

.btn[hidden] { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 560;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.btn:hover {
  filter: brightness(0.97);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn--block {
  width: 100%;
}

.alert {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.alert--ok {
  background: rgba(61, 107, 79, 0.1);
  color: var(--ok);
  border: 1px solid rgba(61, 107, 79, 0.25);
}

.alert--error {
  background: rgba(139, 58, 47, 0.08);
  color: var(--danger);
  border: 1px solid rgba(139, 58, 47, 0.25);
}

.alert--dev {
  background: rgba(201, 162, 39, 0.12);
  color: #5a4a12;
  border: 1px solid rgba(201, 162, 39, 0.35);
  word-break: break-all;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-links {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 0.85rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.15rem 0.35rem;
  text-align: center;
}

.sidebar__brand img {
  width: 64px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.sidebar__brand .laraia-brand,
.sidebar__brand .nubia-brand {
  justify-content: center;
  text-align: center;
}

.sidebar__meta {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 0.4rem;
  line-height: 1.3;
  text-align: center;
}

.sidebar > .wedding-chip {
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}

.sidebar nav {
  display: grid;
  gap: 0.15rem;
  flex: 1;
  align-content: start;
  align-items: stretch;
}

.nav-link {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.25;
}

.nav-link:hover {
  background: rgba(179, 155, 124, 0.12);
}

.nav-link.is-active {
  background: rgba(179, 155, 124, 0.2);
  font-weight: 600;
}

.chart-box {
  position: relative;
  width: 100%;
  max-width: none;
  height: 168px;
  margin: 0.35rem 0 0;
  flex: 1 1 auto;
}

.chart-box--wide {
  max-width: none;
  height: 168px;
}

.chart-box--tall {
  height: 240px;
}

.chart-box--wave {
  height: 110px;
  margin-top: 0.25rem;
}

.metrics-wave-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

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

@media (max-width: 560px) {
  .metrics-wave-grid {
    grid-template-columns: 1fr;
  }
}

.metrics-wave {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.7);
  padding: 0.65rem 0.75rem 0.5rem;
}

.metrics-wave__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.chart-box canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.dash-charts {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.75rem;
  align-items: stretch;
}

@media (max-width: 720px) {
  .dash-charts {
    grid-template-columns: 1fr;
  }
}

.dash-charts > .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 240px;
  margin-top: 0 !important;
}

.dash-charts > .panel .chart-box,
.dash-charts > .panel .empty-state {
  margin-top: auto;
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-charts > .panel .empty-state {
  width: 100%;
}

.sidebar__footer {
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
}

.sidebar__footer .muted {
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: center;
}

.sidebar__footer form {
  width: 100%;
  margin: 0;
}

.sidebar__footer .btn {
  text-align: center;
}

.support-dialog {
  width: min(28rem, calc(100vw - 2rem));
  margin: auto;
  border: 1px solid var(--line, #d5d0c2);
  background: #fffdf9;
  color: var(--text, #1f1a17);
  padding: 1.1rem 1.15rem 1rem;
}

.support-dialog::backdrop {
  background: rgba(28, 25, 23, 0.35);
}

.support-dialog h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.support-dialog p {
  margin: 0 0 0.8rem;
}

.support-dialog label {
  display: grid;
  gap: 0.35rem;
}

.support-dialog textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
}

.support-dialog__error {
  color: #8a2a2a;
  margin-top: 0.55rem;
}

.support-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.main {
  padding: 1rem clamp(0.85rem, 2vw, 1.5rem) 1.75rem;
  min-width: 0;
}

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  min-height: 2.4rem;
}

.panel-topbar__start,
.panel-topbar__end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.panel-topbar__mobile-brand {
  display: none;
}

.panel-topbar .mobile-nav__toggle {
  display: none;
}

.notif-bell {
  position: relative;
}

.notif-bell__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink, #1f1a17);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.notif-bell__btn:hover,
.notif-bell.is-open .notif-bell__btn {
  border-color: color-mix(in srgb, var(--ink, #1f1a17) 28%, var(--line));
}

.notif-bell__badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #8b3a2f;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15rem;
  text-align: center;
}

.notif-bell__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 26rem);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
}

.notif-bell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.notif-bell__head a {
  color: inherit;
  font-size: 0.82rem;
}

.notif-bell__empty {
  margin: 0;
  padding: 0.9rem 0.85rem;
  font-size: 0.88rem;
}

.notif-bell__item {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.notif-bell__item:last-child {
  border-bottom: 0;
}

.notif-bell__item.is-unread {
  background: color-mix(in srgb, var(--accent, #a88f6d) 8%, #fff);
}

.notif-bell__link {
  display: grid;
  gap: 0.15rem;
  text-decoration: none;
  color: inherit;
}

.notif-bell__link strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.notif-bell__link span {
  color: var(--muted);
  font-size: 0.78rem;
}

.notif-bell__mark {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.page-header {
  margin-bottom: 1rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  margin: 0 0 0.25rem;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.wedding-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.9);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 0.75rem;
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
}

.kpi-panel h2 { margin-bottom: 1rem; }
.kpi-row { display:grid; grid-template-columns:minmax(10rem, 1fr) auto minmax(8rem, 2fr); gap:.75rem; align-items:center; margin:.7rem 0; }
.kpi-bar { display:block; height:.55rem; overflow:hidden; border-radius:999px; background:var(--surface-muted, #eee8df); }
.kpi-bar i { display:block; height:100%; border-radius:inherit; background:var(--accent, #a88f6d); }
@media (max-width:600px) { .kpi-row { grid-template-columns:1fr auto; } .kpi-bar { grid-column:1/-1; } }

.guest-page {
  display: grid;
  gap: 1rem;
}
.guest-page .stat-grid { margin: 0; }
.guest-page .panel { margin-top: 0; padding: 1.15rem 1.35rem; }
.guest-page .stat { padding: 0.95rem 1.1rem; }
.guest-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.15rem;
  align-items: end;
  margin: 0;
}
.guest-filters label { flex: 1 1 11rem; min-width: 0; }
.guest-filters label:has(input[type="checkbox"]) { flex: 0 1 auto; }
.guest-filters .btn { flex: 0 0 auto; margin-left: auto; }
.guest-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.guest-tools .panel { height: 100%; }
.guest-tools .btn { margin-top: 0.35rem; }
@media (max-width: 860px) {
  .guest-tools { grid-template-columns: 1fr; }
  .guest-filters .btn { margin-left: 0; }
}

.stat {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.stat--primary {
  padding: 0.95rem 1rem;
  grid-column: span 1;
}

.stat--primary .stat__value {
  font-size: 1.75rem;
}

.stat--primary .stat__label {
  font-size: 0.82rem;
}

.stat--secondary {
  padding: 0.5rem 0.65rem;
  opacity: 0.88;
}

.stat--secondary .stat__value {
  font-size: 1.1rem;
}

.stat--secondary .stat__label {
  font-size: 0.7rem;
}

.stat__label {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.stat__value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-top: 0.1rem;
  line-height: 1.15;
}

.empty-state {
  padding: 0.85rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  color: var(--muted);
  font-weight: 560;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mobile-nav {
  display: none;
}

.mobile-nav__toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar), 88vw);
    z-index: 40;
    height: 100%;
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    display: flex;
  }

  .topbar {
    display: flex;
  }

  .panel-topbar .mobile-nav__toggle {
    display: inline-flex;
  }

  .panel-topbar__mobile-brand {
    display: inline-flex;
    align-items: center;
  }

  .mobile-nav {
    display: block;
  }

  .backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 26, 23, 0.35);
    z-index: 30;
  }

  .backdrop.is-open {
    display: block;
  }
}

textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--text);
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}

.metrics-nav-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.metrics-nav-group__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.1rem;
  white-space: nowrap;
}

.section-tabs__sep {
  align-self: center;
  width: 1px;
  height: 1.15em;
  margin: 0 0.1rem;
  background: currentColor;
  opacity: 0.28;
  flex-shrink: 0;
}

.section-tabs a {
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
  color: var(--text);
}

.section-tabs a:hover {
  border-color: var(--accent);
}

.section-tabs a.is-active {
  border-color: var(--accent, #8b6b21);
  background: rgba(139, 107, 33, 0.08);
  font-weight: 600;
}

.geo-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.geo-scope--sub {
  margin-top: 0.15rem;
  margin-bottom: 0;
}

.geo-scope a {
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.geo-scope a.is-active {
  border-color: var(--accent, #8b6b21);
  background: rgba(139, 107, 33, 0.1);
  font-weight: 600;
}

.geo-map {
  width: 100%;
  height: min(58vh, 480px);
  min-height: 300px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f7f1e8;
}

.geo-map .leaflet-container {
  background: #f7f1e8;
  font: inherit;
}

.geo-map .leaflet-control-zoom a {
  color: var(--text);
}

.geo-legend {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.geo-legend__bar {
  flex: 1;
  max-width: 180px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f6e7b8, #c9a227, #3f2e0e);
}

.geo-zone-link {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 107, 33, 0.35);
}

.geo-zone-link:hover {
  border-bottom-color: var(--accent, #8b6b21);
}

table.data tr.is-selected td {
  background: rgba(139, 107, 33, 0.08);
}

.geo-cohort__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.geo-cohort h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.geo-sequence {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 42rem;
}

.geo-pick-hint {
  border-color: rgba(139, 107, 33, 0.35);
  background: rgba(139, 107, 33, 0.06);
}

.geo-detail {
  border-color: rgba(139, 107, 33, 0.45);
  box-shadow: 0 0 0 1px rgba(139, 107, 33, 0.12);
}

.geo-row-link {
  display: grid;
  grid-template-columns: minmax(7rem, 1.6fr) repeat(4, minmax(3.5rem, 1fr));
  gap: 0.5rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  color: inherit;
  text-decoration: none;
}

.geo-row-link:hover {
  background: rgba(139, 107, 33, 0.08);
}

.geo-row-link__label {
  font-weight: 600;
}

@media (max-width: 640px) {
  .section-tabs {
    gap: 0.55rem;
  }

  .metrics-nav-group {
    width: 100%;
  }

  .section-tabs__sep {
    width: 100%;
    height: 1px;
    margin: 0.15rem 0;
  }
}

.metrics-delta {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
}

.metrics-delta--up {
  color: #2f6b3a;
}

.metrics-delta--down {
  color: #8a3b2d;
}

.subhead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 1rem 0 0.5rem;
}

.event-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 1rem;
}

.event-list--readonly li {
  margin-bottom: 0.5rem;
}

.event-edit {
  margin-bottom: 0.5rem;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.pagination__disabled {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.panel + .panel,
section.panel + section.panel {
  margin-top: 1rem;
}

.ai-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  max-width: min(360px, calc(100vw - 2rem));
}

.ai-panel__toggle {
  border: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.ai-panel__drawer {
  margin-top: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.65rem;
}

.ai-panel__intro,
.ai-panel__label {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.ai-panel__input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  resize: vertical;
}

.ai-panel__out {
  font-size: 0.92rem;
  white-space: pre-wrap;
  min-height: 1.2em;
}

.ai-panel__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.ai-panel__btn-link {
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: underline;
}

/* Asistente: misma presencia visual que la landing, cerrado por defecto. */
.app-assistant-root{position:fixed;right:1.25rem;bottom:1.25rem;z-index:80}.app-assistant-root .asistente-stack{display:flex;flex-direction:column;align-items:flex-end;gap:.75rem}.app-assistant-root .asistente-fab{width:58px;height:58px;border:1px solid var(--gold-rich);border-radius:50%;background:var(--surface);color:var(--gold-rich);display:grid;place-items:center;cursor:pointer;box-shadow:0 10px 28px rgba(25,20,16,.18)}.app-assistant-root .asistente-fab svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.app-assistant-root .asistente-panel{width:min(380px,calc(100vw - 2rem));max-height:min(70vh,620px);display:flex;flex-direction:column;background:var(--surface);border:1px solid rgba(201,162,39,.48);border-radius:22px;box-shadow:0 18px 48px rgba(25,20,16,.2);overflow:hidden}.app-assistant-root .asistente-panel[hidden]{display:none!important}.app-assistant-root .asistente-panel__head{display:flex;align-items:flex-start;justify-content:space-between;padding:1rem 1.1rem .85rem;border-bottom:1px solid var(--line)}.app-assistant-root .asistente-panel__eyebrow{margin:0 0 .15rem;font-size:.65rem;letter-spacing:.12em;color:var(--accent-dark)}.app-assistant-root .asistente-panel__title{margin:0;font:600 1.35rem/1.1 var(--font-display);color:var(--text)}.app-assistant-root .asistente-panel__close{border:0;background:transparent;color:var(--muted);font-size:1.7rem;line-height:1;cursor:pointer;padding:.1rem .25rem}.app-assistant-root .asistente-panel__messages{padding:1rem;overflow:auto;display:flex;flex-direction:column;gap:.65rem}.app-assistant-root .asistente-msg{max-width:90%;padding:.65rem .8rem;border-radius:14px;font-size:.9rem;white-space:pre-wrap}.app-assistant-root .asistente-msg--bot,.app-assistant-root .asistente-msg--typing{align-self:flex-start;background:#f1ece4;color:var(--text)}.app-assistant-root .asistente-msg--user{align-self:flex-end;background:var(--accent-dark);color:#fff}.app-assistant-root .asistente-msg__buttons{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.55rem}.app-assistant-root .asistente-msg__buttons a{color:var(--accent-dark);font-size:.8rem;text-decoration:underline}.app-assistant-root .asistente-panel__form{display:flex;gap:.5rem;padding:.75rem;border-top:1px solid var(--line)}.app-assistant-root .asistente-panel__input{min-width:0;flex:1;border:1px solid var(--line);border-radius:12px;padding:.65rem .7rem;font:inherit;resize:none;background:#fff}.app-assistant-root .asistente-panel__send{border:0;border-radius:999px;padding:0 .95rem;background:var(--accent-dark);color:#fff;font:inherit;font-weight:600;cursor:pointer}.app-assistant-root .asistente-panel__send:disabled{opacity:.55;cursor:wait}@media(max-width:520px){.app-assistant-root{right:.75rem;bottom:.75rem}.app-assistant-root .asistente-panel{width:calc(100vw - 1.5rem);max-height:68vh}}
.app-assistant-root .asistente-panel__messages{flex:1 1 auto;min-height:0;max-height:min(52vh,460px)}
.app-assistant-root .asistente-panel__brand{display:flex;align-items:flex-start;gap:.65rem;min-width:0}.app-assistant-root .asistente-panel__logo{flex:0 0 auto;width:28px;height:28px;object-fit:contain;margin-top:.15rem;border-radius:6px}.app-assistant-root.laraia-assistant .asistente-fab{border-color:#2c2c2c;color:#2c2c2c}.app-assistant-root.laraia-assistant .asistente-panel{border-color:rgba(44,44,44,.28)}

.client-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

.client-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface, #fffefb);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.client-card--inactive {
  opacity: 0.72;
}

/* Zona exclusiva del logo: no la pisan nombre ni botones */
.client-card__logo {
  grid-row: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.1rem 1.1rem 0;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(31, 26, 23, 0.03);
  border: 1px solid rgba(31, 26, 23, 0.06);
  box-sizing: border-box;
}

.client-card__logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.client-card__initials {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(31, 26, 23, 0.04);
  font: 600 1.6rem / 1 var(--font-display, Georgia, serif);
  color: var(--accent, #8b6b21);
}

.client-card__name {
  grid-row: 2;
  margin: 0.85rem 1rem 0;
  text-align: center;
  font: 600 clamp(1.2rem, 2.5vw, 1.55rem) / 1.15 var(--font-display, Georgia, serif);
  color: var(--text);
}

.client-card__actions {
  grid-row: 3;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.85rem 0.9rem 1rem;
  margin-top: 0.55rem;
}

.client-card__actions form {
  flex: 1 1 auto;
  margin: 0;
}

.client-card__actions .btn,
.client-card__actions .btn--ghost {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
}

.client-card__actions > .btn {
  flex: 1 1 auto;
}

.drive-status {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.drive-status[data-drive-state="reconnect"],
.drive-status[data-drive-state="quota"],
.drive-status[data-drive-state="error"],
.drive-status[data-drive-state="temporary"] {
  border-color: var(--danger);
}

.drive-status[data-drive-state="connected"],
.drive-status[data-drive-state="pending-files"] {
  border-color: var(--ok);
}

.drive-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.drive-facts div {
  min-width: 0;
}

.drive-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.drive-facts dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}

.drive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.drive-actions form {
  margin: 0;
}

@media (max-width: 40rem) {
  .drive-actions,
  .drive-actions form,
  .drive-actions .btn,
  .drive-actions .btn--ghost {
    width: 100%;
  }
}

.license-notice {
  position: fixed;
  z-index: 80;
  top: 1.2rem;
  right: 1.2rem;
  width: min(24rem, calc(100vw - 2rem));
  margin: 0;
  border: 1px solid var(--line, #d5d0c2);
  background: #fffdf9;
  color: var(--text, #1f1a17);
  padding: 1rem 1.1rem;
  box-shadow: 0 16px 40px rgba(28, 25, 23, 0.16);
}

.license-notice p {
  margin: 0 0 0.8rem;
}

.license-notice form {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}
