:root {
  --hilara-brand: #08b8c7;
  --hilara-brand-strong: #073b67;
  --hilara-brand-soft: #e8f9fb;
  --hilara-bg: #f5f9fb;
  --hilara-surface: #ffffff;
  --hilara-surface-muted: #f7fbfc;
  --hilara-text: #102a43;
  --hilara-text-muted: #66788a;
  --hilara-border: #dce7ec;
  --hilara-success: #16845b;
  --hilara-danger: #c93c4a;
  --hilara-radius-sm: 10px;
  --hilara-radius: 16px;
  --hilara-radius-lg: 24px;
  --hilara-shadow: 0 12px 35px rgba(7,59,103,.08);
  --hilara-content: 1180px;
  --hilara-field-height: 50px;
}

html, body { background: var(--hilara-bg); color: var(--hilara-text); }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.hilara-page { width: min(100% - 32px, var(--hilara-content)); margin: 0 auto; padding: 32px 0 48px; }
.hilara-page--narrow { max-width: 760px; }
.hilara-stack { display: grid; gap: 20px; }
.hilara-grid { display: grid; gap: 20px; grid-template-columns: repeat(12, minmax(0,1fr)); }
.hilara-col-6 { grid-column: span 6; }
.hilara-col-12 { grid-column: span 12; }

.hilara-eyebrow { color: var(--hilara-brand); font-weight: 750; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.hilara-title { margin: 5px 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.08; font-weight: 800; letter-spacing: -.035em; }
.hilara-subtitle { margin: 0; color: var(--hilara-text-muted); font-size: 1rem; line-height: 1.65; }

.hilara-card { background: var(--hilara-surface); border: 1px solid var(--hilara-border); border-radius: var(--hilara-radius-lg); box-shadow: var(--hilara-shadow); padding: 24px; }
.hilara-card--flat { box-shadow: none; }
.hilara-card__title { font-size: 1.05rem; font-weight: 760; margin: 0 0 6px; }
.hilara-card__text { color: var(--hilara-text-muted); margin: 0; }

.hilara-form { display: grid; gap: 18px; }
.hilara-field { display: grid; gap: 7px; }
.hilara-label { font-size: .9rem; font-weight: 700; }
.hilara-help { color: var(--hilara-text-muted); font-size: .82rem; }
.hilara-input, .hilara-select, .hilara-textarea {
  width: 100%; border: 1px solid #cbdbe3; border-radius: var(--hilara-radius-sm); background: #fff;
  color: var(--hilara-text); padding: 0 14px; min-height: var(--hilara-field-height); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hilara-textarea { padding-top: 12px; min-height: 110px; resize: vertical; }
.hilara-input:focus, .hilara-select:focus, .hilara-textarea:focus { border-color: var(--hilara-brand); box-shadow: 0 0 0 4px rgba(8,184,199,.14); }

.hilara-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hilara-btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 0 18px; border: 1px solid transparent; font-weight: 750; text-decoration: none; cursor: pointer; transition: .15s ease; }
.hilara-btn--primary { background: var(--hilara-brand); color: #fff; }
.hilara-btn--primary:hover { background: var(--hilara-brand-strong); color: #fff; transform: translateY(-1px); }
.hilara-btn--secondary { background: #fff; border-color: var(--hilara-border); color: var(--hilara-text); }
.hilara-btn--secondary:hover { background: var(--hilara-surface-muted); color: var(--hilara-text); }

.hilara-badge { display: inline-flex; align-items: center; width: fit-content; padding: 6px 10px; border-radius: 999px; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-size: .78rem; font-weight: 750; }
.hilara-divider { height: 1px; background: var(--hilara-border); border: 0; margin: 2px 0; }
.hilara-note { border-radius: var(--hilara-radius); padding: 14px 16px; background: var(--hilara-brand-soft); color: #07546f; font-size: .9rem; }

.hilara-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.hilara-choice { border: 1px solid var(--hilara-border); border-radius: var(--hilara-radius); padding: 18px; background: #fff; }
.hilara-choice strong { display:block; margin-bottom: 4px; }
.hilara-choice span { color: var(--hilara-text-muted); font-size: .88rem; }

@media (max-width: 720px) {
  .hilara-page { width: min(100% - 24px, var(--hilara-content)); padding-top: 22px; }
  .hilara-card { padding: 18px; border-radius: 18px; }
  .hilara-col-6 { grid-column: span 12; }
  .hilara-choice-grid { grid-template-columns: 1fr; }
  .hilara-actions .hilara-btn { width: 100%; }
}

/* Onboarding */
.hilara-onboarding-layout { min-height: 100vh; background: radial-gradient(circle at 85% 0%, rgba(8,184,199,.10), transparent 28rem), var(--hilara-bg); }
.hilara-onboarding-brand { width: min(100% - 32px, 1180px); margin: 0 auto; padding: 24px 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.hilara-brand-link { display: inline-flex; align-items: center; gap: 10px; color: var(--hilara-text); text-decoration: none; font-size: 1.15rem; font-weight: 850; letter-spacing: -.025em; }
.hilara-brand-mark { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--hilara-brand); color: #fff; font-weight: 850; box-shadow: 0 8px 22px rgba(8,184,199,.20); }
.hilara-onboarding-brand__tagline { color: var(--hilara-text-muted); font-size: .86rem; }
.hilara-onboarding-main { min-height: calc(100vh - 64px); }
.hilara-stepper { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 24px; }
.hilara-step { position: relative; display: grid; justify-items: center; gap: 6px; color: #8a9ba8; font-weight: 700; text-align: center; }
.hilara-step::before { content: ""; position: absolute; height: 2px; background: var(--hilara-border); left: calc(-50% + 18px); right: calc(50% + 18px); top: 17px; }
.hilara-step:first-child::before { display: none; }
.hilara-step > span { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--hilara-border); font-size: .82rem; }
.hilara-step small { font-size: .72rem; }
.hilara-step.is-active { color: var(--hilara-brand-strong); }
.hilara-step.is-active > span { border-color: var(--hilara-brand); box-shadow: 0 0 0 4px rgba(8,184,199,.12); }
.hilara-step.is-done { color: var(--hilara-success); }
.hilara-step.is-done > span { background: #ecfdf3; border-color: #abefc6; }
.hilara-optional { margin-left: 6px; color: var(--hilara-text-muted); font-size: .76rem; font-weight: 600; }
.hilara-choice--button { width: 100%; text-align: left; cursor: pointer; font: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.hilara-choice--button:hover { border-color: #86dbe2; transform: translateY(-1px); }
.hilara-choice--button.is-selected { border-color: var(--hilara-brand); box-shadow: 0 0 0 3px rgba(8,184,199,.12); background: #f5fdfe; }
.hilara-choice__icon { width: 36px; height: 36px; margin-bottom: 14px; border-radius: 10px; display: grid !important; place-items: center; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong) !important; font-weight: 850; font-style: normal; }
.hilara-choice em { display: block; margin-top: 12px; color: var(--hilara-brand-strong); font-size: .76rem; font-weight: 750; font-style: normal; }
.hilara-validation { border: 1px solid #fecdca; background: #fffbfa; color: #b42318; border-radius: 12px; padding: 12px 14px; margin-top: 18px; font-size: .88rem; }
.hilara-actions--between { justify-content: space-between; margin-top: 18px; }

@media (max-width: 720px) {
  .hilara-onboarding-brand { width: min(100% - 24px, 1180px); padding-top: 16px; }
  .hilara-onboarding-brand__tagline { display: none; }
  .hilara-step small { display: none; }
  .hilara-stepper { margin-bottom: 18px; }
  .hilara-actions--between { display: grid; grid-template-columns: 1fr; }
}

/* Brand artwork */
.hilara-brand-logo { display:block; width: 190px; height: auto; max-height: 54px; object-fit: contain; object-position: left center; }
@media (max-width: 720px) { .hilara-brand-logo { width: 160px; height: auto; max-height: 46px; } }

/* Password visibility + onboarding success modal */
.hilara-password-wrap { position: relative; }
.hilara-password-wrap .hilara-input { padding-right: 48px; }
.hilara-password-toggle { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--hilara-navy, #0b4268); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.hilara-password-toggle:hover { background: rgba(8,184,199,.08); }
.hilara-password-toggle:focus-visible { outline: 2px solid var(--hilara-brand); outline-offset: 2px; }
.hilara-password-toggle svg { width: 21px; height: 21px; }

.hilara-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(8, 31, 50, .52); backdrop-filter: blur(4px); }
.hilara-modal { width: min(100%, 500px); background: #fff; border: 1px solid rgba(8,184,199,.18); border-radius: 24px; padding: 30px; box-shadow: 0 24px 70px rgba(8,31,50,.22); text-align: center; }
.hilara-modal__icon { width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(8,184,199,.10); color: var(--hilara-brand); font-size: 32px; font-weight: 800; }
.hilara-modal__title { margin: 0 0 10px; color: var(--hilara-navy, #0b4268); font-size: 1.55rem; }
.hilara-modal__text { margin: 0 0 24px; color: var(--hilara-muted, #667085); line-height: 1.6; }
.hilara-modal .hilara-btn { width: 100%; }
.hilara-modal--error { border-color: rgba(220, 38, 38, .18); }
.hilara-modal__icon--error { background: rgba(220, 38, 38, .08); color: #dc2626; }


/* Hide the browser-native password reveal control; Hilara provides its own toggle. */
.hilara-password-wrap input[type="password"]::-ms-reveal,
.hilara-password-wrap input[type="password"]::-ms-clear {
    display: none;
}

.hilara-password-wrap input::-webkit-credentials-auto-fill-button,
.hilara-password-wrap input::-webkit-contacts-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    position: absolute;
    right: 0;
}

/* Hilara Gestión - application shell */
.hilara-app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0,1fr); background: var(--hilara-bg); }
.hilara-app-sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px 20px; background: #fff; border-right: 1px solid var(--hilara-border); display: flex; flex-direction: column; }
.hilara-app-logo { display: flex; align-items: center; height: 46px; padding: 0 8px; margin-bottom: 28px; text-decoration: none; }
.hilara-app-logo img { display: block; width: 142px; max-height: 42px; object-fit: contain; object-position: left center; }
.hilara-app-section-label { padding: 0 12px 9px; color: #91a0ad; font-size: .67rem; font-weight: 800; letter-spacing: .12em; }
.hilara-app-nav { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.hilara-app-nav-item { min-height: 46px; padding: 0 12px; border-radius: 12px; display: flex; align-items: center; gap: 11px; color: #53687a; text-decoration: none; font-size: .91rem; font-weight: 700; }
.hilara-app-nav-item:hover { background: #f3fafb; color: var(--hilara-brand-strong); }
.hilara-app-nav-item.active { color: var(--hilara-brand-strong); background: var(--hilara-brand-soft); box-shadow: inset 3px 0 0 var(--hilara-brand); }
.hilara-app-nav-item.is-disabled { cursor: default; }
.hilara-app-nav-item.is-disabled:hover { background: transparent; color: #53687a; }
.hilara-app-nav-item small { margin-left: auto; color: #8aa0af; font-size: .63rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.hilara-app-nav-icon { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; background: #f2f7f9; color: #557285; font-size: .92rem; font-weight: 850; }
.hilara-app-nav-item.active .hilara-app-nav-icon { background: #fff; color: var(--hilara-brand); }
.hilara-app-nav-spacer { flex: 1; }
.hilara-app-sidebar-footer { margin-top: 18px; padding: 15px 12px 2px; border-top: 1px solid var(--hilara-border); }
.hilara-app-network-badge { color: var(--hilara-brand); font-size: .68rem; font-weight: 850; letter-spacing: .08em; }
.hilara-app-network-text { margin-top: 4px; color: var(--hilara-text-muted); font-size: .73rem; line-height: 1.35; }
.hilara-app-main { min-width: 0; }
.hilara-app-topbar { height: 78px; padding: 0 34px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--hilara-border); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hilara-app-context { display: grid; gap: 1px; }
.hilara-app-context-label { color: var(--hilara-text-muted); font-size: .7rem; font-weight: 650; }
.hilara-app-context strong { color: var(--hilara-text); font-size: .96rem; }
.hilara-app-user { display: flex; align-items: center; gap: 10px; }
.hilara-app-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-size: .78rem; font-weight: 850; }
.hilara-app-user-copy { display: grid; gap: 1px; }
.hilara-app-user-copy strong { color: var(--hilara-text); font-size: .84rem; }
.hilara-app-user-copy span { color: var(--hilara-text-muted); font-size: .7rem; }
.hilara-app-content { width: min(100%, 1280px); margin: 0 auto; padding: 38px 42px 56px; }
.hilara-dashboard { display: grid; gap: 26px; }
.hilara-dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.hilara-dashboard-heading h1 { margin: 4px 0 6px; color: var(--hilara-brand-strong); font-size: clamp(1.85rem,3vw,2.45rem); letter-spacing: -.035em; }
.hilara-dashboard-heading p { margin: 0; color: var(--hilara-text-muted); }
.hilara-dashboard-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #cde8dd; border-radius: 999px; background: #f3fbf7; color: var(--hilara-success); font-size: .76rem; font-weight: 750; white-space: nowrap; }
.hilara-dashboard-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--hilara-success); }
.hilara-dashboard-welcome { min-height: 210px; padding: 30px 32px; border: 1px solid var(--hilara-border); border-radius: 24px; background: linear-gradient(115deg,#fff 0%,#fff 63%,#eefbfd 100%); box-shadow: var(--hilara-shadow); display: flex; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; }
.hilara-dashboard-welcome-copy { max-width: 690px; }
.hilara-dashboard-welcome h2 { margin: 14px 0 8px; color: var(--hilara-brand-strong); font-size: 1.55rem; letter-spacing: -.025em; }
.hilara-dashboard-welcome p { margin: 0; color: var(--hilara-text-muted); line-height: 1.65; }
.hilara-dashboard-mark { flex: 0 0 112px; width: 112px; height: 112px; border-radius: 32px; display: grid; place-items: center; background: var(--hilara-brand); color: #fff; font-size: 3.2rem; font-weight: 900; box-shadow: 0 18px 45px rgba(8,184,199,.22); transform: rotate(-5deg); }
.hilara-dashboard-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.hilara-module-card { min-height: 145px; padding: 20px; border: 1px solid var(--hilara-border); border-radius: 18px; background: #fff; display: grid; grid-template-columns: 42px 1fr; grid-template-rows: 1fr auto; gap: 12px; box-shadow: 0 8px 25px rgba(7,59,103,.045); }
.hilara-module-card--active { text-decoration: none; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.hilara-module-card--active:hover { border-color: rgba(18, 183, 196, .35); box-shadow: 0 10px 28px rgba(7,59,103,.08); transform: translateY(-1px); }
.hilara-module-card--active em { color: var(--hilara-cyan, #12b7c4); }
.hilara-module-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-size: 1.05rem; font-weight: 850; }
.hilara-module-card div { display: grid; align-content: start; gap: 4px; }
.hilara-module-card strong { color: var(--hilara-text); font-size: .96rem; }
.hilara-module-card div span { color: var(--hilara-text-muted); font-size: .8rem; line-height: 1.45; }
.hilara-module-card em { grid-column: 2; color: #8aa0af; font-size: .68rem; font-weight: 800; font-style: normal; text-transform: uppercase; letter-spacing: .05em; }

.hilara-home-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.hilara-home-summary-card { min-height:122px; padding:20px 22px; border:1px solid var(--hilara-border); border-radius:18px; background:#fff; box-shadow:0 8px 25px rgba(7,59,103,.045); display:flex; flex-direction:column; justify-content:center; gap:5px; text-decoration:none; transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.hilara-home-summary-card:hover { border-color:rgba(18,183,196,.35); box-shadow:0 10px 28px rgba(7,59,103,.08); transform:translateY(-1px); }
.hilara-home-summary-card span { color:var(--hilara-text-muted); font-size:.76rem; font-weight:800; text-transform:uppercase; letter-spacing:.045em; }
.hilara-home-summary-card strong { color:var(--hilara-brand-strong); font-size:1.55rem; letter-spacing:-.025em; }
.hilara-home-summary-card small { color:var(--hilara-text-muted); font-size:.78rem; }
.hilara-dashboard-welcome--compact { min-height:150px; padding-top:24px; padding-bottom:24px; }
@media (max-width:900px) { .hilara-home-summary { grid-template-columns:1fr; } }
@media (max-width: 900px) {
  .hilara-app-shell { grid-template-columns: 84px minmax(0,1fr); }
  .hilara-app-sidebar { padding-inline: 12px; }
  .hilara-app-logo { padding: 0; justify-content: center; overflow: hidden; }
  .hilara-app-logo img { width: 126px; max-width: none; object-position: left; transform: translateX(43px); }
  .hilara-app-section-label, .hilara-app-nav-item > span:not(.hilara-app-nav-icon), .hilara-app-nav-item small, .hilara-app-sidebar-footer { display: none; }
  .hilara-app-nav-item { justify-content: center; padding: 0; }
  .hilara-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hilara-app-shell { display: block; }
  .hilara-app-sidebar { position: fixed; z-index: 20; inset: auto 0 0 0; width: 100%; height: 68px; padding: 8px 12px; border-right: 0; border-top: 1px solid var(--hilara-border); }
  .hilara-app-logo, .hilara-app-section-label, .hilara-app-sidebar-footer, .hilara-app-nav-spacer, .hilara-app-nav-item:nth-child(n+5) { display: none; }
  .hilara-app-nav { flex-direction: row; justify-content: space-around; }
  .hilara-app-nav-item { flex: 1; min-height: 50px; }
  .hilara-app-topbar { height: 68px; padding: 0 18px; }
  .hilara-app-user-copy { display: none; }
  .hilara-app-content { padding: 26px 18px 96px; }
  .hilara-dashboard-heading { align-items: start; flex-direction: column; gap: 12px; }
  .hilara-dashboard-welcome { min-height: 0; padding: 24px; }
  .hilara-dashboard-mark { display: none; }
}

/* Hilara login */
.hilara-login-page { width: min(100% - 32px, 520px); margin: 0 auto; padding: 36px 0 56px; }
.hilara-login-card { padding: 34px; border: 1px solid var(--hilara-border); border-radius: 24px; background: #fff; box-shadow: var(--hilara-shadow); }
.hilara-login-heading { margin-bottom: 26px; }
.hilara-login-heading h1 { margin: 6px 0 8px; color: var(--hilara-brand-strong); font-size: clamp(1.8rem,4vw,2.25rem); letter-spacing: -.035em; }
.hilara-login-heading p { margin: 0; color: var(--hilara-text-muted); line-height: 1.6; }
.hilara-login-submit { width: 100%; margin-top: 2px; }
.hilara-login-register { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--hilara-border); display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; color: var(--hilara-text-muted); font-size: .88rem; }
.hilara-login-register a { color: var(--hilara-brand-strong); font-weight: 800; text-decoration: none; }
.hilara-login-register a:hover { color: var(--hilara-brand); }

/* User menu + logout */
.hilara-app-user-menu { position: relative; }
.hilara-app-user-button { border: 0; padding: 6px 8px; border-radius: 12px; background: transparent; font: inherit; cursor: pointer; text-align: left; }
.hilara-app-user-button:hover { background: #f3fafb; }
.hilara-app-user-chevron { margin-left: 2px; color: #8093a2; font-size: .9rem; }
.hilara-app-user-dropdown { position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; width: 250px; padding: 8px; border: 1px solid var(--hilara-border); border-radius: 14px; background: #fff; box-shadow: 0 18px 45px rgba(7,59,103,.14); }
.hilara-app-user-dropdown-info { padding: 9px 10px 12px; display: grid; gap: 3px; border-bottom: 1px solid var(--hilara-border); }
.hilara-app-user-dropdown-info strong { overflow: hidden; text-overflow: ellipsis; color: var(--hilara-text); font-size: .78rem; }
.hilara-app-user-dropdown-info span { color: var(--hilara-text-muted); font-size: .72rem; }
.hilara-app-user-dropdown button { width: 100%; margin-top: 6px; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--hilara-danger); font-weight: 750; text-align: left; cursor: pointer; }
.hilara-app-user-dropdown button:hover { background: #fff4f5; }

@media (max-width: 640px) {
  .hilara-login-page { padding-top: 20px; }
  .hilara-login-card { padding: 24px 20px; }
  .hilara-app-user-chevron { display: none; }
  .hilara-app-user-dropdown { right: 0; width: min(250px, calc(100vw - 36px)); }
}

/* Responsive polish: login viewport + complete mobile navigation */
.hilara-app-mobile-more { display: none; }

@media (min-width: 641px) {
  .hilara-login-page {
    min-height: calc(100vh - 86px);
    padding-top: 16px;
    padding-bottom: 28px;
    display: flex;
    align-items: center;
  }
  .hilara-login-card { width: 100%; }
}

@media (max-width: 640px) {
  .hilara-app-nav-secondary { display: none; }
  .hilara-app-mobile-more { display: block; flex: 1; position: relative; }
  .hilara-app-mobile-more > summary {
    list-style: none;
    height: 50px;
    justify-content: center;
    padding: 0;
    cursor: pointer;
  }
  .hilara-app-mobile-more > summary::-webkit-details-marker { display: none; }
  .hilara-app-mobile-more[open] > summary {
    color: var(--hilara-brand-strong);
    background: var(--hilara-brand-soft);
  }
  .hilara-app-mobile-more-menu {
    position: absolute;
    right: 0;
    bottom: 62px;
    width: min(250px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid var(--hilara-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(7,59,103,.16);
  }
  .hilara-app-mobile-more-item {
    min-height: 48px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 10px;
    color: #53687a;
    font-size: .88rem;
    font-weight: 700;
  }
  .hilara-app-mobile-more-item + .hilara-app-mobile-more-item {
    border-top: 1px solid #eef3f5;
  }
}


/* 2026-10-06: ajuste final de viewport del login y navegación móvil */
@media (min-width: 641px) {
  .hilara-login-page {
    box-sizing: border-box;
    min-height: calc(100dvh - 82px);
    padding-top: 8px;
    padding-bottom: 16px;
  }
  .hilara-login-card { padding: 30px 34px; }
  .hilara-login-heading { margin-bottom: 20px; }
  .hilara-login-register { margin-top: 20px; padding-top: 18px; }
}

@media (max-width: 640px) {
  .hilara-app-sidebar {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    z-index: 100;
    height: 72px;
  }
  .hilara-app-nav { gap: 3px; }
  .hilara-app-nav-item {
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    gap: 3px;
    font-size: .61rem;
    line-height: 1;
  }
  .hilara-app-nav-item > span:not(.hilara-app-nav-icon) { display: block; }
  .hilara-app-nav-icon { width: 27px; height: 27px; font-size: .78rem; }
  .hilara-app-mobile-more > summary { height: 54px; }
  .hilara-app-mobile-more-menu { bottom: 66px; }
  .hilara-app-content { padding-bottom: 108px; }
}


/* Hilara Gestión - Productos */
.hilara-products-page { display: grid; gap: 24px; }
.hilara-products-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.hilara-products-heading h1 { margin: 4px 0 6px; color: var(--hilara-brand-strong); font-size: clamp(1.85rem,3vw,2.45rem); letter-spacing: -.035em; }
.hilara-products-heading p { margin: 0; color: var(--hilara-text-muted); }
.hilara-products-add { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--hilara-brand-strong); color: #fff; font: inherit; font-size: .86rem; font-weight: 800; display: inline-flex; align-items: center; gap: 7px; }
.hilara-products-add:disabled { opacity: .82; cursor: default; }
.hilara-products-panel { overflow: hidden; border: 1px solid var(--hilara-border); border-radius: 20px; background: #fff; box-shadow: 0 8px 25px rgba(7,59,103,.045); }
.hilara-products-toolbar { min-height: 76px; padding: 14px 18px; border-bottom: 1px solid var(--hilara-border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hilara-products-search { width: min(100%, 520px); min-height: 46px; padding: 0 14px; border: 1px solid #cbd8df; border-radius: 12px; background: #fff; display: flex; align-items: center; gap: 9px; color: #78909f; }
.hilara-products-search:focus-within { border-color: var(--hilara-brand); box-shadow: 0 0 0 3px rgba(8,184,199,.10); }
.hilara-products-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--hilara-text); font: inherit; font-size: .9rem; }
.hilara-products-search input::placeholder { color: #92a3ae; }
.hilara-products-count { color: var(--hilara-text-muted); font-size: .76rem; font-weight: 750; white-space: nowrap; }
.hilara-products-count.is-near-limit { color: #b45309; font-weight: 850; }
.hilara-products-state { min-height: 330px; padding: 44px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hilara-products-state.is-compact { min-height: 220px; }
.hilara-products-state-icon { width: 58px; height: 58px; margin-bottom: 15px; border-radius: 18px; display: grid; place-items: center; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-size: 1.35rem; font-weight: 900; }
.hilara-products-state strong { color: var(--hilara-text); font-size: 1rem; }
.hilara-products-state span { max-width: 430px; margin-top: 6px; color: var(--hilara-text-muted); font-size: .84rem; line-height: 1.5; }
.hilara-products-state.is-error .hilara-products-state-icon { background: #fff1f2; color: var(--hilara-danger); }
.hilara-products-list { display: grid; }
.hilara-product-row { min-height: 78px; padding: 13px 18px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 13px; }
.hilara-product-row + .hilara-product-row { border-top: 1px solid #edf2f4; }
.hilara-product-avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-weight: 850; }
.hilara-product-main { min-width: 0; display: grid; gap: 3px; }
.hilara-product-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hilara-text); font-size: .9rem; }
.hilara-product-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hilara-text-muted); font-size: .75rem; }
.hilara-product-status { padding: 6px 9px; border-radius: 999px; background: #f3f5f6; color: #788994; font-size: .68rem; font-weight: 800; }
.hilara-product-status.is-active { background: #f0faf5; color: var(--hilara-success); }
@media (max-width: 640px) {
  .hilara-products-heading { align-items: stretch; flex-direction: column; gap: 14px; }
  .hilara-products-add { justify-content: center; }
  .hilara-products-toolbar { align-items: stretch; flex-direction: column; }
  .hilara-products-search { width: 100%; }
  .hilara-products-count { padding-left: 2px; }
  .hilara-products-state { min-height: 280px; }
  .hilara-product-row { grid-template-columns: 42px minmax(0,1fr); }
  .hilara-product-status { grid-column: 2; justify-self: start; margin-top: -5px; }
}

/* Gestión · agregar producto desde catálogo universal */
.hilara-products-add { cursor: pointer; }
.hilara-products-add:hover { background: #0a4b7f; }
.hilara-product-modal-backdrop { position: fixed; inset: 0; z-index: 1400; padding: 24px; display: grid; place-items: center; background: rgba(5, 32, 54, .42); backdrop-filter: blur(3px); }
.hilara-product-modal { width: min(100%, 620px); max-height: calc(100vh - 48px); overflow: auto; padding: 26px; border: 1px solid var(--hilara-border); border-radius: 22px; background: #fff; box-shadow: 0 28px 70px rgba(7, 59, 103, .22); }
.hilara-product-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.hilara-product-modal-header h2 { margin: 4px 0 5px; color: var(--hilara-brand-strong); font-size: 1.55rem; letter-spacing: -.025em; }
.hilara-product-modal-header p { margin: 0; color: var(--hilara-text-muted); font-size: .88rem; }
.hilara-product-modal-close { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 11px; background: #f2f7f9; color: var(--hilara-brand-strong); font: inherit; font-size: 1.45rem; line-height: 1; cursor: pointer; }
.hilara-product-modal-close:hover { background: var(--hilara-brand-soft); }
.hilara-product-barcode-search { margin-top: 24px; display: grid; gap: 8px; }
.hilara-product-barcode-search > label { color: var(--hilara-text); font-size: .84rem; font-weight: 750; }
.hilara-product-barcode-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.hilara-product-barcode-row .hilara-btn { min-width: 105px; }
.hilara-product-result-message { margin-top: 18px; padding: 16px; border: 1px solid #cfe8ec; border-radius: 14px; background: #f5fcfd; display: grid; gap: 4px; }
.hilara-product-result-message strong { color: var(--hilara-brand-strong); font-size: .9rem; }
.hilara-product-result-message span { color: var(--hilara-text-muted); font-size: .8rem; line-height: 1.45; }
.hilara-product-result-message.is-error { border-color: #fecdca; background: #fffbfa; }
.hilara-product-result-message.is-error strong { color: #b42318; }
.hilara-product-found-card { margin-top: 18px; padding: 18px; border: 1px solid #bfe6ea; border-radius: 16px; background: #f8feff; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: center; }
.hilara-product-found-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-weight: 900; }
.hilara-product-found-info { min-width: 0; display: grid; gap: 4px; }
.hilara-product-found-label { color: var(--hilara-brand); font-size: .7rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.hilara-product-found-info > strong { color: var(--hilara-text); font-size: 1rem; }
.hilara-product-found-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--hilara-text-muted); font-size: .78rem; }
.hilara-product-found-meta span + span::before { content: "·"; margin-right: 12px; color: #9aabb5; }
.hilara-product-modal-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; }
.hilara-product-modal .hilara-btn:disabled { opacity: .65; cursor: default; transform: none; }

@media (max-width: 620px) {
  .hilara-product-modal-backdrop { padding: 12px; align-items: end; }
  .hilara-product-modal { max-height: calc(100vh - 24px); padding: 20px; border-radius: 20px; }
  .hilara-product-barcode-row { grid-template-columns: 1fr; }
  .hilara-product-modal-actions { display: grid; grid-template-columns: 1fr; }
  .hilara-product-modal-actions .hilara-btn { width: 100%; }
}

/* Gestión · métodos de incorporación de productos */
.hilara-product-add-methods { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hilara-product-method { min-width: 0; min-height: 86px; padding: 13px; border: 1px solid var(--hilara-border); border-radius: 14px; background: #fff; color: var(--hilara-text); font: inherit; text-align: left; cursor: pointer; display: flex; align-items: flex-start; gap: 10px; }
.hilara-product-method:hover { border-color: #9edce2; background: #fbfeff; }
.hilara-product-method.is-active { border-color: var(--hilara-brand); background: #f4fcfd; box-shadow: 0 0 0 2px rgba(8,184,199,.08); }
.hilara-product-method-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-weight: 900; }
.hilara-product-method > span:last-child { min-width: 0; display: grid; gap: 3px; }
.hilara-product-method strong { color: var(--hilara-brand-strong); font-size: .78rem; line-height: 1.25; }
.hilara-product-method small { color: var(--hilara-text-muted); font-size: .69rem; line-height: 1.3; }
.hilara-product-found-card { grid-template-columns: 62px minmax(0, 1fr); }
.hilara-product-found-image { width: 62px; height: 62px; overflow: hidden; border: 1px solid #dcebed; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--hilara-brand-strong); font-weight: 900; }
.hilara-product-found-image img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.hilara-product-inline-action { width: fit-content; margin-top: 8px; padding: 0; border: 0; background: transparent; color: var(--hilara-brand-strong); font: inherit; font-size: .79rem; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.hilara-product-next-step { margin-top: 20px; padding: 18px; border: 1px solid #cfe8ec; border-radius: 16px; background: #f8feff; display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 13px; }
.hilara-product-next-step-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-weight: 900; }
.hilara-product-next-step strong { color: var(--hilara-brand-strong); }
.hilara-product-next-step p { margin: 5px 0 0; color: var(--hilara-text-muted); font-size: .8rem; line-height: 1.5; }
.hilara-product-preserved-code { display: inline-block; margin-top: 10px; padding: 6px 9px; border-radius: 8px; background: #fff; color: var(--hilara-text-muted); font-size: .72rem; }
@media (max-width: 620px) {
  .hilara-product-add-methods { grid-template-columns: 1fr; }
  .hilara-product-method { min-height: 66px; }
}

/* Productos · carga manual */
.hilara-product-manual-form { margin-top: 20px; }
.hilara-product-manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hilara-product-field { display: grid; gap: 7px; color: var(--hilara-brand-strong); font-size: .78rem; font-weight: 800; }
.hilara-product-field--wide { grid-column: 1 / -1; }
.hilara-product-field > span small { color: var(--hilara-text-muted); font-weight: 600; }
.hilara-product-field select.hilara-input { appearance: auto; background: #fff; }
.hilara-product-manual-help { margin: 12px 0 0; color: var(--hilara-text-muted); font-size: .78rem; line-height: 1.45; }
@media (max-width: 640px) {
    .hilara-product-manual-grid { grid-template-columns: 1fr; }
    .hilara-product-field--wide { grid-column: auto; }
}

/* Productos · precio y costo */
.hilara-product-commercial-summary {
    display: flex;
    gap: 28px;
    margin-left: auto;
}

.hilara-product-commercial-summary > span {
    display: grid;
    min-width: 92px;
    gap: 2px;
}

.hilara-product-commercial-summary small {
    color: #7a8ca3;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.hilara-product-commercial-summary strong {
    color: #0a3158;
    font-size: 14px;
}

.hilara-product-commercial-summary .is-sale strong { font-size: 15px; }

.hilara-product-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hilara-product-edit {
    border: 1px solid #78cbd7;
    border-radius: 7px;
    background: #e7f6fa;
    color: #074f7a;
    padding: 8px 14px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.hilara-product-edit:hover {
    background: #d8f1f6;
    border-color: #20aebe;
    color: #063e67;
}

.hilara-product-commercial-modal { max-width: 590px; }

.hilara-product-commercial-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 22px;
}

.hilara-money-input { position: relative; }
.hilara-money-input > span {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #60758c;
    font-weight: 800;
    pointer-events: none;
}
.hilara-money-input .hilara-input { padding-left: 34px; }

@media (max-width: 760px) {
    .hilara-product-commercial-summary {
        grid-column: 2;
        width: 100%;
        margin-left: 0;
        gap: 22px;
    }

    .hilara-product-commercial-summary > span { min-width: 0; }
    .hilara-product-row-actions { grid-column: 2; justify-content: flex-start; }
    .hilara-product-commercial-form { grid-template-columns: 1fr; }
}

/* Stock */
.hilara-stock-page { display: grid; gap: 24px; }
.hilara-stock-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.hilara-stock-summary article { min-height: 92px; padding: 18px 20px; border: 1px solid var(--hilara-border); border-radius: 16px; background: #fff; box-shadow: 0 8px 25px rgba(7,59,103,.04); display: grid; gap: 5px; }
.hilara-stock-summary span { color: var(--hilara-text-muted); font-size: .78rem; font-weight: 700; }
.hilara-stock-summary strong { color: var(--hilara-brand-strong); font-size: 1.45rem; }
.hilara-stock-list { display: grid; }
.hilara-stock-row { min-height: 88px; padding: 15px 18px; border-bottom: 1px solid var(--hilara-border); display: grid; grid-template-columns: 44px minmax(220px,1fr) minmax(105px,auto) minmax(105px,auto); align-items: center; gap: 14px; }
.hilara-stock-row:last-child { border-bottom: 0; }
.hilara-stock-quantity { display: grid; gap: 4px; text-align: right; }
.hilara-stock-quantity small { color: var(--hilara-text-muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.hilara-stock-quantity strong { color: var(--hilara-text); font-size: .95rem; }
.hilara-stock-quantity.is-available strong { color: var(--hilara-brand-strong); }
@media (max-width: 700px) {
    .hilara-stock-summary { grid-template-columns: 1fr; }
    .hilara-stock-row { grid-template-columns: 42px minmax(0,1fr) auto; }
    .hilara-stock-quantity { grid-column: 2; text-align: left; }
    .hilara-stock-quantity.is-available { grid-column: 3; grid-row: 2; text-align: right; }
}

/* Stock manual entry */
.hilara-stock-row { grid-template-columns: 44px minmax(220px,1fr) minmax(105px,auto) minmax(105px,auto) auto; }
.hilara-stock-entry-button { min-height: 38px; padding: 0 13px; border: 1px solid rgba(8,184,199,.48); border-radius: 9px; background: #eafafb; color: #075f73; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.hilara-stock-entry-button:hover { background: #dcf6f8; border-color: rgba(8,184,199,.68); }
.hilara-stock-entry-modal { max-width: 560px; }
.hilara-stock-entry-form { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hilara-stock-entry-form .hilara-product-field--wide { grid-column: 1 / -1; }
.hilara-stock-default-warehouse { min-height: 46px; display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--hilara-border); border-radius: 12px; background: #f8fbfc; color: var(--hilara-text); font-weight: 700; }
@media (max-width: 760px) {
  .hilara-stock-row { grid-template-columns: 42px minmax(0,1fr) auto; }
  .hilara-stock-entry-button { grid-column: 2 / -1; justify-self: start; }
  .hilara-stock-entry-form { grid-template-columns: 1fr; }
  .hilara-stock-entry-form .hilara-product-field--wide { grid-column: auto; }
}

/* Stock adjustment */
.hilara-stock-actions { display: flex; align-items: center; gap: 8px; }
.hilara-stock-adjust-button { min-height: 38px; padding: 0 13px; border: 1px solid #efd29a; border-radius: 9px; background: #fff8e9; color: #875b12; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.hilara-stock-adjust-button:hover { background: #fff2d6; border-color: #e6bd6d; }
.hilara-stock-current-value { margin-top: 20px; padding: 13px 15px; border: 1px solid var(--hilara-border); border-radius: 12px; background: #f8fbfc; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hilara-stock-current-value span { color: var(--hilara-text-muted); font-size: .8rem; font-weight: 700; }
.hilara-stock-current-value strong { color: var(--hilara-brand-strong); font-size: 1.05rem; }
@media (max-width: 760px) {
  .hilara-stock-actions { grid-column: 2 / -1; flex-wrap: wrap; }
  .hilara-stock-entry-button { grid-column: auto; }
}

/* Stock · historial de movimientos */
.hilara-products-heading { align-items: flex-start; }
.hilara-stock-history-modal { width: min(760px, calc(100vw - 32px)); max-width: 760px; }
.hilara-stock-history-list { margin-top: 22px; max-height: min(58vh, 520px); overflow: auto; border: 1px solid var(--hilara-border); border-radius: 14px; }
.hilara-stock-history-row { padding: 14px 16px; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(70px,auto); align-items: center; gap: 14px; border-bottom: 1px solid var(--hilara-border); }
.hilara-stock-history-row:last-child { border-bottom: 0; }
.hilara-stock-history-main { min-width: 0; display: grid; gap: 3px; }
.hilara-stock-history-main strong { color: var(--hilara-text); font-size: .9rem; }
.hilara-stock-history-main span, .hilara-stock-history-main small { color: var(--hilara-text-muted); font-size: .74rem; }
.hilara-stock-history-kind { padding: 5px 9px; border-radius: 999px; background: #f4f8fa; color: var(--hilara-text-muted); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.hilara-stock-history-quantity { text-align: right; font-size: .92rem; }
.hilara-stock-history-quantity.is-positive { color: #087d70; }
.hilara-stock-history-quantity.is-negative { color: #a5483e; }
.hilara-stock-history-empty { margin-top: 22px; padding: 28px 16px; border: 1px dashed var(--hilara-border); border-radius: 14px; color: var(--hilara-text-muted); text-align: center; font-weight: 700; }
@media (max-width: 700px) {
  .hilara-products-heading { gap: 14px; }
  .hilara-stock-history-row { grid-template-columns: minmax(0,1fr) auto; }
  .hilara-stock-history-kind { grid-column: 1; justify-self: start; }
  .hilara-stock-history-quantity { grid-column: 2; grid-row: 1 / span 2; }
}


/* Compras · base visual */
.hilara-purchases-page { display: grid; gap: 24px; }
.hilara-purchases-add { min-height: 42px; padding: 0 15px; border: 1px solid rgba(8,184,199,.42); border-radius: 10px; background: #eafafb; color: #075f73; font: inherit; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.hilara-purchases-add:disabled { opacity: .72; cursor: default; }
.hilara-purchases-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.hilara-purchases-summary article { min-height: 92px; padding: 18px 20px; border: 1px solid var(--hilara-border); border-radius: 16px; background: #fff; box-shadow: 0 8px 25px rgba(7,59,103,.04); display: grid; gap: 5px; }
.hilara-purchases-summary span { color: var(--hilara-text-muted); font-size: .78rem; font-weight: 700; }
.hilara-purchases-summary strong { color: var(--hilara-brand-strong); font-size: 1.45rem; }
.hilara-purchases-empty { min-height: 310px; }
@media (max-width: 700px) {
  .hilara-purchases-summary { grid-template-columns: 1fr; }
  .hilara-purchases-add { width: 100%; justify-content: center; }
}

/* Compras · inicio del flujo */
.hilara-purchases-add:not(:disabled) { cursor: pointer; }
.hilara-purchases-add:not(:disabled):hover { background: #dff7f9; border-color: rgba(8,184,199,.62); }
.hilara-purchase-modal { width: min(560px, calc(100vw - 28px)); }
.hilara-purchase-field { display: grid; gap: 7px; margin-top: 16px; }
.hilara-purchase-field > span { color: var(--hilara-brand-strong); font-size: .78rem; font-weight: 800; }
.hilara-purchase-field input, .hilara-purchase-field select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--hilara-border); border-radius: 11px; background: #fff; color: var(--hilara-text); font: inherit; outline: none; }
.hilara-purchase-field input:focus, .hilara-purchase-field select:focus { border-color: rgba(8,184,199,.62); box-shadow: 0 0 0 3px rgba(8,184,199,.10); }
.hilara-purchase-provider-empty { margin-top: 14px; padding: 14px 15px; border: 1px solid #dceef1; border-radius: 12px; background: #f5fcfd; display: grid; gap: 3px; }
.hilara-purchase-provider-empty strong { color: var(--hilara-brand-strong); font-size: .84rem; }
.hilara-purchase-provider-empty span, .hilara-purchase-provider-state { color: var(--hilara-text-muted); font-size: .8rem; }
.hilara-purchase-provider-state { padding: 18px 0 4px; }
.hilara-purchase-new-supplier { margin-top: 12px; padding: 0; border: 0; background: transparent; color: #087f91; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.hilara-purchase-supplier-form { display: grid; }
.hilara-purchase-form-title { margin-top: 16px; display: grid; gap: 3px; }
.hilara-purchase-form-title strong { color: var(--hilara-brand-strong); }
.hilara-purchase-form-title span { color: var(--hilara-text-muted); font-size: .8rem; }
.hilara-purchase-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hilara-purchase-error { margin-top: 14px; padding: 11px 13px; border: 1px solid #f3c8c8; border-radius: 10px; background: #fff7f7; color: #9b3535; font-size: .8rem; }
@media (max-width: 620px) { .hilara-purchase-two-columns { grid-template-columns: 1fr; gap: 0; } }

/* Compras · productos y cantidades */
.hilara-purchase-products-step { display: grid; gap: 14px; }
.hilara-purchase-step-summary { margin-top: 14px; padding: 11px 14px; border: 1px solid #dceef1; border-radius: 11px; background: #f5fcfd; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.hilara-purchase-step-summary span { color: var(--hilara-text-muted); font-size: .76rem; font-weight: 700; }
.hilara-purchase-step-summary strong { color: var(--hilara-brand-strong); font-size: .84rem; text-align: right; }
.hilara-purchase-product-search { margin-top: 0; }
.hilara-purchase-product-list { max-height: min(46vh, 430px); overflow: auto; border: 1px solid var(--hilara-border); border-radius: 13px; background: #fff; }
.hilara-purchase-product-row { min-height: 72px; padding: 11px 13px; border-bottom: 1px solid var(--hilara-border); display: grid; grid-template-columns: minmax(0,1fr) 96px; align-items: center; gap: 14px; transition: background .14s ease; }
.hilara-purchase-product-row:last-child { border-bottom: 0; }
.hilara-purchase-product-row.is-selected { background: #f2fbfc; }
.hilara-purchase-product-main { min-width: 0; display: grid; gap: 3px; }
.hilara-purchase-product-main strong { color: var(--hilara-text); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hilara-purchase-product-main span { color: var(--hilara-text-muted); font-size: .72rem; }
.hilara-purchase-quantity { display: grid; gap: 4px; }
.hilara-purchase-quantity span { color: var(--hilara-text-muted); font-size: .66rem; font-weight: 750; }
.hilara-purchase-quantity input { width: 100%; min-height: 38px; padding: 0 9px; border: 1px solid var(--hilara-border); border-radius: 9px; background: #fff; color: var(--hilara-text); font: inherit; text-align: right; outline: none; }
.hilara-purchase-quantity input:focus { border-color: rgba(8,184,199,.62); box-shadow: 0 0 0 3px rgba(8,184,199,.10); }
.hilara-purchase-selected-count { padding: 10px 13px; border-radius: 10px; background: #f7fafb; display: flex; align-items: center; justify-content: space-between; }
.hilara-purchase-selected-count span { color: var(--hilara-text-muted); font-size: .76rem; font-weight: 700; }
.hilara-purchase-selected-count strong { color: var(--hilara-brand-strong); }
@media (max-width: 620px) {
  .hilara-purchase-product-row { grid-template-columns: minmax(0,1fr) 82px; gap: 10px; }
}


/* Compras · revisión */
.hilara-purchase-review-step { display: grid; gap: 14px; }
.hilara-purchase-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hilara-purchase-review-heading > div { display: grid; gap: 3px; }
.hilara-purchase-review-heading strong { color: var(--hilara-brand-strong); font-size: .9rem; }
.hilara-purchase-review-heading span { color: var(--hilara-text-muted); font-size: .76rem; }
.hilara-purchase-review-count { padding: 5px 9px; border-radius: 999px; background: #eafafb; color: #075f73 !important; font-weight: 800; white-space: nowrap; }
.hilara-purchase-review-list { max-height: min(44vh, 410px); overflow: auto; border: 1px solid var(--hilara-border); border-radius: 13px; background: #fff; }
.hilara-purchase-review-row { min-height: 66px; padding: 11px 13px; border-bottom: 1px solid var(--hilara-border); display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 16px; }
.hilara-purchase-review-row:last-child { border-bottom: 0; }
.hilara-purchase-review-row > div { min-width: 0; display: grid; gap: 3px; }
.hilara-purchase-review-row > div strong { color: var(--hilara-text); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hilara-purchase-review-row > div span { color: var(--hilara-text-muted); font-size: .71rem; }
.hilara-purchase-review-quantity { min-width: 52px; text-align: right; color: var(--hilara-brand-strong); font-size: .9rem; }
.hilara-purchase-review-quantity::before { content: "Cant. "; color: var(--hilara-text-muted); font-size: .66rem; font-weight: 700; }
@media (max-width: 620px) {
  .hilara-purchase-review-heading { display: grid; }
  .hilara-purchase-review-count { justify-self: start; }
}

/* Loading estándar Hilara */
.hilara-loader {
    width: 100%;
    min-height: 82px;
    margin: 8px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hilara-loader-ring {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, #08b8c7 0deg 11deg, transparent 11deg 20deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
    animation: hilara-loader-spin .9s linear infinite;
}

@keyframes hilara-loader-spin {
    to { transform: rotate(360deg); }
}


@media (prefers-reduced-motion: reduce) {
    .hilara-loader-ring { animation-duration: 2.4s; }
}

/* Compras · selector de proveedor separado del flujo de compra */
.hilara-purchase-provider-modal {
    width: min(560px, calc(100vw - 28px));
}

/* Compras · confirmación de guardado */
.hilara-purchase-saved-state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 28px 18px 10px; }
.hilara-purchase-saved-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #eafafb; border: 1px solid rgba(8,184,199,.35); color: #087d8d; font-size: 1.35rem; font-weight: 900; }
.hilara-purchase-saved-state strong { color: var(--hilara-brand-strong); font-size: 1.12rem; }
.hilara-purchase-saved-state span { max-width: 390px; color: var(--hilara-text-muted); font-size: .88rem; }
.hilara-purchase-saved-state .hilara-modal-primary { margin-top: 10px; min-width: 110px; }

/* Compras · listado real */
.hilara-purchases-list { display: grid; }
.hilara-purchase-list-row { min-height: 78px; padding: 14px 16px; border-top: 1px solid var(--hilara-border); display: grid; grid-template-columns: minmax(0,1fr) 86px auto; align-items: center; gap: 18px; }
.hilara-purchase-list-row:first-child { border-top: 0; }
.hilara-purchase-list-main { min-width: 0; display: grid; gap: 4px; }
.hilara-purchase-list-main strong { color: var(--hilara-text); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hilara-purchase-list-main span { color: var(--hilara-text-muted); font-size: .73rem; }
.hilara-purchase-list-items { display: grid; gap: 3px; text-align: right; }
.hilara-purchase-list-items span { color: var(--hilara-text-muted); font-size: .67rem; font-weight: 700; }
.hilara-purchase-list-items strong { color: var(--hilara-brand-strong); font-size: .88rem; }
.hilara-purchase-status { justify-self: end; padding: 6px 10px; border: 1px solid transparent; border-radius: 999px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.hilara-purchase-status.is-pending { background: #fff8e8; border-color: #f3dfae; color: #8a6214; }
.hilara-purchase-status.is-partial { background: #eef8fb; border-color: #cce8ee; color: #17697a; }
.hilara-purchase-status.is-received { background: #edf9f4; border-color: #cbe9db; color: #24745c; }
.hilara-purchase-status.is-cancelled { background: #fff4f4; border-color: #f0d1d1; color: #985050; }
@media (max-width: 700px) {
  .hilara-purchase-list-row { grid-template-columns: minmax(0,1fr) auto; gap: 10px 14px; }
  .hilara-purchase-list-items { grid-column: 2; grid-row: 1; }
  .hilara-purchase-status { grid-column: 1 / -1; justify-self: start; }
}
\n\n/* Planes · incentivo suave y reutilizable */\n.hilara-app-context-wrap { display: flex; align-items: center; gap: 12px; }\n.hilara-plan-badge { min-height: 34px; padding: 5px 10px; border: 1px solid rgba(8,184,199,.34); border-radius: 10px; background: #eefbfc; color: #075f73; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }\n.hilara-plan-badge:hover { transform: translateY(-1px); background: #e5f9fb; box-shadow: 0 7px 18px rgba(8,184,199,.10); }\n.hilara-plan-badge span { font-size: .68rem; font-weight: 900; letter-spacing: .055em; }\n.hilara-plan-badge small { padding-left: 7px; border-left: 1px solid rgba(7,95,115,.18); color: #547987; font-size: .66rem; font-weight: 750; }\n.hilara-plans-modal { width: min(100%, 780px); }\n.hilara-plans-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }\n.hilara-plan-card { min-width: 0; padding: 17px; border: 1px solid var(--hilara-border); border-radius: 16px; background: #fff; box-shadow: 0 7px 22px rgba(7,59,103,.035); }\n.hilara-plan-card.is-current { background: #f8fbfc; }\n.hilara-plan-card.is-plus { border-color: rgba(8,184,199,.28); background: #f3fcfd; }\n.hilara-plan-card.is-pro { border-color: rgba(7,59,103,.16); background: #f7f9fc; }\n.hilara-plan-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }\n.hilara-plan-card-top strong { color: var(--hilara-brand-strong); font-size: 1rem; }\n.hilara-plan-card-top span { padding: 4px 7px; border-radius: 999px; background: #e8f7f8; color: #087b8b; font-size: .58rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }\n.hilara-plan-card.is-current .hilara-plan-card-top span { background: #edf2f5; color: #617581; }\n.hilara-plan-card p { margin: 13px 0 8px; color: var(--hilara-text); font-size: .78rem; font-weight: 700; line-height: 1.45; }\n.hilara-plan-card small { display: block; color: var(--hilara-text-muted); font-size: .7rem; line-height: 1.55; }\n.hilara-plans-note { margin-top: 14px; padding: 13px 15px; border-radius: 13px; background: #f6fafb; color: var(--hilara-text-muted); font-size: .75rem; line-height: 1.5; }\n.hilara-plans-note strong { color: var(--hilara-brand-strong); }\n@media (max-width: 760px) {\n  .hilara-plan-badge small { display: none; }\n  .hilara-plans-grid { grid-template-columns: 1fr; }\n}\n@media (max-width: 520px) {\n  .hilara-app-context-wrap { gap: 7px; min-width: 0; }\n  .hilara-plan-badge { min-height: 30px; padding: 4px 8px; }\n}\n
/* Planes · acceso discreto en navegación */
.hilara-plan-sidebar-card {
    width: calc(100% - 24px);
    margin: 14px 12px 12px;
    padding: 14px 15px;
    border: 1px solid rgba(8, 184, 199, .22);
    border-radius: 15px;
    background: linear-gradient(145deg, #f5fcfd 0%, #eef9fb 100%);
    text-align: left;
    font: inherit;
    cursor: pointer;
    display: grid;
    gap: 4px;
    box-shadow: 0 7px 20px rgba(7, 59, 103, .035);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.hilara-plan-sidebar-card:hover {
    transform: translateY(-1px);
    border-color: rgba(8, 184, 199, .38);
    box-shadow: 0 9px 22px rgba(7, 59, 103, .06);
}
.hilara-plan-sidebar-kicker {
    color: #078b9c;
    font-size: .61rem;
    font-weight: 900;
    letter-spacing: .07em;
}
.hilara-plan-sidebar-card strong { color: var(--hilara-brand-strong); font-size: .79rem; line-height: 1.3; }
.hilara-plan-sidebar-card small { color: var(--hilara-text-muted); font-size: .66rem; line-height: 1.4; }
.hilara-plan-sidebar-card em { margin-top: 4px; color: #087f90; font-size: .68rem; font-weight: 850; font-style: normal; }
.hilara-mobile-plan-link { width: 100%; border: 0; background: #f2fbfc; color: inherit; font: inherit; text-align: left; }

@media (max-width: 900px) {
    .hilara-plan-sidebar-card { display: none; }
}


/* Planes · acceso contextual junto al comercio activo */
.hilara-commerce-plan-pill {
    width: fit-content;
    max-width: 100%;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid #bfe8d7;
    border-radius: 999px;
    background: #f2fbf7;
    color: #087a58;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.hilara-commerce-plan-pill:hover {
    background: #ebf9f3;
    border-color: #9edcc7;
    box-shadow: 0 5px 14px rgba(8, 122, 88, .07);
}
.hilara-commerce-plan-dot { width: 7px; height: 7px; border-radius: 50%; background: #17a673; flex: 0 0 auto; }
.hilara-commerce-plan-pill span:not(.hilara-commerce-plan-dot):not(.hilara-commerce-plan-separator),
.hilara-commerce-plan-pill strong { font-size: .67rem; font-weight: 800; }
.hilara-commerce-plan-separator { color: #7bbca6; font-size: .7rem; }
.hilara-commerce-plan-pill em { color: #087f90; font-size: .64rem; font-weight: 850; font-style: normal; margin-left: 2px; }
.hilara-app-context-name { margin-top: 2px; }
@media (max-width: 600px) {
    .hilara-commerce-plan-pill { padding: 4px 8px; gap: 4px; }
    .hilara-commerce-plan-pill em { display: none; }
}

/* Clientes · base visual */
.hilara-clients-page { display: grid; gap: 24px; }
.hilara-clients-add {
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid rgba(8, 184, 199, .42);
    border-radius: 10px;
    background: #eafafb;
    color: #075f73;
    font: inherit;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}
.hilara-clients-add:disabled { opacity: .72; cursor: default; }
.hilara-clients-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hilara-clients-summary article {
    min-height: 92px;
    padding: 18px 20px;
    border: 1px solid var(--hilara-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(7, 59, 103, .04);
    display: grid;
    gap: 5px;
}
.hilara-clients-summary span { color: var(--hilara-text-muted); font-size: .78rem; font-weight: 700; }
.hilara-clients-summary strong { color: var(--hilara-brand-strong); font-size: 1.45rem; }
.hilara-clients-empty { min-height: 310px; }
@media (max-width: 700px) {
    .hilara-clients-summary { grid-template-columns: 1fr; }
    .hilara-clients-add { width: 100%; }
}

/* Clientes · alta real y listado */
.hilara-clients-add { cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.hilara-clients-add:hover { background: #ddf7f8; border-color: rgba(8, 184, 199, .62); }
.hilara-clients-list { display: grid; }
.hilara-client-row {
    min-height: 74px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hilara-border);
    display: flex;
    align-items: center;
    gap: 13px;
}
.hilara-client-row:last-child { border-bottom: 0; }
.hilara-client-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #e9f9fb;
    color: #08798a;
    display: grid;
    place-items: center;
    font-size: .85rem;
    font-weight: 900;
    flex: 0 0 auto;
}
.hilara-client-main { min-width: 0; display: grid; gap: 4px; }
.hilara-client-main strong { color: var(--hilara-brand-strong); font-size: .88rem; }
.hilara-client-main span { color: var(--hilara-text-muted); font-size: .75rem; overflow-wrap: anywhere; }
.hilara-client-modal { max-width: 520px; }
@media (max-width: 700px) {
    .hilara-client-row { padding: 13px 12px; }
}

/* =========================================================
   HILARA · SISTEMA GLOBAL DE BOTONES
   Usar estas variantes en toda la aplicación.
   ========================================================= */
.hilara-btn,
.hilara-modal-primary,
.hilara-modal-secondary,
.hilara-btn--danger,
.hilara-btn--warning {
    appearance: none;
    -webkit-appearance: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.hilara-btn--primary,
.hilara-modal-primary {
    background: #e7f8fb;
    border-color: #8ddce8;
    color: #075d70;
    box-shadow: 0 3px 10px rgba(16, 164, 188, .10);
}

.hilara-btn--primary:hover:not(:disabled),
.hilara-modal-primary:hover:not(:disabled) {
    background: #d8f3f7;
    border-color: #5fcbd9;
    color: #064f60;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(16, 164, 188, .14);
}

.hilara-btn--secondary,
.hilara-modal-secondary {
    background: #ffffff;
    border-color: #cbd8e5;
    color: #334e68;
    box-shadow: 0 2px 7px rgba(15, 45, 70, .05);
}

.hilara-btn--secondary:hover:not(:disabled),
.hilara-modal-secondary:hover:not(:disabled) {
    background: #f4f8fb;
    border-color: #aebfce;
    color: #163b5c;
    transform: translateY(-1px);
}

.hilara-btn--danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #b4233b;
}

.hilara-btn--danger:hover:not(:disabled) {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #9f1239;
    transform: translateY(-1px);
}

.hilara-btn--warning {
    background: #fff8e7;
    border-color: #f5d78e;
    color: #8a5a00;
}

.hilara-btn--warning:hover:not(:disabled) {
    background: #fff1cc;
    border-color: #e9c35d;
    color: #714900;
    transform: translateY(-1px);
}

.hilara-btn:focus-visible,
.hilara-modal-primary:focus-visible,
.hilara-modal-secondary:focus-visible,
.hilara-btn--danger:focus-visible,
.hilara-btn--warning:focus-visible {
    outline: 3px solid rgba(34, 197, 219, .22);
    outline-offset: 2px;
}

.hilara-btn:disabled,
.hilara-modal-primary:disabled,
.hilara-modal-secondary:disabled,
.hilara-btn--danger:disabled,
.hilara-btn--warning:disabled {
    opacity: .52;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 640px) {
    .hilara-product-modal-actions .hilara-modal-primary,
    .hilara-product-modal-actions .hilara-modal-secondary {
        min-height: 46px;
    }
}

/* Hilara · normalización de acciones existentes */
.hilara-btn--warning {
    background: #fff8e7;
    border-color: #f4d58d;
    color: #8a5a00;
}
.hilara-btn--warning:hover:not(:disabled) {
    background: #fff2cf;
    border-color: #e8bd58;
    color: #704900;
    transform: translateY(-1px);
}
.hilara-btn:disabled,
.hilara-modal-primary:disabled,
.hilara-modal-secondary:disabled {
    opacity: .58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.hilara-btn:focus-visible,
.hilara-modal-primary:focus-visible,
.hilara-modal-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(8,184,199,.16);
}

/* Clientes · acción de edición */
.hilara-client-main { flex: 1 1 auto; }
.hilara-client-edit { margin-left: auto; flex: 0 0 auto; }
@media (max-width: 700px) {
    .hilara-client-edit { min-width: auto; padding-inline: 14px; }
}


/* Clientes · ficha básica */
.hilara-client-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hilara-client-view, .hilara-client-edit { min-width: 72px; }
.hilara-client-detail-modal { max-width: 620px; }
.hilara-client-detail-body { display: grid; gap: 18px; }
.hilara-client-detail-identity { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--hilara-border); border-radius: 16px; background: #f8fcfd; }
.hilara-client-detail-avatar { width: 48px; height: 48px; border-radius: 14px; background: #e4f8fa; color: #08798a; display: grid; place-items: center; font-weight: 900; flex: 0 0 auto; }
.hilara-client-detail-identity > div:last-child { min-width: 0; display: grid; gap: 4px; }
.hilara-client-detail-identity strong { color: var(--hilara-brand-strong); font-size: 1rem; }
.hilara-client-detail-identity span { color: var(--hilara-text-muted); font-size: .76rem; }
.hilara-client-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.hilara-client-detail-grid article { min-width: 0; padding: 15px 16px; border: 1px solid var(--hilara-border); border-radius: 14px; background: #fff; display: grid; gap: 5px; }
.hilara-client-detail-grid span { color: var(--hilara-text-muted); font-size: .72rem; font-weight: 700; }
.hilara-client-detail-grid strong { color: var(--hilara-brand-strong); font-size: .86rem; overflow-wrap: anywhere; }
.hilara-client-detail-future { padding: 15px 16px; border: 1px dashed #b9dce2; border-radius: 14px; background: #f8fcfd; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hilara-client-detail-future > div { display: grid; gap: 4px; }
.hilara-client-detail-future strong { color: var(--hilara-brand-strong); font-size: .82rem; }
.hilara-client-detail-future div span { color: var(--hilara-text-muted); font-size: .73rem; line-height: 1.45; }
.hilara-client-detail-coming { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #e9f9fb; color: #08798a; font-size: .65rem; font-weight: 850; text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 700px) {
    .hilara-client-row { align-items: flex-start; flex-wrap: wrap; }
    .hilara-client-main { flex: 1 1 calc(100% - 58px); }
    .hilara-client-actions { width: 100%; margin-left: 53px; }
    .hilara-client-actions .hilara-btn { flex: 1 1 0; min-width: 0; }
    .hilara-client-detail-grid { grid-template-columns: 1fr; }
    .hilara-client-detail-future { align-items: flex-start; flex-direction: column; }
}

/* Hilara Gestión · Ventas / POS base */
.hilara-sales-page { display: grid; gap: 22px; }
.hilara-sales-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.hilara-sales-heading h1 { margin: 4px 0 6px; color: var(--hilara-brand-strong); font-size: clamp(1.85rem,3vw,2.45rem); letter-spacing: -.035em; }
.hilara-sales-heading p { margin: 0; color: var(--hilara-text-muted); }
.hilara-sales-draft { padding: 7px 11px; border: 1px solid #bfe7dc; border-radius: 999px; background: #effbf7; color: #23745f; font-size: .72rem; font-weight: 800; }
.hilara-sales-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(330px,.75fr); gap: 18px; align-items: start; }
.hilara-sales-catalog, .hilara-sales-ticket { border: 1px solid var(--hilara-border); border-radius: 20px; background: #fff; box-shadow: 0 8px 24px rgba(7,59,103,.045); }
.hilara-sales-catalog { padding: 18px; }
.hilara-sales-client-row { min-height: 62px; padding: 10px 12px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #e1eaef; border-radius: 14px; background: #f9fcfd; }
.hilara-sales-client-row > div { display: grid; gap: 2px; }
.hilara-sales-label { color: var(--hilara-text-muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.hilara-sales-client-row strong { color: var(--hilara-brand-strong); font-size: .9rem; }
.hilara-sales-customer-select { width: min(250px,48%); min-height: 40px; padding: 0 34px 0 11px; border: 1px solid #cbd8e5; border-radius: 10px; background: #fff; color: #334e68; font: inherit; font-size: .8rem; }
.hilara-sales-search { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid #8fa8b8; border-radius: 13px; background: #fff; }
.hilara-sales-search:focus-within { border-color: #42c4d2; box-shadow: 0 0 0 4px rgba(8,184,199,.10); }
.hilara-sales-search span { color: #607d8b; font-size: 1.15rem; }
.hilara-sales-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--hilara-text); font: inherit; font-size: .9rem; }
.hilara-sales-search-help { margin: 6px 3px 14px; color: #8aa0af; font-size: .68rem; }
.hilara-sales-product-list { display: grid; gap: 7px; }
.hilara-sales-product { width: 100%; min-height: 62px; padding: 9px 10px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto 30px; align-items: center; gap: 10px; border: 1px solid #e4ecef; border-radius: 13px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: .14s ease; }
.hilara-sales-product:hover:not(:disabled) { border-color: #9edfe6; background: #f8feff; transform: translateY(-1px); }
.hilara-sales-product:disabled { opacity: .55; cursor: default; }
.hilara-sales-product-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-weight: 850; }
.hilara-sales-product-copy { min-width: 0; display: grid; gap: 3px; }
.hilara-sales-product-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hilara-text); font-size: .84rem; }
.hilara-sales-product-copy small { color: var(--hilara-text-muted); font-size: .68rem; }
.hilara-sales-product-price { color: var(--hilara-brand-strong); font-size: .83rem; font-weight: 850; white-space: nowrap; }
.hilara-sales-product-add { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #e7f8fb; color: #075d70; font-weight: 900; }
.hilara-sales-state { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; color: var(--hilara-text-muted); }
.hilara-sales-state strong { color: var(--hilara-brand-strong); }
.hilara-sales-state span { font-size: .8rem; }
.hilara-sales-ticket { position: sticky; top: 86px; overflow: hidden; }
.hilara-sales-ticket-head { min-height: 65px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e8eef2; }
.hilara-sales-ticket-head > div { display: grid; gap: 2px; }
.hilara-sales-ticket-head span { color: var(--hilara-text-muted); font-size: .7rem; font-weight: 750; }
.hilara-sales-ticket-head strong { color: var(--hilara-brand-strong); font-size: .9rem; }
.hilara-sales-clear { border: 0; background: transparent; color: #708697; font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer; }
.hilara-sales-cart-empty { min-height: 245px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; }
.hilara-sales-cart-empty > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #f0f7f9; color: #648293; }
.hilara-sales-cart-empty strong { color: var(--hilara-brand-strong); font-size: .88rem; }
.hilara-sales-cart-empty small { max-width: 220px; color: var(--hilara-text-muted); line-height: 1.45; }
.hilara-sales-cart-list { max-height: 390px; overflow: auto; }
.hilara-sales-cart-line { padding: 12px 15px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; border-bottom: 1px solid #edf2f4; }
.hilara-sales-cart-name { min-width: 0; display: grid; gap: 2px; }
.hilara-sales-cart-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hilara-text); font-size: .78rem; }
.hilara-sales-cart-name small { color: var(--hilara-text-muted); font-size: .65rem; }
.hilara-sales-qty { display: flex; align-items: center; gap: 8px; }
.hilara-sales-qty button { width: 28px; height: 28px; border: 1px solid #cbd8e5; border-radius: 9px; background: #fff; color: #31536c; font: inherit; font-weight: 850; cursor: pointer; }
.hilara-sales-qty strong { min-width: 18px; text-align: center; font-size: .76rem; }
.hilara-sales-line-total { grid-column: 1 / -1; justify-self: end; color: var(--hilara-brand-strong); font-size: .78rem; }
.hilara-sales-total { padding: 16px; display: flex; align-items: end; justify-content: space-between; gap: 12px; border-top: 1px solid #e5ecef; background: #fbfdfd; }
.hilara-sales-total span { color: var(--hilara-text-muted); font-size: .8rem; font-weight: 750; }
.hilara-sales-total strong { color: var(--hilara-brand-strong); font-size: 1.55rem; letter-spacing: -.03em; }
.hilara-sales-charge { width: calc(100% - 32px); margin: 0 16px 8px; min-height: 48px; }
.hilara-sales-demo-note { display: block; padding: 0 16px 15px; color: #8aa0af; font-size: .64rem; text-align: center; }
@media (max-width: 980px) { .hilara-sales-layout { grid-template-columns: 1fr; } .hilara-sales-ticket { position: static; } }
@media (max-width: 640px) {
  .hilara-sales-page { gap: 16px; }
  .hilara-sales-heading { align-items: start; }
  .hilara-sales-draft { display: none; }
  .hilara-sales-catalog { padding: 12px; border-radius: 16px; }
  .hilara-sales-client-row { align-items: stretch; flex-direction: column; gap: 8px; }
  .hilara-sales-customer-select { width: 100%; }
  .hilara-sales-product { grid-template-columns: 36px minmax(0,1fr) auto 28px; gap: 8px; }
  .hilara-sales-product-copy small { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hilara-sales-ticket { border-radius: 16px; }
}

/* Ventas · scanner físico + cámara móvil */
.hilara-sales-search-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: stretch; }
.hilara-sales-camera { display: none; min-height: 52px; padding-inline: 15px; }
@media (max-width: 980px) {
  .hilara-sales-camera { display: inline-flex; }
}
.hilara-sales-camera > span:first-child { font-size: 1rem; }
.hilara-sales-scan-message { margin: -5px 3px 12px; padding: 8px 10px; border-radius: 10px; font-size: .72rem; font-weight: 750; }
.hilara-sales-scan-message.is-success { background: #effbf7; color: #23745f; border: 1px solid #bfe7dc; }
.hilara-sales-scan-message.is-warning { background: #fff8e7; color: #8a5a00; border: 1px solid #f4d58d; }
.hilara-sales-camera-modal { max-width: 520px; }
.hilara-sales-camera-body { position: relative; margin: 0 18px 16px; min-height: 300px; overflow: hidden; border-radius: 16px; background: #0b1720; }
.hilara-sales-camera-body video { display: block; width: 100%; min-height: 300px; max-height: 55vh; object-fit: cover; }
.hilara-sales-camera-guide { pointer-events: none; position: absolute; inset: 0; display: grid; place-items: center; }
.hilara-sales-camera-guide span { width: min(78%,340px); height: 112px; border: 2px solid rgba(126,232,222,.9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(5,18,27,.22); }
.hilara-sales-camera-body p { position: absolute; left: 12px; right: 12px; bottom: 10px; margin: 0; padding: 8px 10px; border-radius: 10px; background: rgba(5,18,27,.72); color: #fff; font-size: .72rem; text-align: center; }
@media (max-width: 640px) {
  .hilara-sales-search-row { grid-template-columns: minmax(0,1fr) 52px; }
  .hilara-sales-camera { width: 52px; padding: 0; }
  .hilara-sales-camera > span:last-child { display: none; }
  .hilara-sales-camera-body { min-height: 330px; margin-inline: 12px; }
  .hilara-sales-camera-body video { min-height: 330px; }
}


/* Ventas: resultado de confirmación */
.hilara-sales-sale-message { margin: 0 16px 15px; padding: 10px 12px; border-radius: 12px; font-size: .78rem; font-weight: 700; text-align: center; }
.hilara-sales-sale-message.is-success { color: #087f5b; background: #ecfdf5; border: 1px solid #a7f3d0; }
.hilara-sales-sale-message.is-error { color: #b42318; background: #fff1f0; border: 1px solid #fecaca; }

/* Ventas · medio de pago simple */
.hilara-sales-payment-modal { max-width: 560px; }
.hilara-sales-payment-total { margin: 0 18px 14px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #dce9ed; border-radius: 14px; background: #f8fcfd; }
.hilara-sales-payment-total span { color: var(--hilara-text-muted); font-size: .78rem; font-weight: 750; }
.hilara-sales-payment-total strong { color: var(--hilara-brand-strong); font-size: 1.35rem; letter-spacing: -.025em; }
.hilara-sales-payment-options { margin: 0 18px; display: grid; gap: 8px; }
.hilara-sales-payment-option { width: 100%; min-height: 62px; padding: 10px 12px; display: grid; grid-template-columns: 40px minmax(0,1fr) 28px; align-items: center; gap: 11px; border: 1px solid #dce7ec; border-radius: 13px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: .14s ease; }
.hilara-sales-payment-option:hover { border-color: #9edfe6; background: #f9feff; }
.hilara-sales-payment-option.is-selected { border-color: #54cbd5; background: #effbfd; box-shadow: 0 0 0 3px rgba(8,184,199,.08); }
.hilara-sales-payment-option-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-size: .82rem; font-weight: 900; }
.hilara-sales-payment-option > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.hilara-sales-payment-option strong { color: var(--hilara-brand-strong); font-size: .82rem; }
.hilara-sales-payment-option small { color: var(--hilara-text-muted); font-size: .68rem; }
.hilara-sales-payment-check { color: #0796a5; font-size: 1rem; font-weight: 900; text-align: center; }
@media (max-width: 640px) {
  .hilara-sales-payment-total, .hilara-sales-payment-options { margin-inline: 12px; }
  .hilara-sales-payment-option { min-height: 58px; }
}

/* Caja · resumen simple del día */
.hilara-cash-page { display: grid; gap: 20px; }
.hilara-cash-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.hilara-cash-heading h1 { margin: 4px 0 5px; color: var(--hilara-brand-strong); font-size: clamp(1.55rem,2vw,2rem); letter-spacing: -.035em; }
.hilara-cash-heading p { margin: 0; color: var(--hilara-text-muted); font-size: .86rem; }
.hilara-cash-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.hilara-cash-main-card, .hilara-cash-method-card, .hilara-cash-sales { border: 1px solid #dfe9ed; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(25,64,86,.045); }
.hilara-cash-main-card { grid-row: span 2; padding: 22px; display: grid; align-content: center; gap: 5px; background: linear-gradient(145deg,#f4fcfd,#fff); }
.hilara-cash-main-card > span { color: var(--hilara-text-muted); font-size: .76rem; font-weight: 800; }
.hilara-cash-main-card > strong { color: var(--hilara-brand-strong); font-size: clamp(1.75rem,3vw,2.45rem); letter-spacing: -.045em; }
.hilara-cash-main-card > small { color: #78909e; font-size: .72rem; }
.hilara-cash-method-card { min-height: 92px; padding: 15px; display: flex; align-items: center; gap: 12px; }
.hilara-cash-method-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 12px; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); font-weight: 900; }
.hilara-cash-method-card > div { min-width: 0; display: grid; gap: 3px; }
.hilara-cash-method-card span { color: var(--hilara-text-muted); font-size: .7rem; font-weight: 750; }
.hilara-cash-method-card strong { color: var(--hilara-brand-strong); font-size: 1rem; }
.hilara-cash-sales { overflow: hidden; }
.hilara-cash-sales-head { min-height: 74px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e7eef1; }
.hilara-cash-sales-head > div { display: grid; gap: 2px; }
.hilara-cash-sales-head span { color: var(--hilara-text-muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.hilara-cash-sales-head h2 { margin: 0; color: var(--hilara-brand-strong); font-size: 1.05rem; }
.hilara-cash-sales-head > strong { min-width: 38px; height: 38px; padding-inline: 10px; display: grid; place-items: center; border-radius: 12px; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); }
.hilara-cash-list { display: grid; }
.hilara-cash-sale-row { min-height: 66px; padding: 11px 18px; display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid #edf2f4; }
.hilara-cash-sale-row:last-child { border-bottom: 0; }
.hilara-cash-sale-time { color: #688393; font-size: .75rem; font-weight: 800; }
.hilara-cash-sale-copy { min-width: 0; display: grid; gap: 2px; }
.hilara-cash-sale-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hilara-text); font-size: .82rem; }
.hilara-cash-sale-copy small { color: var(--hilara-text-muted); font-size: .68rem; }
.hilara-cash-sale-total { color: var(--hilara-brand-strong); font-size: .88rem; white-space: nowrap; }
.hilara-cash-empty, .hilara-cash-state { min-height: 245px; padding: 28px; display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; color: var(--hilara-text-muted); }
.hilara-cash-empty > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--hilara-brand-soft); color: var(--hilara-brand-strong); }
.hilara-cash-empty strong, .hilara-cash-state strong { color: var(--hilara-brand-strong); }
.hilara-cash-empty small, .hilara-cash-state span { margin-bottom: 8px; font-size: .76rem; }
@media (max-width: 850px) { .hilara-cash-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } .hilara-cash-main-card { grid-column: 1 / -1; grid-row: auto; } }
@media (max-width: 640px) { .hilara-cash-page { gap: 16px; } .hilara-cash-heading { align-items: stretch; flex-direction: column; } .hilara-cash-heading .hilara-btn { width: 100%; } .hilara-cash-summary { grid-template-columns: 1fr 1fr; gap: 8px; } .hilara-cash-main-card { padding: 18px; } .hilara-cash-method-card { min-height: 82px; padding: 11px; gap: 9px; } .hilara-cash-method-icon { width: 34px; height: 34px; flex-basis: 34px; } .hilara-cash-method-card strong { font-size: .88rem; } .hilara-cash-sale-row { grid-template-columns: 48px minmax(0,1fr) auto; padding-inline: 12px; gap: 8px; } }

/* Caja: apertura y cierre básico */
.hilara-cash-session-card { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:18px 20px; background:#fff; border:1px solid #dbe7ee; border-radius:18px; box-shadow:0 8px 24px rgba(11,66,104,.05); }
.hilara-cash-session-copy { display:grid; gap:4px; min-width:0; }
.hilara-cash-session-copy > strong { color:#123e5c; font-size:1rem; }
.hilara-cash-session-copy > small { color:#6b7f8e; }
.hilara-cash-session-status { width:max-content; padding:5px 9px; border-radius:999px; background:#f2f5f7; color:#60717d; font-size:.75rem; font-weight:800; }
.hilara-cash-session-status--open { background:#e9f8f1; color:#178052; border:1px solid #cceedd; }
.hilara-cash-money-field { display:grid; gap:7px; text-align:left; margin:18px 0; color:#344c5d; font-weight:700; }
.hilara-cash-money-field input { width:100%; min-height:50px; padding:0 14px; border:1px solid #b9cad5; border-radius:12px; font:inherit; font-size:1.05rem; color:#163d58; background:#fff; outline:none; }
.hilara-cash-money-field input:focus { border-color:#08b8c7; box-shadow:0 0 0 3px rgba(8,184,199,.12); }
.hilara-cash-modal-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:18px; }
.hilara-cash-close-summary { display:grid; gap:9px; padding:14px; border-radius:14px; background:#f7fafc; border:1px solid #e2ebf0; text-align:left; }
.hilara-cash-close-summary span { display:flex; align-items:center; justify-content:space-between; gap:12px; color:#60717d; }
.hilara-cash-close-summary strong { color:#173f5a; }
.hilara-cash-close-expected { padding-top:9px; border-top:1px solid #dfe8ed; font-weight:800; }
.hilara-cash-live-difference { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-radius:11px; font-size:.9rem; }
.hilara-cash-live-difference--ok { background:#eaf8f2; color:#197653; }
.hilara-cash-live-difference--different { background:#fff4e5; color:#9a5b00; }
.hilara-cash-action-error { margin:10px 0; padding:10px 12px; border-radius:11px; background:#fff0f0; color:#b42318; font-size:.88rem; text-align:left; }
@media (max-width:640px) { .hilara-cash-session-card { align-items:stretch; flex-direction:column; padding:16px; } .hilara-cash-session-card .hilara-btn { width:100%; } .hilara-cash-modal-actions { grid-template-columns:1fr; } }

/* Historial de ventas */
.hilara-sale-history-page{display:grid;gap:22px}.hilara-sale-history-card{padding:18px;border:1px solid var(--hilara-border);border-radius:20px;background:#fff;box-shadow:0 8px 24px rgba(7,59,103,.045)}.hilara-sale-history-search{max-width:620px;margin-bottom:16px}.hilara-sale-history-list{display:grid}.hilara-sale-history-row{display:grid;grid-template-columns:130px minmax(0,1fr) 140px auto;gap:18px;align-items:center;padding:15px 4px;border-top:1px solid #e8eff3}.hilara-sale-history-row:first-child{border-top:0}.hilara-sale-history-date,.hilara-sale-history-customer{display:grid;gap:3px}.hilara-sale-history-date span,.hilara-sale-history-customer span,.hilara-sale-detail-summary span,.hilara-sale-detail-item span{color:var(--hilara-text-muted);font-size:.82rem}.hilara-sale-history-total{text-align:right;color:var(--hilara-brand-strong);font-size:1.05rem}.hilara-sale-detail-modal{max-width:620px}.hilara-sale-detail-summary{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px}.hilara-sale-detail-summary>div{display:grid;gap:3px;padding:12px;border:1px solid #e1eaef;border-radius:13px;background:#f9fcfd}.hilara-sale-detail-items{display:grid;max-height:340px;overflow:auto;border-top:1px solid #e8eff3}.hilara-sale-detail-item{display:flex;justify-content:space-between;gap:16px;padding:13px 2px;border-bottom:1px solid #e8eff3}.hilara-sale-detail-item>div{display:grid;gap:3px}
@media(max-width:760px){.hilara-sale-history-row{grid-template-columns:1fr auto;gap:10px 14px}.hilara-sale-history-date{grid-column:1}.hilara-sale-history-customer{grid-column:1}.hilara-sale-history-total{grid-column:2;grid-row:1/3;align-self:center}.hilara-sale-history-row>.hilara-btn{grid-column:1/3;width:100%}.hilara-sale-detail-summary{grid-template-columns:1fr}}
.hilara-sales-heading-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}@media(max-width:640px){.hilara-sales-heading{align-items:flex-start}.hilara-sales-heading-actions{width:100%;justify-content:space-between}}

/* Clientes · actividad de compras */
.hilara-client-activity {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e4edf3;
}
.hilara-client-activity-heading { display:flex; justify-content:space-between; gap:12px; margin-bottom:12px; }
.hilara-client-activity-heading div { display:flex; flex-direction:column; gap:3px; }
.hilara-client-activity-heading strong { color:#12304a; font-size:15px; }
.hilara-client-activity-heading span { color:#718399; font-size:13px; }
.hilara-client-activity-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.hilara-client-activity-summary article { padding:12px 14px; border:1px solid #dce8ef; border-radius:14px; background:#f8fbfd; display:flex; flex-direction:column; gap:4px; }
.hilara-client-activity-summary span { color:#718399; font-size:12px; }
.hilara-client-activity-summary strong { color:#12304a; font-size:18px; }
.hilara-client-activity-empty { padding:14px; border-radius:12px; background:#f8fbfd; color:#718399; font-size:13px; }
.hilara-client-purchases { display:flex; flex-direction:column; gap:8px; }
.hilara-client-purchase-row { width:100%; border:1px solid #dce8ef; background:#fff; border-radius:13px; padding:11px 13px; display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left; cursor:pointer; font:inherit; }
.hilara-client-purchase-row:hover { border-color:#94d9dc; background:#f7fcfc; }
.hilara-client-purchase-row > span { display:flex; flex-direction:column; gap:3px; min-width:0; }
.hilara-client-purchase-row strong { color:#17324a; font-size:13px; }
.hilara-client-purchase-row small { color:#718399; font-size:12px; }
.hilara-client-purchase-row b { color:#12304a; white-space:nowrap; font-size:14px; }
.hilara-client-sale-items { display:flex; flex-direction:column; gap:8px; padding:4px 0 8px; }
.hilara-client-sale-items article { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 0; border-bottom:1px solid #e8eef2; }
.hilara-client-sale-items article > div { display:flex; flex-direction:column; gap:3px; }
.hilara-client-sale-items strong { color:#17324a; font-size:14px; }
.hilara-client-sale-items span { color:#718399; font-size:12px; }
.hilara-client-sale-items b { color:#12304a; white-space:nowrap; }
@media (max-width: 640px) {
    .hilara-client-activity-summary { grid-template-columns:1fr 1fr; }
    .hilara-client-purchase-row { align-items:flex-start; }
}


/* Hilara · estado y edición del control de stock */
.hilara-product-stock-status { display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px; font-size:.68rem; font-weight:800; white-space:nowrap; }
.hilara-product-stock-status.is-enabled { background:#eafaf5; color:#087f6b; border:1px solid #bfeee2; }
.hilara-product-stock-status.is-disabled { background:#f3f5f7; color:#667985; border:1px solid #dfe6ea; }
.hilara-stock-toggle-row { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:15px 16px; border:1px solid #dce7eb; border-radius:14px; background:#f8fbfc; }
.hilara-stock-toggle-row > span:first-child { display:flex; flex-direction:column; gap:3px; }
.hilara-stock-toggle-row small { color:#71838e; font-weight:500; }
.hilara-stock-toggle { display:flex; align-items:center; gap:9px; cursor:pointer; white-space:nowrap; }
.hilara-stock-toggle input { position:absolute; opacity:0; pointer-events:none; }
.hilara-stock-toggle-track { width:42px; height:24px; padding:3px; border-radius:999px; background:#cfdadd; transition:.18s ease; }
.hilara-stock-toggle-track > span { display:block; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(20,45,55,.18); transition:.18s ease; }
.hilara-stock-toggle input:checked + .hilara-stock-toggle-track { background:#25b9a8; }
.hilara-stock-toggle input:checked + .hilara-stock-toggle-track > span { transform:translateX(18px); }
@media (max-width: 680px) { .hilara-stock-toggle-row { align-items:flex-start; flex-direction:column; gap:12px; } }
\n\n/* Ventas · comprobante de venta */\n.hilara-sales-sale-message { display:grid; gap:7px; }\n.hilara-sales-receipt-link { justify-self:center; border:0; padding:0; background:transparent; color:#087b82; font:inherit; font-size:.74rem; font-weight:850; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }\n.hilara-sales-receipt-modal { max-width:560px; }\n.hilara-sales-receipt-paper { margin:0 18px 4px; padding:22px; border:1px solid #dfe8ed; border-radius:16px; background:#fff; }\n.hilara-sales-receipt-brand { display:grid; gap:3px; padding-bottom:15px; text-align:center; border-bottom:1px dashed #cdd9df; }\n.hilara-sales-receipt-brand strong { color:#123e5c; font-size:1.15rem; }\n.hilara-sales-receipt-brand span { color:#71838e; font-size:.72rem; }\n.hilara-sales-receipt-meta { display:grid; grid-template-columns:1fr 1fr; gap:10px 18px; padding:15px 0; border-bottom:1px dashed #cdd9df; }\n.hilara-sales-receipt-meta span { display:grid; gap:2px; }\n.hilara-sales-receipt-meta small { color:#7a8d99; font-size:.67rem; }\n.hilara-sales-receipt-meta strong { color:#243f51; font-size:.79rem; }\n.hilara-sales-receipt-items { display:grid; padding:6px 0; }\n.hilara-sales-receipt-item { display:flex; justify-content:space-between; gap:18px; padding:10px 0; border-bottom:1px solid #edf2f4; }\n.hilara-sales-receipt-item > div { display:grid; gap:3px; min-width:0; }\n.hilara-sales-receipt-item strong { color:#243f51; font-size:.8rem; }\n.hilara-sales-receipt-item small { color:#7a8d99; font-size:.69rem; }\n.hilara-sales-receipt-item > strong { white-space:nowrap; }\n.hilara-sales-receipt-total { display:flex; align-items:end; justify-content:space-between; gap:16px; padding-top:15px; }\n.hilara-sales-receipt-total span { color:#607784; font-weight:750; }\n.hilara-sales-receipt-total strong { color:#123e5c; font-size:1.4rem; }\n.hilara-sales-receipt-footer { margin-top:16px; padding-top:10px; border-top:1px dashed #cdd9df; color:#8a9aa4; font-size:.65rem; text-align:center; }\n@media(max-width:640px){.hilara-sales-receipt-paper{margin-inline:12px;padding:17px}.hilara-sales-receipt-meta{grid-template-columns:1fr}.hilara-sales-receipt-actions{display:grid;grid-template-columns:1fr 1fr}.hilara-sales-receipt-actions .hilara-btn{width:100%}}\n@media print {\n  body * { visibility:hidden !important; }\n  #hilara-sale-receipt, #hilara-sale-receipt * { visibility:visible !important; }\n  #hilara-sale-receipt { position:fixed !important; inset:0 !important; width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; border:0 !important; box-shadow:none !important; background:#fff !important; }\n  #hilara-sale-receipt .hilara-sales-receipt-screen-header, #hilara-sale-receipt .hilara-sales-receipt-actions { display:none !important; }\n  #hilara-sale-receipt .hilara-sales-receipt-paper { width:80mm; margin:0 auto !important; padding:5mm !important; border:0 !important; border-radius:0 !important; }\n}\n

/* Ventas · confirmación de venta */
.hilara-sales-success-modal { max-width:440px; overflow:hidden; }
.hilara-sales-success-content { display:flex; flex-direction:column; align-items:center; padding:34px 28px 24px; text-align:center; }
.hilara-sales-success-icon { display:grid; place-items:center; width:54px; height:54px; margin-bottom:16px; border-radius:50%; background:#e8fbf7; border:1px solid #a7eadf; color:#078a7e; font-size:1.55rem; font-weight:900; }
.hilara-sales-success-content h2 { margin:5px 0 12px; color:#123e5c; font-size:1.45rem; }
.hilara-sales-success-total { color:#123e5c; font-size:2rem; line-height:1.05; letter-spacing:-.03em; }
.hilara-sales-success-payment { margin-top:9px; color:#6b7f8b; font-size:.84rem; font-weight:750; }
.hilara-sales-success-actions { padding-top:16px; }
@media(max-width:640px){.hilara-sales-success-modal{width:calc(100% - 28px)}.hilara-sales-success-content{padding:30px 20px 20px}.hilara-sales-success-actions{display:grid;grid-template-columns:1fr 1fr}.hilara-sales-success-actions .hilara-btn{width:100%}}

/* Configuración · datos básicos del comercio */
.hilara-settings-page { display:grid; gap:24px; }
.hilara-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.hilara-settings-card { overflow:hidden; border:1px solid var(--hilara-border); border-radius:20px; background:#fff; box-shadow:0 8px 24px rgba(7,59,103,.045); }
.hilara-settings-card-heading { display:flex; align-items:flex-start; gap:13px; padding:20px 20px 17px; border-bottom:1px solid #e8eff3; }
.hilara-settings-icon { flex:0 0 40px; width:40px; height:40px; display:grid; place-items:center; border-radius:12px; background:var(--hilara-brand-soft); color:var(--hilara-brand-strong); font-weight:900; }
.hilara-settings-card-heading h2 { margin:1px 0 4px; color:var(--hilara-brand-strong); font-size:1rem; }
.hilara-settings-card-heading p { margin:0; color:var(--hilara-text-muted); font-size:.78rem; line-height:1.45; }
.hilara-settings-data-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:4px 20px 8px; }
.hilara-settings-data-item { min-width:0; display:grid; gap:4px; padding:15px 4px; border-bottom:1px solid #edf2f4; }
.hilara-settings-data-item:nth-last-child(-n+2) { border-bottom:0; }
.hilara-settings-data-item span { color:var(--hilara-text-muted); font-size:.7rem; font-weight:750; }
.hilara-settings-data-item strong { overflow:hidden; text-overflow:ellipsis; color:#243f51; font-size:.84rem; font-weight:800; }
.hilara-settings-card-footer { padding:12px 20px; border-top:1px solid #e8eff3; background:#f8fbfc; color:#71838e; font-size:.7rem; }
.hilara-settings-empty { margin:18px 20px; padding:18px; border:1px dashed #ccdce4; border-radius:14px; background:#f8fbfc; color:var(--hilara-text-muted); font-size:.8rem; text-align:center; }
.hilara-settings-loading, .hilara-settings-state { min-height:260px; display:grid; place-items:center; align-content:center; gap:10px; border:1px solid var(--hilara-border); border-radius:20px; background:#fff; }
.hilara-settings-state strong { color:var(--hilara-brand-strong); }
.hilara-settings-state span { color:var(--hilara-text-muted); font-size:.8rem; }
@media(max-width:900px){.hilara-settings-grid{grid-template-columns:1fr}}
@media(max-width:640px){.hilara-settings-page{gap:16px}.hilara-settings-card-heading{padding:17px}.hilara-settings-data-grid{grid-template-columns:1fr;padding-inline:17px}.hilara-settings-data-item:nth-last-child(-n+2){border-bottom:1px solid #edf2f4}.hilara-settings-data-item:last-child{border-bottom:0}.hilara-settings-card-footer{padding-inline:17px}}

/* Configuración · edición de datos del comercio */
.hilara-settings-card-footer--action { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.hilara-settings-card-footer--action .hilara-btn { flex:0 0 auto; min-height:38px; padding-inline:14px; font-size:.76rem; }
.hilara-settings-editor { width:min(100%,680px); max-height:calc(100vh - 40px); overflow:auto; border:1px solid rgba(8,184,199,.18); border-radius:22px; background:#fff; box-shadow:0 24px 70px rgba(8,31,50,.22); }
.hilara-settings-editor-heading { display:flex; justify-content:space-between; gap:20px; padding:22px 24px 18px; border-bottom:1px solid #e8eff3; }
.hilara-settings-editor-heading h2 { margin:3px 0 4px; color:var(--hilara-brand-strong); font-size:1.15rem; }
.hilara-settings-editor-heading p { margin:0; color:var(--hilara-text-muted); font-size:.78rem; }
.hilara-settings-editor-close { flex:0 0 36px; width:36px; height:36px; border:1px solid #d7e2e8; border-radius:10px; background:#fff; color:#617783; font-size:1.45rem; line-height:1; cursor:pointer; }
.hilara-settings-editor-close:hover { background:#f4f8fa; color:#24495d; }
.hilara-settings-editor-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:22px 24px; }
.hilara-settings-field { min-width:0; display:grid; gap:7px; }
.hilara-settings-field--wide { grid-column:1/-1; }
.hilara-settings-field span { color:#405c6d; font-size:.74rem; font-weight:800; }
.hilara-settings-field input { width:100%; min-height:46px; padding:0 13px; border:1px solid #cbd8e5; border-radius:11px; background:#fff; color:#203d50; font:inherit; font-size:.86rem; outline:none; }
.hilara-settings-field input:focus { border-color:#62cbd8; box-shadow:0 0 0 3px rgba(16,164,188,.10); }
.hilara-settings-editor-error { margin:0 24px 18px; padding:11px 13px; border:1px solid #fecdd3; border-radius:10px; background:#fff1f2; color:#a61b35; font-size:.78rem; }
.hilara-settings-editor-actions { display:flex; justify-content:flex-end; gap:10px; padding:17px 24px 22px; border-top:1px solid #e8eff3; }
@media(max-width:640px){.hilara-settings-card-footer--action{align-items:stretch;flex-direction:column}.hilara-settings-card-footer--action .hilara-btn{width:100%}.hilara-settings-editor{width:calc(100% - 24px);max-height:calc(100vh - 24px);border-radius:18px}.hilara-settings-editor-heading{padding:18px}.hilara-settings-editor-body{grid-template-columns:1fr;padding:18px}.hilara-settings-field--wide{grid-column:auto}.hilara-settings-editor-error{margin:0 18px 16px}.hilara-settings-editor-actions{display:grid;grid-template-columns:1fr 1fr;padding:15px 18px 18px}.hilara-settings-editor-actions .hilara-btn{width:100%;padding-inline:10px}}

/* Anulación de ventas */
.hilara-sale-history-row.is-cancelled{opacity:.72}.hilara-sale-cancelled-badge{display:inline-flex;align-items:center;margin-left:7px;padding:3px 8px;border-radius:999px;background:#fff1f2;color:#b42318;border:1px solid #fecdd3;font-size:.72rem;font-weight:800;vertical-align:middle}.hilara-sale-cancel-warning{display:grid;gap:6px;padding:14px 15px;margin-bottom:14px;border:1px solid #fecdd3;border-radius:14px;background:#fff7f7}.hilara-sale-cancel-warning strong{color:#9f1d1d}.hilara-sale-cancel-warning span{color:var(--hilara-text-muted);line-height:1.45}.hilara-sale-cancel-modal{max-width:520px}.hilara-modal-backdrop--front{z-index:1100}


.hilara-return-items { display:grid; gap:10px; margin:16px 0; }
.hilara-return-item { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 14px; border:1px solid #dbe5ee; border-radius:12px; background:#fff; }
.hilara-return-item > div { display:grid; gap:3px; }
.hilara-return-item span { color:#667085; font-size:.86rem; }
.hilara-return-item input { width:110px; min-height:42px; padding:8px 10px; border:1px solid #cbd5e1; border-radius:10px; text-align:right; }
@media (max-width: 640px) { .hilara-return-item { align-items:flex-start; } .hilara-return-item input { width:92px; } }

/* Configuración · usuarios del comercio */
.hilara-settings-card--wide {
    grid-column: 1 / -1;
}

.hilara-users-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 2px 0 16px;
    padding: 13px 15px;
    border: 1px solid #dbe7ee;
    border-radius: 14px;
    background: #f7fbfc;
}

.hilara-users-plan-row strong {
    color: #16324a;
    font-size: 14px;
}

.hilara-users-plan-row span {
    color: #647789;
    font-size: 13px;
}

.hilara-users-list {
    display: grid;
    gap: 10px;
}

.hilara-user-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f5;
}

.hilara-user-row:last-child {
    border-bottom: 0;
}

.hilara-user-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8f8f7;
    color: #167d79;
    font-weight: 800;
    font-size: 13px;
}

.hilara-user-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.hilara-user-main strong {
    color: #18344c;
    font-size: 14px;
}

.hilara-user-main span {
    color: #708191;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hilara-user-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.hilara-user-status.is-active {
    background: #e9f8f1;
    color: #28765b;
}

.hilara-user-status.is-inactive {
    background: #f1f4f6;
    color: #7a8792;
}

@media (max-width: 720px) {
    .hilara-users-plan-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .hilara-user-row {
        grid-template-columns: 42px minmax(0, 1fr) auto;
    }

    .hilara-user-row .hilara-btn {
        grid-column: 2 / -1;
        justify-self: start;
    }
}


/* Legal / consentimiento de registro */
.hilara-legal-consent { display:flex; align-items:flex-start; gap:10px; padding:14px 16px; border:1px solid #dbe8ed; border-radius:14px; background:#f8fbfc; color:#425b6c; font-size:13px; line-height:1.45; cursor:pointer; }
.hilara-legal-consent input { width:18px; height:18px; margin-top:1px; accent-color:#20b8b1; flex:0 0 auto; }
.hilara-legal-consent a { color:#147f82; font-weight:700; text-decoration:none; }
.hilara-legal-consent a:hover { text-decoration:underline; }
.hilara-legal-page { max-width:860px; margin:36px auto; padding:28px; background:#fff; border:1px solid #e1e9ee; border-radius:22px; box-shadow:0 14px 34px rgba(24,52,76,.07); color:#425b6c; }
.hilara-legal-page h1 { color:#18344c; margin:0 0 4px; }
.hilara-legal-page h2 { color:#18344c; font-size:17px; margin:24px 0 7px; }
.hilara-legal-page p { line-height:1.65; }
.hilara-legal-version { color:#7b8d99; font-size:12px; margin-bottom:20px; }

.hilara-settings-legal-links { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; margin-top:18px; color:#7b8d99; font-size:12px; }
.hilara-settings-legal-links a { color:#147f82; font-weight:700; text-decoration:none; }
.hilara-settings-legal-links a:hover { text-decoration:underline; }

/* Producto encontrado: configuración en modal dedicado */
.hilara-product-modal-backdrop--product-config { z-index: 1500; }
.hilara-product-config-modal { max-width: 720px; }
.hilara-product-found-card--modal { margin-top: 4px; margin-bottom: 18px; }

/* Stock: control directo de seguimiento por producto */
.hilara-stock-control-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-size: .72rem;
    font-weight: 800;
    color: #536a78;
    cursor: pointer;
    user-select: none;
}
.hilara-stock-control-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.hilara-stock-control-toggle-track {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: #dfe6ea;
    border: 1px solid #ccd8df;
    transition: .18s ease;
    flex: 0 0 auto;
}
.hilara-stock-control-toggle-track span {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 43, 61, .18);
    transition: .18s ease;
}
.hilara-stock-control-toggle input:checked + .hilara-stock-control-toggle-track {
    background: #bfeee8;
    border-color: #73d9cd;
}
.hilara-stock-control-toggle input:checked + .hilara-stock-control-toggle-track span {
    transform: translateX(14px);
}
.hilara-stock-control-toggle input:focus-visible + .hilara-stock-control-toggle-track {
    outline: 3px solid rgba(26, 188, 177, .18);
    outline-offset: 2px;
}
.hilara-stock-control-toggle input:disabled + .hilara-stock-control-toggle-track {
    opacity: .55;
    cursor: wait;
}
.hilara-stock-control-error { margin: 14px 16px 0; }

/* Compras: historial / detalle */
.hilara-purchase-list-row.is-clickable { cursor: pointer; }
.hilara-purchase-list-row.is-clickable:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 23, 42, .07); }
.hilara-purchase-list-row.is-clickable:focus-visible { outline: 3px solid rgba(21, 184, 166, .22); outline-offset: 2px; }
.hilara-purchase-detail-modal { max-width: 760px; }
.hilara-purchase-detail-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 4px 0 18px; }
.hilara-purchase-detail-meta > div { padding: 12px 14px; border: 1px solid #e5eaf0; border-radius: 12px; background: #f8fafc; display:flex; flex-direction:column; gap:4px; }
.hilara-purchase-detail-meta span, .hilara-purchase-detail-row span, .hilara-purchase-detail-total span { color:#667085; font-size:12px; }
.hilara-purchase-detail-list { display:flex; flex-direction:column; gap:8px; max-height:42vh; overflow:auto; }
.hilara-purchase-detail-row { display:grid; grid-template-columns:minmax(0,1fr) 110px 130px; gap:14px; align-items:center; padding:12px 14px; border:1px solid #e5eaf0; border-radius:12px; }
.hilara-purchase-detail-row > div { min-width:0; display:flex; flex-direction:column; gap:3px; }
.hilara-purchase-detail-quantity, .hilara-purchase-detail-amount { text-align:right; }
.hilara-purchase-detail-total { margin-top:14px; padding:14px 16px; border-radius:12px; background:#f0fdfa; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.hilara-purchase-detail-total strong { font-size:20px; color:#0f3d4a; }
@media (max-width: 640px) {
  .hilara-purchase-detail-meta { grid-template-columns:1fr; }
  .hilara-purchase-detail-row { grid-template-columns:minmax(0,1fr) auto; }
  .hilara-purchase-detail-amount { grid-column:1 / -1; flex-direction:row !important; justify-content:space-between; text-align:left; padding-top:8px; border-top:1px solid #eef2f6; }
}

/* Productos · navegación interna Productos / Stock */
.hilara-products-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--hilara-border);
    border-radius: 14px;
    background: #f7fbfd;
}

.hilara-products-tab {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 10px;
    color: var(--hilara-text-muted);
    font-weight: 700;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.hilara-products-tab:hover {
    color: var(--hilara-brand-strong);
    background: rgba(255,255,255,.8);
}

.hilara-products-tab.is-active {
    color: #fff;
    background: var(--hilara-brand);
    box-shadow: 0 4px 12px rgba(8,184,199,.22);
}

.hilara-products-tab.is-active:hover {
    color: #fff;
    background: var(--hilara-brand);
}

@media (max-width: 640px) {
    .hilara-products-tabs { width: 100%; }
    .hilara-products-tab { flex: 1; }
}

/* Proveedores */
.hilara-suppliers-page { display:grid; gap:24px; }
.hilara-supplier-list { display:grid; }
.hilara-supplier-row { width:100%; border:0; border-bottom:1px solid var(--hilara-border); background:#fff; padding:16px 18px; display:grid; grid-template-columns:44px minmax(0,1fr) auto 18px; align-items:center; gap:14px; text-align:left; font:inherit; cursor:pointer; }
.hilara-supplier-row:first-child { border-top:1px solid var(--hilara-border); }
.hilara-supplier-row:hover { background:#f8fcfd; }
.hilara-supplier-avatar { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; background:#eafafb; color:#08788a; font-size:.8rem; font-weight:900; }
.hilara-supplier-main { min-width:0; display:grid; gap:4px; }
.hilara-supplier-main strong { color:var(--hilara-brand-strong); font-size:.94rem; }
.hilara-supplier-main span, .hilara-supplier-purchases span { color:var(--hilara-text-muted); font-size:.76rem; }
.hilara-supplier-purchases { display:grid; gap:3px; text-align:right; }
.hilara-supplier-purchases strong { color:var(--hilara-brand-strong); }
.hilara-supplier-chevron { color:#7b97aa; font-size:1.5rem; }
.hilara-supplier-modal { max-width:620px; }
.hilara-supplier-detail-modal { max-width:720px; }
.hilara-supplier-detail-data { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:4px 0 18px; }
.hilara-supplier-detail-data > div { padding:13px 14px; border:1px solid var(--hilara-border); border-radius:12px; background:#f9fcfd; display:grid; gap:4px; min-width:0; }
.hilara-supplier-detail-data span { color:var(--hilara-text-muted); font-size:.72rem; font-weight:700; }
.hilara-supplier-detail-data strong { overflow-wrap:anywhere; color:var(--hilara-brand-strong); font-size:.86rem; }
.hilara-supplier-detail-actions { display:flex; justify-content:flex-end; gap:9px; padding-bottom:18px; border-bottom:1px solid var(--hilara-border); }
.hilara-supplier-history-title { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:18px 0 10px; }
.hilara-supplier-history-title strong { color:var(--hilara-brand-strong); }
.hilara-supplier-history-title span { color:var(--hilara-text-muted); font-size:.78rem; }
.hilara-supplier-history { display:grid; max-height:300px; overflow:auto; }
.hilara-supplier-history-row { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px 2px; border-top:1px solid var(--hilara-border); }
.hilara-supplier-history-row > div { display:grid; gap:3px; }
.hilara-supplier-history-row span, .hilara-supplier-history-empty { color:var(--hilara-text-muted); font-size:.78rem; }
.hilara-supplier-history-empty { padding:18px 0; }
@media (max-width:700px) {
  .hilara-supplier-row { grid-template-columns:42px minmax(0,1fr) 16px; padding:14px 12px; gap:10px; }
  .hilara-supplier-purchases { display:none; }
  .hilara-supplier-detail-data { grid-template-columns:1fr; }
  .hilara-supplier-detail-actions { display:grid; grid-template-columns:1fr 1fr; }
}

/* File controls use the same Hilara treatment across commerce and platform pages. */
input[type="file"] { display: block; max-width: 100%; width: 100%; padding: .35rem; color: #496273; font: inherit; background: #f6fbfd; border: 1px solid #c9dfe7; border-radius: .75rem; }
input[type="file"]::file-selector-button { margin-right: .8rem; padding: .65rem 1rem; border: 1px solid #91d6e3; border-radius: .6rem; background: #e7f8fc; color: #006a83; font: inherit; font-weight: 700; cursor: pointer; transition: background .15s ease; }
input[type="file"]:not(:disabled)::file-selector-button:hover { background: #cceff6; }
input[type="file"]:focus-visible { outline: 3px solid #8bd9e8; outline-offset: 3px; }
input[type="file"]:disabled { opacity: .6; cursor: not-allowed; }
input[type="file"]:disabled::file-selector-button { cursor: not-allowed; }

.hilara-product-edit-photo { display:block; width:120px; height:120px; object-fit:contain; margin-top:.5rem; border:1px solid #c9dfe7; border-radius:.75rem; background:white; }

/* Encabezado compacto del comercio y plan. */
.hilara-commerce-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.hilara-commerce-identity > .hilara-app-context-name { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hilara-commerce-identity .hilara-commerce-plan-pill { flex-shrink: 0; min-height: 30px; padding: 5px 12px; border-color: #a4e8e7; color: #075469; background: linear-gradient(145deg,#ffffff 0%,#e9ffff 32%,#bff3f0 68%,#e6ffff 100%); box-shadow: inset 0 1px 1px #ffffff, 0 2px 6px #087f991c; }
.hilara-commerce-identity .hilara-commerce-plan-dot { background: #057c99; }
@media(max-width:600px) { .hilara-commerce-identity { gap: 4px 8px; } .hilara-commerce-identity > .hilara-app-context-name { font-size: .82rem; } }

/* El menú móvil abierto debe cubrir también los accesos flotantes de la página. */
@media (max-width: 640px) {
  .hilara-app-sidebar:has(.hilara-app-mobile-more[open]) { z-index: 1600; }
}

.hilara-settings-missing { margin: 0 20px 16px; padding: 10px 12px; border-radius: 10px; background: #f5f9fb; color: #526777; font-size: .78rem; line-height: 1.5; }

/* Campos monetarios compartidos: formato argentino también durante la edición. */
input[data-hilara-money] { width:100%; min-width:0; min-height:42px; padding:10px 12px; border:1px solid #cbd8e3; border-radius:10px; background:#fff; color:#17384f; font:inherit; font-variant-numeric:tabular-nums; }
input[data-hilara-money]:focus { outline:2px solid #21b5b533; border-color:#159eab; }
input[data-hilara-money][aria-invalid="true"] { border-color:#c74444; }
.hilara-money-error { display:block; color:#a83232; font-size:.75rem; }
