@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Paleta House of Karla */
  --navy:      #0B315A;   /* Deep Coastal Navy – marca, texto */
  --arena:     #D7AD78;   /* Soft Sand */
  --oro:       #F5C565;   /* Sunset Gold */
  --carmesi:   #E94F5D;   /* Soft Crimson – acento */
  --coral:     #EF806B;   /* Warm Coral */
  --oliva:     #4D5638;   /* Palm Olive */
  --crema:     #FAF5E9;   /* Warm Cream – fondo claro */
  --blanco:    #FFFDF8;   /* Soft White */

  --bg:        var(--crema);
  --surface:   var(--blanco);
  --ink:       var(--navy);
  --muted:     #5A6B82;
  --line:      #E8DDC8;
  --terracota: var(--carmesi);
  --mostaza:   var(--oro);
  --durazno:   #F8EBD3;
  --rosa:      var(--coral);
  --salvia:    var(--oliva);
  --error:     #B63A47;
  --error-bg:  #FCE8EA;
  --ok-bg:     #ECEFE0;
  --radius:    20px;
  --serif:     'Fraunces', Georgia, serif;
  --sans:      'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border: 1.5px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center;
}
.brand__mark::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.brand__name { font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* ============================================================
   AUTH (login / registro)
   ============================================================ */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 560px) 1fr;
  background: #FFFDF8;
  overflow: hidden;
}
.auth__panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px clamp(24px, 6vw, 88px);
  position: relative; z-index: 2;
}
.auth__brand { position: absolute; top: 40px; left: clamp(24px, 6vw, 88px); }
.auth__card { width: 100%; max-width: 380px; }

.auth__eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.auth__title { font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 4vw, 42px); line-height: 1.1; margin: 0 0 10px; }
.auth__title em { font-style: italic; color: var(--terracota); font-weight: 500; }
.auth__lead { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0 0 28px; }

.field { margin-bottom: 14px; }
.field__label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 0 0 6px 18px; }
.field__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input {
  width: 100%; height: 48px; padding: 0 20px;
  font: inherit; font-size: 14.5px; color: var(--ink);
  background: rgba(255,255,255,.85);
  border: 1px solid var(--line); border-radius: 999px;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: #B5ABA1; }
.input:focus { background: #fff; border-color: var(--terracota); box-shadow: 0 0 0 4px rgba(233,79,93,.16); }
.input[readonly] { background: var(--durazno); color: var(--muted); }

.pw { position: relative; }
.pw .input { padding-right: 64px; }
.pw__toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 500;
  color: var(--muted); padding: 8px 12px; border-radius: 999px;
}
.pw__toggle:hover { color: var(--ink); }

.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0 18px; }

.btn {
  width: 100%; height: 50px; margin-top: 10px;
  font: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: .01em;
  color: #fff; background: var(--ink);
  border: 0; border-radius: 999px; cursor: pointer;
  transition: transform .12s, background .15s;
}
.btn:hover { background: #164573; }
.btn:active { transform: scale(.99); }

.alert { font-size: 13.5px; line-height: 1.45; padding: 12px 16px; border-radius: 14px; margin: 0 0 18px; }
.alert--error { background: var(--error-bg); color: var(--error); }
.alert--info  { background: var(--ok-bg); color: var(--oliva); }
.alert ul { margin: 0; padding-left: 18px; }

.auth__switch { margin-top: 24px; font-size: 13.5px; color: var(--muted); }
.auth__switch a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

/* Arte: ilustración de la casa sobre fondo blanco */
.auth__art { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 32px 56px; }
.auth__hero { width: 100%; max-width: 500px; max-height: 66vh; object-fit: contain; mix-blend-mode: multiply; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .auth__panel { padding-top: 110px; align-items: center; }
}

/* ============================================================
   DASHBOARD (shell)
   ============================================================ */
.topbar {
  height: 80px; padding: 0 40px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.user { display: flex; align-items: center; gap: 14px; }
.user__avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--arena); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.user__name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.user__role { font-size: 12px; color: var(--muted); }
.btn-ghost {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; cursor: pointer;
}
.btn-ghost:hover { color: var(--ink); }

.hero {
  background: linear-gradient(180deg, var(--durazno) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 48px 24px 60px;
}
.wrap { max-width: 1100px; margin: 0 auto; }
.hero h1 { font-family: var(--serif); font-size: 38px; font-weight: 600; margin: 6px 0 8px; }
.hero h1 em { color: var(--terracota); font-weight: 500; }
.hero p { color: var(--muted); font-size: 14.5px; max-width: 460px; line-height: 1.5; margin: 0 0 28px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stat__value { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.stat__label { margin-top: 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.section-title { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 44px 0 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card {
  display: block; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  transition: transform .15s, box-shadow .15s;
}
a.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(11,49,90,.10); }
.card--soon { opacity: .55; }
/* Iconos planos de dos tonos (sin recuadro) */
.card__icon { margin-bottom: 16px; }
.ico { display: block; isolation: isolate; overflow: visible; transition: transform .25s ease; }
.ico .m { mix-blend-mode: multiply; }
a.card:hover .ico { transform: translateY(-3px) rotate(-3deg); }
.card--soon .ico { filter: saturate(.75); }
.card__title { font-family: var(--serif); font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.card__text { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; }
.tag { display: inline-block; margin-top: 12px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--terracota); font-weight: 600; }

@media (max-width: 720px) {
  .topbar { padding: 0 20px; }
  .user__meta { display: none; }
  .stats { grid-template-columns: 1fr; }
}


/* ============================================================
   PÁGINAS INTERNAS · Propiedades
   ============================================================ */
.page { padding-top: 28px; padding-bottom: 80px; }
/* Botón "Volver al panel" */
.btn-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 10px 18px; font-size: 13.5px; font-weight: 500; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; transition: background .15s, border-color .15s, transform .15s; }
.btn-back:hover { background: var(--durazno); border-color: var(--arena); }
.btn-back:hover span { transform: translateX(-2px); }
.btn-back span { transition: transform .15s; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 4vw, 38px); margin: 4px 0 0; }
.page-title em { color: var(--terracota); font-weight: 500; }
.btn--inline { width: auto; margin-top: 0; padding: 0 24px; white-space: nowrap; }
.btn--inline[hidden] { display: none; }
.stats--page { margin-bottom: 28px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; margin-bottom: 32px; }
.panel[hidden] { display: none; }
.panel__title { font-family: var(--serif); font-size: 22px; margin: 0 0 18px; }
.subhead { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 26px 0 12px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid__pair { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg__opt span { display: block; padding: 9px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.seg__opt input:checked + span { background: var(--ink); color: #fff; }
.seg__opt input:focus-visible + span { outline: 2px solid var(--carmesi); outline-offset: 2px; }

.floor-forms { display: grid; gap: 12px; }
.floor-form { display: grid; grid-template-columns: 90px auto 1fr; align-items: center; gap: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.floor-form[hidden] { display: none; }
.floor-form--on { background: #FFF8E8; border-color: var(--arena); }
.floor-form__title { font-family: var(--serif); font-weight: 600; font-size: 16px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track { width: 42px; height: 24px; border-radius: 999px; background: #D9D2C2; position: relative; transition: background .15s; }
.toggle__knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11,49,90,.25); transition: transform .15s; }
.toggle input:checked + .toggle__track { background: var(--oliva); }
.toggle input:checked + .toggle__track .toggle__knob { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--carmesi); outline-offset: 2px; }
.toggle__text { font-size: 14px; font-weight: 500; }

.money { display: flex; align-items: center; gap: 8px; max-width: 280px; justify-self: end; width: 100%; }
.money .input { height: 42px; }
.money .input:disabled { opacity: .45; background: transparent; }
.money__sign, .money__unit { font-size: 14px; color: var(--muted); }

.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.form-actions .btn-ghost { text-decoration: none; display: inline-block; }

/* Lista de propiedades */
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.prop { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.prop__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.prop__name { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.prop__addr { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }
.badge { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--ink); background: #F8EBD3; border-radius: 999px; padding: 6px 12px; white-space: nowrap; }

.floors { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.floor { display: grid; grid-template-columns: 70px auto 1fr; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.floor__name { font-size: 14px; font-weight: 600; }
.floor__rent { justify-self: end; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.floor__rent small, .prop__income small { font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.floor__rent--none { color: var(--muted); font-weight: 400; }
.chip { font-size: 11px; font-weight: 600; letter-spacing: .04em; border-radius: 999px; padding: 4px 10px; }
.chip--rented { background: #E6EAD6; color: var(--oliva); }
.chip--vacant { background: #F6E8D0; color: #7A5A2B; }

.prop__foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 16px; margin-top: auto; }
.prop__income { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.prop__actions { display: flex; gap: 8px; }
.prop__actions form { margin: 0; }
.prop__actions .btn-ghost { text-decoration: none; display: inline-block; padding: 8px 14px; }
.btn-ghost--danger:hover { color: var(--error); border-color: var(--error); }

.empty { text-align: center; background: var(--surface); border: 1px dashed var(--arena); border-radius: 24px; padding: 48px 24px; }
.empty__icon { display: grid; place-items: center; margin-bottom: 12px; }
.empty .card__text { max-width: 380px; margin: 0 auto; }

@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .floor-form { grid-template-columns: 1fr auto; }
  .floor-form .money { grid-column: 1 / -1; max-width: none; justify-self: stretch; }
  .props { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
}

/* ============================================================
   Inquilinos
   ============================================================ */
.subhead--first { margin-top: 0; }
.input--select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%230B315A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 20px center; }
.input--area { height: auto; padding: 14px 20px; border-radius: 22px; resize: vertical; line-height: 1.5; }
.toggle--inline { margin: 12px 0 0 18px; }
.money .input { min-width: 0; }

.tabs { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 4px 0 20px; }
.tabs__item { padding: 9px 22px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; transition: background .15s, color .15s; }
.tabs__item:hover { color: var(--ink); }
.tabs__item.is-on { background: var(--ink); color: #fff; }

.tenant__who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tenant__avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--arena); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.tenant .prop__name { margin: 0 0 2px; }

.facts { margin: 0; display: grid; gap: 2px; }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); flex: none; }
.facts dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.facts dd a { color: inherit; text-underline-offset: 3px; }
.facts dd small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.tenant__notes { margin: 0; padding: 12px 14px; background: var(--bg); border-radius: 14px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.prop__foot--end { justify-content: flex-end; }

.chip--soon { background: #FCEBC4; color: #7A5200; }
.chip--expired { background: #FCE0E3; color: #A22F3C; }
.chip--neutral { background: #ECE7DA; color: var(--muted); }

/* Ajustes de formulario de inquilinos */
.form-grid .money { max-width: none; justify-self: stretch; }
.chip { white-space: nowrap; }
.tenant .prop__head { align-items: center; }

/* ============================================================
   Contratos
   ============================================================ */
.stats--four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 960px) { .stats--four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats--four { grid-template-columns: 1fr; } }

.form-grid__pair--even { grid-template-columns: 1fr 1fr; }
.input--file { height: auto; padding: 10px 14px; border-radius: 22px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.input--file::file-selector-button { font: inherit; font-size: 13px; font-weight: 600; color: #fff; background: var(--ink); border: 0; border-radius: 999px; padding: 8px 16px; margin-right: 12px; cursor: pointer; }
.hint--block { margin: 22px 0 0; }
.hint a { color: var(--ink); text-underline-offset: 3px; }
.muted { color: var(--muted); font-weight: 400; }

.bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: var(--oliva); transition: width .4s ease; }
.bar__fill--soon { background: var(--oro); }
.bar__fill--expired { background: var(--carmesi); }

.btn-ghost--accent { color: var(--ink); background: #FCEBC4; border-color: var(--oro); }
.btn-ghost--accent:hover { background: var(--oro); color: var(--ink); }

/* ============================================================
   Pagos y cobros
   ============================================================ */
.stat__value--bad { color: var(--error); }
.amount--bad { color: var(--error); font-weight: 600; }
.panel__sub { margin: -8px 0 18px; font-size: 14px; color: var(--muted); }
.panel__sub strong { color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 20px; }
.toolbar .tabs { margin: 0; }
.monthnav { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.monthnav strong { min-width: 150px; text-align: center; font-family: var(--serif); font-size: 16px; font-weight: 600; }
.monthnav a, .monthnav__off { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; color: var(--ink); font-size: 16px; transition: background .15s; }
.monthnav a:hover { background: var(--durazno); }
.monthnav__off { color: var(--line); }

.paylist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.paylist li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--bg); font-size: 13px; color: var(--muted); }
.paylist__amt { color: var(--ink); font-weight: 600; }
.paylist__link { color: var(--ink); font-size: 12px; font-weight: 600; text-underline-offset: 3px; }
.paylist form { margin: 0; }
.paylist__del { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.paylist__del:hover { background: #FCE0E3; color: var(--error); }

/* Recibo imprimible */
.receipt-body { background: var(--bg); padding: 32px 16px; }
.receipt-actions { max-width: 640px; margin: 0 auto 16px; display: flex; justify-content: flex-end; }
.receipt { max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 40px; }
.receipt__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.receipt__no { text-align: right; display: grid; gap: 2px; }
.receipt__no span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.receipt__no strong { font-family: var(--serif); font-size: 20px; }
.receipt__amount { margin: 28px 0; padding: 22px 24px; border-radius: 18px; background: var(--durazno); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.receipt__amount span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.receipt__amount strong { font-family: var(--serif); font-size: 36px; color: var(--ink); }
.receipt__rows { margin: 0; }
.receipt__rows > div { display: flex; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.receipt__rows dt { color: var(--muted); flex: none; }
.receipt__rows dd { margin: 0; text-align: right; font-weight: 500; }
.receipt__foot { margin-top: 36px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.receipt__foot p { margin: 0; font-family: var(--serif); font-style: italic; color: var(--terracota); font-size: 18px; }
.receipt__sign { width: 220px; }
.receipt__sign span { display: block; border-bottom: 1px solid var(--ink); height: 36px; }
.receipt__sign small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

@media (max-width: 720px) {
  .toolbar { flex-direction: column; align-items: flex-start; }
  .monthnav strong { min-width: 120px; }
  .receipt { padding: 24px; }
  .receipt__amount strong { font-size: 28px; }
}
@media print {
  .no-print { display: none !important; }
  .receipt-body { background: #fff; padding: 0; }
  .receipt { border: 0; border-radius: 0; max-width: none; padding: 0; }
  .receipt__amount { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== Gastos ===== */
.cat { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cat--predial { background: #DDE6F1; color: var(--navy); }
.cat--seguro { background: #E6EAD6; color: var(--oliva); }
.cat--reparaciones { background: #FCE0E3; color: #A22F3C; }
.cat--mantenimiento { background: #FCEBC4; color: #7A5200; }
.cat--servicios { background: #F8EBD3; color: #7A5A2B; }
.cat--hipoteca { background: #E4DDF0; color: #4A3A78; }
.cat--otro { background: #ECE7DA; color: var(--muted); }
.cat-fill--predial { background: var(--navy); }
.cat-fill--seguro { background: var(--oliva); }
.cat-fill--reparaciones { background: var(--carmesi); }
.cat-fill--mantenimiento { background: var(--oro); }
.cat-fill--servicios { background: var(--arena); }
.cat-fill--hipoteca { background: #7C68B0; }
.cat-fill--otro { background: var(--muted); }

.catpick { display: flex; flex-wrap: wrap; gap: 8px; }
.catpick__opt { cursor: pointer; }
.catpick__opt input { position: absolute; opacity: 0; pointer-events: none; }
.catpick__opt .cat { padding: 8px 14px; font-size: 13px; border: 2px solid transparent; opacity: .6; transition: opacity .15s, border-color .15s; }
.catpick__opt:hover .cat { opacity: .9; }
.catpick__opt input:checked + .cat { opacity: 1; border-color: var(--ink); }
.catpick__opt input:focus-visible + .cat { outline: 2px solid var(--carmesi); outline-offset: 2px; }

.cats { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px; margin-bottom: 18px; display: grid; gap: 2px; }
.cats__row { display: grid; grid-template-columns: 130px 1fr 100px 44px; gap: 14px; align-items: center; padding: 8px 8px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.cats__row:hover, .cats__row.is-on { background: var(--bg); }
.cats__bar { height: 10px; border-radius: 999px; background: #F0E8D6; overflow: hidden; }
.cats__fill { display: block; height: 100%; border-radius: 999px; }
.cats__amt { text-align: right; font-weight: 600; font-size: 14px; }
.cats__pct { text-align: right; color: var(--muted); font-size: 12px; }

.ledger { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.ledger__row { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ledger__date { font-size: 13px; color: var(--muted); }
.ledger__title { font-weight: 600; }
.ledger__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); }
.ledger__notes { margin-top: 4px; font-size: 12px; color: var(--muted); font-style: italic; }
.ledger__amount { font-family: var(--serif); font-size: 18px; font-weight: 600; text-align: right; }
.ledger__actions { display: flex; gap: 6px; }
.ledger__total { display: flex; justify-content: space-between; padding: 14px 18px; background: var(--durazno); font-weight: 600; }

.toolbar__right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.catfilter { display: flex; gap: 8px; align-items: center; }
.input--compact { padding: 8px 36px 8px 14px; font-size: 13px; width: auto; }
.stat__value--good { color: var(--oliva); }

@media (max-width: 720px) {
  .cats__row { grid-template-columns: 1fr 80px 40px; }
  .cats__bar { grid-column: 1 / -1; order: 5; }
  .ledger__row { grid-template-columns: 1fr auto; }
  .ledger__date { grid-column: 1 / -1; }
  .ledger__actions { grid-column: 1 / -1; }
}

/* ===== Mantenimiento ===== */
.pri--baja { background: #E6EAD6; color: var(--oliva); }
.pri--media { background: #FCEBC4; color: #7A5200; }
.pri--alta { background: #FAD9C9; color: #A04418; }
.pri--urgente { background: #FCE0E3; color: #A22F3C; }

.tabs__n { display: inline-block; margin-left: 4px; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(11,49,90,.08); font-size: 11px; text-align: center; }
.tabs__item.is-on .tabs__n { background: rgba(255,255,255,.22); }

.check { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.tickets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--arena); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.ticket--baja { border-left-color: var(--oliva); }
.ticket--media { border-left-color: var(--oro); }
.ticket--alta { border-left-color: var(--coral); }
.ticket--urgente { border-left-color: var(--carmesi); }
.ticket.is-done { opacity: .78; }
.ticket__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ticket__title { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.25; }
.ticket__chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ticket__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.ticket__meta .is-late { color: var(--error); font-weight: 600; }
.ticket__desc { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.45; }
.ticket__facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); padding: 10px 12px; background: var(--bg); border-radius: 12px; }
.ticket__facts a { color: var(--ink); text-underline-offset: 3px; }
.ticket__facts strong { color: var(--ink); }
.ticket__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.ticket__actions form { margin: 0; }

@media (max-width: 860px) {
  .tickets { grid-template-columns: 1fr; }
  .ticket__head { flex-direction: column; }
  .ticket__chips { justify-content: flex-start; }
}

/* ===== Admin ===== */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.section-head .section-title { margin-bottom: 16px; }
.section-head form { margin: 0 0 16px; }
.people__row { grid-template-columns: 44px 1fr auto; }
.people__avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--arena); color: var(--ink); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.people__avatar--mail { background: var(--durazno); color: var(--muted); font-family: var(--serif); font-size: 18px; }
.people__you { color: var(--muted); font-weight: 400; font-size: 13px; }
.invite-ready { border-color: var(--oro); background: #FFF8E6; margin-bottom: 20px; }
.invite-link { display: flex; gap: 10px; align-items: center; }
.invite-link .input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

@media (max-width: 720px) {
  .people__row { grid-template-columns: 44px 1fr; }
  .people__row .ledger__actions { grid-column: 1 / -1; }
  .invite-link { flex-direction: column; align-items: stretch; }
}
