/* N Proyectos · sistema visual industrial
   Capa de presentación: mantiene intactos datos, permisos y flujos de trabajo. */
:root {
  --ink: #122b46;
  --ink-deep: #091b2f;
  --blue: #1c5f9f;
  --blue-strong: #174f86;
  --blue-soft: #eaf2fa;
  --paper: #f2f5f8;
  --white: #fff;
  --text: #25364a;
  --muted: #63758a;
  --line: #d7e0e9;
  --orange: #bf7425;
  --green: #16835c;
  --red: #bd4038;
  --shadow: 0 14px 34px rgb(16 40 68 / 9%);
  --shadow-soft: 0 3px 12px rgb(16 40 68 / 5%);
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --focus-ring: 0 0 0 3px rgb(28 95 159 / 18%);
  --display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body { color: var(--text); background: #f2f5f8; font-family: var(--body); font-size: 14px; line-height: 1.45; }
::selection { color: #fff; background: #286ca8; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button, input[type="button"], input[type="submit"], input[type="reset"], summary, .button { text-transform: none; }
.sidebar-collapse-button { text-transform: none; letter-spacing: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(42 116 177 / 38%);
  outline-offset: 2px;
}

/* Acceso */
.login-screen { min-height: 100svh; background: #eef2f6; }
.login-atmosphere { background: linear-gradient(145deg, #0d2743 0%, #153d62 58%, #1d5079 100%); }
.login-grid { opacity: .12; background-size: 34px 34px; }
.drawing-n { color: rgb(255 255 255 / 5%); font-family: var(--display); font-weight: 800; }
.drawing-copy strong { font-family: var(--display); font-size: clamp(38px, 5vw, 68px); font-weight: 700; letter-spacing: -.045em; line-height: 1.02; }
.login-entry { background: #f4f6f8; }
.login-card { width: min(100%, 480px); padding: clamp(28px, 4vw, 48px); border: 1px solid #e0e6ec; border-radius: 16px; background: #fff; box-shadow: 0 18px 50px rgb(16 40 68 / 10%); }
.login-logo { max-width: 190px; max-height: 54px; object-fit: contain; object-position: left center; }
.login-heading h1 { color: var(--ink); font-size: clamp(27px, 3vw, 34px); letter-spacing: -.035em; line-height: 1.15; }
.login-heading > p:last-child { color: var(--muted); font-size: 14px; }
.login-fields > label, .password-label { color: #344b63; font-size: 12px; font-weight: 700; }
.login-input { min-height: 46px; border-color: #cbd7e2; border-radius: 8px; box-shadow: none; }
.secure-access { border-color: #dce7ef; border-radius: 9px; background: #f6f9fb; }
.prototype-note { color: #738397; }

/* Marco y navegación */
.app-shell { grid-template-columns: 252px minmax(0, 1fr); background: var(--paper); }
.sidebar { padding: 15px 13px 12px; background: #fff; border-right: 1px solid #dce4eb; box-shadow: 4px 0 16px rgb(16 40 68 / 4%); transition: width .2s ease, transform .2s ease, box-shadow .2s ease; }
.sidebar-header { display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; gap: 8px; margin: 0 2px 10px; }
.brand--logo { height: 52px; min-height: 52px; margin: 0; padding: 7px 10px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.brand--logo img { width: 100%; height: 100%; max-width: 184px; max-height: 36px; object-fit: contain; object-position: center; filter: none; transform: none; }
.sidebar-collapse-button { width: 30px; min-width: 30px; height: 30px; min-height: 30px; display: grid; place-items: center; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 7px; color: #6e8092; background: transparent; cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.sidebar-collapse-button:hover { color: #174f7d; border-color: #e3eaf0; background: #f4f7fa; transform: none; }
.sidebar-collapse-button svg { width: 15px; height: 15px; color: currentColor; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.sidebar-collapse-button[aria-pressed="true"] svg { transform: rotate(180deg); }
.nav-label { margin: 0 9px 8px; color: #8292a2; font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.primary-nav { gap: 2px; margin-top: 0; }
.nav-item { min-height: 40px; gap: 10px; margin: 1px 0; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; color: #43586c; font-size: 12px; font-weight: 600; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.nav-item svg { width: 17px; height: 17px; color: #73899d; stroke-width: 1.7; }
.nav-item:hover { color: #174f7d; background: #f5f8fb; border-color: #e7edf2; transform: translateX(1px); }
.nav-item:hover svg { color: #286b9e; }
.nav-item.is-active { color: #174f7d; background: #edf4f9; border-color: #dbe7f0; box-shadow: inset 2px 0 #2778b5; }
.nav-item.is-active::before { left: -1px; width: 2px; height: 18px; background: #2778b5; border-radius: 0 3px 3px 0; }
.nav-item.is-active svg { color: #236d9f; }
.nav-count { color: #245f8d; background: #e7f1f8; }
.sidebar-bottom { border-top-color: #e4eaf0; }
.sidebar-values-toggle { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 8px; margin: 0 0 7px; padding: 0 8px; border: 1px solid transparent; border-radius: 7px; color: #64788c; background: transparent; font: 600 11px/1 var(--body); text-align: left; cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.sidebar-values-toggle:hover { color: #174f7d; border-color: #e7edf2; background: #f5f8fb; }
.sidebar-values-toggle svg { width: 16px; height: 16px; }
.sidebar-values-toggle.is-hidden { color: #236b9f; border-color: #dce9f2; background: #f0f6fa; }
.profile { min-width: 0; padding: 10px 4px 5px; }
.profile strong { color: #233d56; font-size: 11px; }
.profile small { color: #74869a; font-size: 10px; }
.avatar { color: #fff; background: #2c6d9e; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%); }
.logout-button { color: #536b80; border-radius: 7px; }
.logout-button:hover { color: #174f7d; background: #f0f5f9; }

@media (min-width: 861px) {
  .app-shell { grid-template-columns: 252px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
  .app-shell.is-sidebar-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
  .app-shell.is-sidebar-collapsed .sidebar { width: 68px; overflow-x: hidden; padding: 12px 8px; transform: none; pointer-events: auto; box-shadow: 4px 0 14px rgb(16 40 68 / 5%); }
  .app-shell.is-sidebar-collapsed .sidebar-header { display: flex; justify-content: center; margin: 0 0 12px; }
  .app-shell.is-sidebar-collapsed .brand--logo,
  .app-shell.is-sidebar-collapsed .nav-label { display: none; }
  .app-shell.is-sidebar-collapsed .sidebar-collapse-button { width: 34px; min-width: 34px; height: 34px; }
  .app-shell.is-sidebar-collapsed .primary-nav { margin-top: 0; }
  .app-shell.is-sidebar-collapsed .nav-item { justify-content: center; gap: 0; min-height: 42px; margin: 2px 0; padding: 0; border-color: transparent; border-radius: 8px; font-size: 0; }
  body:not([class*="is-printing"]) .app-shell.is-sidebar-collapsed .sidebar .nav-item { font-size: 0; }
  .app-shell.is-sidebar-collapsed .nav-item:hover { transform: none; }
  .app-shell.is-sidebar-collapsed .nav-item svg { width: 18px; height: 18px; }
  .app-shell.is-sidebar-collapsed .nav-item.is-active { border-color: #dbe7f0; box-shadow: inset 2px 0 #2778b5; }
  .app-shell.is-sidebar-collapsed .sidebar-bottom { padding-top: 8px; }
  .app-shell.is-sidebar-collapsed .sidebar-values-toggle { width: 42px; min-height: 38px; justify-content: center; gap: 0; margin: 0 auto 7px; padding: 0; font-size: 0; }
  .app-shell.is-sidebar-collapsed .sidebar-values-toggle svg { width: 17px; height: 17px; }
  .app-shell.is-sidebar-collapsed .profile-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 7px; }
  .app-shell.is-sidebar-collapsed .profile { width: auto; justify-content: center; padding: 4px; }
  .app-shell.is-sidebar-collapsed .profile > span:last-child { display: none; }
  .app-shell.is-sidebar-collapsed .logout-button { width: 34px; height: 34px; }
  .app-shell.is-sidebar-collapsed .main { grid-column: 2; }
  .app-shell.is-sidebar-collapsed .topbar { grid-template-columns: minmax(145px, 1fr) minmax(240px, 390px) minmax(220px, 1fr); }
  .app-shell.is-sidebar-collapsed .menu-button { display: none; }
}

/* Barra superior y páginas */
.main { min-width: 0; background: var(--paper); }
.topbar { height: 62px; grid-template-columns: minmax(145px, 1fr) minmax(240px, 390px) minmax(220px, 1fr); gap: 22px; padding: 0 clamp(18px, 2.3vw, 34px); background: rgb(255 255 255 / 96%); border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgb(16 40 68 / 3%); backdrop-filter: blur(12px); }
.date-block span { color: #718399; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.date-block strong { color: #213b56; font-size: 11px; font-weight: 750; }
.global-search { min-height: 37px; border: 1px solid #d4dee7; border-radius: 8px; background: #f6f8fa; box-shadow: none; }
.global-search:focus-within { background: #fff; border-color: #78a2c6; box-shadow: var(--focus-ring); }
.global-search input { font-size: 12px; }
.global-search kbd { border: 1px solid #dbe3ea; border-radius: 4px; background: #fff; color: #667a90; }
.role-pill { min-height: 28px; padding: 0 9px; border: 1px solid #dce5ed; border-radius: 999px; background: #f7f9fb; font-size: 10px; }
.admin-role-switch { display: inline-flex; align-items: center; gap: 6px; color: #64788c; font-size: 11px; font-weight: 650; white-space: nowrap; }
.admin-role-switch select { min-width: 112px; min-height: 34px; padding: 0 25px 0 9px; border: 1px solid #cbd8e4; border-radius: 7px; color: #24435f; background: #fff; font: 650 12px/1.2 var(--body); cursor: pointer; }
.admin-role-switch select:focus-visible { outline: 3px solid rgb(42 116 177 / 38%); outline-offset: 2px; }
.admin-activate-button { white-space: nowrap; }
.admin-activate-button[hidden], .admin-role-switch[hidden] { display: none; }
.top-actions .button { min-height: 36px; padding: 0 12px; }
.menu-button { width: 36px; min-width: 36px; min-height: 36px; padding: 8px; border-color: #d4dee7; border-radius: 8px; }
.menu-button span { width: 16px; height: 2px; margin: 2px auto; border-radius: 2px; background: #284964; }
.workspace-view { width: min(100%, 1640px); padding: 28px clamp(18px, 2.3vw, 34px) 48px; }
.workspace-hero { align-items: center; gap: 22px; margin-bottom: 20px; padding: 0 0 17px; border-bottom: 1px solid #d8e1e9; }
.workspace-hero h1, .home-welcome h1 { color: var(--ink); font-family: var(--display); font-size: clamp(28px, 2.7vw, 38px); font-weight: 700; line-height: 1.12; letter-spacing: -.035em; }
.workspace-hero > div > p:last-child, .home-welcome > div > p:last-child { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.eyebrow { margin: 0 0 7px; color: #53708b; font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.eyebrow > span { display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border-radius: 2px; background: #bd813e; }
.section-kicker { color: #657c91; font-size: 10px; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.home-page { max-width: 1500px; }

/* Controles */
.button, .icon-button, .menu-button, .inventory-view-toggle, .history-view-toggle,
.sii-document-button, .order-print__button { min-height: 37px; border-radius: 7px; font-size: 12px; font-weight: 650; transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button { padding: 0 13px; }
.button--primary { color: #fff; background: #1c5f9f; border-color: #1c5f9f; box-shadow: 0 2px 4px rgb(23 79 134 / 13%); }
.button--primary:hover { background: #174f86; border-color: #174f86; box-shadow: 0 4px 10px rgb(23 79 134 / 18%); transform: translateY(-1px); }
.button--secondary, .icon-button { color: #294965; background: #fff; border-color: #cdd9e4; }
.button--secondary:hover, .icon-button:hover { color: #174f86; background: #f4f8fb; border-color: #9db5ca; }
.button:active, .icon-button:active { transform: translateY(1px); }
.button:disabled, button:disabled { opacity: .54; cursor: not-allowed; box-shadow: none; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
select, textarea { color: #20374e; border-color: #cbd7e2; border-radius: 7px; background: #fff; box-shadow: inset 0 1px 2px rgb(16 40 68 / 3%); }
input::placeholder, textarea::placeholder { color: #8c9bab; }
input:focus, select:focus, textarea:focus { border-color: #6d99bf !important; box-shadow: var(--focus-ring) !important; }
input[readonly], input:disabled, select:disabled, textarea:disabled { color: #718195; background: #f1f4f7; }
label { color: #3d5268; }
label > small, .form-hint { color: #75869a; }
.form-error, [role="alert"].form-error, .login-error { color: #a93232; }
.file-drop { border-color: #b8cad9; border-radius: 9px; background: #f7fafc; transition: border-color .16s ease, background-color .16s ease; }
.file-drop:hover, .file-drop.is-dragover { border-color: #5385ae; background: #eef5fa; }

/* Inicio y cifras */
.home-workbench { margin-top: 9px; }
.home-workbench__head { align-items: flex-end; margin-bottom: 15px; }
.home-workbench__head h1 { color: var(--ink); font-size: clamp(29px, 3vw, 40px); letter-spacing: -.04em; }
.home-workbench__intro p, .home-welcome > div > p:last-child { color: var(--muted); font-size: 12px; }
.home-welcome { align-items: center; gap: 15px; padding: 0; border: 0; }
.home-welcome__greeting { color: #294967; font-size: 14px; font-weight: 650; }
.home-shift { min-width: 145px; padding: 8px 12px; border: 1px solid #d5e0e9; border-left: 3px solid #b88142; border-radius: 7px; background: #fff; }
.home-shift span { color: #77899d; font-size: 9px; }
.home-shift strong { color: #24435f; font-size: 12px; }
.home-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border: 0; }
.home-action { min-height: 98px; grid-template-columns: 38px minmax(0, 1fr) 14px; gap: 12px; padding: 14px; border: 1px solid #d9e2ea; border-radius: 10px; background: #fff; box-shadow: var(--shadow-soft); }
.home-action:hover { z-index: 1; border-color: #a9bfd2; background: #fbfdff; box-shadow: 0 7px 18px rgb(16 40 68 / 8%); transform: translateY(-1px); }
.home-action--primary, .home-action--primary:hover { color: #fff; border-color: #1e527f; border-left: 3px solid #d19a56; background: linear-gradient(115deg, #163d60, #1d527d); box-shadow: 0 5px 15px rgb(16 54 85 / 16%); }
.home-action__icon, .home-action--primary .home-action__icon { width: 36px; height: 36px; color: #1b5c91; border: 1px solid #d6e3ed; border-radius: 8px; background: #edf4f9; }
.home-action__icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.home-action--primary .home-action__icon { color: #e4eef7; border-color: rgb(255 255 255 / 18%); background: rgb(255 255 255 / 10%); }
.home-action strong { color: #203c57; font-size: 12px; font-weight: 700; }
.home-action small { margin-top: 4px; color: #728398; font-size: 10px; line-height: 1.4; }
.home-action--primary strong { color: #fff; }
.home-action--primary small { color: #d2e1ee; }
.home-action b { color: #899bad; font-size: 16px; }
.home-action--primary b { color: #d8e7f3; }
.home-delivery-alerts, .owner-command { margin-top: 15px; border: 1px solid #d8e2eb; border-radius: 11px; background: #fff; box-shadow: var(--shadow-soft); }
.home-delivery-alerts { padding: 17px 19px; }
.home-delivery-alerts h2, .owner-command__head h2 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.02em; }
.home-delivery-alerts__grid button { min-height: 52px; border: 1px solid #dbe4eb; border-radius: 8px; background: #f8fafc; }
.home-delivery-alerts__grid button:hover { border-color: #afc3d4; background: #f0f5f9; transform: translateY(-1px); }
.owner-command { padding: 18px; border-top: 3px solid #244d70; }
.owner-command__head { margin-bottom: 13px; }
.owner-command__head h2 { font-size: 21px; }
.owner-command__grid { gap: 8px; }
.owner-command-card { min-height: 80px; padding: 12px 14px; border-radius: 8px; }
.owner-command-card span { font-size: 10px; }
.owner-command-card strong { font-size: 25px; }

/* Paneles, listados y tablas */
.registry-strip, .inventory-summary, .users-summary { gap: 1px; margin-bottom: 15px; border: 1px solid #dbe3ea; border-radius: 10px; background: #dbe3ea; box-shadow: var(--shadow-soft); }
.registry-strip article, .inventory-summary article, .users-summary article { min-height: 82px; padding: 14px 17px; background: #fff; border: 0; }
.registry-strip article:first-child, .inventory-summary article:first-child, .users-summary article:first-child { border-radius: 9px 0 0 9px; }
.registry-strip article:last-child, .inventory-summary article:last-child, .users-summary article:last-child { border-radius: 0 9px 9px 0; }
.registry-strip span, .inventory-summary span, .users-summary span { color: #65798e; font-size: 10px; font-weight: 650; }
.registry-strip strong, .inventory-summary strong, .users-summary strong { color: #1b4569; font-family: var(--body); font-size: 25px; font-weight: 700; }
.registry-strip small, .inventory-summary small, .users-summary small { color: #8391a0; font-size: 9px; }
.inventory-summary { background: #dbe3ea; }
.inventory-summary article::after { height: 2px; background: #4c83ad; }
.inventory-summary span { color: #667b90; }
.inventory-summary strong { color: #1a4265; font-size: 25px; text-shadow: none; }
.inventory-summary small { color: #7b8b9d; }
.registry-panel, .entry-card, .users-create-panel, .purchase-board, .movement-board, .cost-center-control, .cost-center-entry-panel,
.billing-selector, .excel-workbook, .history-filters, .inventory-catalog, .cost-center-list-panel {
  border: 1px solid #d8e1e9; border-radius: 11px; background: #fff; box-shadow: var(--shadow-soft);
}
.registry-panel { overflow: hidden; }
.registry-panel__head, .panel-head, .vault-panel-head { min-height: 62px; padding: 13px 17px; border-bottom: 1px solid #e2e8ee; background: #fff; }
.registry-panel__head h2, .panel-head h2, .inventory-toolbar h2, .inventory-side h2 { color: var(--ink); font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.registry-panel__hint { color: #78899c; font-size: 11px; }
.client-directory-head, .order-history-head, .inventory-table-head, .billing-table-head, .cost-center-table-head, .quote-history-head {
  color: #526b81; background: #eff3f6; border-color: #dce4eb; font-family: var(--body); font-size: 9px; font-weight: 750; letter-spacing: .045em; text-transform: uppercase;
}
.client-directory-row, .order-history-row, .billing-row, .cost-center-row, .quote-history-row, .inventory-row {
  border-bottom-color: #e6ebf0; transition: background-color .14s ease;
}
.client-directory-row:hover, .order-history-row:hover, .billing-row:hover, .cost-center-row:hover, .quote-history-row:hover, .inventory-row:hover { background: #f4f8fb; }
.client-directory-row, .order-history-row { min-height: 68px; padding-top: 10px; padding-bottom: 10px; }
.client-directory-row > strong, .client-directory-row > span:first-child, .order-history-row > strong { color: #24435f; }
.history-value, .billing-row .billing-money, .cost-center-money, .quote-history-total { font-variant-numeric: tabular-nums; }
.registry-loading { min-height: 150px; color: #6f8296; font-size: 12px; }
.registry-loading i { width: 17px; height: 17px; border-width: 2px; }
.registry-empty { min-height: 175px; }
.registry-empty > span { width: 40px; height: 40px; border-radius: 9px; background: #edf3f8; }
.registry-empty strong { color: #304d67; font-size: 14px; }
.registry-empty p { color: #77899c; font-size: 11px; }

/* Formularios y entrada de OT */
.entry-layout { align-items: start; gap: 16px; }
.entry-card { padding: 21px 23px 23px; }
.entry-card__head { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; margin-bottom: 20px; padding-bottom: 16px; }
.entry-card__head > span.entry-card__icon { width: 40px; height: 40px; color: #1d5b91; border: 1px solid #d4e1eb; border-radius: 9px; background: #edf4f8; }
.entry-card__head > span.entry-card__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.entry-card__head h2 { color: var(--ink); font-family: var(--display); font-size: 22px; }
.entry-card > label, .entry-card .form-grid > label, .entry-form label, .cost-center-recurring-form label { color: #3d5267; font-size: 11px; font-weight: 650; }
.entry-card input, .entry-card select, .entry-card textarea { border-color: #cbd7e2; border-radius: 7px; font-size: 12px; }
.entry-card input, .entry-card select { height: 41px; }
.entry-card textarea { min-height: 100px; }
.entry-card input:focus, .entry-card select:focus, .entry-card textarea:focus { border-color: #7199b9; box-shadow: var(--focus-ring); }
.entry-actions { position: sticky; bottom: 8px; z-index: 4; margin: 14px -10px -10px; padding: 12px; border: 1px solid #d9e3ec; border-radius: 10px; background: rgb(255 255 255 / 96%); box-shadow: 0 8px 20px rgb(16 40 68 / 10%); backdrop-filter: blur(8px); }
.entry-actions > span { color: #75869a; font-size: 10px; }
.service-selector { border-color: #d8e2ea; border-radius: 9px; background: #f8fafc; }
.service-selector legend { color: #2f4a64; font-size: 12px; }
.service-selector__grid label { border: 1px solid #dbe3ea; border-radius: 7px; background: #fff; }
.service-selector__grid label:has(input:checked) { border-color: #80a7c8; background: #edf4f9; box-shadow: inset 0 0 0 1px rgb(28 95 159 / 10%); }
.next-order-number { border: 1px solid #d9e3eb; border-left: 3px solid #b88142; border-radius: 8px; background: #fff; }

/* Cotizador: se conserva el lenguaje de hoja editable y se quita el aspecto de planilla antigua. */
.quote-page .excel-workbook { overflow: hidden; }
.quote-page .excel-tabs { min-height: 48px; gap: 4px; padding: 7px 12px 0; border-bottom-color: #dce4eb; background: #f1f4f7; }
.quote-page .excel-tabs button { min-width: 104px; height: 37px; color: #536b81; border-radius: 7px 7px 0 0; font-family: var(--body); font-size: 11px; }
.quote-page .excel-tabs button.is-active { color: #1c578a; border-color: #d8e2ea; border-bottom: 1px solid #fff; border-top: 2px solid #1c5f9f; background: #fff; }
.quote-page .excel-toolbar--quotation { gap: 13px; padding: 15px 18px; background: #f8fafc; border-bottom-color: #dfe6ec; }
.quote-page .excel-toolbar__actions { gap: 6px; }
.quote-page .excel-toolbar__actions .button { min-height: 36px; border-radius: 7px; font-size: 10px; }
.quote-page .quotation-sheet { border-color: #d8e0e7; border-radius: 5px; box-shadow: 0 7px 24px rgb(22 42 65 / 12%); }
.quote-page .quotation-sheet input:focus { background: #f1f6fa; box-shadow: inset 0 0 0 1px #7ea2bf; }
.quote-page .quote-total-preview { border-radius: 8px; }
.quote-history-head { background: #eff3f6; color: #526b81; }
.quote-history-open { color: #1c5f9f; border-color: #cbdce9; border-radius: 6px; background: #f3f7fa; }

/* Historial, cobros y finanzas */
.history-filters { padding: 16px; border-left: 3px solid #1c5f9f; }
.history-filters__intro h2 { color: var(--ink); font-size: 20px; }
.history-filters__intro > p:last-child { color: #6d7e90; }
.history-filters__controls label, .history-more-filters__controls label { color: #42586e; font-size: 10px; }
.history-filters__controls select, .history-filters__controls input, .history-more-filters__controls select, .history-more-filters__controls input { min-height: 38px; border-color: #d1dce5; border-radius: 7px; }
.history-quick-filters { gap: 6px; }
.history-quick-filters button { min-height: 30px; border-radius: 6px; color: #3e5b75; background: #f6f8fa; border-color: #dbe3e9; font-size: 10px; }
.history-quick-filters button.is-active { color: #fff; background: #245f91; border-color: #245f91; box-shadow: none; }
.applied-search-filters__chip { border-color: #d3e0e9; border-radius: 999px; background: #f7fafc; }
.history-registry-head { gap: 12px 20px; }
.history-registry-head__title h2 { font-size: 20px; }
.history-registry-head__title #history-result-count { color: #52697f; font-size: 11px; }
.history-view-actions .button, .history-view-actions .action-menu summary { min-height: 35px; padding: 6px 10px; font-size: 10px; }
.history-view-actions .history-sort-control select { min-height: 35px; font-size: 11px; }
.history-top-totals { padding: 10px 17px; border-color: #dfe6ec; background: #f7f9fb; }
.order-history.is-compact { padding: 7px; background: #f4f6f8; }
.order-history-compact { min-height: 46px; margin: 3px 0; border-color: #dce4ea; border-radius: 8px; box-shadow: none; font-size: 11px; }
.order-history-compact:hover { border-color: #aebfd0; box-shadow: 0 3px 10px rgb(20 48 75 / 7%); }
.order-history-compact > strong:first-child { background: #1b4e79; }
.order-history-compact.is-expanded { background: #f3f7fa; }
.history-work-state, .history-payment-state, .history-delivery-date { min-height: 22px; padding: 3px 7px; border: 1px solid #e1e8ee; border-radius: 999px; font-size: 10px; }
.history-work-state { color: #1e5b8f; border-color: #d2e1ed; background: #edf4f9; }
.history-payment-state.is-paid { color: #146b4b; border-color: #c8e3d7; background: #edf8f2; }
.history-payment-state.is-partial { color: #8b5b1d; border-color: #eddfc7; background: #fbf6ed; }
.history-financial-summary { border-color: #d9e2ea; border-radius: 9px; background: #fff; }
.history-financial-summary__values strong { color: #204c72; }
.billing-report, .billing-selector { overflow: hidden; }
.billing-report { scroll-margin-top: 18px; }
.billing-report-head { align-items: center; }
.billing-table-head { border-bottom-color: #d9e2e9; }
.billing-row { min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
.billing-row:nth-child(even) { background: #f8fafb; }
.billing-row.is-excluded { color: #718093; background: #f1f4f6; }
.cost-center-page > .cost-center-tabs { top: 66px; border-color: #d7e1e9; border-radius: 9px; box-shadow: 0 4px 12px rgb(16 40 68 / 8%); }
.cost-center-tabs button, .cost-center-tabs button.is-active { min-height: 37px; border-radius: 7px; font-size: 11px; }
.cost-center-tabs button.is-active { background: #1b4e79; border-color: #1b4e79; }
.cost-center-tabs .cost-center-tabs__add { background: #1c5f9f; border-color: #1c5f9f; }
.cost-center-split { gap: 12px; padding: 13px; }
.cost-center-list-panel { border-radius: 9px; box-shadow: none; }
.cost-center-list-panel__head { min-height: 65px; padding: 11px 14px; background: #f8fafb; }
.cost-center-list-panel__head h3 { font-size: 16px; }
.cost-center-table-head { min-height: 36px; }
.cost-center-list-panel .cost-center-row { min-height: 64px; padding-top: 9px; padding-bottom: 9px; }

/* Bodega, equipo y ventanas */
.inventory-toolbar { min-height: 68px; padding: 12px 15px; border-radius: 10px 10px 0 0; }
.inventory-toolbar h2 { margin-top: 2px; font-size: 19px; }
.inventory-toolbar__controls { gap: 7px; }
.inventory-toolbar select, .inventory-view-toggle { min-height: 36px; border-radius: 7px; font-size: 10px; }
.inventory-table-head { min-height: 34px; }
.inventory-row { min-height: 63px; padding-top: 9px; padding-bottom: 9px; }
.inventory-card, .purchase-board, .movement-board { border-radius: 10px; box-shadow: var(--shadow-soft); }
.inventory-card:hover { box-shadow: 0 6px 16px rgb(16 40 68 / 8%); }
.purchase-board > header, .movement-board > header { padding: 13px 15px; border-bottom: 1px solid #e4e9ee; background: #f8fafb; }
.users-create-panel { padding: 18px; }
.users-create-panel__intro h2 { color: var(--ink); font-size: 20px; }
.user-list { padding: 7px 12px 12px; }
.user-card { border-bottom-color: #e4e9ee; }
.user-card__avatar { color: #1b527f; background: #edf4f8; }
.project-dialog, .operations-dialog { max-height: min(90dvh, 860px); border: 1px solid #d6e0e8; border-radius: 14px; background: #fff; box-shadow: 0 22px 70px rgb(6 25 44 / 28%); }
dialog::backdrop { background: rgb(7 24 42 / 55%); backdrop-filter: blur(2px); }
.dialog-head { border-bottom-color: #e3e9ee; }
.action-menu summary { border-radius: 7px; }
.action-menu > div { border-color: #d9e2e9; border-radius: 9px; box-shadow: 0 12px 28px rgb(15 38 63 / 16%); }
.toast { right: 22px; bottom: 22px; border: 1px solid rgb(255 255 255 / 12%); border-left: 3px solid #4bb487; border-radius: 8px; box-shadow: 0 12px 32px rgb(6 25 44 / 22%); font-size: 12px; }
.toast.is-error { border-left-color: #e47a70; }

@media screen and (max-width: 1200px) {
  .app-shell { grid-template-columns: 228px minmax(0, 1fr); }
  .workspace-view { padding-right: 22px; padding-left: 22px; }
  .home-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar { padding-right: 22px; padding-left: 22px; }
}
@media screen and (max-width: 1100px) {
  .topbar { gap: 14px; padding-right: 18px; padding-left: 18px; }
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { z-index: 30; width: min(280px, 86vw); transform: translateX(-105%); box-shadow: 12px 0 30px rgb(8 27 49 / 24%); }
  .sidebar.is-open { transform: translateX(0); }
  .main { width: 100%; }
  .topbar { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; }
  .menu-button { display: grid; place-items: center; }
  .date-block { display: none; }
  .global-search { grid-column: 2; }
  .top-actions .icon-button { display: none; }
}
@media screen and (max-width: 700px) {
  .topbar, .app-shell.is-sidebar-collapsed .topbar { height: 58px; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; padding: 0 12px; }
  .topbar .date-block { display: none; }
  .global-search { min-width: 0; }
  .global-search kbd, .role-pill { display: none; }
  .top-actions { gap: 0; }
  .admin-role-switch { gap: 0; }
  .admin-role-switch > span { display: none; }
  .admin-role-switch select { width: 104px; min-width: 104px; min-height: 32px; padding: 0 22px 0 7px; font-size: 11px; }
  .admin-activate-button { max-width: 112px; min-height: 34px; padding: 0 7px; font-size: 10px; white-space: normal; }
  .top-actions .button { width: 38px; min-width: 38px; padding: 0; overflow: hidden; font-size: 0; }
  .top-actions .button svg { width: 17px; height: 17px; flex: 0 0 auto; }
  .workspace-view { padding: 21px 13px 34px; }
  .workspace-hero { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 15px; padding-bottom: 14px; }
  .workspace-hero h1, .home-workbench__head h1 { font-size: clamp(26px, 8vw, 34px); }
  .workspace-hero > .button, .inventory-hero__actions { width: 100%; }
  .home-workbench__head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .home-welcome { width: 100%; justify-content: space-between; }
  .home-actions { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .home-action { min-height: 73px; grid-template-columns: 36px minmax(0, 1fr) 12px; padding: 10px 12px; }
  .home-action__icon { width: 33px; height: 33px; }
  .home-delivery-alerts { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
  .home-delivery-alerts__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-delivery-alerts__grid button { min-height: 49px; padding: 8px; }
  .owner-command { padding: 14px; }
  .owner-command__head { align-items: flex-start; flex-direction: column; }
  .owner-command__head .button { width: 100%; }
  .owner-command__grid { grid-template-columns: minmax(0, 1fr); }
  .registry-strip, .inventory-summary, .users-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .registry-strip--history article:nth-child(2) { border-right: 0; border-radius: 0 9px 0 0; }
  .registry-strip--history article:last-child { grid-column: 1 / -1; border-radius: 0 0 9px 9px; }
  .registry-strip article, .inventory-summary article, .users-summary article { min-height: 72px; padding: 11px 12px; }
  .registry-strip article:first-child, .inventory-summary article:first-child, .users-summary article:first-child { border-radius: 9px 0 0 0; }
  .registry-strip article:last-child, .inventory-summary article:last-child, .users-summary article:last-child { border-radius: 0 0 9px 0; }
  .registry-strip strong, .inventory-summary strong, .users-summary strong { font-size: 21px; }
  .entry-card { padding: 15px; }
  .entry-actions { position: static; margin: 12px 0 0; padding: 10px; }
  .entry-actions__buttons { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .entry-actions__buttons .button { width: 100%; }
  .entry-card__head { margin-bottom: 15px; }
  .entry-card .form-grid, .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .inventory-hero__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .inventory-hero__actions .live-indicator { grid-column: 1 / -1; }
  .inventory-toolbar { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px; }
  .inventory-toolbar__controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-search { grid-column: 1 / -1; width: 100%; }
  .inventory-toolbar__controls .button, .inventory-toolbar__controls .inventory-view-toggle { width: 100%; }
  .inventory-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-summary article { min-height: 68px; border-bottom: 1px solid #dbe3ea; }
  .inventory-layout { grid-template-columns: minmax(0, 1fr); }
  .quote-page .excel-tabs { position: sticky; top: 58px; z-index: 5; overflow-x: auto; flex-wrap: nowrap; }
  .quote-page .excel-toolbar--quotation { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .quote-page .excel-toolbar__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-page .excel-toolbar__actions .button { width: 100%; }
  .quote-page .excel-toolbar__actions #quote-print { grid-column: 1 / -1; }
  .quote-page .quotation-sheet { width: 816px; margin: 0; }
  .history-view-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-view-actions > * { min-width: 0; }
  .history-view-actions .history-sort-control { grid-column: 1 / -1; }
  .history-view-actions .button, .history-view-actions .action-menu summary { width: 100%; }
  .history-filters { padding: 12px; }
  .history-top-totals { padding: 11px; }
  .history-top-totals .history-financial-summary__values > div { padding: 4px 6px; }
  .history-top-totals .history-financial-summary__values strong { font-size: 12px; }
  .billing-report-head { align-items: flex-start; }
  .billing-report-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .billing-report-actions > * { min-width: 0; }
  .cost-center-page > .cost-center-tabs { top: 60px; overflow-x: auto; flex-wrap: nowrap; padding: 7px; }
  .cost-center-tabs button, .cost-center-tabs button.is-active { flex: 0 0 auto; min-height: 35px; padding: 0 10px; }
  .cost-center-tabs .cost-center-tabs__add { margin-left: 0; }
  .cost-center-split { padding: 8px; }
  .users-create-panel { padding: 13px; }
  .users-create-form__footer { align-items: stretch; flex-direction: column; }
  .users-create-form__footer .button { width: 100%; }
  .project-dialog, .operations-dialog { width: calc(100vw - 20px); max-height: 92svh; border-radius: 12px; }
  .toast { right: 12px; bottom: 12px; left: 12px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Inicio operativo: búsqueda y últimas OT en primer plano, accesos secundarios compactos. */
.home-page { padding-top: 23px; }
.home-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.home-heading h1 { margin: 0; color: var(--ink); font: 700 clamp(26px, 2.5vw, 34px)/1.15 var(--display); letter-spacing: -.035em; }
.home-heading h1 span { color: #245e91; }
.home-heading > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.home-new-order { flex: 0 0 auto; min-height: 42px; gap: 8px; }
.home-new-order svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.home-order-search { position: relative; z-index: 3; max-width: 900px; margin-bottom: 24px; }
.home-connected-users { max-width: 900px; margin: -7px 0 22px; padding: 14px 16px; border: 1px solid #e3eaf0; border-radius: 10px; background: #fff; }
.home-connected-users .home-section-heading { align-items: center; margin-bottom: 10px; }
.home-connected-users .home-section-heading h2 { font-size: 15px; }
.home-connected-users__count { color: #18815d; font-size: 11px; font-weight: 700; }
.home-connected-users__list { display: flex; flex-wrap: wrap; gap: 8px; }
.home-connected-user { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 5px 10px 5px 6px; border: 1px solid #e8edf1; border-radius: 999px; background: #fbfcfd; }
.home-connected-user__avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #245e91; background: #eaf2fa; font-size: 9px; font-weight: 750; }
.home-connected-user__name { max-width: 180px; overflow: hidden; color: #334a60; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.home-connected-user__status { display: inline-flex; align-items: center; gap: 5px; color: #18815d; font-size: 9px; font-weight: 650; white-space: nowrap; }
.home-connected-user__status::before { width: 6px; height: 6px; border-radius: 50%; background: #27a875; content: ""; }
.home-connected-users__empty { margin: 0; color: #788797; font-size: 11px; }
.home-order-search__field { display: flex; align-items: center; gap: 11px; min-height: 54px; padding: 0 15px; border: 1px solid #b9cad9; border-radius: 10px; background: #fff; box-shadow: 0 4px 15px rgb(16 40 68 / 6%); transition: border-color .16s ease, box-shadow .16s ease; }
.home-order-search__field:focus-within { border-color: #5c91bf; box-shadow: 0 0 0 3px rgb(28 95 159 / 12%), 0 5px 18px rgb(16 40 68 / 8%); }
.home-order-search__field > svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: #5f7890; stroke-width: 1.8; stroke-linecap: round; }
.home-order-search__field input { width: 100%; min-width: 0; height: 50px; padding: 0; border: 0 !important; outline: 0; background: transparent; box-shadow: none !important; font-size: 14px; }
.home-order-search__field input:focus { box-shadow: none !important; }
.home-order-search__field kbd { padding: 3px 7px; border: 1px solid #e0e7ed; border-radius: 5px; color: #728398; background: #f8fafc; font: 10px var(--body); }
.home-order-search__results { position: absolute; top: calc(100% + 6px); right: 0; left: 0; max-height: min(420px, 65vh); overflow-y: auto; border: 1px solid #d4dfe8; border-radius: 9px; background: #fff; box-shadow: 0 12px 28px rgb(16 40 68 / 14%); }
.home-order-result { display: grid; grid-template-columns: 90px minmax(130px, .8fr) minmax(160px, 1.5fr) minmax(110px, auto); align-items: center; gap: 12px; width: 100%; min-height: 53px; padding: 9px 14px; border: 0; border-bottom: 1px solid #edf1f4; color: var(--text); background: #fff; text-align: left; cursor: pointer; }
.home-order-result:last-child { border-bottom: 0; }
.home-order-result:hover, .home-recent-order:hover { background: #f5f8fb; }
.home-order-result__number, .home-recent-order__number { color: #1d578a; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.home-order-result__client, .home-order-result__detail, .home-recent-order__client, .home-recent-order__summary { overflow: hidden; color: #455b70; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.home-order-result__found { color: #73859a; font-size: 10px; text-align: right; }
.home-order-search__view-all { width: 100%; min-height: 42px; border: 0; border-top: 1px solid #e5ebf0; color: #1c5f9f; background: #f8fafc; font-size: 11px; font-weight: 700; cursor: pointer; }
.home-order-search__view-all:hover { background: #eef4f9; }
.home-order-search__empty { margin: 0; padding: 16px; color: var(--muted); font-size: 12px; }
.home-recent-orders { max-width: 1180px; }
.home-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.home-section-heading .section-kicker { margin: 0 0 4px; }
.home-section-heading h2 { margin: 0; color: var(--ink); font-size: 18px; letter-spacing: -.02em; }
.home-history-link { color: #1c5f9f; font-size: 11px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.home-history-link:hover { color: #123f69; text-decoration: underline; }
.home-recent-orders__list { overflow: hidden; border: 1px solid #d8e1e9; border-radius: 9px; background: #fff; }
.home-recent-order { display: grid; grid-template-columns: 82px minmax(140px, .85fr) minmax(180px, 1.5fr) minmax(130px, auto) 16px; align-items: center; gap: 14px; width: 100%; min-height: 51px; padding: 8px 13px; border: 0; border-bottom: 1px solid #edf1f4; color: inherit; background: #fff; text-align: left; cursor: pointer; transition: background-color .14s ease; }
.home-recent-order:last-child { border-bottom: 0; }
.home-order-status { justify-self: start; padding: 4px 8px; border: 1px solid #e1e7ec; border-radius: 999px; color: #596c7e; background: #f7f9fb; font-size: 10px; font-weight: 650; white-space: nowrap; }
.home-order-status.is-ready { border-color: #f1dfc4; color: #8b5b1e; background: #fff9f0; }
.home-order-status.is-delivered { border-color: #cfe5d8; color: #26724c; background: #f1faf4; }
.home-order-status.is-in_progress { border-color: #cfe0ef; color: #285f8b; background: #f1f7fc; }
.home-recent-order__arrow { color: #8a9aab; font-size: 15px; text-align: right; }
.home-recent-orders__empty { margin: 0; padding: 17px; color: var(--muted); font-size: 12px; }
.home-shortcuts { display: flex; flex-wrap: wrap; gap: 5px 17px; max-width: 1180px; margin-top: 15px; padding-top: 10px; border-top: 1px solid #e1e7ec; }
.home-shortcuts button { min-height: 28px; padding: 3px 0; border: 0; color: #64798d; background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; }
.home-shortcuts button:hover { color: #1c5f9f; text-decoration: underline; }
.home-page [hidden] { display: none !important; }
@media (max-width: 900px) {
  .home-order-result { grid-template-columns: 78px minmax(115px, .8fr) minmax(130px, 1.3fr); }
  .home-order-result__found { grid-column: 2 / -1; margin-top: -5px; text-align: left; }
  .home-recent-order { grid-template-columns: 74px minmax(120px, .8fr) minmax(120px, 1.2fr) auto 14px; gap: 9px; }
}
@media (max-width: 700px) {
  .home-page { padding-top: 17px; }
  .home-heading { align-items: flex-start; gap: 12px; margin-bottom: 16px; }
  .home-heading h1 { font-size: 25px; }
  .home-heading > div > p:last-child { max-width: 220px; font-size: 11px; line-height: 1.4; }
  .home-new-order { min-height: 38px; padding: 0 9px; font-size: 10px; }
  .home-new-order svg { width: 15px; }
  .home-order-search { margin-bottom: 20px; }
  .home-order-search__field { min-height: 48px; padding: 0 11px; }
  .home-order-search__field input { height: 46px; font-size: 12px; }
  .home-order-search__field kbd { display: none; }
  .home-order-result { grid-template-columns: 72px minmax(0, 1fr); gap: 4px 9px; padding: 10px 11px; }
  .home-order-result__client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home-order-result__detail { grid-column: 2; }
  .home-order-result__found { grid-column: 2; margin-top: 0; }
  .home-section-heading { align-items: flex-start; }
  .home-section-heading h2 { font-size: 16px; }
  .home-history-link { padding-top: 17px; font-size: 10px; }
  .home-recent-order { grid-template-columns: 65px minmax(0, 1fr) auto; gap: 4px 8px; min-height: 59px; padding: 9px 10px; }
  .home-recent-order__number { grid-row: 1 / span 2; align-self: start; padding-top: 2px; font-size: 11px; }
  .home-recent-order__client { font-size: 11px; font-weight: 650; }
  .home-recent-order__summary { grid-column: 2; font-size: 10px; }
  .home-order-status { grid-column: 3; grid-row: 1 / span 2; max-width: 118px; padding: 4px 6px; font-size: 9px; white-space: normal; }
  .home-recent-order__arrow { display: none; }
  .home-shortcuts { gap: 3px 13px; margin-top: 13px; }
  .home-shortcuts button { min-height: 30px; font-size: 10px; }
}

/* Inicio con accesos principales en primer plano y actividad reciente compacta. */
.home-order-search, .home-modules, .home-recent-orders { width: 100%; max-width: none; }
.home-modules { margin: 1px 0 0; }
.home-modules > .home-section-heading { margin-bottom: 11px; }
.home-modules .home-section-heading h2 { font-size: 19px; }
.home-module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-module-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) 16px; align-items: center; gap: 13px; min-width: 0; min-height: 88px; padding: 14px 16px; border: 1px solid #d8e2eb; border-radius: 10px; color: inherit; background: #fff; box-shadow: 0 2px 8px rgb(16 40 68 / 4%); text-align: left; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, transform .16s ease; }
.home-module-card:hover { transform: translateY(-2px); border-color: #a9bfd2; background: #fcfdff; box-shadow: 0 8px 18px rgb(16 40 68 / 9%); }
.home-module-card:focus-visible { outline: 0; border-color: #5c91bf; box-shadow: 0 0 0 3px rgb(28 95 159 / 16%); }
.home-module-card__icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #dbe6ef; border-radius: 9px; color: #1f5b8e; background: #f1f6fa; }
.home-module-card__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.home-module-card__copy { display: grid; min-width: 0; gap: 4px; }
.home-module-card__copy strong { overflow: hidden; color: #1d3852; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.home-module-card__copy small { overflow: hidden; color: #718196; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.home-module-card__arrow { color: #91a1b0; font-size: 15px; text-align: right; transition: color .16s ease, transform .16s ease; }
.home-module-card:hover .home-module-card__arrow { transform: translateX(2px); color: #1c5f9f; }
.home-recent-orders { margin-top: 21px; }
.home-recent-panels { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 21px; }
.home-recent-panels .home-recent-orders, .home-recent-panels .home-stock-activity { min-width: 0; margin-top: 0; }
.home-recent-orders .home-section-heading { margin-bottom: 8px; }
.home-recent-orders .home-section-heading h2 { font-size: 16px; }
.home-recent-orders .section-kicker { font-size: 9px; }
.home-recent-orders__list { border-color: #e0e6ec; box-shadow: 0 1px 5px rgb(16 40 68 / 3%); }
.home-recent-order { min-height: 44px; padding-block: 6px; }
.home-stock-activity .home-section-heading { margin-bottom: 8px; }
.home-stock-activity .home-section-heading h2 { font-size: 16px; }
.home-stock-activity .section-kicker { font-size: 9px; }
.home-history-link[type="button"] { padding: 0; border: 0; background: transparent; cursor: pointer; }
.home-history-link:focus-visible { outline: 2px solid #5c91bf; outline-offset: 3px; border-radius: 3px; }
.home-stock-activity__list { overflow: hidden; border: 1px solid #e0e6ec; border-radius: 9px; background: #fff; box-shadow: 0 1px 5px rgb(16 40 68 / 3%); }
.home-stock-activity__item { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 49px; padding: 7px 10px; border-bottom: 1px solid #edf1f4; }
.home-stock-activity__item:last-child { border-bottom: 0; }
.home-stock-activity__marker { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #237450; background: #edf7f0; font-size: 15px; font-weight: 700; }
.home-stock-activity__item.is-out .home-stock-activity__marker { color: #9a5c26; background: #fbf3e9; }
.home-stock-activity__copy { display: grid; min-width: 0; gap: 3px; }
.home-stock-activity__copy strong { overflow: hidden; color: #334a60; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.home-stock-activity__copy small { overflow: hidden; color: #8290a0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.home-stock-activity__quantity { color: #28764f; font-size: 10px; font-weight: 700; white-space: nowrap; }
.home-stock-activity__item.is-out .home-stock-activity__quantity { color: #a3622a; }
.home-stock-activity__message { margin: 0; padding: 15px; color: #78889a; font-size: 11px; }
.home-stock-activity__message.is-error { color: #a3453e; }
@media (max-width: 1050px) {
  .home-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-recent-panels { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 700px) {
  .home-heading { align-items: center; }
  .home-module-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .home-module-card { grid-template-columns: 36px minmax(0, 1fr) 15px; min-height: 72px; gap: 11px; padding: 10px 12px; }
  .home-module-card__icon { width: 34px; height: 34px; }
  .home-module-card__icon svg { width: 18px; height: 18px; }
  .home-module-card__copy strong { font-size: 12px; }
  .home-module-card__copy small { font-size: 10px; }
  .home-recent-panels { gap: 15px; margin-top: 18px; }
}

/* Pulido minimalista del inicio: superficies neutras y acentos de marca por módulo. */
.home-heading { margin-bottom: 17px; }
.home-heading > div > p:last-child { display: none; }
.home-order-search { margin-bottom: 21px; }
.home-order-search__field { min-height: 50px; border-color: #e1e7eb; border-radius: 9px; box-shadow: none; }
.home-order-search__field:focus-within { border-color: #28aeb0; box-shadow: 0 0 0 3px rgb(0 166 171 / 13%); }
.home-order-search__field > svg { color: #698196; }
.home-module-grid { gap: 11px; }
.home-modules > .home-section-heading { align-items: center; margin-bottom: 9px; }
.home-modules .home-section-heading h2 { color: #223b53; font-size: 18px; }
.home-module-card { min-height: 78px; padding: 11px 14px; border-color: #e7ebef; border-radius: 9px; box-shadow: none; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, transform .14s ease; }
.home-module-card:hover { transform: translateY(-1px); border-color: #d7e1e7; background: #fff; box-shadow: 0 4px 12px rgb(20 43 65 / 7%); }
.home-module-card:active { transform: translateY(0) scale(.995); box-shadow: 0 1px 4px rgb(20 43 65 / 5%); }
.home-module-card:focus-visible { border-color: #39aaad; box-shadow: 0 0 0 3px rgb(0 166 171 / 16%); }
.home-module-card__icon { width: 35px; height: 35px; border: 0; border-radius: 9px; }
.home-module-card__icon.is-history { color: #2866a1; background: #edf4fb; }
.home-module-card__icon.is-stock { color: #078e91; background: #eaf7f5; }
.home-module-card__icon.is-quotes { color: #7956a8; background: #f3eff9; }
.home-module-card__icon.is-clients { color: #b67535; background: #fbf3e9; }
.home-module-card__icon.is-billing { color: #328268; background: #edf6f1; }
.home-module-card__icon.is-costs { color: #527989; background: #eef4f6; }
.home-module-card__copy { gap: 3px; }
.home-module-card__copy strong { font-size: 12px; }
.home-module-card__copy small { color: #788797; font-size: 10px; }
.home-module-card__arrow { font-size: 14px; }
.home-users-link { padding: 4px 1px; border: 0; color: #078e91; background: transparent; font-size: 10px; font-weight: 650; cursor: pointer; }
.home-users-link:hover { color: #076f73; text-decoration: underline; }
.home-users-link:active { color: #075f62; }
.home-users-link:focus-visible { outline: 2px solid rgb(0 166 171 / 55%); outline-offset: 3px; border-radius: 3px; }
.home-recent-panels { margin-top: 19px; }
.home-recent-orders .home-section-heading, .home-stock-activity .home-section-heading { align-items: center; margin-bottom: 7px; }
.home-recent-orders .home-section-heading h2, .home-stock-activity .home-section-heading h2 { color: #263e54; font-size: 15px; font-weight: 700; }
.home-recent-orders .section-kicker, .home-stock-activity .section-kicker { display: none; }
.home-history-link { color: #168f94; font-size: 10px; }
.home-history-link:hover { color: #086c70; }
.home-recent-orders__table-wrap { overflow: hidden; border: 1px solid #e6ebef; border-radius: 8px; background: #fff; }
.home-recent-orders__table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.home-recent-orders__table th { height: 29px; padding: 0 9px; color: #7d8a98; background: #fafbfc; font-size: 9px; font-weight: 650; text-align: left; }
.home-recent-orders__table th:first-child { width: 78px; }
.home-recent-orders__table th:nth-child(2) { width: 23%; }
.home-recent-orders__table th:last-child { width: 118px; }
.home-recent-order { cursor: pointer; transition: background-color .13s ease; }
.home-recent-order:hover { background: #f8fbfc; }
.home-recent-order:active { background: #f0f7f7; }
.home-recent-order td { height: 39px; padding: 5px 9px; border-bottom: 1px solid #eef1f3; }
.home-recent-order:last-child td { border-bottom: 0; }
.home-recent-order__open { padding: 2px 0; border: 0; color: #22639b; background: transparent; cursor: pointer; }
.home-recent-order__open:focus-visible { outline: 2px solid #35a9ad; outline-offset: 2px; border-radius: 3px; }
.home-recent-order__number { font-size: 10px; font-weight: 700; }
.home-recent-order__client, .home-recent-order__summary { display: block; font-size: 10px; }
.home-order-status { padding: 3px 7px; border-color: #e8ecef; color: #617184; background: #fafbfc; font-size: 9px; }
.home-order-status.is-ordered { border-color: #e4eaf0; color: #62788e; background: #f5f8fa; }
.home-order-status.is-in_progress { border-color: #d9eaf0; color: #287888; background: #f1f8f9; }
.home-order-status.is-ready { border-color: #e8e1f2; color: #735499; background: #f7f4fb; }
.home-order-status.is-delivered { border-color: #d8ebe3; color: #287b61; background: #f1f8f4; }
.home-recent-orders__empty { margin: 0; padding: 13px; color: #7b8998; font-size: 10px; }
.home-stock-activity__list { border-color: #e6ebef; box-shadow: none; }
.home-stock-activity__item { min-height: 43px; padding-block: 5px; border-color: #eef1f3; }
.home-stock-activity__marker { width: 22px; height: 22px; color: #087f84; background: #eaf7f5; }
.home-stock-activity__item.is-out .home-stock-activity__marker { color: #93652e; background: #faf3e8; }
.home-stock-activity__quantity { color: #078e91; }
@media (max-width: 700px) {
  .home-heading { margin-bottom: 15px; }
  .home-order-search { margin-bottom: 17px; }
  .home-module-grid { gap: 7px; }
  .home-module-card { min-height: 69px; padding: 9px 11px; }
  .home-module-card__icon { width: 32px; height: 32px; }
  .home-modules .home-section-heading h2 { font-size: 17px; }
  .home-recent-orders__table { table-layout: auto; }
  .home-recent-orders__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .home-recent-orders__table tbody { display: block; }
  .home-recent-order { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 3px 8px; min-height: 54px; padding: 7px 9px; border-bottom: 1px solid #eef1f3; }
  .home-recent-order td { display: block; height: auto; min-width: 0; padding: 0; border: 0; }
  .home-recent-order td:first-child { grid-row: 1 / span 2; align-self: center; }
  .home-recent-order td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .home-recent-order td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .home-recent-order td:nth-child(4) { grid-column: 3; grid-row: 1 / span 2; }
  .home-recent-orders__table td[colspan] { display: block; grid-column: 1 / -1; }
}

/* Historial compacto del dueño: tres importes juntos, sin saldo redundante. */
@media screen and (min-width: 1250px) {
  body[data-role="owner"] .order-history-compact {
    grid-template-columns: 70px 82px minmax(85px, .7fr) minmax(110px, .9fr) minmax(240px, 1.5fr) minmax(230px, 1.4fr);
    align-items: center;
    gap: 6px;
    min-height: 48px;
    margin: 3px 0;
    padding: 4px 24px 4px 8px;
  }

  body[data-role="owner"] .order-history-compact > .order-history-compact__detail { grid-column: 4; }
  body[data-role="owner"] .order-history-compact__financials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
    grid-column: 5;
    min-width: 0;
  }
  body[data-role="owner"] .order-history-compact__amount,
  body[data-role="owner"] .order-history-compact__amount--neto,
  body[data-role="owner"] .order-history-compact__amount--iva { display: grid; min-width: 0; gap: 1px; text-align: right; }
  body[data-role="owner"] .order-history-compact__amount small { font-size: 9px; }
  body[data-role="owner"] .order-history-compact__amount strong,
  body[data-role="owner"] .order-history-compact__amount .history-value { font: 700 11px/1.2 var(--mono); }
  body[data-role="owner"] .order-history-compact > .order-history-compact__status-group {
    display: flex;
    grid-column: 6;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
  }
}

@media screen and (min-width: 761px) and (max-width: 1249px) {
  body[data-role="owner"] .order-history-compact {
    grid-template-columns: 64px 76px minmax(90px, .8fr) minmax(0, 1fr);
    align-items: center;
    gap: 6px 8px;
    padding-block: 7px;
  }

  body[data-role="owner"] .order-history-compact > strong:first-child { grid-column: 1; grid-row: 1; }
  body[data-role="owner"] .order-history-compact > time,
  body[data-role="owner"] .order-history-compact > .order-history-compact__date-edit { grid-column: 2; grid-row: 1; }
  body[data-role="owner"] .order-history-compact > span:nth-of-type(1) { grid-column: 3 / -1; grid-row: 1; }
  body[data-role="owner"] .order-history-compact > .order-history-compact__detail { grid-column: 1 / -1; grid-row: 2; }
  body[data-role="owner"] .order-history-compact > .order-history-compact__tax-id,
  body[data-role="owner"] .order-history-compact > .order-history-compact__progress { display: none; }
  body[data-role="owner"] .order-history-compact__financials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / 3;
    grid-row: 3;
    gap: 6px;
    min-width: 0;
  }
  body[data-role="owner"] .order-history-compact__amount,
  body[data-role="owner"] .order-history-compact__amount--neto,
  body[data-role="owner"] .order-history-compact__amount--iva { display: grid; min-width: 0; gap: 1px; text-align: left; }
  body[data-role="owner"] .order-history-compact__amount small { font-size: 9px; }
  body[data-role="owner"] .order-history-compact__amount strong,
  body[data-role="owner"] .order-history-compact__amount .history-value { font: 700 11px/1.2 var(--mono); }
  body[data-role="owner"] .order-history-compact > .order-history-compact__status-group {
    display: flex;
    grid-column: 3 / -1;
    grid-row: 3;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
  }
}

body[data-role="owner"] .order-history-compact.is-expanded .order-history-compact__financials { display: none; }
body[data-role="owner"] .order-history-compact__financials > .order-history-compact__amount { grid-column: auto; grid-row: auto; }

@media screen and (max-width: 760px) {
  .order-history.is-compact .order-history-compact { row-gap: 3px; }
  .order-history.is-compact .order-history-compact__creator { margin-top: 0; line-height: 1.2; }
  body[data-role="owner"] .order-history.is-compact .order-history-compact__financials { display: none; }
  body[data-role="owner"] .order-history.is-compact .history-mobile-financials {
    display: block;
    color: #173b66;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Jerarquía tipográfica común. Los ajustes quedan al final para corregir las
   reglas heredadas de cada módulo sin cambiar su paleta ni su estructura. */
:root {
  --type-caption: 12px;
  --type-label: 13px;
  --type-body: 14px;
  --type-lead: 16px;
  --type-section: 20px;
  --type-subsection: 17px;
}

body { font-size: var(--type-body); line-height: 1.5; }
.workspace-hero h1, .home-welcome h1 { line-height: 1.16; }
.workspace-hero > div > p:last-child, .home-welcome > div > p:last-child { font-size: var(--type-body); line-height: 1.5; }
.workspace-view h2, .workspace-view .panel-head h2, .workspace-view .registry-panel__head h2 { font-size: var(--type-section); line-height: 1.3; }
.workspace-view h3, .workspace-view .cost-center-list-panel__head h3 { font-size: var(--type-subsection); line-height: 1.35; }

#app-shell :is(small, label, th, .next-order-number > span, #material-sheets-kicker,
  #order-file-name, .billing-pending-client__orders, .cost-center-cash__note,
  .cost-center-tabs__period small, .cost-center-list-panel__total > span, .entry-actions > span,
  .home-connected-users__empty, .quote-page .excel-toolbar__hint,
  .history-total-client-filter-row > span, .history-print-range > div > span) {
  font-size: max(var(--type-caption), 1em);
  line-height: 1.45;
}

#app-shell :is(small, label, th) { font-size: max(var(--type-caption), 1em); }

#app-shell .order-file-drop strong, #app-shell .avatar { font-size: var(--type-caption); }
#app-shell .order-history-compact > strong:first-child,
#app-shell .history-total-client-filter summary strong,
#app-shell .cost-center-reconciliation span,
#app-shell .cost-center-reconciliation strong { font-size: var(--type-caption); }
#cost-center-view .cost-center-list-panel__title span { font-size: var(--type-caption); }

#app-shell button:not(.icon-button):not(.sidebar-collapse-button):not(.menu-button):not(.logout-button),
#app-shell a.button, #app-shell summary {
  font-size: max(var(--type-label), 1em);
  line-height: 1.4;
}

.nav-label, .date-block span, .date-block strong, .role-pill, .eyebrow, .section-kicker,
.registry-strip span, .inventory-summary span, .users-summary span,
.registry-strip small, .inventory-summary small, .users-summary small,
.history-filters__controls label, .history-more-filters__controls label,
.history-registry-head__title #history-result-count, .history-view-actions .button,
.history-view-actions .action-menu summary, .history-view-actions .history-sort-control select,
.history-quick-filters button, .history-work-state, .history-payment-state, .history-delivery-date,
.cost-center-tabs button, .inventory-toolbar select, .inventory-view-toggle,
.inventory-table-head, .cost-center-table-head,
.quote-page .excel-tabs button, .quote-page .excel-toolbar__actions .button,
.cost-center-income-view-switch button {
  font-size: var(--type-caption);
  line-height: 1.35;
}

.nav-item, .sidebar-values-toggle, .profile strong, .profile small,
.button, .icon-button, .menu-button, .history-view-toggle,
.entry-card > label, .entry-card .form-grid > label, .entry-form label,
.cost-center-recurring-form label, .entry-form .form-hint,
.quote-page .quote-history-open, .cost-center-open-order,
.cost-center-list-panel .cost-center-delete,
.cost-center-salary-presets__toolbar .button,
.cost-center-salary-presets__payments .button,
.cost-center-salary-admin__list-head .button,
.cost-center-salary-admin__actions .button,
.cost-center-salary-admin__form-head .button {
  font-size: var(--type-label);
  line-height: 1.4;
}

.home-connected-users__count { font-size: var(--type-caption); }
.home-recent-order__number, .home-recent-order__client, .home-recent-order__summary { font-size: var(--type-label); }
.home-order-status { font-size: var(--type-caption); }
.home-order-search__field kbd { font-size: var(--type-caption); }

.global-search input, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
select, textarea, .inventory-row, .order-history-compact, .client-directory-row,
.billing-row, .cost-center-row, .quote-history-row,
.order-history-compact__amount strong, .order-history-compact__amount .history-value,
body[data-role="owner"] .order-history-compact__amount strong,
body[data-role="owner"] .order-history-compact__amount .history-value {
  font-size: var(--type-body);
  line-height: 1.45;
}

.registry-loading, .registry-error, .form-hint, .field-hint,
.history-filter-chip, .empty-state, .empty-state p, .registry-empty,
.cost-center-reconciliation, .cost-center-salary-presets__record,
.cost-center-salary-presets__history-empty, .inventory-identity > span,
.inventory-identity small, .stock-gauge small, .inventory-attachment,
.inventory-side header > span, .registry-empty > span,
.cost-center-list-panel__title, .cost-center-list-panel__title span, .cost-center-cash__source,
.cost-center-cash__flow-head > span, #cost-center-ledger-status {
  font-size: var(--type-caption);
  line-height: 1.5;
}

.nav-label, .date-block span, .date-block strong, .eyebrow, .section-kicker,
.registry-strip span, .inventory-summary span, .users-summary span,
.history-filters__controls label, .history-more-filters__controls label,
.inventory-table-head, .cost-center-table-head { color: #53677c; }

button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #1769aa;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgb(23 105 170 / 16%);
}

@media (max-width: 760px) {
  :root { --type-body: 14px; --type-label: 13px; --type-caption: 12px; --type-section: 19px; --type-subsection: 16px; }
  .workspace-view { line-height: 1.5; }
}

@media (max-width: 380px) {
  .home-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .home-heading .home-new-order { width: 100%; justify-content: center; }
}

@media (min-width: 861px) and (max-width: 1400px) {
  #inventory-view .inventory-hero { align-items: flex-start; flex-direction: column; gap: 12px; }
  #inventory-view .inventory-hero__actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  #inventory-view .inventory-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  #inventory-view .inventory-toolbar__controls { display: flex; flex-wrap: wrap; width: 100%; }
  #inventory-view .inventory-toolbar__controls > * { min-width: 0; }
  #inventory-view .inventory-search { flex: 1 1 220px; }
  #inventory-view .inventory-layout { grid-template-columns: minmax(0, 1fr); }
  .quote-page .excel-tabs { overflow-x: auto; }
  .quote-page .excel-tabs > :last-child { display: none; }
}

@media (max-width: 700px) {
  #app-shell .top-actions .button:not(.icon-button):not(.sidebar-collapse-button):not(.menu-button):not(.logout-button) { font-size: 0; }
}

@media screen {
  #app-shell .quote-page .quote-total-preview > span, #app-shell .quote-page .quote-total-preview > small { font-size: var(--type-caption); }
  .quote-page .quotation-sheet { font-size: var(--type-caption); }
  .quote-page .quotation-company b, .quote-page .quotation-client b,
  .quote-page .quotation-terms b, .quote-page .quotation-terms label > span,
  .quote-page .quotation-lines, .quote-page .quotation-lines th,
  .quote-page .quotation-lines tfoot tr:last-child th,
  .quote-page .quotation-lines tfoot tr:last-child td,
  .quote-page .quotation-conditions, .quote-page .quotation-conditions h3,
  .quote-page .quotation-payment, .quote-page .quotation-payment strong,
  .quote-page .quotation-footer, .quote-page .quotation-footer strong,
  .quote-page .quotation-company input, .quote-page .quotation-client input,
  .quote-page .quotation-terms input { font-size: var(--type-caption); }
  #app-shell .quote-page .quotation-sheet input { font-size: var(--type-caption); }
}

/* En el menú lateral minimizado se conserva el control por su ícono,
   sin que la jerarquía tipográfica vuelva a mostrar y partir su etiqueta. */
@media (min-width: 861px) {
  #app-shell.is-sidebar-collapsed .sidebar .sidebar-values-toggle {
    width: 42px;
    min-height: 38px;
    justify-content: center;
    gap: 0;
    margin: 0 auto 7px;
    padding: 0;
    font-size: 0;
    line-height: 0;
  }
  #app-shell.is-sidebar-collapsed .sidebar .sidebar-values-toggle > span { display: none; }
  #app-shell.is-sidebar-collapsed .sidebar .sidebar-values-toggle > svg { width: 17px; height: 17px; flex: 0 0 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Acciones compactas y columnas legibles en el libro del Centro de costos. */
#cost-center-view .cost-center-list-panel .cost-center-table-head,
#cost-center-view .cost-center-list-panel .cost-center-row {
  grid-template-columns: minmax(74px, .72fr) minmax(88px, .88fr) minmax(0, 1.8fr) minmax(72px, .72fr) 116px;
  gap: 7px;
}
#cost-center-view .cost-center-list-panel .cost-center-table-head > *,
#cost-center-view .cost-center-list-panel .cost-center-row > * { min-width: 0; }
#cost-center-view .cost-center-list-panel .cost-center-description,
#cost-center-view .cost-center-list-panel .cost-center-invoice {
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.4;
}
#cost-center-view .cost-center-list-panel .cost-center-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}
#cost-center-view .cost-center-list-panel .cost-center-row__actions > button {
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  flex: 0 0 34px;
  padding: 0;
  border-radius: 7px;
  font-size: 0;
  line-height: 1;
}
#cost-center-view .cost-center-list-panel .cost-center-row__actions > button svg { display: block; width: 17px; height: 17px; }
#cost-center-view .cost-center-list-panel .cost-center-row__actions > .cost-center-delete,
#cost-center-view .cost-center-list-panel .cost-center-row__actions > .cost-center-void { color: #b42318; }
#cost-center-view .cost-center-list-panel .cost-center-row__actions > button:hover { transform: translateY(-1px); }

@media (max-width: 1240px) {
  #cost-center-view .cost-center-list-panel .cost-center-table-head,
  #cost-center-view .cost-center-list-panel .cost-center-row {
    grid-template-columns: minmax(84px, .72fr) minmax(108px, .9fr) minmax(150px, 1.8fr) minmax(100px, .8fr) 116px;
    gap: 9px;
  }
}
@media (max-width: 760px) {
  #cost-center-view .cost-center-list-panel .cost-center-row__actions { justify-content: flex-start; gap: 7px; }
  #cost-center-view .cost-center-list-panel .cost-center-row__actions > button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    flex-basis: 38px;
  }
}

/* Identidad bancaria del Centro de costos: activa por banco sin alterar cálculos. */
@media screen {
  #cost-center-view {
    --cc-accent: #a52b38;
    --cc-accent-strong: #84202b;
    --cc-accent-soft: #fff3f4;
    --cc-accent-line: #e8c5c9;
  }
  #cost-center-view.is-bank-santander {
    --cc-accent: #a52b38;
    --cc-accent-strong: #84202b;
    --cc-accent-soft: #fff3f4;
    --cc-accent-line: #e8c5c9;
  }
  #cost-center-view.is-bank-chile {
    --cc-accent: #205fae;
    --cc-accent-strong: #174b8c;
    --cc-accent-soft: #eff6ff;
    --cc-accent-line: #c6d9f0;
  }

  #cost-center-view .cost-center-cash__head .section-kicker,
  #cost-center-view .cost-center-cash__head h2 { color: var(--cc-accent-strong); }
  #cost-center-view .cost-center-bank-tabs {
    gap: 8px;
    padding: 13px 22px 0;
    background: #fff;
  }
  #cost-center-view .cost-center-bank-tabs button {
    position: relative;
    min-height: 44px;
    padding: 0 16px 0 32px;
    border-radius: 8px;
    color: #4f647b;
    font-size: 14px;
    font-weight: 700;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
  }
  #cost-center-view .cost-center-bank-tabs button::before {
    position: absolute;
    left: 14px;
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 50%;
    content: "";
    opacity: .72;
  }
  #cost-center-view .cost-center-bank-tabs button[data-cost-center-bank="santander"].is-active,
  #cost-center-view.is-bank-santander .cost-center-bank-tabs button[data-cost-center-bank="santander"].is-active {
    color: var(--cc-accent-strong);
    background: var(--cc-accent-soft);
    border-color: var(--cc-accent-line);
    box-shadow: inset 0 -3px var(--cc-accent);
  }
  #cost-center-view.is-bank-chile .cost-center-bank-tabs button[data-cost-center-bank="banco_chile"].is-active {
    color: var(--cc-accent-strong);
    background: var(--cc-accent-soft);
    border-color: var(--cc-accent-line);
    box-shadow: inset 0 -3px var(--cc-accent);
  }
  #cost-center-view .cost-center-bank-tabs button.is-active::before { background: currentColor; opacity: 1; }
  #cost-center-view .cost-center-bank-tabs button:hover:not(.is-active) { color: var(--cc-accent-strong); background: #f7f9fc; }
  #cost-center-view .cost-center-bank-tabs button:focus-visible,
  #cost-center-view .cost-center-month-tab:focus-visible,
  #cost-center-view .cost-center-tabs button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--cc-accent) 28%, transparent);
    outline-offset: 2px;
  }

  #cost-center-view .cost-center-cash__accounts { padding: 12px 22px 18px; background: #fff; }
  #cost-center-view .cost-center-cash-account {
    min-height: 124px;
    padding: 20px 24px;
    color: var(--cc-accent-strong);
    background: var(--cc-accent-soft);
    border: 1px solid var(--cc-accent-line);
    border-left: 4px solid var(--cc-accent);
    border-radius: 10px;
    box-shadow: none;
  }
  #cost-center-view .cost-center-cash-account > div strong { color: var(--cc-accent-strong); font-size: 18px; }
  #cost-center-view .cost-center-cash-account > div small { color: #687b91; font-size: 13px; }
  #cost-center-view .cost-center-cash-account__label { color: #5d7086; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: none; }
  #cost-center-view .cost-center-cash-account__balance {
    color: var(--cc-accent-strong);
    font-size: clamp(34px, 3.4vw, 46px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.1;
  }
  #cost-center-view .cost-center-cash-account__value > button {
    min-height: 34px;
    color: var(--cc-accent-strong);
    background: #fff;
    border-color: var(--cc-accent-line);
    font-size: 13px;
  }
  #cost-center-view .cost-center-cash-account__value > button:hover { background: var(--cc-accent-soft); border-color: var(--cc-accent); }
  #cost-center-view .cost-center-cash__flow-head h3 { color: var(--cc-accent-strong); font-size: 17px; }
  #cost-center-view .cost-center-cash__grid { border-top-color: #e5ebf2; }
  #cost-center-view .cost-center-cash__grid article { padding: 15px 20px; }
  #cost-center-view .cost-center-cash__grid span { color: #5d7188; font-size: 13px; font-weight: 650; }
  #cost-center-view .cost-center-cash__grid strong { margin-top: 6px; font-size: 18px; }
  #cost-center-view .cost-center-cash__grid article:nth-child(3) strong { color: var(--cc-accent-strong); }
  #cost-center-view .cost-center-cash__note { font-size: 12px; }

  #cost-center-view .cost-center-month-tab[aria-pressed="true"] {
    color: #fff;
    background: var(--cc-accent);
    border-color: var(--cc-accent);
    box-shadow: 0 3px 9px color-mix(in srgb, var(--cc-accent) 20%, transparent);
  }
  #cost-center-view .cost-center-tabs button.is-active {
    color: var(--cc-accent-strong);
    background: var(--cc-accent-soft);
    border-color: var(--cc-accent-line);
  }
  #cost-center-view .cost-center-tabs .cost-center-tabs__add {
    background: var(--cc-accent);
    border-color: var(--cc-accent);
  }
  #cost-center-view .cost-center-tabs .cost-center-tabs__add:hover { background: var(--cc-accent-strong); border-color: var(--cc-accent-strong); }
  #cost-center-view .cost-center-entry-panel:not([hidden]) { border-top: 3px solid var(--cc-accent); }
  #cost-center-view .cost-center-entry-panel.is-fixed-payment { border-left-color: #a52b38; }
  #cost-center-view .cost-center-form input:focus,
  #cost-center-view .cost-center-form select:focus,
  #cost-center-view .cost-center-filters input:focus { border-color: var(--cc-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-accent) 14%, transparent); }
  #cost-center-view .cost-center-ledger { border-top: 3px solid var(--cc-accent); }
  #cost-center-view .cost-center-ledger-heading h2 { color: var(--cc-accent-strong); }

  @media (max-width: 760px) {
    #cost-center-view .cost-center-bank-tabs { gap: 7px; padding: 12px 12px 0; }
    #cost-center-view .cost-center-bank-tabs button { min-height: 44px; flex: 1 1 0; padding: 0 8px 0 22px; font-size: 13px; }
    #cost-center-view .cost-center-bank-tabs button::before { left: 8px; width: 8px; height: 8px; }
    #cost-center-view .cost-center-cash__accounts { padding: 10px 12px 14px; }
    #cost-center-view .cost-center-cash-account { min-height: 0; gap: 10px; padding: 16px; }
    #cost-center-view .cost-center-cash-account__balance { max-width: 100%; font-size: clamp(34px, 9vw, 42px); }
    #cost-center-view .cost-center-cash__grid article { padding: 12px 9px; }
    #cost-center-view .cost-center-cash__grid span { font-size: 12px; line-height: 1.35; }
    #cost-center-view .cost-center-cash__grid strong { font-size: clamp(13px, 3.6vw, 17px); }
  }
}

/* Mantén el RUT copiable junto al cliente en el historial compacto del dueño. */
body[data-role="owner"] .order-history-compact > .order-history-compact__company {
  display: grid;
  min-width: 0;
  gap: 1px;
  overflow: hidden;
  white-space: normal;
}
body[data-role="owner"] .order-history-compact__company-name {
  min-width: 0;
  overflow: hidden;
  color: #223d5f;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-role="owner"] .order-history-compact .order-history-compact__tax-id {
  display: inline-flex;
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  color: #60758e !important;
  background: transparent;
  border: 0;
  font: 600 11px/1.25 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: copy;
}
body[data-role="owner"] .order-history-compact .order-history-compact__tax-id:hover {
  color: #155eef !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
body[data-role="owner"] .order-history-compact .order-history-compact__tax-id:focus-visible {
  outline: 2px solid #1769e8;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Historial trazable y filtrable de cada movimiento de bodega. */
.inventory-history { margin-top: 22px; overflow: hidden; border: 1px solid #d9e3ec; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgb(16 40 68 / 5%); scroll-margin-top: 78px; }
.inventory-history__header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px 17px; border-bottom: 1px solid #e4ebf1; }
.inventory-history__header h2 { margin: 2px 0 4px; color: #173957; font-size: clamp(18px, 2vw, 22px); line-height: 1.25; }
.inventory-history__header > div > p:last-child { margin: 0; color: #6d8095; font-size: 13px; }
.inventory-history__count { flex: 0 0 auto; padding: 7px 11px; color: #245b87; background: #edf5fb; border: 1px solid #d7e7f3; border-radius: 999px; font-size: 12px; font-weight: 750; }
.inventory-history__filters { display: grid; grid-template-columns: minmax(230px, 1.4fr) minmax(170px, 1fr) minmax(190px, 1fr) repeat(2, minmax(140px, .7fr)) auto; align-items: end; gap: 10px; padding: 16px 20px; background: #f7f9fb; border-bottom: 1px solid #e4ebf1; }
.inventory-history__filters label { display: grid; min-width: 0; gap: 5px; color: #52677d; font-size: 11px; font-weight: 700; }
.inventory-history__filters input, .inventory-history__filters select { width: 100%; min-width: 0; min-height: 39px; padding: 0 10px; color: #283f56; background: #fff; border: 1px solid #cfdbe6; border-radius: 7px; font: 500 12px/1.3 var(--body); }
.inventory-history__filters input:focus-visible, .inventory-history__filters select:focus-visible { outline: 3px solid rgb(42 116 177 / 26%); outline-offset: 1px; border-color: #5d92bf; }
.inventory-history__filters .button { min-height: 39px; padding: 0 12px; white-space: nowrap; font-size: 11px; }
.inventory-history__totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px 20px; border-bottom: 1px solid #e8edf2; }
.inventory-history__totals article { display: grid; gap: 3px; padding: 10px 13px; background: #f8fafc; border: 1px solid #e6edf3; border-radius: 8px; }
.inventory-history__totals span { color: #6c7f93; font-size: 11px; font-weight: 650; }
.inventory-history__totals strong { color: #1e4e74; font-size: 19px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.inventory-history__list { display: grid; }
.inventory-history-row { display: grid; grid-template-columns: 104px minmax(190px, 1.05fr) minmax(230px, 1.25fr) minmax(170px, .85fr); align-items: center; gap: 15px; padding: 14px 20px; border-bottom: 1px solid #e8edf2; transition: background-color .14s ease; }
.inventory-history-row:last-child { border-bottom: 0; }
.inventory-history-row:hover { background: #f8fbfd; }
.inventory-history-row__date { display: grid; gap: 3px; color: #344f68; font-size: 12px; font-weight: 750; white-space: nowrap; }
.inventory-history-row__date small { color: #7c8da0; font-size: 11px; font-weight: 500; }
.inventory-history-row__material,
.inventory-history-row__trace,
.inventory-history-row__quantity { display: grid; min-width: 0; gap: 4px; }
.inventory-history-row__material strong,
.inventory-history-row__trace > strong { overflow: hidden; color: #203e5b; font-size: 13px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.inventory-history-row__material small,
.inventory-history-row__trace small { overflow: hidden; color: #73869a; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; }
.inventory-history-row__trace .inventory-history-row__actor { color: #506b83; font-weight: 650; }
.inventory-history-row__kind { width: fit-content; max-width: 100%; overflow: hidden; padding: 3px 7px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.inventory-history-row__kind.is-in { color: #08764e; background: #eaf7f0; border-color: #cbe9d8; }
.inventory-history-row__kind.is-out { color: #a43d36; background: #fff0ee; border-color: #f1d1cd; }
.inventory-history-row__order { justify-self: start; padding: 0; border: 0; color: #1765a3; background: transparent; font: 700 11px/1.35 var(--body); text-align: left; cursor: pointer; }
.inventory-history-row__order:hover { color: #0d4e82; text-decoration: underline; text-underline-offset: 2px; }
.inventory-history-row__quantity { justify-items: end; text-align: right; }
.inventory-history-row__quantity > span { color: #8291a2; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.inventory-history-row__quantity > strong { color: #08764e; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inventory-history-row__quantity > strong.is-out { color: #ad4038; }
.inventory-history-row__quantity > small { color: #72859a; font-size: 11px; white-space: nowrap; }
.inventory-history__pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; background: #f7f9fb; border-top: 1px solid #e4ebf1; }
.inventory-history__pagination > span { color: #687d92; font-size: 12px; }
.inventory-history__pagination > div { display: flex; gap: 8px; }
.inventory-history__pagination .button { min-height: 35px; padding: 0 12px; font-size: 11px; }
.inventory-history-jump { padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; color: #1d6399; background: transparent; font: 700 11px/1.3 var(--body); cursor: pointer; white-space: nowrap; }
.inventory-history-jump:hover { background: #edf5fb; border-color: #d6e7f3; }

/* La actividad suele vivir en una columna angosta: separar título, controles
   y cantidades evita que el encabezado y las descripciones se monten. */
.movement-board > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
}
.movement-board > header > div { grid-column: 1 / -1; min-width: 0; }
.movement-board > header h2 { line-height: 1.2; overflow-wrap: anywhere; }
.movement-board > header > span { justify-self: start; white-space: nowrap; }
.movement-board > header .inventory-history-jump { justify-self: end; }
.movement-item {
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 7px 10px;
}
.movement-mark { grid-row: 1 / span 2; }
.movement-item > div { min-width: 0; }
.movement-item strong { overflow-wrap: anywhere; }
.movement-item small { line-height: 1.4; overflow-wrap: anywhere; }
.movement-item .movement-item__sheet-detail { color: #385b78; font-weight: 700; }
.movement-delta { grid-column: 2; justify-self: end; max-width: 100%; text-align: right; overflow-wrap: anywhere; }
.movement-delta.is-label { max-width: 100%; }

@media (max-width: 420px) {
  .movement-board > header { gap: 7px; padding: 12px; }
  .movement-board > header h2 { font-size: 19px; }
  .movement-board > header .inventory-history-jump { padding-inline: 4px; font-size: 12px; }
  .movement-item { padding: 12px; }
}

/* Chat interno: bandeja estable a la izquierda y conversación legible a la derecha. */
.nav-chat-unread { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding-inline: 5px; border-radius: 999px; color: #fff; background: #1d6399; font-size: 11px; font-weight: 800; }
.internal-chat-page { min-width: 0; }
.internal-chat-page > .workspace-hero { gap: 14px; margin-bottom: 13px; padding-bottom: 12px; }
.internal-chat-page > .workspace-hero h1 { font-size: clamp(24px, 2vw, 30px); }
.internal-chat-page > .workspace-hero > div > p:last-child { margin-top: 4px; font-size: 12px; }
.internal-chat-layout { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.78fr); grid-template-rows: minmax(0, 1fr); height: clamp(440px, calc(100dvh - 250px), 650px); min-height: 0; overflow: hidden; border: 1px solid #dce4eb; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgb(16 40 77 / 5%); }
.internal-chat-inbox { display: flex; min-width: 0; min-height: 0; flex-direction: column; border-right: 1px solid #e2e8ee; background: #fbfcfd; }
.internal-chat-inbox__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 10px; }
.internal-chat-inbox__head h2 { margin: 0; color: #183957; font-size: 16px; }
.internal-chat-inbox__head > span { color: #25805c; font-size: 12px; font-weight: 700; }
.internal-chat-inbox__head > span.is-error { color: #a7463c; }
.internal-chat-search { display: block; padding: 0 12px 9px; }
.internal-chat-search input { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid #d9e2e9; border-radius: 8px; background: #fff; color: #203d59; font: inherit; font-size: 13px; }
.internal-chat-conversation-list { display: grid; min-height: 0; align-content: start; overflow-y: auto; }
.internal-chat-empty-note { display: grid; justify-items: center; gap: 6px; margin: auto; padding: 28px 20px; color: #718399; font-size: 14px; line-height: 1.5; text-align: center; }
.internal-chat-empty-note strong { color: #3d5872; font-size: 15px; }
.internal-chat-conversation { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 64px; padding: 9px 11px; border: 0; border-top: 1px solid #edf1f4; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.internal-chat-conversation:hover { background: #f2f7fa; }
.internal-chat-conversation.is-active { background: #eaf2f8; box-shadow: inset 3px 0 #2874ad; }
.internal-chat-conversation__avatar, .internal-chat-roster__avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; color: #245e84; background: #e3eef5; font-size: 12px; font-weight: 800; }
.internal-chat-conversation__avatar.is-group { color: #34785e; background: #e7f4ec; letter-spacing: -3px; padding-right: 3px; }
.internal-chat-conversation__content { display: grid; min-width: 0; gap: 2px; }
.internal-chat-conversation__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; min-width: 0; }
.internal-chat-conversation__heading strong { overflow: hidden; color: #1b3e5e; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-conversation__heading small { flex: 0 0 auto; color: #8795a5; font-size: 10px; }
.internal-chat-conversation__preview { overflow: hidden; color: #75869a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-conversation__unread { display: grid; place-items: center; min-width: 21px; height: 21px; padding-inline: 5px; border-radius: 999px; color: white; background: #2477a8; font-size: 11px; font-weight: 800; }
.internal-chat-thread { display: grid; min-width: 0; min-height: 0; height: 100%; grid-template-rows: minmax(0, 1fr); background: #fff; }
.internal-chat-welcome { display: flex; min-height: 0; height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.internal-chat-welcome__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #286b98; background: #eaf3f8; font-size: 24px; }
.internal-chat-welcome h2 { margin: 14px 0 4px; color: #193b59; font-size: 20px; }
.internal-chat-welcome p { max-width: 42ch; margin: 0 0 14px; color: #718399; font-size: 14px; line-height: 1.5; }
.internal-chat-active { display: grid; min-height: 0; height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; }
.internal-chat-thread__head { display: flex; align-items: center; min-height: 60px; padding: 9px 16px; border-bottom: 1px solid #e4eaf0; background: #fff; }
.internal-chat-thread__head h2 { margin: 0; color: #193b59; font-size: 16px; }
.internal-chat-thread__head { justify-content: space-between; gap: 12px; }
.internal-chat-call-start { min-height: 38px; flex: 0 0 auto; padding: 0 12px; font-size: 13px; }
.internal-chat-thread__head p { margin: 3px 0 0; color: #78899d; font-size: 11px; }
.internal-chat-messages { display: flex; min-height: 0; flex-direction: column; gap: 9px; overflow: auto; padding: 14px clamp(12px, 2vw, 24px); background: #f7f9fb; }
.internal-chat-messages > .internal-chat-empty-note { align-self: center; }
.internal-chat-message { width: fit-content; max-width: min(78%, 680px); padding: 9px 11px; border: 1px solid #e0e7ed; border-radius: 11px 11px 11px 3px; background: #fff; box-shadow: 0 2px 5px rgb(25 50 75 / 3%); }
.internal-chat-message.is-mine { align-self: flex-end; border-color: #c8dfef; border-radius: 12px 12px 3px 12px; background: #eaf4fa; }
.internal-chat-message__head { display: flex; align-items: baseline; gap: 10px; }
.internal-chat-message__head strong { color: #2a577b; font-size: 12px; }
.internal-chat-message__head time { color: #8190a0; font-size: 11px; }
.internal-chat-message p { margin: 4px 0 0; color: #253d54; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.internal-chat-message__files { display: grid; gap: 6px; margin-top: 8px; }
.internal-chat-image-file { display: grid; justify-items: start; gap: 5px; max-width: 100%; }
.internal-chat-image-preview { position: relative; display: grid; place-items: center; width: min(300px, 100%); min-height: 64px; max-height: 240px; overflow: hidden; padding: 0; border: 1px solid #d5e2eb; border-radius: 9px; background: #eef3f6; cursor: zoom-in; }
.internal-chat-image-preview img { display: block; max-width: 100%; max-height: 240px; object-fit: contain; }
.internal-chat-image-preview__status { padding: 18px; color: #526b7e; font-size: 12px; }
.internal-chat-image-preview__status[hidden] { display: none; }
.internal-chat-image-file .internal-chat-file { font-size: 11px; }
.internal-chat-image-dialog { position: fixed; inset: 0; width: min(92vw, 1200px); max-width: none; max-height: 92dvh; overflow: visible; padding: 40px 16px 12px; border: 0; border-radius: 12px; color: #fff; background: #15232c; }
.internal-chat-image-dialog::backdrop { background: rgb(8 18 25 / 82%); }
.internal-chat-image-dialog img { display: block; max-width: 100%; max-height: calc(92dvh - 82px); margin: auto; object-fit: contain; }
.internal-chat-image-dialog p { overflow: hidden; margin: 8px 36px 0; color: #e1e9ef; font-size: 12px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-image-dialog__close { position: absolute; top: 5px; right: 8px; width: 34px; height: 34px; border: 1px solid rgb(255 255 255 / 40%); border-radius: 50%; color: white; background: rgb(255 255 255 / 12%); cursor: pointer; font-size: 25px; line-height: 1; }
.internal-chat-file { max-width: 100%; overflow: hidden; padding: 7px 9px; border: 1px solid #ccdeea; border-radius: 7px; color: #225f8c; background: #f7fbfd; cursor: pointer; font: inherit; font-size: 12px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-file:hover { background: #eaf4fa; }
.internal-chat-file:disabled { cursor: wait; opacity: .7; }
.internal-chat-composer { padding: 9px 12px 8px; border-top: 1px solid #e1e8ee; background: #fff; }
.internal-chat-composer__row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: end; gap: 7px; }
.internal-chat-composer textarea { width: 100%; min-height: 38px; max-height: 120px; resize: vertical; padding: 8px 10px; border: 1px solid #d5e0e8; border-radius: 8px; color: #203b55; background: #fff; font: inherit; font-size: 13px; line-height: 1.4; }
.internal-chat-composer textarea:focus, .internal-chat-search input:focus, .internal-chat-group-title input:focus { border-color: #5b99c5; outline: 3px solid rgb(47 125 177 / 15%); }
.internal-chat-attach { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #d4e0e9; border-radius: 8px; color: #326c94; background: #f7fafc; cursor: pointer; }
.internal-chat-attach:hover { background: #eaf3f8; }
.internal-chat-attach input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.internal-chat-attach:focus-within { outline: 3px solid rgb(47 125 177 / 20%); }
.internal-chat-attach > span[aria-hidden] { font-size: 25px; font-weight: 400; line-height: 1; }
.internal-chat-composer__row > button { min-height: 38px; padding-inline: 13px; }
.internal-chat-composer__hint { margin: 6px 0 0 51px; color: #8291a1; font-size: 11px; }
.internal-chat-error { min-height: 0; margin: 0; color: #ae4139; font-size: 13px; }
.internal-chat-error:not(:empty) { margin: 6px 0 0 51px; }
.internal-chat-pending-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.internal-chat-file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border: 1px solid #d6e3eb; border-radius: 7px; color: #3f5c73; background: #f6f9fb; font-size: 12px; }
.internal-chat-file-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-file-chip button { border: 0; color: #637a8e; background: transparent; cursor: pointer; font-size: 18px; }
.internal-chat-dialog { display: flex; width: min(520px, calc(100vw - 28px)); height: min(86dvh, 720px); max-height: min(86dvh, 720px); flex-direction: column; overflow: hidden; padding: 0; }
.internal-chat-new-form { display: flex; min-height: 0; max-height: inherit; flex: 1 1 auto; flex-direction: column; padding: 0 !important; }
.internal-chat-new-form .dialog-head { flex: 0 0 auto; margin: 0; padding: 16px 18px; }
.internal-chat-new-form .dialog-head h2 { font-size: 22px; }
.internal-chat-dialog__intro { margin: 0; padding: 14px 18px 7px; color: #667b8e; font-size: 14px; line-height: 1.45; }
.internal-chat-group-title { display: grid; flex: 0 0 auto; gap: 6px; margin: 0 !important; padding: 7px 18px 11px; color: #425c72; font-size: 13px; font-weight: 700; }
.internal-chat-group-title[hidden] { display: none; }
.internal-chat-group-title input { min-height: 40px; padding: 8px 10px; border: 1px solid #d6e0e8; border-radius: 7px; font: inherit; font-weight: 400; }
.internal-chat-roster { display: grid; min-height: 0; flex: 1 1 auto; align-content: start; gap: 4px; overflow-y: auto; padding: 6px 12px; }
.project-dialog .internal-chat-roster__person { display: flex; min-width: 0; align-items: center; gap: 10px; min-height: 58px; margin: 0; padding: 7px 9px; border-radius: 8px; color: #425c72; font-size: 14px; font-weight: 500; cursor: pointer; }
.internal-chat-roster__person:hover { background: #f3f7fa; }
.project-dialog .internal-chat-roster__person > input { width: 17px; min-width: 17px; height: 17px; flex: 0 0 17px; margin: 0; padding: 0; accent-color: #286e9e; }
.internal-chat-roster__avatar { width: 34px; height: 34px; font-size: 11px; }
.internal-chat-roster__copy { display: grid; min-width: 0; }
.internal-chat-roster__copy strong { color: #254560; font-size: 14px; }
.internal-chat-new-form > .internal-chat-error { flex: 0 0 auto; margin: 0 18px; }
.internal-chat-new-form > .dialog-actions { flex: 0 0 auto; margin: 0; padding: 12px 18px 17px; }
.internal-chat-notifications { position: fixed; z-index: 1200; top: 16px; right: 18px; display: grid; width: min(390px, calc(100vw - 28px)); max-height: min(60vh, 520px); gap: 8px; overflow-y: auto; pointer-events: none; }
.internal-chat-call-panel { position: fixed; z-index: 1250; right: 425px; bottom: 20px; display: grid; width: min(340px, calc(100vw - 28px)); gap: 8px; padding: 16px; border: 1px solid #d5e1e9; border-radius: 14px; color: #25445e; background: #fff; box-shadow: 0 16px 44px rgb(20 44 67 / 24%); }
.internal-chat-call-panel[hidden] { display: none; }
.internal-chat-call-panel__name { color: #193b59; font-size: 16px; }
.internal-chat-call-panel__status { color: #61788c; font-size: 13px; }
.internal-chat-call-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.internal-chat-call-panel__actions button { min-height: 38px; padding: 0 13px; border: 1px solid #d2e0e9; border-radius: 8px; color: #245777; background: #f6fafc; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.internal-chat-call-panel__actions .internal-chat-call-panel__answer { border-color: #15875c; color: #fff; background: #15875c; }
.internal-chat-call-panel__actions .internal-chat-call-panel__hangup { border-color: #d7aaa6; color: #a83e36; background: #fff7f6; }
.internal-chat-call-panel__actions button:focus-visible, .internal-chat-call-start:focus-visible { outline: 3px solid rgb(42 116 177 / 34%); outline-offset: 2px; }
.internal-chat-notification { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 28px; align-items: center; gap: 9px; padding: 11px 10px; border: 1px solid #d9e4ec; border-left: 4px solid #2c83ae; border-radius: 12px; color: #25445e; background: #fff; box-shadow: 0 12px 34px rgb(18 43 66 / 18%); pointer-events: auto; }
.internal-chat-notification__icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: #286384; background: #e6f1f6; font-size: 12px; font-weight: 800; }
.internal-chat-notification__content { display: grid; min-width: 0; gap: 2px; }
.internal-chat-notification__content strong { overflow: hidden; color: #1e405a; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-notification__content small { overflow: hidden; color: #7b8da0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-notification__content > span { display: -webkit-box; overflow: hidden; color: #526b80; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.internal-chat-notification__open { min-height: 34px; padding: 0 10px; border: 1px solid #cddfe9; border-radius: 7px; color: #21658c; background: #f7fbfd; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.internal-chat-notification__dismiss { width: 28px; height: 28px; border: 0; border-radius: 6px; color: #73879a; background: transparent; cursor: pointer; font-size: 20px; }
.internal-chat-notification__open:hover, .internal-chat-notification__dismiss:hover { background: #edf4f8; }
.internal-chat-dock { position: fixed; z-index: 950; right: 18px; bottom: 18px; display: flex; width: min(360px, calc(100vw - 28px)); height: min(520px, calc(100dvh - 36px)); flex-direction: column; overflow: hidden; border: 1px solid #d5e0e9; border-radius: 12px; background: #fff; box-shadow: 0 18px 48px rgb(20 44 67 / 24%); }
.internal-chat-dock[hidden] { display: none; }
.internal-chat-dock.is-minimized { height: 58px; }
.internal-chat-dock__header { display: flex; min-height: 50px; flex: 0 0 auto; align-items: stretch; gap: 6px; padding: 6px 7px 6px 11px; border-bottom: 1px solid #e3eaf0; background: #f8fafc; }
.internal-chat-dock__toggle { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; justify-content: space-between; gap: 10px; border: 0; color: #214661; background: transparent; cursor: pointer; font: inherit; font-size: 14px; font-weight: 750; text-align: left; }
.internal-chat-dock__toggle > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-dock__toggle > span:last-child { color: #6d8295; font-size: 20px; line-height: 1; }
.internal-chat-dock__open { display: grid; width: 34px; flex: 0 0 34px; place-items: center; border: 1px solid #d5e1e9; border-radius: 8px; color: #315f80; background: #fff; cursor: pointer; font-size: 17px; }
.internal-chat-dock__open:hover { background: #edf4f8; }
.internal-chat-dock__dismiss { display: grid; width: 34px; flex: 0 0 34px; place-items: center; border: 1px solid #d5e1e9; border-radius: 8px; color: #61778b; background: #fff; cursor: pointer; font-size: 21px; line-height: 1; }
.internal-chat-dock__dismiss:hover { color: #9b3d36; background: #fff4f2; border-color: #edcbc7; }
.internal-chat-dock-launcher { position: fixed; z-index: 951; right: 20px; bottom: 20px; display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid #cbdce8; border-radius: 50%; color: #fff; background: #236c9e; box-shadow: 0 6px 20px rgb(20 44 67 / 22%); cursor: pointer; font: 700 21px/1 var(--body); }
.internal-chat-dock-launcher[hidden] { display: none; }
.internal-chat-dock-launcher:hover { background: #185780; }
.internal-chat-dock-launcher:focus-visible, .internal-chat-dock__dismiss:focus-visible { outline: 3px solid rgb(42 116 177 / 34%); outline-offset: 2px; }
.internal-chat-dock__body { min-height: 0; flex: 1 1 auto; overflow: hidden; }
.internal-chat-dock__body[hidden] { display: none; }
.internal-chat-dock__body .internal-chat-active { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
.internal-chat-dock__body .internal-chat-thread__head { display: none; }
.internal-chat-dock__body .internal-chat-messages { min-height: 0; padding: 12px; }
.internal-chat-dock__body .internal-chat-composer { padding: 10px; }
.internal-chat-dock__body .internal-chat-composer__hint { margin-left: 0; font-size: 10px; }
.internal-chat-dock__body .internal-chat-composer__row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px; }
.internal-chat-dock__body .internal-chat-attach { width: 36px; }
.internal-chat-dock__body .internal-chat-composer__row > button { padding-inline: 11px; }
.internal-chat-dock__body .internal-chat-error:not(:empty) { margin-left: 0; }
.internal-chat-dock__body .internal-chat-message { max-width: 94%; }
.internal-chat-dock__body .internal-chat-image-preview { width: min(220px, 100%); max-height: 170px; }
.internal-chat-dock__body .internal-chat-image-preview img { max-height: 170px; }
.internal-chat-active.is-drop-target .internal-chat-composer { outline: 3px dashed #2b78aa; outline-offset: -5px; background: #eef7fc; }
.internal-chat-active.is-drop-target .internal-chat-composer::before { content: 'Suelta aquí la captura para adjuntarla'; display: block; margin: 0 10px 8px; padding: 7px 10px; border: 1px solid #bfdae9; border-radius: 7px; color: #245d80; background: #f4fbff; font-size: 12px; font-weight: 750; text-align: center; }

@media (max-width: 760px) {
  .internal-chat-page > .workspace-hero { align-items: flex-start; gap: 9px; margin-bottom: 11px; padding-bottom: 10px; }
  .internal-chat-page > .workspace-hero h1 { font-size: 24px; }
  .internal-chat-page > .workspace-hero > div > p:last-child { font-size: 12px; }
  .internal-chat-notifications { top: max(10px, env(safe-area-inset-top)); right: 10px; width: calc(100vw - 20px); }
  .internal-chat-dock { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 20px)); height: min(520px, calc(100dvh - 20px - env(safe-area-inset-bottom))); }
  .internal-chat-dock-launcher { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  .internal-chat-dock.is-minimized { height: 56px; }
  .internal-chat-dialog { width: min(520px, calc(100vw - 20px)); height: min(90svh, 720px); max-height: 90svh; }
  .internal-chat-new-form .dialog-head { padding: 13px 15px; }
  .internal-chat-new-form > .dialog-actions { gap: 8px; padding: 10px 14px max(14px, env(safe-area-inset-bottom)); }
  .internal-chat-new-form > .dialog-actions .button { min-height: 42px; }
  .internal-chat-layout { height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(400px, 1fr); overflow: visible; }
  .internal-chat-inbox { min-height: 0; max-height: 155px; border-right: 0; border-bottom: 1px solid #e2e8ee; }
  .internal-chat-conversation-list { min-height: 48px; max-height: 78px; }
  .internal-chat-conversation { min-height: 58px; padding-block: 7px; }
  .internal-chat-thread, .internal-chat-welcome, .internal-chat-active { min-height: 400px; height: 400px; }
  .internal-chat-welcome { padding: 20px 16px; }
  .internal-chat-message { max-width: 90%; }
  .internal-chat-call-panel { right: 10px; bottom: max(76px, calc(env(safe-area-inset-bottom) + 70px)); }
  .internal-chat-thread__head { padding-inline: 12px; }
  .internal-chat-call-start { min-height: 36px; padding-inline: 9px; }
  .internal-chat-composer { padding-inline: 10px; }
  .internal-chat-composer__row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 6px; }
  .internal-chat-attach { width: 36px; height: 38px; }
  .internal-chat-composer__row > button { min-height: 38px; padding-inline: 10px; }
  .internal-chat-composer__hint { margin-left: 45px; }
  .internal-chat-error:not(:empty) { margin-left: 45px; }
}

@media (max-width: 1120px) {
  .inventory-history__filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inventory-history__search { grid-column: span 2; }
  .inventory-history-row { grid-template-columns: 88px minmax(150px, 1fr) minmax(190px, 1.2fr) minmax(145px, .8fr); gap: 11px; padding-inline: 15px; }
}
@media (max-width: 760px) {
  .inventory-history { margin-top: 16px; border-radius: 10px; }
  .inventory-history__header { align-items: flex-start; padding: 16px; }
  .inventory-history__header > div > p:last-child { max-width: 52ch; font-size: 12px; }
  .inventory-history__count { padding: 6px 8px; font-size: 10px; }
  .inventory-history__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 12px; }
  .inventory-history__search { grid-column: 1 / -1; }
  .inventory-history__filters label { font-size: 10px; }
  .inventory-history__filters input, .inventory-history__filters select { min-height: 42px; font-size: 12px; }
  .inventory-history__filters .button { grid-column: 1 / -1; min-height: 40px; }
  .inventory-history__totals { gap: 6px; padding: 10px 12px; }
  .inventory-history__totals article { padding: 9px 8px; }
  .inventory-history__totals span { font-size: 10px; line-height: 1.3; }
  .inventory-history__totals strong { font-size: 16px; }
  .inventory-history-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date quantity" "material material" "trace trace"; align-items: start; gap: 9px 12px; padding: 13px 14px; }
  .inventory-history-row__date { grid-area: date; font-size: 11px; }
  .inventory-history-row__quantity { grid-area: quantity; gap: 2px; }
  .inventory-history-row__quantity > strong { font-size: 13px; }
  .inventory-history-row__quantity > small { font-size: 10px; }
  .inventory-history-row__material { grid-area: material; }
  .inventory-history-row__trace { grid-area: trace; padding-top: 7px; border-top: 1px solid #edf1f5; }
  .inventory-history-row__material strong, .inventory-history-row__trace > strong { white-space: normal; }
  .inventory-history__pagination { align-items: flex-start; flex-direction: column; padding: 12px; }
  .inventory-history__pagination > div { width: 100%; }
  .inventory-history__pagination .button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .inventory-history-row { transition: none; }
}
