/* GUUD visual system. Scoped application rules take precedence over legacy modules.
   Public pages use the tokens while keeping their own layout and store branding. */
:root {
  --guud-yellow: #f0b323; /* Original sidebar gold; shared by primary actions. */
  --guud-yellow-hover: #ecad19;
  --guud-yellow-soft: #fff5d7;
  --guud-ink: #1c1c1c;
  --guud-muted: #626873;
  --guud-line: #e1e4e8;
  --guud-surface: #ffffff;
  --guud-background: #f7f8fa;
  --guud-radius: 9px;
  --guud-danger: #a83737;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sis-shell {
  --shell-accent: var(--guud-yellow);
  --shell-line: var(--guud-line);
  color: var(--guud-ink);
  background: var(--guud-background);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
.sis-shell *, .sis-shell *::before, .sis-shell *::after { transition-property: color, background-color, border-color, box-shadow, opacity, transform; transition-duration: .16s; }
.sis-shell #contenido { padding-bottom: 80px; }
.sis-shell #contenido :is(.form-container, .calendar-page) { width: 100%; max-width: 1440px; min-width: 0; margin-inline: auto; padding: 16px; }
.sis-shell #contenido .form-container .form-container { padding: 0; }
.sis-shell #contenido .calendar-page { margin-block: 0; }
.sis-shell #contenido :is(h1, .table-title h2, .header-form h2) { color: var(--guud-ink); font-size: clamp(24px, 2.1vw, 30px); font-weight: 600; letter-spacing: -.035em; line-height: 1.25; }
.sis-shell #contenido :is(h2, h3) { line-height: 1.35; }
.sis-shell #contenido .table-title { gap: 16px; margin: 4px 0 24px; }
.sis-shell #contenido .table-title h2 { display: flex; align-items: center; gap: 10px; }
.sis-shell #contenido .calendar-heading { gap: 16px; margin-bottom: 20px; }
.sis-shell #contenido .calendar-heading > div { min-width: 0; }
.sis-shell #contenido .calendar-heading > div > p { margin-top: 8px; color: var(--guud-muted); }
.sis-shell #contenido .calendar-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.sis-shell #contenido .calendar-form { max-width: 900px; padding: 24px; border: 1px solid var(--guud-line); border-radius: 14px; }
.sis-shell #contenido .calendar-form form > button[type="submit"] { margin-top: 12px; }
.sis-shell #contenido a { color: var(--guud-ink); text-underline-offset: 4px; }
.sis-shell #contenido a:hover { text-decoration: underline; }

/* One control scale: 40px text buttons, 36px record actions. */
.sis-shell #contenido :is(button, input[type="submit"], input[type="button"], .btn, .btn-primary, .btn-secondary, .calendar-primary, .store-button, .setup-action, .data-export-link, .pdf, .calendar-month > a, .go-back) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; max-width: 100%; min-height: 40px; height: auto;
  margin: 0; padding: 9px 14px; border: 1px solid #d5d9df; border-radius: var(--guud-radius);
  background: var(--guud-surface); color: var(--guud-ink);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.5;
  text-align: center; text-decoration: none; text-transform: none; vertical-align: middle;
  white-space: normal; cursor: pointer; box-shadow: 0 1px 2px #1c1c1c04;
}
.sis-shell #contenido :is(button, input[type="submit"], input[type="button"], .btn, .btn-primary, .btn-secondary, .calendar-primary, .store-button, .setup-action, .data-export-link, .pdf, .calendar-month > a, .go-back):hover {
  border-color: #aeb5bf; background: #f1f3f5; color: var(--guud-ink); text-decoration: none;
}
.sis-shell #contenido :is(.btn-primary, .calendar-primary, .store-primary, .setup-action, .primaryGuud, input[type="submit"], .dashboard-filter-button) {
  background: var(--guud-yellow); border-color: var(--guud-yellow); color: var(--guud-ink);
}
.sis-shell #contenido :is(.btn-primary, .calendar-primary, .store-primary, .setup-action, .primaryGuud, input[type="submit"], .dashboard-filter-button):hover {
  background: var(--guud-yellow-hover); border-color: var(--guud-yellow-hover); color: var(--guud-ink);
}
.sis-shell #contenido :is(.btn-secondary, .btn-outline-primary, .secondaryGuud, .data-export-link, .pdf) { background: white; color: var(--guud-ink); border-color: #d5d9df; }
.sis-shell #contenido .data-export-controls .data-export-excel { background: var(--guud-yellow); border-color: #e2af32; }
.sis-shell #contenido .data-export-controls .data-export-excel:hover { background: var(--guud-yellow-hover); border-color: var(--guud-yellow-hover); }
.sis-shell #contenido :is(.btn-outline-danger, .btn-danger, .store-danger, .package-remove) { background: #fff; border-color: #e5bcbc; color: var(--guud-danger); }
.sis-shell #contenido :is(.btn-outline-danger, .btn-danger, .store-danger, .package-remove):hover { color: #892a2a; background: #fff0f0; border-color: #cd8d8d; }
.sis-shell #contenido .go-back { flex: 0 0 36px; min-height: 36px; width: 36px; padding: 0; margin-right: 14px; }
.sis-shell #contenido .submit-row { margin-top: 24px; }
.sis-shell #contenido .submit-row input { min-width: 130px; }
.sis-shell #contenido :is(.calendar-month, .server-pagination) { flex-wrap: wrap; font-size: 13px; }
.sis-shell #contenido .calendar-month > a { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.sis-shell #contenido :is(.machine-actions, .store-actions, .import-actions) { gap: 10px; }
.sis-shell #contenido .machine-actions form { padding: 0; }
.sis-shell #contenido .movimientos-container { justify-content: flex-start; gap: 10px; padding: 8px 0; margin-bottom: 16px; }
.sis-shell #contenido .movimientos-container .pdf { font-size: 12px; }

/* Neutral fields: validation and focus no longer paint every input orange. */
.sis-shell #contenido :is(input:where(:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="color"])), select, textarea) {
  max-width: 100%; min-width: 0; min-height: 40px;
  padding: 9px 12px; border: 1px solid #d5d9df; border-radius: var(--guud-radius);
  background: #fff; color: var(--guud-ink); font-family: inherit; font-size: 14px; line-height: 1.5; box-shadow: none;
}
.sis-shell #contenido select:not([multiple]):not([size]) { height: 40px; }
.sis-shell #contenido textarea { min-height: 100px; resize: vertical; }
.sis-shell #contenido input::placeholder, .sis-shell #contenido textarea::placeholder { color: #8a919b; }
.sis-shell #contenido :is(input, select, textarea):focus { border-color: #988600; outline: 2px solid #c1aa00; outline-offset: 2px; box-shadow: 0 0 0 4px #f0b32320; }
.sis-shell :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid #877600; outline-offset: 3px; }
.sis-shell #contenido :is(input[type="checkbox"], input[type="radio"]) { accent-color: #8b7900; }
.sis-shell #contenido label { font-size: 13px; font-weight: 500; color: #515965; }
.sis-shell #contenido :is(.input-group, .input-group-select, .input-group-fecha) { margin-top: 18px; }
.sis-shell #contenido :is(.user-label, .user-label-select, .user-label-fecha) { top: -9px; bottom: auto; left: 9px; padding: 0 5px; transform: none; color: #626873; background: var(--guud-background); font-size: 12px; line-height: 18px; }
.sis-shell #contenido :is(.container, .popup-content) :is(.user-label, .user-label-select, .user-label-fecha) { background: #fff; }
.sis-shell #contenido :is(.grid-container-form, .container-inputs) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sis-shell #contenido :is(.input-form, .input-form-select) { width: 100%; }
.sis-shell #contenido .helptext { color: var(--guud-muted); font-size: 12px; line-height: 1.6; }
.sis-shell #contenido :is(.calendar-filters, .movement-filters) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px; margin: 18px 0; border: 1px solid var(--guud-line); border-radius: 12px; background: #fff; }
.sis-shell #contenido .calendar-filters label { gap: 6px; }
.sis-shell #contenido .movement-filters { align-items: center; }
.sis-shell #contenido .movement-filters select { width: 200px; }
.sis-shell #contenido .movement-filters button { margin-left: auto; }
.sis-shell #contenido :is(.container, .popup-content) { max-width: 100%; }
.sis-shell #contenido .pop-up { padding: 16px; }
.sis-shell #contenido .popup-content { width: 100%; max-width: 1000px; margin: 0 auto; padding: 24px; background: #fff; border: 1px solid var(--guud-line); border-radius: 14px; box-shadow: 0 4px 24px #1c1c1c05; }
.sis-shell #contenido .popup-content form { padding: 0; }
.sis-shell #contenido .header-form { margin-bottom: 22px; gap: 8px; }

/* Tables retain local horizontal scrolling and clear row boundaries. */
.sis-shell #contenido .table-scroll { border: 1px solid var(--guud-line); border-radius: 12px; background: white; }
.sis-shell #contenido .table-bordered { margin: 0; width: 100%; font-size: 13px; border-collapse: separate; border-spacing: 0; background: white; }
.sis-shell #contenido .table-bordered :is(th, td) { padding: 12px 14px; line-height: 1.5; text-align: left; vertical-align: middle; }
.sis-shell #contenido .table-bordered th { color: #626873; background: #f0f2f5; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sis-shell #contenido .table-bordered td { border-top: 1px solid #edf0f3; }
.sis-shell #contenido .table-bordered tbody tr:hover { background: #fffdf0; }
.sis-shell #contenido .table-bordered .primaryGuud { background: #fff5d7; }
.sis-shell #contenido .table-help { margin: 14px 0 18px; padding: 11px 14px; border: 1px solid var(--guud-line); border-radius: 9px; background: #f1f3f6; color: var(--guud-muted); font-size: 12px; }
.sis-shell #contenido .table-help summary { color: #4c5561; cursor: pointer; font-weight: 500; }
.sis-shell #contenido .table-help p { margin-top: 9px; line-height: 1.6; }
.sis-shell #contenido :is(.table-actions, .record-actions) { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.sis-shell #contenido .table-actions form { display: inline-flex; margin: 0; padding: 0; }
.sis-shell #contenido .action-button {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px;
  width: 36px; height: 36px; min-height: 36px; margin: 0; padding: 0; gap: 0;
  border: 1px solid #dce0e5; border-radius: 8px; background: #fff; color: #454c56;
  font-size: 14px; line-height: 1; text-decoration: none; box-shadow: none;
}
.sis-shell #contenido .action-button i { margin: 0; font-size: 14px; }
.sis-shell #contenido .action-button:hover { background: var(--guud-yellow-soft); border-color: #d8c754; color: var(--guud-ink); text-decoration: none; }
.sis-shell #contenido .action-button.action-button--danger { color: var(--guud-danger); }
.sis-shell #contenido .action-button.action-button--danger:hover { color: #892a2a; background: #fff0f0; border-color: #d89f9f; }
.sis-shell #contenido .action-button--warning:hover { background: #fff4ce; border-color: #d8bf70; color: #70550c; }
.sis-shell #contenido .action-button--success:hover { background: #eaf5ee; border-color: #a5c8b0; color: #28623a; }
.sis-shell #contenido :is(.pagination, .data-export-controls) { font-size: 12px; }
.sis-shell #contenido .data-export-controls { gap: 8px; margin: 16px 0; }
.sis-shell #contenido .data-export-link { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.sis-shell #contenido .data-export-scope { font-size: 12px; color: var(--guud-muted); }
.sis-shell #contenido .pagination { padding: 14px 0; margin-top: 18px; border-top: 1px solid var(--guud-line); }
.sis-shell #contenido .pagination button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.sis-shell #contenido #page-buttons button.active { background: var(--guud-yellow); border-color: var(--guud-yellow); color: var(--guud-ink); }

/* Help is a circular, quiet accent rather than a tiny square input. */
.sis-shell #contenido button.tour-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 28px; width: 28px; height: 28px; min-height: 28px; margin: 0 0 0 4px; padding: 0;
  border: 0; border-radius: 50%; background: #fff0c6; color: #766400; box-shadow: none; vertical-align: middle;
}
.sis-shell #contenido button.tour-btn i { font-size: 15px; margin: 0; }
.sis-shell #contenido button.tour-btn:hover { background: var(--guud-yellow); color: var(--guud-ink); }

/* Shared navigation, notices and compact onboarding. */
.sis-shell .sidebar .header__link { font-size: 13px; min-height: 40px; padding: 9px 12px; }
.sis-shell .sidebar li { margin-bottom: 4px; }
.sis-shell .sidebar .sidebar-group { margin: 0; padding: 0; list-style: none; }
.sis-shell .sidebar .sidebar-group ul { margin: 0; padding: 0; list-style: none; }
.sis-shell .sidebar .sidebar-group-label { margin: 18px 12px 7px; padding: 0; color: #858b94; font-size: 10px; font-weight: 600; letter-spacing: .09em; line-height: 1.4; text-transform: uppercase; }
.sis-shell .sidebar .sidebar-group:first-of-type .sidebar-group-label { margin-top: 4px; }
.sis-shell .sidebar .sidebar-group .header__link { min-height: 38px; padding-block: 8px; }
.sis-shell .sidebar .sidebar-group li { margin-bottom: 2px; }
.sis-shell .sidebar .header__link.active { color: var(--guud-ink); background: var(--guud-yellow); border-color: #e2af32; box-shadow: 0 2px 6px #b57f0014; }
.sis-shell .sidebar .header__link:hover:not(.active) { background: #fff0c8; color: var(--guud-ink); }
.sis-shell .header-right button:hover { background: var(--guud-yellow-soft); color: var(--guud-ink); }
.sis-shell .plant-name select:hover:not(:disabled) { border-color: #d0bf50; background: #fffdf0; }
.sis-shell #contenido .inventory-setup { max-width: 1440px; padding: 20px 22px; margin: 0 auto 24px; background: #fffdf0; border: 1px solid #e9e2bd; border-left: 4px solid var(--guud-yellow); border-radius: 12px; color: var(--guud-ink); font-size: 13px; }
.sis-shell #contenido .inventory-setup h2 { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.sis-shell #contenido .inventory-setup p { margin: 4px 0; color: var(--guud-muted); line-height: 1.6; }
.sis-shell #contenido .inventory-setup .setup-action { margin-top: 12px; }
.sis-shell #contenido :is(.count-note, .trace-note, .package-note, .operation-context) { padding: 16px 18px; background: var(--guud-yellow-soft); border: 1px solid #eee3a0; font-size: 13px; }
.sis-shell #contenido :is(.package-card, .count-card, .trace-card, .calendar-event) { padding: 18px 20px; border-color: var(--guud-line); border-radius: 12px; box-shadow: 0 2px 6px #1c1c1c02; }
.sis-shell #contenido :is(.package-card, .count-card, .trace-card) h2 { font-size: 18px; }
.sis-shell #contenido :where(.account-page) .btn:where(:not(.btn-secondary):not(.btn-outline-primary):not(.btn-outline-danger):not(.btn-danger)) { background: var(--guud-yellow); border-color: var(--guud-yellow); color: var(--guud-ink); }
.sis-shell #contenido .account-page .btn:hover:not(:disabled) { filter: brightness(.97); }
.sis-shell #contenido .subscription-size-option { min-height: 34px; padding: 6px 12px; border-color: transparent; background: transparent; box-shadow: none; font-size: 12px; }
.sis-shell #contenido .subscription-size-option.is-selected { background: var(--guud-ink); color: var(--guud-yellow); }
.sis-shell #contenido .subscription-plan-action .btn { width: 100%; }
.sis-shell #contenido .subscription-steps [aria-current="step"] span { color: var(--guud-yellow); }
.sis-shell #contenido .store-primary { background: var(--guud-yellow); border-color: var(--guud-yellow); }
.sis-shell #contenido .store-tabs a[aria-current="page"] { background: var(--guud-yellow-soft); color: var(--guud-ink); }
.sis-shell #contenido .switch input:checked + .slider { background: #a18d00; }
.sis-shell #contenido .profile-card { margin: 0 auto; box-shadow: none; padding: 0; }
.sis-shell #contenido .profile-card form { margin: 14px 0; }
.sis-shell #contenido .profile-card input[type="file"] { margin-bottom: 12px; width: 100%; }
.sis-shell #contenido .profile-details { font-size: 14px; text-align: left; padding: 18px; background: var(--guud-background); border-radius: 10px; line-height: 1.8; }

/* Disabled states win over every color variant; existing access guards stay intact. */
.sis-shell #contenido :is(button, input, select, textarea, .btn, .calendar-primary, .store-button):disabled,
.sis-shell #contenido [aria-disabled="true"] {
  background: #eceef1; border-color: #dce0e5; color: #777f8b; opacity: .7; cursor: not-allowed; box-shadow: none; filter: none;
}
.sis-shell #contenido [hidden] { display: none !important; }
@media (max-width: 768px) {
  .sis-shell #contenido :is(.form-container, .calendar-page) { padding: 10px 2px; }
  .sis-shell #contenido :is(.grid-container-form, .container-inputs) { grid-template-columns: minmax(0, 1fr); }
  .sis-shell #contenido .popup-content { padding: 18px 14px; }
  .sis-shell #contenido .pop-up { padding: 0; }
  .sis-shell #contenido :is(.calendar-heading, .table-title) { align-items: flex-start; flex-wrap: wrap; }
  .sis-shell #contenido .calendar-filters > label { flex: 1 1 150px; }
  .sis-shell #contenido .calendar-filters select { width: 100%; }
  .sis-shell #contenido .movement-filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .sis-shell #contenido .movement-filters select { width: 100%; }
  .sis-shell #contenido .movement-filters button { margin-left: 0; }
  .sis-shell #contenido .inventory-setup { padding: 16px; }
  .sis-shell #contenido .table-bordered :is(th, td) { padding: 10px 12px; }
  .sis-shell #contenido .calendar-month { gap: 8px; }
  .sis-shell #contenido .calendar-month h2 { font-size: 16px; }
}
@media (pointer: coarse) {
  .sis-shell #contenido .action-button { width: 44px; height: 44px; min-height: 44px; flex-basis: 44px; }
  .sis-shell #contenido button.tour-btn { width: 36px; height: 36px; min-height: 36px; flex-basis: 36px; }
}
@media (prefers-reduced-motion: reduce) { .sis-shell *, .sis-shell *::before, .sis-shell *::after { transition: none !important; animation: none !important; } }

/* Clear interaction feedback without changing the primary brand color. */
.sis-shell #contenido :is(.btn-secondary, .btn-outline-primary, .secondaryGuud, .data-export-link, .pdf):hover:not(:disabled):not([aria-disabled="true"]) { background: #fff7e3; border-color: #c6a04b; }
.sis-shell #contenido :is(.btn-primary, .calendar-primary, .store-primary, .setup-action, .primaryGuud, input[type="submit"], .dashboard-filter-button):hover:not(:disabled):not([aria-disabled="true"]),
.sis-shell #contenido .data-export-controls .data-export-excel:hover { background: #dda31e; border-color: #c89318; box-shadow: 0 3px 8px #a8791620; }
.sis-shell #contenido :is(button, .btn, .btn-primary, .btn-secondary, input[type="submit"]):active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); box-shadow: none; }
.sis-shell #contenido .action-button:hover:not(:disabled):not([aria-disabled="true"]) { background: #fff0c4; border-color: #c6a04b; }
.sis-shell #contenido .action-button.action-button--danger:hover:not(:disabled) { background: #ffebeb; border-color: #c78383; }
@media (prefers-reduced-motion: reduce) { .sis-shell #contenido :is(button, .btn, .btn-primary, .btn-secondary, input[type="submit"]):active { transform: none; } }

/* Compact, keyboard-operable navigation groups. */
.sis-shell .sidebar .sidebar-group-label { margin-inline: 0; }
.sis-shell .sidebar .sidebar-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 34px; padding: 7px 12px; margin: 0;
  background: transparent; color: inherit; border: 0; border-radius: 8px;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  text-align: left; box-shadow: none; cursor: pointer;
}
.sis-shell .sidebar .sidebar-group-toggle:hover { color: var(--color-primary, #efb51b); background: rgba(127,127,127,.09); }
.sis-shell .sidebar .sidebar-group-toggle:focus-visible { outline: 2px solid #efb51b; outline-offset: -2px; }
.sis-shell .sidebar .sidebar-group-chevron { font-size: 16px; line-height: 1; }
.sis-shell .sidebar .sidebar-group-toggle[aria-expanded="false"] .sidebar-group-chevron { transform: rotate(-90deg); }
.sis-shell .sidebar .sidebar-group ul[hidden] { display: none; }
.operation-guide { margin: 16px 0; padding: 12px 16px; border: 1px solid currentColor; border-radius: 12px; }
.operation-guide summary { cursor: pointer; font-weight: 600; }
.operation-guide dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; margin: 16px 0 0; }
.operation-guide dt { font-weight: 600; margin-bottom: 6px; }
.operation-guide dd { margin: 0; line-height: 1.5; }
