/* Dirección visual 2026: cálida, compacta y orientada al trabajo. */
:root {
  --manso-ink: #292b25;
  --manso-muted: #70736b;
  --manso-canvas: #f5f3eb;
  --manso-paper: #fffdf8;
  --manso-line: #deddd3;
  --manso-green: #356f51;
  --manso-green-deep: #285c42;
  --manso-green-soft: #e4eee6;
  --manso-amber: #b57a29;
  --manso-amber-soft: #f6ead3;
  --manso-red: #ad5147;
  --manso-red-soft: #f5dfdc;
  --manso-blue: #557b8c;
  --manso-shadow: 0 15px 40px rgba(45, 52, 43, .07);
  --manso-shadow-raised: 0 20px 52px rgba(45, 52, 43, .11);
  --manso-radius: 19px;
  --brand: var(--manso-green);
  --brand-dark: var(--manso-green-deep);
  --accent: var(--manso-amber);
  --paper: var(--manso-paper);
  --surface: var(--manso-paper);
  --card: var(--manso-paper);
  --text: var(--manso-ink);
  --muted: var(--manso-muted);
  --line: var(--manso-line);
  --layout-line: rgba(58, 67, 57, .13);
  --layout-shadow: var(--manso-shadow);
  --layout-radius: var(--manso-radius);
}

html { background: var(--manso-canvas); }

body {
  color: var(--manso-ink);
  background:
    radial-gradient(circle at 8% 1%, rgba(213, 226, 213, .48), transparent 27rem),
    radial-gradient(circle at 92% 14%, rgba(242, 224, 190, .35), transparent 25rem),
    var(--manso-canvas) !important;
  font-size: 13px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
}

body > header {
  min-height: 70px;
  padding: 7px max(22px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(63, 73, 61, .11);
  background: rgba(255, 253, 248, .88);
  box-shadow: 0 10px 34px rgba(45, 52, 43, .045);
  backdrop-filter: blur(18px) saturate(1.12);
}

body > header > div { gap: 12px; }
body > header .brand-logo {
  width: 82px;
  max-height: 55px;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(34, 48, 37, .08));
}

body > header nav {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(55, 76, 61, .08);
  border-radius: 999px;
  background: rgba(238, 240, 233, .76);
}

body > header nav button,
.global-search-open {
  min-height: 35px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

body > header nav button:hover,
.global-search-open:hover { background: rgba(255, 255, 255, .76); }
body > header nav .tab.active {
  color: var(--manso-green-deep);
  background: var(--manso-paper);
  box-shadow: 0 4px 14px rgba(46, 65, 50, .09);
}

.global-search-open {
  border: 1px solid transparent;
  color: var(--manso-muted);
  background: transparent;
}

main {
  width: min(1240px, calc(100vw - 38px));
  margin-top: 25px;
  padding-bottom: 78px;
}

.view.active { gap: 16px; }
.view.view-entering { animation: manso-view-in .38s cubic-bezier(.2, .85, .28, 1) both; }

@keyframes manso-view-in {
  from { opacity: 0; transform: translateY(9px) scale(.995); }
  70% { transform: translateY(-1px) scale(1); }
  to { opacity: 1; transform: none; }
}

.view > .title-row {
  min-height: 56px;
  padding: 1px 3px 13px;
  border-bottom: 1px solid rgba(55, 69, 56, .13);
}

.view > .title-row > div:first-child { position: relative; }
.view > .title-row > div:first-child::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 4px;
  width: 4px;
  height: 34px;
  border-radius: 99px;
  background: linear-gradient(var(--manso-green), #8ab596);
}

.view > .title-row h2,
.title-row h2,
.auth-intro h1 {
  color: var(--manso-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -.035em;
}

.view > .title-row h2 { font-size: clamp(27px, 2.6vw, 34px); }
.eyebrow,
.view > .title-row .eyebrow {
  color: var(--manso-green);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.card,
details.card,
.home-card,
.visual-card,
.visual-section-card,
.section-entry-card {
  border: 1px solid rgba(61, 72, 61, .13);
  border-radius: var(--manso-radius);
  background: rgba(255, 253, 248, .96);
  box-shadow: var(--manso-shadow);
}

.card,
details.card,
form.card { padding: 18px; }

.card:hover {
  border-color: rgba(53, 111, 81, .22);
  box-shadow: var(--manso-shadow);
}

.section-head h3,
.card > h3,
.home-card h3,
.visual-overview-head h3 {
  color: var(--manso-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -.025em;
}

button,
.file-btn {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--manso-line);
  border-radius: 11px;
  color: var(--manso-ink);
  background: var(--manso-paper);
  box-shadow: 0 3px 10px rgba(44, 55, 45, .035);
  font-weight: 750;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

button:hover,
.file-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(53, 111, 81, .3);
  box-shadow: 0 7px 18px rgba(44, 55, 45, .08);
}

button:active { transform: translateY(0) scale(.985); }
button.primary,
.file-btn.primary {
  border-color: var(--manso-green);
  color: #fff;
  background: var(--manso-green);
  box-shadow: 0 7px 17px rgba(42, 96, 68, .17);
}
button.primary:hover { background: var(--manso-green-deep); }

input,
select,
textarea {
  min-height: 39px;
  border: 1px solid var(--manso-line);
  border-radius: 10px;
  color: var(--manso-ink);
  background: #fffefb;
  box-shadow: inset 0 1px 1px rgba(36, 44, 36, .025);
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(53, 111, 81, .5);
  box-shadow: 0 0 0 3px rgba(53, 111, 81, .10);
}

.workspace-tabs,
.mps-section-nav {
  padding: 4px;
  border: 1px solid rgba(54, 73, 58, .11);
  border-radius: 999px;
  background: rgba(232, 236, 228, .74);
}
.workspace-tabs button,
.mps-section-nav button { border-radius: 999px; }
.workspace-tabs button.active,
.mps-section-nav button.active {
  color: var(--manso-green-deep);
  background: var(--manso-paper);
  box-shadow: 0 4px 12px rgba(44, 58, 46, .09);
}
.production-tabs { margin-top: -4px; }

/* Inicio: primero trabajo concreto, después lectura del negocio. */
.home-production-card {
  position: relative;
  isolation: isolate;
  padding: 23px;
  overflow: hidden;
  border-color: rgba(53, 111, 81, .2);
  background:
    linear-gradient(110deg, rgba(255, 253, 248, .98), rgba(238, 246, 239, .97)),
    var(--manso-paper);
}
.home-production-card::after {
  content: "";
  position: absolute;
  right: -55px;
  top: -76px;
  z-index: -1;
  width: 210px;
  height: 210px;
  border: 28px solid rgba(91, 146, 108, .09);
  border-radius: 46% 54% 55% 45%;
  transform: rotate(18deg);
}
.home-production-head h3 { font-size: 26px; }
.home-production-track { height: 9px; background: rgba(47, 104, 74, .10); }
.home-production-track i { background: linear-gradient(90deg, #86b894, var(--manso-green)); }
.home-production-summary span {
  padding: 6px 10px;
  border-color: rgba(53, 111, 81, .14);
  color: var(--manso-green-deep);
  background: rgba(255, 255, 255, .68);
}
.home-packing-list button {
  border-color: rgba(54, 75, 58, .12);
  border-radius: 13px;
  background: rgba(255, 255, 255, .76);
}
.home-packing-list button:hover { background: #fff; }

.visual-overview { margin-top: 4px; }
.visual-overview-head {
  align-items: end;
  padding: 8px 4px 4px;
}
.visual-overview-head h3 { font-size: 24px; }
.visual-kpi-strip {
  gap: 10px;
  padding: 0;
  background: transparent;
}
.visual-kpi-strip > div {
  min-height: 96px;
  padding: 17px;
  border: 1px solid rgba(58, 72, 59, .12);
  border-radius: 16px;
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--manso-shadow);
}
.visual-kpi-strip strong { font-family: Georgia, serif; font-size: 23px; font-weight: 600; }
.visual-dashboard-grid { gap: 13px; }
.visual-card { padding: 19px; }
.visual-card header h4 { font-family: Georgia, serif; font-size: 18px; }
.visual-columns i.visual-income,
.visual-horizontal-bars em,
.section-status-bars em,
.work-category-bars em { background: linear-gradient(90deg, #79aa88, var(--manso-green)); }
.visual-columns i.visual-expense { background: linear-gradient(#e7bd77, var(--manso-amber)); }
.stock-donut { filter: drop-shadow(0 8px 12px rgba(44, 66, 48, .07)); }
.visual-cash-note {
  padding: 10px 13px;
  border-left: 3px solid var(--manso-amber);
  border-radius: 6px 12px 12px 6px;
  background: rgba(246, 234, 211, .58);
}

/* Centro de pedidos. */
.orders-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.orders-overview article {
  min-width: 0;
  padding: 16px 17px;
  border: 1px solid rgba(57, 72, 59, .12);
  border-radius: 16px;
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--manso-shadow);
}
.orders-overview span,
.orders-overview small { display: block; color: var(--manso-muted); }
.orders-overview span { font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.orders-overview strong { display: block; margin: 7px 0 3px; font-family: Georgia, serif; font-size: 24px; font-weight: 600; }
.orders-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.orders-entry-card {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 128px;
}
.orders-entry-card p { margin: 4px 0 0; color: var(--manso-muted); }
.orders-entry-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 17px 17px 7px 17px;
  color: var(--manso-green-deep);
  background: var(--manso-green-soft);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  transform: rotate(-3deg);
}
.orders-entry-mps .orders-entry-icon { color: #8c5d1e; background: var(--manso-amber-soft); }
.orders-hub-recent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.orders-hub-recent button {
  display: grid;
  grid-template-columns: 75px 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  text-align: left;
  box-shadow: none;
}
.orders-hub-recent button:only-child { grid-column: 1 / -1; }
.orders-hub-recent button span:nth-child(2) { min-width: 0; }
.orders-hub-recent button strong,
.orders-hub-recent button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-hub-recent button small { margin-top: 2px; color: var(--manso-muted); }
.orders-action-kind {
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--manso-green-deep);
  background: var(--manso-green-soft);
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}
.orders-action-kind.warn { color: #875913; background: var(--manso-amber-soft); }
.orders-action-kind.good { color: var(--manso-green-deep); background: var(--manso-green-soft); }
.orders-empty { grid-column: 1 / -1; padding: 18px; text-align: center; color: var(--manso-muted); }
.orders-empty strong,
.orders-empty span { display: block; }

/* Producción y stock. */
#work.active,
#inventory.active,
#recipes.active { gap: 13px; }
.mps-packing-queue-card { border-top: 3px solid var(--manso-green); }
.mps-packing-queue > button,
.mps-packing-queue-row { border-radius: 13px; }
.work-summary-kpis > div {
  border: 0;
  border-left: 1px solid var(--manso-line);
  border-radius: 0;
  background: transparent;
}
.work-summary-kpis > div:first-child { border-left: 0; }
.work-summary-kpis strong { font-family: Georgia, serif; font-size: 20px; }
.guided-stock-card { border-top: 3px solid var(--manso-amber); }
.product-state-table tbody tr { transition: background .15s ease; }

/* Plata: lectura primero, control fino después. */
#finances .section-entry-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
#finances .section-entry-card .section-head { margin-bottom: 9px; }
.operation-hub { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.operation-hub button {
  min-height: 82px;
  align-content: center;
  border-radius: 16px;
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--manso-shadow);
}
.operation-hub button span { font-family: Georgia, serif; font-size: 18px; }
.monthly-finance-card { border-top: 3px solid var(--manso-green); }
.cash-ledger-card { opacity: .9; }

/* Datos y contactos. */
#data > .section-entry-card { padding: 0; }
#data .section-entry-card .section-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
  gap: 11px;
}
#data .section-nav button {
  min-height: 78px;
  border-radius: 16px;
  font-family: Georgia, serif;
  font-size: 17px;
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--manso-shadow);
}
.contact-row-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.contact-row-main > div { min-width: 0; }
.contact-avatar {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(53, 111, 81, .14);
  border-radius: 50%;
  color: var(--manso-green-deep);
  background: var(--manso-green-soft);
}
.contact-avatar img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.contact-avatar b { font-size: 11px; }
.contact-row { min-height: 54px !important; }

/* Densidad de listas y tablas. */
.table-wrap,
.mps-load-table-wrap,
.mps-purchase-table-wrap,
.price-adjustment-table-wrap {
  border: 1px solid rgba(58, 70, 59, .11);
  border-radius: 13px;
  background: rgba(255, 255, 255, .35);
}
table { font-size: 11px; }
table thead th,
th {
  padding: 8px 9px;
  color: #62675f;
  background: #eeefe8;
  font-size: 9px;
  letter-spacing: .035em;
  text-transform: uppercase;
}
td { padding: 7px 9px; }
tbody tr:nth-child(even) { background: rgba(244, 244, 238, .56); }
tbody tr:hover,
tbody tr:focus-within { background: rgba(228, 238, 230, .7); }
.row,
.row.compact-row { min-height: 42px; padding: 8px 4px; }
.pill {
  border: 1px solid rgba(70, 81, 69, .09);
  border-radius: 999px;
  background: #f0f1ea;
  font-weight: 750;
}
.pill.good { color: var(--manso-green-deep); background: var(--manso-green-soft); }
.pill.bad,
.pill.warn { color: #8e3e37; background: var(--manso-red-soft); }

details.card > summary { border-radius: 15px; }
details.card > summary:hover { background: rgba(234, 238, 231, .58); }

/* Cronómetro presente, liviano y estable. */
.card.mps-work-timer {
  bottom: 13px;
  width: min(440px, calc(100vw - 24px));
  border: 1px solid rgba(52, 94, 66, .19);
  border-radius: 17px;
  background: rgba(255, 253, 248, .94);
  box-shadow: 0 18px 48px rgba(35, 52, 39, .17);
  backdrop-filter: blur(16px);
}
.mps-work-timer-clock { color: var(--manso-green-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mps-work-timer-actions button { border-radius: 50%; }

.auth-card {
  border-radius: 26px;
  border-color: rgba(53, 111, 81, .16);
  box-shadow: var(--manso-shadow-raised);
}

@media (max-width: 980px) {
  .orders-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orders-hub-grid { grid-template-columns: 1fr; }
  .orders-entry-card { grid-template-columns: 50px 1fr auto; }
}

@media (max-width: 700px) {
  body { background: var(--manso-canvas) !important; }
  body > header { min-height: 61px; padding-inline: 10px; }
  body > header .brand-logo { width: 62px; max-height: 43px; }
  main { width: calc(100vw - 16px); margin-top: 12px; }
  .view > .title-row { min-height: 44px; }
  .view > .title-row > div:first-child::before { display: none; }
  .view > .title-row h2 { font-size: 25px; }
  .card, details.card, form.card, .home-card, .visual-card { padding: 13px; border-radius: 15px; }
  .home-production-head h3 { font-size: 21px; }
  .visual-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-kpi-strip > div { min-height: 84px; padding: 13px; }
  .orders-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .orders-overview article { padding: 12px; }
  .orders-overview strong { font-size: 20px; }
  .orders-entry-card { grid-template-columns: 42px 1fr; gap: 11px; }
  .orders-entry-card button { grid-column: 1 / -1; }
  .orders-entry-icon { width: 42px; height: 42px; border-radius: 14px 14px 6px 14px; }
  .orders-hub-recent { grid-template-columns: 1fr; }
  .operation-hub,
  #data .section-entry-card .section-nav { grid-template-columns: 1fr; }
  .operation-hub button,
  #data .section-nav button { min-height: 56px; }
  .work-summary-kpis > div:nth-child(odd) { border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .view.view-entering { animation: none; }
  button { transition: none; }
}
