/* ══════════════════════════════════════════════════════
   TOT JARDÍ · Sistema de diseño
   Orgánico · sereno · papel cálido + verde pino + terracota
   ══════════════════════════════════════════════════════ */

:root {
  --bg: #F5F3EA;
  --bg-deep: #EDEADD;
  --surface: #FDFCF7;
  --surface-2: #F8F6EE;
  --ink: #24301F;
  --ink-soft: #55614C;
  --ink-faint: #8B937F;
  --line: #E3E0D0;
  --line-strong: #CFCBB6;

  --pine: #2E5339;
  --pine-deep: #22402B;
  --moss: #6E8F5B;
  --sage: #B9C9AC;
  --sage-soft: #E4EADB;
  --terracotta: #C06B3B;
  --terracotta-soft: #F4E3D5;
  --sun: #C9962E;
  --sun-soft: #F5EAD0;
  --clay: #A94E38;
  --clay-soft: #F2DDD6;
  --sky: #4E7E8A;
  --sky-soft: #DDE9EB;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(36,48,31,.05), 0 4px 16px rgba(36,48,31,.06);
  --shadow-lift: 0 2px 4px rgba(36,48,31,.06), 0 12px 32px rgba(36,48,31,.12);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", "Segoe UI", sans-serif;
  --sidebar-w: 248px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* grain texture overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--sage); color: var(--pine-deep); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--bg); }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: .95rem; }

/* ══════════ LAYOUT ══════════ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--pine-deep);
  color: #E9EEDF;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 50;
  padding: 22px 14px 14px;
  background-image:
    radial-gradient(ellipse 400px 300px at -20% -10%, rgba(110,143,91,.35), transparent 60%),
    radial-gradient(ellipse 300px 400px at 120% 110%, rgba(110,143,91,.22), transparent 60%);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, var(--moss), var(--pine));
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 8px rgba(0,0,0,.25);
}
.brand-mark svg { width: 23px; height: 23px; color: #F2F5E8; }
.brand-name { font-family: var(--font-display); font-size: 1.28rem; font-weight: 600; display: block; line-height: 1.1; color: #F5F7EB; }
.brand-sub { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #9DB08C; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label {
  font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: #8CA07B; padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border: none; border-radius: 10px;
  background: transparent; color: #C9D5BA;
  font-size: .92rem; font-weight: 500; text-align: left;
  transition: background .15s, color .15s, transform .1s;
  width: 100%;
}
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #F2F5E8; }
.nav-item.active { background: rgba(233,238,223,.14); color: #FDFDF6; box-shadow: inset 2px 0 0 var(--sage); }

.sidebar-foot { padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.demo-tag { font-size: .68rem; color: #7E926E; padding: 10px 12px 2px; line-height: 1.4; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 30px;
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.today-chip { font-size: .82rem; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 5px 13px; }

.burger { display: none; background: none; border: none; padding: 6px; }
.burger svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; }

.view { padding: 26px 30px 60px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* entrance animation */
.view > * { animation: rise .45s cubic-bezier(.2,.7,.3,1) both; }
.view > *:nth-child(2) { animation-delay: .05s; }
.view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .15s; }
.view > *:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ══════════ COMPONENTES ══════════ */
.btn {
  border: none; border-radius: 11px;
  padding: 9px 17px; font-size: .9rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--pine); color: #F5F7EB; box-shadow: 0 2px 6px rgba(46,83,57,.3); }
.btn-primary:hover { background: var(--pine-deep); box-shadow: 0 4px 12px rgba(46,83,57,.35); }
.btn-ghost { background: transparent; color: var(--pine); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--pine); background: var(--sage-soft); }
.btn-soft { background: var(--sage-soft); color: var(--pine-deep); }
.btn-soft:hover { background: var(--sage); }
.btn-danger { background: var(--clay-soft); color: var(--clay); }
.btn-danger:hover { background: var(--clay); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: .8rem; border-radius: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.5rem; }
.section-head .sub { color: var(--ink-soft); font-size: .9rem; margin-top: 2px; }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat::after {
  content: ""; position: absolute; top: -30px; right: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--accent, var(--sage-soft)); opacity: .5;
}
.stat-label { font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; margin-top: 4px; position: relative; z-index: 1; }
.stat-note { font-size: .8rem; color: var(--ink-soft); margin-top: 3px; position: relative; z-index: 1; }

/* pills / badges */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 99px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.p-gray { background: var(--bg-deep); color: var(--ink-soft); }
.pill.p-amber { background: var(--sun-soft); color: #8A6415; }
.pill.p-green { background: var(--sage-soft); color: var(--pine); }
.pill.p-deep { background: var(--pine); color: #EDF2E3; }
.pill.p-terra { background: var(--terracotta-soft); color: var(--terracotta); }
.pill.p-red { background: var(--clay-soft); color: var(--clay); }
.pill.p-sky { background: var(--sky-soft); color: var(--sky); }

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; padding: 12px 16px;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--sage-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
td .cell-main { font-weight: 600; }
td .cell-sub { font-size: .8rem; color: var(--ink-faint); }
.t-right { text-align: right; }
.t-num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(110,143,91,.18);
}
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: .75rem; color: var(--ink-faint); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check-chip span {
  display: inline-block; padding: 6px 13px; border-radius: 99px;
  border: 1.5px solid var(--line-strong); font-size: .84rem; font-weight: 600;
  color: var(--ink-soft); transition: all .15s; cursor: pointer;
}
.check-chip input:checked + span { background: var(--pine); border-color: var(--pine); color: #F0F4E4; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-deep); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: none; background: transparent; padding: 7px 14px;
  border-radius: 9px; font-size: .84rem; font-weight: 600; color: var(--ink-soft);
  transition: all .15s;
}
.seg button.active { background: var(--surface); color: var(--pine-deep); box-shadow: 0 1px 4px rgba(36,48,31,.12); }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,40,26,.45);
  backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  padding: 26px; box-shadow: var(--shadow-lift);
  animation: pop .3s cubic-bezier(.2,.9,.3,1.1);
}
.modal.wide { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal h3 { font-size: 1.3rem; margin-bottom: 4px; }
.modal .modal-sub { color: var(--ink-soft); font-size: .87rem; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--pine-deep); color: #EDF2E3;
  padding: 12px 22px; border-radius: 12px; font-size: .9rem; font-weight: 600;
  box-shadow: var(--shadow-lift); z-index: 200;
  transition: transform .3s cubic-bezier(.2,.8,.3,1.1); pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* empty state */
.empty {
  text-align: center; padding: 48px 20px; color: var(--ink-soft);
}
.empty .empty-ico { font-size: 2.2rem; margin-bottom: 10px; }
.empty h4 { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: .88rem; max-width: 380px; margin: 0 auto 16px; }

/* ══════════ DASHBOARD ══════════ */
.dash-hero {
  background: linear-gradient(120deg, var(--pine-deep), var(--pine) 55%, #3E6B4A);
  border-radius: var(--radius-lg);
  color: #EFF4E4; padding: 28px 30px;
  margin-bottom: 22px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lift);
}
.dash-hero::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(185,201,172,.3), transparent 65%);
}
.dash-hero .leafbg {
  position: absolute; right: 20px; bottom: -18px; width: 150px; height: 150px;
  opacity: .16; stroke: #EFF4E4; fill: none; stroke-width: 1;
}
.dash-hero h2 { font-size: 1.7rem; margin-bottom: 4px; color: #F8FAF0; }
.dash-hero p { color: #C4D3B0; font-size: .95rem; max-width: 540px; position: relative; z-index: 1; }
.dash-hero .hero-alerts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.hero-alert {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  border-radius: 11px; padding: 8px 14px; font-size: .83rem; font-weight: 600;
  backdrop-filter: blur(4px); cursor: pointer; color: #F2F6E8;
  transition: background .15s;
}
.hero-alert:hover { background: rgba(255,255,255,.2); }

.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.dash-list { display: flex; flex-direction: column; gap: 10px; }
.dash-job {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 13px;
  background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer; transition: all .15s;
}
.dash-job:hover { border-color: var(--sage); background: var(--sage-soft); transform: translateX(3px); }
.dash-job .job-ico {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--sage-soft);
}
.dash-job .job-body { flex: 1; min-width: 0; }
.dash-job .job-title { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-job .job-meta { font-size: .78rem; color: var(--ink-faint); }

/* mini bar chart */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar {
  width: 100%; max-width: 42px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--moss), var(--pine));
  transition: height .6s cubic-bezier(.2,.7,.3,1);
  position: relative; min-height: 3px;
}
.chart .bar.dim { background: var(--sage); opacity: .55; }
.chart .bar-label { font-size: .72rem; color: var(--ink-faint); font-weight: 600; }
.chart .bar-val { font-size: .68rem; color: var(--ink-soft); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ══════════ CALENDARIO ══════════ */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h3 { font-size: 1.35rem; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line-strong);
  background: var(--surface); font-size: 1rem; color: var(--pine); font-weight: 700;
  transition: all .15s;
}
.cal-nav button:hover { background: var(--sage-soft); border-color: var(--moss); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); padding: 6px 0; }
.cal-day {
  min-height: 92px; border-radius: 12px; padding: 7px 8px;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-day:hover { border-color: var(--moss); box-shadow: var(--shadow); }
.cal-day.other { opacity: .4; background: transparent; }
.cal-day.today { border: 2px solid var(--pine); background: var(--sage-soft); }
.cal-day .d-num { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.cal-day.today .d-num { color: var(--pine); }
.cal-event {
  font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--sage-soft); color: var(--pine-deep);
  border-left: 3px solid var(--moss);
}
.cal-event.e-amber { background: var(--sun-soft); color: #7A5A12; border-color: var(--sun); }
.cal-event.e-done { background: var(--bg-deep); color: var(--ink-faint); border-color: var(--line-strong); text-decoration: line-through; }
.cal-more { font-size: .66rem; color: var(--ink-faint); font-weight: 700; }

/* ══════════ FACTURA (detalle/impresión) ══════════ */
.inv-doc { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 34px; box-shadow: var(--shadow); }
.inv-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 2px solid var(--pine); }
.inv-top h2 { font-size: 1.6rem; }
.inv-num { font-family: var(--font-display); font-size: 1.15rem; color: var(--terracotta); font-weight: 600; }
.inv-meta { font-size: .85rem; color: var(--ink-soft); line-height: 1.6; }
.inv-table { width: 100%; margin: 18px 0; }
.inv-totals { margin-left: auto; max-width: 300px; font-size: .92rem; }
.inv-totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.inv-totals .grand { border-top: 2px solid var(--pine); margin-top: 6px; padding-top: 10px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }

/* ══════════ ASISTENTE ══════════ */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; }
.chat-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 6px 4px 18px; }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 16px; font-size: .92rem; line-height: 1.55; animation: rise .3s both; }
.msg.user { align-self: flex-end; background: var(--pine); color: #F0F4E4; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
.msg.bot strong { color: var(--pine); }
.msg.bot .msg-tag { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--terracotta); font-weight: 700; margin-bottom: 5px; }
.chat-suggestions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0; }
.chat-suggestions button {
  border: 1.5px solid var(--line-strong); background: var(--surface);
  border-radius: 99px; padding: 6px 14px; font-size: .8rem; font-weight: 600; color: var(--pine);
  transition: all .15s;
}
.chat-suggestions button:hover { background: var(--sage-soft); border-color: var(--moss); }
.chat-input { display: flex; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.chat-input input {
  flex: 1; padding: 12px 16px; border-radius: 13px;
  border: 1.5px solid var(--line-strong); background: var(--surface);
}
.chat-input input:focus { outline: none; border-color: var(--moss); box-shadow: 0 0 0 3px rgba(110,143,91,.18); }

/* ══════════ IMPUESTOS ══════════ */
.tax-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.tax-timeline { display: flex; flex-direction: column; gap: 0; }
.tax-item { display: flex; gap: 16px; padding: 14px 4px; position: relative; }
.tax-item:not(:last-child)::before {
  content: ""; position: absolute; left: 21px; top: 48px; bottom: -6px;
  width: 2px; background: var(--line-strong);
}
.tax-dot {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.1rem;
  background: var(--sage-soft); z-index: 1;
}
.tax-dot.urgent { background: var(--terracotta-soft); }
.tax-body { flex: 1; }
.tax-body .t-title { font-weight: 700; font-size: .95rem; }
.tax-body .t-sub { font-size: .82rem; color: var(--ink-soft); }

.progress { height: 8px; border-radius: 99px; background: var(--bg-deep); overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--moss), var(--pine)); transition: width .6s ease; }

/* ══════════ PRINT ══════════ */
#printArea { display: none; }
@media print {
  body > .app, .modal-backdrop, .toast { display: none !important; }
  body::before { display: none; }
  #printArea { display: block; }
  #printArea .inv-doc { border: none; box-shadow: none; padding: 10px; }
  body { background: #fff; }
}

/* ══════════ BARRA INFERIOR (móvil) ══════════ */
.bottombar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottombar button {
  flex: 1; border: none; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 10px;
  font-size: .62rem; font-weight: 700; color: var(--ink-faint);
  font-family: inherit;
}
.bottombar button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottombar button.active { color: var(--pine); }
.bottombar button.active svg { stroke-width: 2.2; }
.bottombar button:active { background: var(--sage-soft); }

/* ══════════ ESTRELLAS DE VALORACIÓN ══════════ */
.stars { display: inline-flex; gap: 4px; }
.stars button {
  border: none; background: none; font-size: 1.5rem; line-height: 1;
  color: var(--line-strong); padding: 2px; transition: transform .12s, color .12s;
}
.stars button.on { color: var(--sun); }
.stars button:hover { transform: scale(1.2); }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 980px) {
  .dash-cols { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .burger { display: block; }
  .bottombar { display: flex; }
  .view { padding: 18px 16px 96px; }
  .topbar { padding: 12px 16px; }
  .today-chip { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .cal-day { min-height: 64px; padding: 4px 5px; }
  .cal-event { display: none; }
  .cal-day .d-dots { display: flex; gap: 2px; flex-wrap: wrap; }
  .msg { max-width: 92%; }
}
@media (min-width: 781px) {
  .cal-day .d-dots { display: none; }
}

/* ══════════ FOTOS DE TRABAJO ══════════ */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  transition: opacity .15s;
}
.photo-thumb:hover { opacity: .85; }
@media (max-width: 480px) {
  .photos-grid { grid-template-columns: repeat(3, 1fr); }
}
.d-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--moss); display: inline-block; }

/* ══════════ LOGIN / AUTH ══════════ */
#loginScreen {
  position: fixed; inset: 0; z-index: 8888;
  background: linear-gradient(135deg, #0e1e14 0%, #1a3422 55%, #22402b 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.login-wrap {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.login-brand {
  text-align: center; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.login-logo-wrap {
  width: 58px; height: 58px;
  background: rgba(255,255,255,.12);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.login-logo { width: 30px; height: 30px; color: #a3d9a5; }
.login-title {
  font-family: 'Fraunces', serif;
  font-size: 2rem; font-weight: 600;
  color: #fff; margin: 0; letter-spacing: -.02em;
}
.login-sub { font-size: .875rem; color: rgba(255,255,255,.55); margin: 0; }
.login-card {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  padding: 28px 28px 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}
@media (prefers-color-scheme: dark) {
  .login-card { background: #1e2a22; }
}
.login-tabs {
  display: flex; gap: 4px;
  background: #f0efea;
  border-radius: 12px; padding: 4px;
  margin-bottom: 24px;
}
@media (prefers-color-scheme: dark) {
  .login-tabs { background: #152019; }
}
.login-tab {
  flex: 1; padding: 9px;
  border: none; background: transparent;
  border-radius: 9px; cursor: pointer;
  font-family: 'Karla', sans-serif; font-size: .9rem; font-weight: 500;
  color: #666; transition: all .15s;
}
.login-tab.active {
  background: #fff; color: #1a1a1a;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
@media (prefers-color-scheme: dark) {
  .login-tab { color: rgba(255,255,255,.5); }
  .login-tab.active { background: #22402b; color: #fff; }
}
.btn-google {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  font-family: 'Karla', sans-serif; font-size: .92rem; font-weight: 500;
  color: #1a1a1a; cursor: pointer;
  transition: background .15s, box-shadow .15s;
  margin-bottom: 16px;
}
.btn-google:hover { background: #f5f5f0; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
@media (prefers-color-scheme: dark) {
  .btn-google { background: #263d2c; border-color: #3a5a40; color: #e0f0e3; }
  .btn-google:hover { background: #2e4834; }
}
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; color: #aaa; font-size: .8rem;
}
.login-divider::before,
.login-divider::after { content: ''; flex: 1; height: 1px; background: #e0e0e0; }
@media (prefers-color-scheme: dark) {
  .login-divider { color: rgba(255,255,255,.3); }
  .login-divider::before, .login-divider::after { background: rgba(255,255,255,.1); }
}
.login-link {
  background: none; border: none; cursor: pointer;
  font-family: 'Karla', sans-serif; font-size: .82rem;
  color: var(--pine); text-decoration: underline; padding: 0;
}
.login-error {
  font-size: .84rem; border-radius: 8px;
  padding: 9px 12px; margin-bottom: 12px;
  background: #fef2f2; color: #b91c1c;
}
.login-submit {
  width: 100%; padding: 12px; font-size: .95rem; border-radius: 10px;
}
.login-terms {
  text-align: center; font-size: .78rem; color: #aaa;
  margin-top: 10px; margin-bottom: 0;
}
.login-footer {
  font-size: .78rem; color: rgba(255,255,255,.35);
  text-align: center; margin: 0;
}
.login-footer a { color: rgba(255,255,255,.45); }

/* ══════════ TRIAL BANNER ══════════ */
.trial-banner {
  padding: 9px 20px; font-size: .85rem;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.trial-active { background: #fef9c3; color: #713f12; border-bottom: 1px solid #fde68a; }
.trial-expired { background: #fef2f2; color: #7f1d1d; border-bottom: 1px solid #fecaca; }
.trial-cta {
  margin-left: auto;
  background: var(--pine); color: #fff;
  border: none; border-radius: 6px;
  padding: 5px 13px; font-size: .8rem;
  font-family: 'Karla', sans-serif; font-weight: 600; cursor: pointer;
}
