/*
 * SISTEMA VISUAL CUINANATURAL · APROBADO Y BLOQUEADO
 * Definición: docs/SISTEMA_VISUAL.md
 * No modificar identidad, composición ni componentes sin autorización explícita del usuario.
 */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Questrial&display=swap');

:root {
  --yellow: #F5CE22;
  --yellow-soft: #FBE99C;
  --charcoal: #212529;
  --ivory: #F9F6EE;
  --white: #FFFFFF;
  --ink: #212529;
  --text-muted: rgba(33, 37, 41, .66);
  --line: rgba(33, 37, 41, .16);
  --canvas: var(--ivory);
  --surface: var(--white);
  --surface-soft: var(--ivory);
  --sidebar-bg: var(--charcoal);
  --sidebar-text: var(--white);
  --proposal-bg: var(--surface);
  --calculation-bg: var(--surface);
  --order-area-bg: var(--surface-soft);
  --supplier-bg: var(--surface-soft);
  --proposal-cell-bg: var(--yellow-soft);
  --dev-alert-bg: var(--yellow-soft);
  --manual-field-bg: var(--white);
  --profile-border: var(--yellow);
  --action-bg: var(--charcoal);
  --action-text: var(--white);
  --primary-bg: var(--yellow);
  --primary-text: var(--charcoal);
  --field-bg: var(--surface-soft);
  --table-bg: var(--charcoal);
  --table-text: var(--white);
  --ok-color: #2E7D32;
  --review-color: #C62828;
  --supplier-hover-bg: var(--yellow-soft);
  --supplier-active-bg: rgba(33, 37, 41, .12);
  --supplier-active-frame: rgba(33, 37, 41, .52);
  --pending-order-color: var(--ok-color);
  --module-purchase-bg: var(--surface);
  --module-purchase-accent: var(--yellow);
  --module-frequency-bg: var(--surface);
  --module-frequency-accent: var(--yellow);
  --module-hover-border: var(--yellow);
  --radius: var(--user-radius, 18px);
  --button-radius: var(--user-button-radius, 10px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: var(--white);
  --text-muted: rgba(255, 255, 255, .68);
  --line: rgba(255, 255, 255, .18);
  --canvas: var(--charcoal);
  --surface: var(--charcoal);
  --surface-soft: rgba(249, 246, 238, .08);
  --action-bg: var(--yellow);
  --action-text: var(--charcoal);
  --table-bg: var(--yellow);
  --table-text: var(--charcoal);
  --supplier-active-bg: rgba(249, 246, 238, .16);
  --supplier-active-frame: rgba(249, 246, 238, .62);
  color-scheme: dark;
}

:root[data-theme="light"][data-canvas="white"] { --canvas: var(--white); }
:root[data-theme="light"][data-panels="ivory"] { --surface: var(--ivory); --surface-soft: var(--white); }
:root[data-theme="dark"][data-panels="ivory"] { --surface: rgba(249, 246, 238, .08); }
:root[data-table="yellow"] { --table-bg: var(--yellow); --table-text: var(--charcoal); }
:root[data-table="charcoal"] { --table-bg: var(--charcoal); --table-text: var(--white); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: 'Questrial', Arial, sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }

.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--canvas);
  opacity: 1;
  transition: opacity .4s ease, visibility .4s ease;
}
.startup-screen.is-finished { visibility: hidden; opacity: 0; }
.startup-content { width: min(310px, calc(100% - 48px)); text-align: center; }
.startup-logo { min-height: 200px; display: grid; place-items: center; margin-bottom: 24px; }
.startup-loader-image { width: min(210px, 70vw); height: auto; display: block; object-fit: contain; }
.startup-progress { height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.startup-progress span { width: 100%; height: 100%; display: block; border-radius: inherit; background: var(--yellow); transform-origin: left; animation: cook-progress 2.15s cubic-bezier(.22,.8,.25,1) both; }
.startup-content p { margin: 16px 0 0; font-family: 'DM Serif Display', Georgia, serif; font-size: 21px; }
.cooking-dots span { opacity: .2; animation: cook-dot 1.2s infinite; }
.cooking-dots span:nth-child(2) { animation-delay: .2s; }
.cooking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes cook-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cook-dot { 0%, 70%, 100% { opacity: .2; } 35% { opacity: 1; } }

.app-shell {
  width: min(1500px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 24px 65px rgba(33, 37, 41, .10);
}

.sidebar {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 22px 20px;
  border-radius: 25px 0 0 25px;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
}

.brand {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: transparent;
}
.brand img { width: 128px; height: 59px; object-fit: contain; }
.brand-logo-light { display: none; }
.brand-logo-dark { display: block; }
:root[data-sidebar="ivory"] .brand-logo-light { display: block; }
:root[data-sidebar="ivory"] .brand-logo-dark { display: none; }

.sidebar nav { display: grid; gap: 8px; }
.nav-module-group { display: grid; gap: 8px; }
.nav-module-group[hidden] { display: none; }
.nav-section-toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.14);
  color: var(--sidebar-text);
  background: transparent;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.nav-section-toggle:hover:not(:disabled) { filter: none; transform: none; background: rgba(255,255,255,.07); }
.nav-chevron { font-size: 18px; transition: transform .18s ease; }
.nav-section-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.nav-section-panel { display: grid; gap: 6px; padding: 2px 0 8px 10px; }
.nav-link {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border-radius: 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}
.nav-link:hover { background: rgba(255,255,255,.07); }
.nav-link.active { color: var(--charcoal); background: var(--yellow); }
.nav-icon { width: 18px; font-size: 18px; text-align: center; }
.nav-action { width: 100%; border: 0; background: transparent; text-align: left; }

:root[data-sidebar="ivory"] { --sidebar-bg: var(--ivory); --sidebar-text: var(--charcoal); }
:root[data-sidebar="ivory"] .sidebar { color: var(--sidebar-text); background: var(--sidebar-bg); }
:root[data-sidebar="ivory"] .nav-section-toggle { border-color: rgba(33,37,41,.18); color: var(--sidebar-text); }
:root[data-sidebar="ivory"] .nav-section-toggle:hover:not(:disabled),
:root[data-sidebar="ivory"] .nav-link:hover { background: rgba(33,37,41,.07); }
:root[data-sidebar="ivory"] .nav-link { color: var(--sidebar-text); }
:root[data-sidebar="ivory"] .nav-link.active { color: var(--charcoal); background: var(--yellow); }

.sidebar-identity { display: grid; gap: 10px; }
.sidebar-status {
  margin: 0;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
}
.sidebar-status-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.sidebar-status p { margin: 10px 0 0; color: rgba(255, 255, 255, .70); font-size: 11px; line-height: 1.45; }
:root[data-sidebar="ivory"] .sidebar-status { border-color: rgba(33,37,41,.18); background: rgba(33,37,41,.04); }
:root[data-sidebar="ivory"] .sidebar-status p { color: rgba(33,37,41,.70); }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: rgba(255,255,255,.045); }
.sidebar-user-profile { min-width: 0; min-height: 44px; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; justify-items: start; gap: 9px; padding: 4px 6px; color: var(--sidebar-text); background: transparent; text-align: left; }
.sidebar-user-profile:hover:not(:disabled) { filter: none; background: rgba(255,255,255,.07); }
.sidebar-user-copy { min-width: 0; display: grid; gap: 3px; }
.sidebar-user-copy strong { max-width: 96px; overflow: hidden; color: var(--sidebar-text); font-size: 12px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy small { color: color-mix(in srgb, var(--sidebar-text) 68%, transparent); font-size: 10px; }
.sidebar-user form { margin: 0; }
.sidebar-user form button { min-height: 34px; padding: 0 10px; border: 1px solid rgba(255,255,255,.18); color: var(--sidebar-text); background: transparent; font-size: 11px; }
:root[data-sidebar="ivory"] .sidebar-user { border-color: rgba(33,37,41,.18); background: rgba(33,37,41,.04); }
:root[data-sidebar="ivory"] .sidebar-user form button { border-color: rgba(33,37,41,.18); }
:root[data-sidebar="ivory"] .sidebar-user-profile:hover:not(:disabled) { background: rgba(33,37,41,.07); }
.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--charcoal);
  background: var(--yellow);
  font-size: 10px;
  letter-spacing: .06em;
}
.env-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--charcoal); }
.env-badge.large { font-size: 12px; }

.workspace { min-width: 0; padding: 28px 30px 40px; }
.app-view { min-width: 0; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 6px; color: var(--ink); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; }
h1 { margin: 0; font-size: clamp(31px, 3vw, 40px); line-height: 1.06; }
.page-subtitle { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }
.module-view-selector { min-width: 230px; display: grid; gap: 7px; color: var(--text-muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.module-view-selector select { width: 100%; height: 43px; padding: 0 36px 0 12px; border: 1px solid var(--line); border-radius: var(--button-radius); outline: 0; color: var(--ink); background: var(--field-bg); font-size: 12px; letter-spacing: 0; text-transform: none; }
.module-view-selector select:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 20%, transparent); }

.dashboard-view { min-height: calc(100vh - 105px); }
.dashboard-header { max-width: 720px; margin-top: 8px; margin-bottom: 38px; }
.module-section { max-width: 1040px; }
.module-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.module-section-heading h2 { margin: 0; font-family: 'DM Serif Display', Georgia, serif; font-size: 24px; font-weight: 400; }
.module-section-heading p { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.module-card {
  position: relative;
  overflow: hidden;
  min-height: 164px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  box-shadow: 0 10px 30px rgba(33, 37, 41, .05);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
button.module-card:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--module-hover-border); filter: none; box-shadow: 0 16px 36px rgba(33, 37, 41, .10); }
.module-card.is-available::before { content: ''; position: absolute; top: -1px; bottom: -1px; left: -1px; width: 7px; border-radius: var(--radius) 0 0 var(--radius); background: var(--yellow); }
.module-card-purchase { background: var(--module-purchase-bg); }
.module-card-purchase.is-available::before { background: var(--module-purchase-accent); }
.module-card-purchase .module-icon { background: var(--module-purchase-accent); }
.module-card-frequency { background: var(--module-frequency-bg); }
.module-card-frequency.is-available::before { background: var(--module-frequency-accent); }
.module-card-frequency .module-icon { background: var(--module-frequency-accent); }
.module-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; color: var(--charcoal); background: var(--yellow-soft); }
.module-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.module-copy { display: grid; gap: 8px; }
.module-copy strong { font-family: 'DM Serif Display', Georgia, serif; font-size: 21px; font-weight: 400; }
.module-copy small { max-width: 310px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.module-arrow { font-size: 25px; }
.module-state { align-self: start; padding: 6px 9px; border-radius: 999px; color: var(--charcoal); background: var(--yellow-soft); font-size: 10px; }
.module-card.is-upcoming { opacity: .68; }
.module-empty { grid-column: 1 / -1; display: grid; gap: 8px; padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text-muted); background: var(--surface-soft); }
.module-empty strong { color: var(--ink); font-family: 'DM Serif Display', Georgia, serif; font-size: 20px; font-weight: 400; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--canvas); }
.auth-shell { width: min(940px, 100%); min-height: 590px; display: grid; grid-template-columns: .9fr 1.1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: 0 24px 65px rgba(33,37,41,.12); }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: var(--white); background: var(--charcoal); }
.auth-brand img { width: 180px; height: auto; object-fit: contain; }
.auth-brand h1 { margin-top: 18px; color: var(--white); font-size: 34px; }
.auth-brand p { max-width: 300px; color: rgba(255,255,255,.72); line-height: 1.55; }
.auth-card { align-self: center; padding: 54px clamp(28px, 6vw, 72px); }
.auth-card h2 { margin: 0; font-size: 30px; }
.auth-intro { margin: 9px 0 24px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.auth-error { margin-bottom: 16px; padding: 11px 12px; border-left: 4px solid var(--review-color); border-radius: 8px; color: var(--ink); background: color-mix(in srgb, var(--review-color) 9%, var(--surface)); font-size: 12px; }
.auth-success { margin-bottom: 16px; padding: 11px 12px; border-left: 4px solid var(--ok-color); border-radius: 8px; color: var(--ink); background: color-mix(in srgb, var(--ok-color) 9%, var(--surface)); font-size: 12px; }
.auth-form { display: grid; gap: 2px; }
.auth-form label { margin: 9px 0; }
.auth-form input,
.user-form-grid input[type=text],
.user-form-grid input[type=email],
.user-form-grid input[type=password] { width: 100%; height: 43px; display: block; margin-top: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: var(--field-bg); }
.auth-form input:focus,
.user-form-grid input:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,206,34,.18); }
.auth-form small, .user-form-grid small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 10px; }
.auth-form button { width: 100%; margin-top: 14px; }
.auth-recovery-link { display: block; margin-top: 18px; color: var(--ink); font-size: 11px; text-align: center; text-underline-offset: 3px; }

.recovery-reminder { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--ink); }
.recovery-reminder button { flex: 0 0 auto; }
.account-panel { max-width: 860px; }
.profile-panel, .password-panel { margin-bottom: 18px; }
.profile-avatar { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 3px solid var(--profile-border); border-radius: 50%; color: var(--charcoal); background: var(--yellow-soft); }
.profile-avatar-image, .profile-avatar-fallback { grid-area: 1 / 1; width: 100%; height: 100%; }
.profile-avatar-image { display: block; object-fit: cover; }
.profile-avatar-fallback { display: grid; place-items: center; font-family: 'DM Serif Display', Georgia, serif; font-size: 18px; line-height: 1; }
.profile-avatar-sidebar { width: 38px; height: 38px; border-width: 2px; }
.profile-avatar-sidebar .profile-avatar-fallback { font-size: 15px; }
.profile-avatar-large { width: 118px; height: 118px; border-width: 5px; }
.profile-avatar-large .profile-avatar-fallback { font-size: 42px; }
.profile-avatar-table { width: 38px; height: 38px; border-width: 2px; }
.profile-avatar-table .profile-avatar-fallback { font-size: 14px; }
.profile-editor { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 24px; padding: 0 20px 22px; }
.profile-editor-fields { min-width: 0; display: grid; justify-items: start; gap: 12px; }
.profile-file-label { width: 100%; max-width: 480px; margin: 0; }
.profile-file-label input[type=file] { width: 100%; display: block; margin-top: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--field-bg); }
.profile-file-label input[type=file]::file-selector-button { min-height: 34px; margin-right: 10px; padding: 0 12px; border: 0; border-radius: var(--button-radius); color: var(--action-text); background: var(--action-bg); cursor: pointer; }
.profile-file-label small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 10px; }
.profile-editor .inline-status { width: 100%; margin: 0; }
.profile-editor .inline-status.is-error { border-left: 4px solid var(--review-color); color: var(--ink); background: color-mix(in srgb, var(--review-color) 10%, var(--surface)); }
.profile-actions { flex-wrap: wrap; }
.password-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 14px; padding: 0 20px 22px; }
.password-form label { display: grid; grid-template-rows: auto 43px; align-content: start; margin: 0; }
.password-form input { width: 100%; height: 43px; display: block; margin-top: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: var(--field-bg); }
.password-form input:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,206,34,.18); }
.password-form small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 10px; }
.password-form .inline-status { grid-column: 1 / -1; width: 100%; margin: 0; }
.password-form .inline-status.is-error { border-left: 4px solid var(--review-color); color: var(--ink); background: color-mix(in srgb, var(--review-color) 10%, var(--surface)); }
.password-form button { justify-self: start; }
.account-content { display: grid; justify-items: start; gap: 15px; padding: 0 20px 22px; }
.account-guidance { width: 100%; padding: 17px; border-radius: 12px; background: var(--surface-soft); }
.account-guidance strong { font-family: 'DM Serif Display', Georgia, serif; font-size: 18px; font-weight: 400; }
.account-guidance p { max-width: 650px; margin: 7px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.account-content .inline-status { width: 100%; margin: 0; }
.recovery-codes-result { width: 100%; padding: 18px; border: 1px solid var(--yellow); border-radius: 12px; background: var(--yellow-soft); color: var(--charcoal); }
.recovery-codes-result p { margin: 0 0 13px; font-size: 12px; }
.recovery-codes-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 15px; }
.recovery-codes-list code { padding: 9px; border: 1px solid rgba(33,37,41,.18); border-radius: 8px; background: var(--white); color: var(--charcoal); font-size: 13px; text-align: center; }

.users-panel .tablewrap { margin-bottom: 20px; }
.users-table td:first-child { display: grid; gap: 4px; }
.users-table td.user-identity { display: flex; align-items: center; gap: 10px; }
.user-identity-copy { min-width: 0; display: grid; gap: 4px; }
.users-table td:first-child strong { font-weight: 400; }
.users-table td:first-child small { color: var(--text-muted); }
.users-table td:last-child { width: 1%; text-align: right; }
.user-state { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; }
.user-state.is-active { color: var(--ok-color); background: color-mix(in srgb, var(--ok-color) 12%, transparent); }
.user-state.is-inactive { color: var(--text-muted); background: var(--surface-soft); }
.user-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; max-height: calc(100vh - 210px); overflow-y: auto; padding: 8px 24px 20px; }
.user-form-grid label { margin: 12px 0; }
.user-password-field, .permission-fieldset, .user-options, .form-status { grid-column: 1 / -1; }
.user-options { display: flex; gap: 24px; padding: 8px 0; }
.permission-fieldset { display: grid; gap: 10px; margin: 8px 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.permission-fieldset legend { padding: 0 6px; color: var(--ink); font-size: 11px; }
.permission-fieldset .check { margin: 0; }
.permission-fieldset small { display: inline; margin-left: 5px; }
.form-status { min-height: 18px; margin: 6px 0 0; color: var(--review-color); font-size: 11px; }
.user-share-dialog { width: min(650px, calc(100% - 32px)); }
.user-share-body { padding: 22px 24px 8px; }
.user-share-body label { display: block; color: var(--ink); font-size: 12px; }
.user-share-body textarea { width: 100%; margin-top: 8px; padding: 15px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: var(--field-bg); font: 13px/1.55 'Questrial', Arial, sans-serif; }
.user-share-body textarea:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 20%, transparent); }
.user-share-body .inline-status { min-height: 18px; margin: 8px 0 0; }

button {
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--button-radius);
  color: var(--action-text);
  background: var(--action-bg);
}
button:hover:not(:disabled) { filter: brightness(.96); transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.primary-action {
  min-height: 45px;
  padding: 0 20px;
  color: var(--primary-text);
  background: var(--primary-bg);
  box-shadow: 0 9px 24px rgba(245, 206, 34, .24);
}
.secondary-action { color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); }

.dev-alert {
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid var(--yellow);
  border-radius: 13px;
  color: var(--charcoal);
  background: var(--dev-alert-bg);
  font-size: 12px;
}
.dev-alert strong { color: var(--charcoal); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; margin-bottom: 16px; }
.metric {
  position: relative;
  min-height: 96px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric::after { content: ''; position: absolute; right: -22px; bottom: -36px; width: 90px; height: 90px; border-radius: 50%; background: rgba(245,206,34,.15); }
.metric p { margin: 0 0 10px; color: var(--text-muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.metric div { display: flex; align-items: baseline; gap: 9px; }
.metric strong { font-family: 'DM Serif Display', Georgia, serif; font-size: 30px; font-weight: 400; line-height: 1; }
.metric span { color: var(--ink); font-size: 11px; }

.main-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.proposal-panel { background: var(--proposal-bg); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 20px 15px; }
.panel-head-actions { display: flex; align-items: center; gap: 10px; }
.panel-head.compact { padding-bottom: 2px; }
.panel h2 { margin: 0; font-size: 22px; }
.panel-head p { margin: 5px 0 0; color: var(--text-muted); font-size: 12px; }
.readonly-pill { padding: 6px 9px; border-radius: 999px; color: var(--charcoal); background: var(--yellow-soft); font-size: 10px; white-space: nowrap; }

.inline-status { margin: 0 20px 14px; padding: 11px 12px; border-radius: 10px; color: var(--ink); background: var(--surface-soft); font-size: 12px; }
.inline-status.is-loading { color: var(--ink); }
.success-message { margin: 12px 20px 0; padding: 10px 12px; border-radius: 9px; color: var(--charcoal); background: var(--yellow-soft); font-size: 12px; }

.proposal-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 15px;
}
.proposal-filters { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.compact-field { margin: 0; color: var(--text-muted); font-size: 10px; }
.compact-field select {
  min-width: 170px;
  height: 36px;
  display: block;
  margin-top: 6px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  color: var(--ink);
  background: var(--surface-soft);
}
.compact-field select:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,206,34,.18); }
.compact-field input[type=search] { min-width: 240px; height: 36px; display: block; margin-top: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: var(--surface-soft); }
.compact-field input[type=search]:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,206,34,.18); }
.supplier-filter-field { position: relative; }
.supplier-filter-dropdown { position: relative; min-width: clamp(250px, 32vw, 500px); margin-top: 6px; color: var(--ink); }
.supplier-filter-dropdown summary {
  height: 36px;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--surface-soft);
  cursor: pointer;
  list-style: none;
}
.supplier-filter-dropdown summary::-webkit-details-marker { display: none; }
.supplier-filter-dropdown summary::after { content: '⌄'; font-size: 14px; line-height: 1; transition: transform .18s ease; }
.supplier-filter-dropdown[open] summary { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,206,34,.18); }
.supplier-filter-dropdown[open] summary::after { transform: rotate(180deg); }
.supplier-filter-dropdown.is-disabled { opacity: .58; pointer-events: none; }
.supplier-filter-menu { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; width: 100%; max-height: 290px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 14px 32px rgba(33,37,41,.14); }
.supplier-filter-option { width: 100%; min-height: 35px; display: grid; grid-template-columns: 7px minmax(0,1fr); align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--ink); background: transparent; font-size: 11px; text-align: left; }
.supplier-filter-option:hover:not(:disabled), .supplier-filter-option.is-selected { filter: none; transform: none; background: var(--surface-soft); }
.supplier-filter-dot { width: 7px; height: 7px; display: block; border-radius: 50%; box-shadow: none; opacity: 1; }
.supplier-filter-dot.is-review { background: var(--review-color); }
.supplier-filter-dot.is-ok { background: var(--ok-color); }
.supplier-filter-dot.is-neutral { visibility: hidden; }
.proposal-actions { flex-wrap: wrap; }
.proposal-actions button { white-space: nowrap; }
.print-heading { display: none; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 10px; color: var(--table-text); background: var(--table-bg); font-size: 10px; letter-spacing: .035em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid rgba(33, 37, 41, .12); vertical-align: middle; }
tbody tr:nth-child(even) { background: var(--surface-soft); }
.supplier-group td { padding: 0; color: var(--ink); background: var(--supplier-bg); text-align: left !important; }
.supplier-header { position: relative; min-height: 48px; overflow: hidden; background: var(--supplier-bg); }
.supplier-toggle {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto 22px;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.supplier-toggle:hover:not(:disabled) { filter: none; transform: none; }
.supplier-group.is-open .supplier-header { background: var(--supplier-active-bg); }
.supplier-group .supplier-header:hover { background: var(--supplier-hover-bg); }
.supplier-header:hover .supplier-toggle:not(:disabled) { color: var(--charcoal); background: transparent; }
.supplier-group.is-open td { border-top: 1px solid var(--supplier-active-frame); border-right: 1px solid var(--supplier-active-frame); border-left: 1px solid var(--supplier-active-frame); }
.supplier-group.is-open td:first-child { border-radius: 10px 10px 0 0; }
.supplier-group.is-open .supplier-header { box-shadow: inset 0 1px 0 var(--supplier-active-frame); }
.supplier-header::before { content: ''; position: absolute; z-index: 2; top: 0; bottom: 0; left: 0; width: 5px; pointer-events: none; }
.supplier-group.has-review .supplier-header::before { background: var(--review-color); }
.supplier-group.all-ok .supplier-header::before { background: var(--ok-color); }
.supplier-order-links { margin: 0 36px 8px auto; }
.supplier-group strong { font-weight: 400; }
.supplier-group-summary { color: var(--text-muted); font-size: 10px; text-align: right; }
.supplier-header:hover .supplier-group-summary { color: var(--charcoal); }
.supplier-chevron { font-size: 18px; line-height: 1; text-align: center; transition: transform .18s ease; }
.supplier-group.is-open .supplier-chevron { transform: rotate(180deg); }
.product-row td:first-child { font-weight: 400; }
.product-row.needs-review { background: color-mix(in srgb, var(--review-color) 11%, transparent); }
.product-row.stock-ok { background: color-mix(in srgb, var(--ok-color) 10%, transparent); }
.product-row.needs-review td:first-child { box-shadow: inset 5px 0 0 var(--review-color); }
.product-row.stock-ok td:first-child { box-shadow: inset 5px 0 0 var(--ok-color); }
.product-row.needs-review td.proposal { background: color-mix(in srgb, var(--review-color) 18%, transparent); }
.product-row.stock-ok td.proposal { background: color-mix(in srgb, var(--ok-color) 16%, transparent); }
.product-row.active-supplier td:first-child { border-left: 1px solid var(--supplier-active-frame); }
.product-row.active-supplier td:last-child { border-right: 1px solid var(--supplier-active-frame); }
.product-row.last-active-item td { border-bottom: 1px solid var(--supplier-active-frame); }
.product-row.last-active-item td:first-child { border-radius: 0 0 0 10px; }
.product-row.last-active-item td:last-child { border-radius: 0 0 10px 0; }
.proposal-tablewrap table { min-width: 940px; }
#tabla th:nth-child(n+2), #tabla td:nth-child(n+2) { text-align: right; }
td.proposal { color: var(--charcoal); background: var(--proposal-cell-bg); font-weight: 700; white-space: nowrap; }
.empty { padding: 34px; color: var(--text-muted); text-align: center !important; }
.manual-quantity { width: 90px; height: 35px; display: block; margin: 0 0 0 auto; padding: 0 9px; border: 1.5px solid var(--yellow); border-radius: 9px; outline: 0; color: var(--ink); background: var(--manual-field-bg); text-align: right; }
.manual-quantity:focus { box-shadow: 0 0 0 3px rgba(245,206,34,.25); }
.order-created-info, .supplier-order-links { width: fit-content; max-width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; padding: 4px 8px; border: 1px solid var(--pending-order-color); border-radius: 999px; color: var(--pending-order-color); background: color-mix(in srgb, var(--pending-order-color) 9%, var(--surface)); font-size: 10px; font-weight: 700; white-space: nowrap; text-align: right; }
.order-created-info { margin: 6px 0 0 auto; }
.order-created-info[hidden], .supplier-order-links[hidden] { display: none; }
.order-created-info .order-link, .supplier-order-links .order-link { color: var(--pending-order-color); }
.order-link { color: var(--ok-color); text-decoration: none; }
.order-link:hover { text-decoration: underline; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; color: var(--text-muted); font-size: 11px; }
.panel-foot strong { color: var(--ink); font-weight: 400; }
.order-creation { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--order-area-bg); }
.order-creation p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.order-creation button { min-width: 210px; }
.order-creation button:disabled { color: var(--text-muted); background: var(--surface); border: 1px solid var(--line); }

.calculation-panel { order: -1; padding-bottom: 20px; background: var(--calculation-bg); }
.calculation-panel form { display: grid; grid-template-columns: 1.25fr .55fr 1.7fr auto; align-items: end; gap: 14px; padding: 0 20px; }
label { display: block; margin: 15px 0; color: var(--ink); font-size: 11px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=number] { width: 100%; height: 41px; display: block; margin-top: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: var(--field-bg); font-size: 14px; }
input[type=number]:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,206,34,.18); }
input[type=number].manual-quantity { color: var(--charcoal); background: var(--manual-field-bg); }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; margin: 15px 0; }
.check { display: flex; align-items: flex-start; gap: 9px; margin: 0; color: var(--ink); line-height: 1.35; }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--yellow); }
.save-action { min-width: 180px; margin-bottom: 15px; }

.categories-panel, .providers-panel, .odoo-panel { margin-top: 0; }
.button-group { display: flex; gap: 8px; flex-wrap: wrap; }
.categorias-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 8px; max-height: 260px; overflow: auto; margin: 0 20px 20px; padding: 14px; border-radius: 12px; background: var(--surface-soft); }
.categoria-option { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 9px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); line-height: 1.25; }
.categoria-option:hover { border-color: var(--yellow); color: var(--charcoal); background: var(--yellow-soft); }
.categoria-option input { margin: 1px 0 0; accent-color: var(--yellow); }
.providers-panel .tablewrap { margin-bottom: 6px; }
.providers-panel table { min-width: 800px; }
.frequency-panel { overflow: hidden; }
.frequency-tools { padding-top: 0; }
.frequency-tablewrap,
.frequency-company-table { overflow-x: visible; }
.frequency-tablewrap table,
.frequency-company-table table { min-width: 0; table-layout: fixed; font-size: clamp(8px, .72vw, 11px); }
.frequency-tablewrap th,
.frequency-tablewrap td,
.frequency-company-table th,
.frequency-company-table td { padding: 10px 5px; overflow-wrap: anywhere; word-break: normal; }
.frequency-tablewrap th,
.frequency-company-table th { white-space: normal; line-height: 1.2; }
.frequency-tablewrap th:nth-child(1) { width: 20%; }
.frequency-tablewrap th:nth-child(2) { width: 21%; }
.frequency-tablewrap th:nth-child(3) { width: 7%; }
.frequency-tablewrap th:nth-child(4) { width: 11%; }
.frequency-tablewrap th:nth-child(5) { width: 11%; }
.frequency-tablewrap th:nth-child(6) { width: 9%; }
.frequency-tablewrap th:nth-child(7) { width: 11%; }
.frequency-tablewrap th:nth-child(8) { width: 10%; }
.frequency-state { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; white-space: nowrap; }
.frequency-state.is-retrasado { color: var(--review-color); background: color-mix(in srgb, var(--review-color) 12%, transparent); }
.frequency-state.is-proximo { color: var(--charcoal); background: var(--yellow-soft); }
.frequency-state.is-en_plazo { color: var(--ok-color); background: color-mix(in srgb, var(--ok-color) 12%, transparent); }
.frequency-state.is-sin_datos { color: var(--text-muted); background: var(--surface-soft); }
.frequency-groups { display: grid; gap: 10px; padding: 0 20px 20px; }
.frequency-groups[hidden] { display: none; }
.frequency-groups-empty { padding: 30px 12px; }
.frequency-company { overflow: hidden; border: 1px solid var(--line); border-left: 5px solid var(--ok-color); border-radius: 12px; background: var(--surface); }
.frequency-company.has-alert { border-left-color: var(--review-color); }
.frequency-company.has-warning { border-left-color: var(--yellow); }
.frequency-company > summary { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 18px; padding: 14px 16px; cursor: pointer; list-style: none; color: var(--ink); }
.frequency-company > summary::-webkit-details-marker { display: none; }
.frequency-company > summary::before { content: '›'; grid-column: 1; grid-row: 1; width: 16px; transform: translateX(-7px); color: var(--text-muted); font-size: 20px; transition: transform .15s ease; }
.frequency-company[open] > summary::before { transform: translateX(-7px) rotate(90deg); }
.frequency-company > summary > strong { grid-column: 1; grid-row: 1; padding-left: 17px; }
.frequency-company > summary:hover { background: var(--surface-soft); }
.frequency-company[open] > summary { border-bottom: 1px solid var(--line); }
.frequency-group-alert { min-width: 92px; text-align: right; font-weight: 700; color: var(--ok-color); }
.has-alert > summary .frequency-group-alert { color: var(--review-color); }
.has-warning > summary .frequency-group-alert { color: var(--charcoal); }
.frequency-company-table th:nth-child(1) { width: 24%; }
.frequency-company-table th:nth-child(2) { width: 6%; }
.frequency-company-table th:nth-child(3) { width: 10%; }
.frequency-company-table th:nth-child(4) { width: 10%; }
.frequency-company-table th:nth-child(5) { width: 12%; }
.frequency-company-table th:nth-child(6) { width: 10%; }
.frequency-company-table th:nth-child(7) { width: 10%; }
.frequency-company-table th:nth-child(8) { width: 10%; }
.frequency-company-table th:nth-child(9) { width: 8%; }
.frequency-product-retrasado td { background: color-mix(in srgb, var(--review-color) 10%, var(--surface)); }
.frequency-product-proximo td { background: color-mix(in srgb, var(--yellow) 15%, var(--surface)); }
.frequency-product-en_plazo td { background: color-mix(in srgb, var(--ok-color) 9%, var(--surface)); }
.frequency-product-sin_datos td { background: var(--surface); }
.frequency-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 20px 20px; }
.frequency-pagination button { width: 38px; min-height: 34px; padding: 0; border: 1px solid var(--line); color: var(--ink); background: var(--surface-soft); font-size: 19px; }
.frequency-pagination button:disabled { cursor: default; opacity: .38; }
.frequency-page-count { min-width: 210px; color: var(--text-muted); font-size: 11px; text-align: center; }
.frequency-report-dialog { width: min(760px, calc(100% - 32px)); }
.frequency-report-body { max-height: calc(100vh - 220px); overflow-y: auto; padding: 18px 24px 8px; }
.frequency-report-section { margin: 0 0 17px; }
.frequency-report-section h3 { margin: 0 0 8px; color: var(--ink); font-family: 'DM Serif Display', Georgia, serif; font-size: 17px; font-weight: 400; }
.frequency-report-box { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.frequency-report-choices .check + .check { margin-top: 9px; }
.frequency-report-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; margin-top: 12px; }
.frequency-report-statuses { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.frequency-report-body .inline-status { margin: 4px 0 10px; }

.odoo-panel { border-top: 4px solid var(--yellow); }
.odoo-details { display: grid; grid-template-columns: .7fr 2fr repeat(3, 1fr); gap: 18px; margin: 4px 20px 16px; }
.odoo-details div { min-width: 0; }
.odoo-details dt { color: var(--text-muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.odoo-details dd { margin: 7px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.odoo-url { min-width: 180px; }

.appearance-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(33,37,41,.28);
}
.appearance-dialog::backdrop { background: rgba(33,37,41,.72); }
.appearance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 24px 16px; border-bottom: 1px solid var(--line); }
.appearance-head h2 { margin: 0; font-size: 27px; }
.appearance-head p:last-child { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; }
.dialog-close { width: 38px; min-height: 38px; padding: 0; border: 1px solid var(--line); color: var(--ink); background: var(--surface-soft); font-size: 24px; }
.appearance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; max-height: calc(100vh - 210px); overflow-y: auto; padding: 8px 24px 16px; }
.appearance-grid label { margin: 12px 0; }
.appearance-grid select { width: 100%; height: 42px; display: block; margin-top: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface-soft); }
.appearance-section { grid-column: 1 / -1; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.appearance-section-head h3 { margin: 0; font-family: 'DM Serif Display', Georgia, serif; font-size: 19px; font-weight: 400; }
.appearance-section-head p { margin: 5px 0 0; color: var(--text-muted); font-size: 11px; }
.appearance-color-grid { display: grid; grid-template-columns: repeat(4,minmax(120px,1fr)); gap: 10px 12px; margin-top: 12px; }
.appearance-color-grid label { margin: 0; }
.appearance-color-grid input[type=color] { width: 100%; height: 38px; display: block; margin-top: 6px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.appearance-preview-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.appearance-preview-row input[type=number] { width: 100px; margin: 0; }
.appearance-status-ok, .appearance-status-review { padding: 8px 10px; border-radius: var(--button-radius); font-size: 11px; }
.appearance-status-ok { color: var(--ok-color); background: color-mix(in srgb, var(--ok-color) 12%, transparent); }
.appearance-status-review { color: var(--review-color); background: color-mix(in srgb, var(--review-color) 12%, transparent); }
.appearance-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px 22px; border-top: 1px solid var(--line); }
.appearance-save-status { align-self: center; margin-right: auto; color: var(--text-muted); font-size: 11px; }

:root[data-density="compact"] .workspace { padding: 20px 22px 30px; }
:root[data-density="compact"] .metric { min-height: 78px; padding-block: 13px; }
:root[data-density="compact"] .panel-head { padding-block: 14px 11px; }
:root[data-density="compact"] td { padding-block: 9px; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 214px minmax(0,1fr); }
  .sidebar { padding-inline: 16px; }
  .brand img { width: 116px; height: auto; }
  .calculation-panel form { grid-template-columns: 1fr 1fr; }
  .check-list { align-self: center; }
  .save-action { width: 100%; }
  .odoo-details { grid-template-columns: repeat(3,1fr); }
  .odoo-url { grid-column: span 2; }
}

@media (max-width: 760px) {
  .app-shell { width: 100%; min-height: 100vh; display: block; margin: 0; border: 0; border-radius: 0; }
  .sidebar { position: static; width: 100%; height: auto; display: block; padding: 12px 15px; border-radius: 0; }
  .brand { width: 150px; min-height: 68px; margin: 0 auto; }
  .brand img { width: 112px; }
  .sidebar nav { margin-top: 10px; }
  .sidebar-identity { margin-top: 8px; }
  .workspace { padding: 22px 15px 32px; }
  .page-header { align-items: flex-end; }
  .module-page-header { align-items: stretch; flex-direction: column; }
  .module-view-selector { width: 100%; min-width: 0; }
  .page-subtitle { max-width: 420px; }
  .primary-action { padding: 0 13px; }
  .metrics { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 142px; grid-template-columns: 54px minmax(0, 1fr); padding: 19px; }
  .module-icon { width: 54px; height: 54px; border-radius: 15px; }
  .module-state, .module-arrow { grid-column: 2; justify-self: start; }
  .panel-head { flex-direction: column; }
  .panel-head-actions { width: 100%; justify-content: space-between; }
  .proposal-tools { align-items: stretch; flex-direction: column; }
  .proposal-filters { align-items: stretch; flex-direction: column; }
  .compact-field select { width: 100%; }
  .compact-field input[type=search] { width: 100%; min-width: 0; }
  .frequency-company > summary { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .frequency-company > summary > strong { grid-column: 1; }
  .frequency-company > summary > span:not(.frequency-group-alert) { grid-column: 1; padding-left: 17px; }
  .frequency-group-alert { grid-column: 2; grid-row: 1 / span 2; }
  .frequency-tablewrap table,
  .frequency-tablewrap tbody,
  .frequency-tablewrap tr,
  .frequency-tablewrap td,
  .frequency-company-table table,
  .frequency-company-table tbody,
  .frequency-company-table tr,
  .frequency-company-table td { display: block; width: 100%; }
  .frequency-tablewrap thead,
  .frequency-company-table thead { display: none; }
  .frequency-tablewrap tr,
  .frequency-company-table tr { overflow: hidden; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; }
  .frequency-tablewrap td,
  .frequency-company-table td { min-height: 36px; display: grid; grid-template-columns: minmax(112px, 42%) minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
  .frequency-tablewrap td:last-child,
  .frequency-company-table td:last-child { border-bottom: 0; }
  .frequency-tablewrap td::before,
  .frequency-company-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
  .frequency-state { justify-self: start; }
  .frequency-report-options,
  .frequency-report-statuses { grid-template-columns: 1fr; }
  .supplier-filter-dropdown { width: 100%; min-width: 0; }
  .proposal-actions button { flex: 1; }
  .calculation-panel form { grid-template-columns: 1fr; }
  .field-pair { grid-template-columns: 1fr; gap: 0; }
  .check-list { grid-template-columns: 1fr; }
  .save-action { margin-bottom: 0; }
  .panel-foot { align-items: flex-start; flex-direction: column; }
  .order-creation { align-items: stretch; flex-direction: column; }
  .order-creation button { width: 100%; }
  .odoo-details { grid-template-columns: 1fr 1fr; }
  .odoo-url { grid-column: span 2; }
  .appearance-grid { grid-template-columns: 1fr; }
  .appearance-color-grid { grid-template-columns: 1fr 1fr; }
  .appearance-actions { flex-wrap: wrap; }
  .appearance-save-status { width: 100%; }
  .auth-page { padding: 0; }
  .auth-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-brand { min-height: 230px; padding: 30px; }
  .auth-brand img { width: 145px; }
  .auth-brand h1 { font-size: 28px; }
  .auth-card { padding: 34px 24px; }
  .user-form-grid { grid-template-columns: 1fr; }
  .user-password-field, .permission-fieldset, .user-options, .form-status { grid-column: auto; }
  .recovery-reminder { align-items: stretch; flex-direction: column; }
  .recovery-codes-list { grid-template-columns: 1fr 1fr; }
  .profile-editor { grid-template-columns: 1fr; justify-items: center; }
  .profile-editor-fields { width: 100%; justify-items: stretch; }
  .profile-actions button { flex: 1; }
  .password-form { grid-template-columns: 1fr; }
  .password-form .inline-status { grid-column: auto; }
  .password-form button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: #FFFFFF; }
  body.print-proposal .app-shell { width: 100%; min-height: 0; display: block; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  body.print-proposal .sidebar,
  body.print-proposal .page-header,
  body.print-proposal .dev-alert,
  body.print-proposal .metrics,
  body.print-proposal .calculation-panel,
  body.print-proposal .categories-panel,
  body.print-proposal .providers-panel,
  body.print-proposal .odoo-panel,
  body.print-proposal .proposal-panel > .panel-head,
  body.print-proposal .proposal-tools,
  body.print-proposal .inline-status,
  body.print-proposal .panel-foot,
  body.print-proposal .order-creation { display: none !important; }
  body.print-proposal .workspace { padding: 0; }
  body.print-proposal .main-grid { display: block; }
  body.print-proposal .proposal-panel { border: 0; border-radius: 0; }
  body.print-proposal .print-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 8mm; }
  body.print-proposal .print-heading img { width: 34mm; height: auto; }
  body.print-proposal .print-heading h2 { margin: 0; font-size: 21pt; }
  body.print-proposal .print-heading p { margin: 2mm 0 0; color: var(--charcoal); font-size: 9pt; }
  body.print-proposal .proposal-tablewrap { overflow: visible; }
  body.print-proposal .proposal-tablewrap table { min-width: 0; font-size: 7pt; }
  body.print-proposal th { padding: 2.2mm 1.5mm; font-size: 6.5pt; }
  body.print-proposal td { padding: 2mm 1.5mm; }
  body.print-proposal .supplier-group td { display: table-cell; }
  body.print-proposal .supplier-toggle { min-height: 0; display: flex; justify-content: space-between; padding: 2mm; color: var(--charcoal); background: var(--ivory); }
  body.print-proposal .supplier-chevron { display: none; }
  body.print-proposal .manual-quantity { width: 18mm; height: 7mm; padding: 0 1mm; border-color: var(--charcoal); box-shadow: none; font-size: 7pt; }
}
