:root {
  /* Light, Google-like theme tokens */
  --bg: #f3f7ff;
  --panel: #fbfdff;
  --muted: #6b7280;
  --accent: #1d4ed8;
  --accent-2: #10b981;
  --accent-alt: #f59e0b;
  --danger: #ef4444;
  --card: #fbfdff;
  --text: #0f172a;
  --border: #e6eef8;
  --surface: rgba(251,253,255,0.95);
  --shadow: 0 12px 32px rgba(15,23,42,0.1);
  --button-bg: #3b82f6;
  --button-surface: #eff6ff;
  --button-text: #ffffff;
  --button-muted-text: #1d4ed8;
  --btn-primary: #4338ca;
  --btn-secondary: #1f2937;
  --btn-success: #10b981;
  --btn-info: #0ea5e9;
  --btn-warning: #f59e0b;
  --btn-danger: #ef4444;
  --btn-purple: #8b5cf6;
}

    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: Inter, Arial, sans-serif;
      background: linear-gradient(180deg, #f7faff, #eef4fb 60%);
      color: var(--text);
      padding: 20px;
      min-height: 100vh;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%);
      pointer-events: none;
    }

    .container {
      max-width: 1280px;
      margin: 0 auto;
    }

    .header {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 22px;
      align-items: center;
    }

    .header-left h1 {
      margin: 0 0 8px;
      font-size: clamp(2rem, 2.6vw, 3rem);
    }

    .header-left p {
      margin: 0;
      color: var(--muted);
      max-width: 720px;
    }

    .button-group {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
    }

    .button-group .button-link,
    .button-link,
    button,
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 36px;
      padding: 0 16px;
      border-radius: 999px;
      border: 1px solid transparent;
      background: var(--button-bg);
      color: var(--button-text);
      font-weight: 700;
      text-decoration: none;
      letter-spacing: 0.01em;
      box-shadow: 0 14px 34px rgba(59,130,246,0.16);
      transition: transform .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
      cursor: pointer;
      white-space: nowrap;
      min-width: 120px;
    }

    button,
    .btn {
      border: none;
    }

    .button-link,
    .btn-secondary {
      background: #fbfdff;
      color: var(--accent);
      border-color: rgba(59,130,246,0.18);
      box-shadow: 0 10px 24px rgba(37,99,235,0.08);
    }

    .btn-primary {
      background: var(--btn-primary);
      color: var(--button-text);
    }

    .btn-success {
      background: var(--btn-success);
      color: var(--button-text);
    }

    .btn-info {
      background: var(--btn-info);
      color: var(--button-text);
    }

    .btn-warning {
      background: var(--btn-warning);
      color: var(--button-text);
    }

    .btn-danger {
      background: var(--btn-danger);
      color: var(--button-text);
    }

    .btn-purple {
      background: var(--btn-purple);
      color: var(--button-text);
    }

    .btn-dark {
      background: #1f2937;
      color: var(--button-text);
    }

    .btn-sm {
      min-height: 28px;
      padding: 0 10px;
      font-size: 0.86rem;
      min-width: 90px;
    }

    .button-link:hover,
    button:hover,
    .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 36px rgba(59,130,246,0.2);
      filter: brightness(1.03);
    }

    .button-link.secondary:hover,
    .btn-secondary:hover {
      background: #dbeafe;
    }

    .dropdown {
      position: relative;
    }

    /* If the dropdown trigger uses the `.btn` classes, keep the shared button styles.
       Only apply the special dropdown-only appearance to buttons that are NOT `.btn`. */
    .dropdown > button:not(.btn) {
      border: none;
      border-radius: 16px;
      min-height: 36px;
      padding: 0 14px;
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.02em;
      color: #ffffff;
      background: var(--button-bg);
      box-shadow: 0 12px 26px rgba(37,99,235,0.18);
      transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
      cursor: pointer;
    }

    .dropdown > button:not(.btn):hover {
      transform: translateY(-1px);
      background: #1e40af;
      box-shadow: 0 14px 28px rgba(37,99,235,0.2);
    }

    .header-update {
      margin: 2px 0 0;
      color: #4b5563;
      font-size: 13px;
      line-height: 1.25;
    }

    .menu-content {
      display: none;
      position: absolute;
      right: 0;
      top: calc(100% + 10px);
      background: #fbfdff;
      border: 1px solid #d1d9e6;
      border-radius: 12px;
      padding: 8px;
      min-width: 260px;
      box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      z-index: 40;
    }

    .menu-content.is-open { display: block; }

    .menu-link {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      color: #202124;
      text-decoration: none;
      border-radius: 9px;
      font-size: 14px;
      font-weight: 600;
      line-height: 1.25;
    }

    .menu-link + .menu-link {
      margin-top: 4px;
    }

    .menu-link:hover {
      background: #edf4ff;
      color: #174ea6;
    }

    button:not(.btn) {
      border: none;
      border-radius: 8px;
      padding: 10px 14px;
      background: var(--accent);
      color: #ffffff;
      cursor: pointer;
      font-weight: 700;
      transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
      box-shadow: 0 6px 18px rgba(26,115,232,0.08);
    }

    button:not(.btn):hover { transform: translateY(-1px); filter: brightness(1.03); box-shadow: 0 10px 28px rgba(26,115,232,0.12); }

    .metrics-grid,
    .main-grid,
    .forms-grid {
      display: grid;
      gap: 18px;
      margin-bottom: 18px;
    }

    .metrics-grid {
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .card-panel,
    .panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: var(--shadow);
      padding: 18px;
      overflow: hidden;
    }

    .panel-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      margin-bottom: 16px;
    }

    .panel-header h2 {
      margin: 0;
      font-size: 1.05rem;
    }

    .panel-header small {
      color: var(--muted);
    }

    .metric-card {
      border-radius: 18px;
      padding: 18px;
      background: rgba(255,255,255,0.04);
      min-height: 140px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    .metric-card strong {
      display: block;
      font-size: 1.8rem;
      margin-bottom: 8px;
    }

    .metric-card span {
      color: var(--muted);
      font-size: 0.95rem;
    }

    .main-grid {
      grid-template-columns: 1fr 1fr;
    }

    .page-index .main-grid {
      grid-template-columns: 1fr 1fr;
      gap: 18px;
      align-items: start;
    }

    /* Ensure both panels look symmetric on desktop without affecting mobile */
    @media (min-width: 901px) {
      .page-index .panel {
        min-height: 480px;
      }
    }

    .kanban {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 14px;
    }

    .kanban-column {
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(148,163,184,0.15);
      border-radius: 18px;
      padding: 14px;
      min-height: 360px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .kanban-column h3 {
      margin: 0;
      font-size: 1rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }

    .dropzone {
      flex: 1;
      border-radius: 16px;
      padding: 10px;
      border: 2px dashed transparent;
      transition: all .2s ease;
      min-height: 180px;
      overflow-y: auto;
      display: grid;
      gap: 10px;
    }

    .dropzone.drag-over {
      border-color: var(--accent);
      background: rgba(56, 189, 248, 0.12);
    }

    .process-card {
      background: #fbfdff;
      color: #0f172a;
      border-radius: 14px;
      padding: 14px;
      cursor: grab;
      box-shadow: 0 9px 24px rgba(15,23,42,0.12);
      display: grid;
      gap: 8px;
    }

    .process-card small {
      color: #475569;
    }

    .table-wrapper {
      overflow-x: auto;
    }

    /* Audit modal filters layout: 3 columns on desktop, stacked on mobile */
    .audit-filters {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      align-items: start;
      margin-bottom: 12px;
    }

    .audit-filters .audit-filters-col {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .audit-filters .audit-filter-actions {
      display: flex;
      gap: 8px;
      margin-top: 4px;
    }

    .product-search { position: relative; }
    .product-search .suggestions {
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 6px);
      background: #fbfdff;
      border: 1px solid #e6eef8;
      box-shadow: 0 8px 20px rgba(15,23,42,0.06);
      border-radius: 8px;
      list-style: none;
      padding: 6px 0;
      margin: 0;
      z-index: 60;
      max-height: 220px;
      overflow-y: auto;
    }

    .product-search .suggestions li {
      padding: 8px 12px;
      cursor: pointer;
      font-size: 0.95rem;
      color: var(--text);
    }

    .product-search .suggestions li:hover { background: #f1f5f9; }

    .product-search .suggestions .no-results { color: var(--muted); cursor: default; }

    @media (max-width: 900px) {
      .audit-filters { grid-template-columns: 1fr; }
    }

    /* Mobile: stack movement modal fields */
    @media (max-width: 640px) {

      .pipeline-modal-dialog { max-width: 96vw !important; width: 96vw !important; margin: 0 2vw !important; }

      /* Force stacked layout for movement modal fields */
      .pipeline-modal-dialog .movement-form-header,
      .pipeline-modal-dialog .movement-form-top {
        display: block !important;
      }

      .pipeline-modal-dialog .movement-form-header > label,
      .pipeline-modal-dialog .movement-form-top > label {
        display: block !important;
        width: 100% !important;
        margin-bottom: 10px !important;
      }

      .movement-form-header label,
      .movement-form-top label { font-size: 0.9rem; }


      .pipeline-modal-dialog .movement-row {
        display: block !important;
      }

      .pipeline-modal-dialog .movement-row > * { width: 100% !important; display: block !important; margin-bottom: 8px; }

      .movement-actions-row { justify-content: center; }

      .movement-add-row { width: 100%; text-align: center; }

      .pipeline-modal-actions { justify-content: center; }
      .pipeline-modal-actions .btn { min-width: 140px; width: 48%; }
    }

    /* Audit filter labels and alignment */
    .audit-filters label {
      display: block;
      font-size: 0.85rem;
      color: var(--muted, #6b7280);
      margin-bottom: 6px;
      font-weight: 600;
    }

    .audit-filters .audit-filters-col input[type="text"],
    .audit-filters .audit-filters-col input[type="date"],
    .audit-filters .audit-filters-col select {
      width: 100%;
      box-sizing: border-box;
    }

    .audit-filter-actions { display: flex; gap: 12px; align-items: center; }

    /* Slightly smaller input placeholders */
    .audit-filters input::placeholder { font-size: 0.95rem; }

    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 560px;
    }

    th, td {
      padding: 12px 10px;
      text-align: left;
      border-bottom: 1px solid rgba(148,163,184,0.12);
      font-size: 0.95rem;
    }

    .page-forecast #forecastTable th {
      font-size: 12px;
    }

    .page-forecast #forecastTable td {
      font-size: 12px;
    }

    .page-forecast #forecastTable td:nth-child(1),
    .page-forecast #forecastTable td:nth-child(2) {
      font-size: 10px;
    }

    .page-forecast #forecastTable td:nth-child(n+3) {
      font-size: 11px;
    }

    .page-index #vinedoStock th:nth-child(1),
    .page-index #vinedoStock th:nth-child(2),
    .page-index #vinedoStock td:nth-child(1),
    .page-index #vinedoStock td:nth-child(2),
    .page-index #romanoStock th:nth-child(1),
    .page-index #romanoStock th:nth-child(2),
    .page-index #romanoStock td:nth-child(1),
    .page-index #romanoStock td:nth-child(2) {
      font-size: 10px;
    }

    .page-index #vinedoStock th:nth-child(3),
    .page-index #vinedoStock td:nth-child(3),
    .page-index #romanoStock th:nth-child(3),
    .page-index #romanoStock td:nth-child(3) {
      font-size: 13px;
    }

    th {
      color: var(--accent);
      font-weight: 700;
    }

    td {
      color: var(--text);
    }

    .badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 0.8rem;
      font-weight: 700;
      background: rgba(255,255,255,0.08);
      color: var(--text);
    }

    .badge.success { background: rgba(34,197,94,0.15); color: #a7f3d0; }
    .badge.warning { background: rgba(251,191,36,0.15); color: #fde68a; }
    .badge.danger { background: rgba(248,113,113,0.15); color: #fecaca; }

    form {
      display: grid;
      gap: 12px;
    }

    input, select, textarea {
      width: 100%;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text);
      padding: 10px 12px;
      font-size: 0.95rem;
      outline: none;
    }

    textarea { min-height: 120px; resize: vertical; }

    .form-row {
      display: grid;
      gap: 12px;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .alert {
      padding: 14px 16px;
      border-radius: 14px;
      background: rgba(56,189,248,0.12);
      color: var(--text);
      border: 1px solid rgba(56,189,248,0.22);
    }

    .panel-hidden { display: none; }
    .panel-footer {
      margin-top: 14px;
      color: var(--muted);
      font-size: 0.9rem;
    }

    @media (max-width: 900px) {
      .main-grid, .page-index .main-grid { grid-template-columns: 1fr; }
      .forms-grid { grid-template-columns: 1fr; }
      .page-pipeline .finished-toolbar { grid-template-columns: 1fr; }
      .page-pipeline .pipeline-modal-wide { width: min(96vw, 1220px); }
      .page-pipeline .pipeline-header {
        flex-direction: column;
        align-items: stretch;
      }
      .page-pipeline .button-group {
        width: 100%;
        justify-content: flex-start;
      }
      .page-pipeline .button-group > button:not(#btnMenu),
      .page-pipeline .button-group > .btn:not(#btnMenu),
      .page-pipeline .button-group > a,
      .page-pipeline .button-group .button-link,
      .page-pipeline .dropdown > button:not(#btnMenu) {
        width: 100%;
      }
      .page-pipeline .button-group > button#btnMenu,
      .page-pipeline .button-group > .btn#btnMenu,
      .page-pipeline .dropdown > button#btnMenu {
        width: 52px;
        min-width: 52px;
      }
      .page-pipeline .pipeline-form-row {
        flex-direction: column;
      }
      .page-pipeline .pipeline-form-row .grow-2,
      .page-pipeline .pipeline-form-row .grow-1,
      .page-pipeline .pipeline-form-row .grow-auto {
        flex: 1 1 100%;
        min-width: 0;

        #warehouseSelectionPanel {
          display: none;
        }
      }
      .page-pipeline .dashboard-link {
        width: 100%;
        justify-content: center;
      }
      /* menu button mobile positioning removed per user request */
      /* Mobile: force menu dropdown to open downward and aligned to the right of the trigger */
      .header .menu-content {
        left: auto !important;
        right: 0 !important;
        transform: none !important;
        top: calc(100% + 8px);
        min-width: 160px;
        box-shadow: 0 18px 36px rgba(15,23,42,0.12);
        z-index: 60;
      }
      
        
    }

    /* Pipeline page */
    body.page-pipeline {
      padding: 20px;
      background: radial-gradient(circle at top right, rgba(26, 115, 232, 0.06), transparent 34%),
                  radial-gradient(circle at top left, rgba(251, 188, 5, 0.08), transparent 40%),
                  #f8f9fa;
      color: #202124;
    }

    .page-pipeline .pipeline-header,
    .page-pipeline .header {
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap: 16px;
      margin-bottom:18px;
      flex-wrap: wrap;
      background: var(--panel);
      border: 1px solid #d3dae6;
      border-radius: 18px;
      padding: 14px 18px;
      box-shadow: 0 10px 24px rgba(32, 33, 36, 0.12);
    }

    .page-pipeline .button-group {
      gap: 12px;
      align-items: center;
      justify-content: flex-start;
      flex-wrap: wrap;
      width: auto;
      margin-left: auto;
      flex: 0 1 auto;
    }

    .page-pipeline .dropdown {
      margin-left: 12px;
    }

    .page-pipeline .button-group > button,
    .page-pipeline .button-group > .btn,
    .page-pipeline .button-group > a,
    .page-pipeline .dropdown > button {
      min-height: 40px;
      min-width: 140px;
      padding: 0 20px;
      border-radius: 999px;
      font-size: 0.95rem;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 14px 30px rgba(37, 99, 235, 0.16);
    }

    .page-pipeline .button-group > button#btnMenu,
    .page-pipeline .dropdown > button {
      width: 52px;
      min-width: 52px;
      height: 52px;
      padding: 0;
      border-radius: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 14px 30px rgba(37, 99, 235, 0.16);
    }

    .page-pipeline .pipeline-header h1,
    .page-pipeline .header h1 {
      margin:0;
      color:#174ea6;
      font-size: clamp(2rem, 2.6vw, 2.6rem);
    }

    .page-pipeline .button-link:not(.btn) {
      color: var(--accent);
      text-decoration: none;
      background: var(--panel);
      border: 1px solid rgba(59,130,246,0.18);
      border-radius: 16px;
      padding: 0 16px;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 8px 20px rgba(37,99,235,0.08);
    }

    .page-pipeline .button-link:hover {
      background:#dbeafe;
    }

    .page-pipeline #pipelinePanel {
      display: none;
    }

    .page-pipeline .pipeline-grid {
      display:grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap:12px;
      margin-top: 20px;
    }

    .page-pipeline .column {
      background: var(--panel);
      border:1px solid #dfe3eb;
      border-radius:18px;
      padding:12px;
      min-height:260px;
      display:flex;
      flex-direction:column;
      box-shadow:0 8px 24px rgba(26, 115, 232, 0.08);
      border-top: 4px solid var(--proc-color, #1a73e8);
    }

    .page-pipeline .column h3 {
      margin:0 0 10px;
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap: 10px;
      color:#1f2937;
      font-size: 1rem;
    }

    .page-pipeline .column h3 .badge {
      border-radius: 999px;
      padding: 5px 10px;
      font-size: 12px;
      font-weight: 800;
      box-shadow: none;
    }

    .page-pipeline .card {
      background:var(--panel);
      color:#202124;
      border-radius:12px;
      padding:8px;
      margin-bottom:8px;
      cursor:pointer;
      box-shadow:0 8px 20px rgba(26, 115, 232, 0.10);
      border:1px solid #dfe3eb;
      transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
      line-height: 1.15;
      font-size: 0.75rem;
    }

    .page-pipeline .card:hover {
      transform: translateY(-2px);
      box-shadow:0 12px 24px rgba(26, 115, 232, 0.14);
      border-color:#c9dafc;
    }

    .page-pipeline .card strong {
      display:block;
      margin-bottom: 2px;
      color:#174ea6;
      font-size: 0.75rem;
      line-height: 1.1;
    }

    .page-pipeline .card small {
      color:#5f6368;
      display:block;
      font-size: 0.7rem;
    }

    .page-pipeline .add-form { margin-bottom:18px; }

    .page-pipeline .dashboard-link {
      color:#174ea6;
      text-decoration:none;
      padding:10px 14px;
      border-radius:12px;
      background:#e8f0fe;
      border:1px solid #c9dafc;
      font-weight:600;
      display:inline-flex;
      align-items:center;
    }

    .page-pipeline .dashboard-link:hover { background:#d8e6fd; }

    .page-pipeline .pipeline-form-row { display:flex; gap:10px; flex-wrap:wrap; }
    .page-pipeline .pipeline-form-row > * { min-width: 0; }
    .page-pipeline .grow-2 { flex:2; min-width: 0; }
    .page-pipeline .grow-1 { flex:1; min-width: 0; }
    .page-pipeline .grow-auto { flex:0 0 auto; min-width: 0; }

    .page-pipeline .add-form .pipeline-form-row {
      align-items: stretch;
    }

    .page-pipeline .add-form select,
    .page-pipeline .add-form input,
    .page-pipeline .add-form button {
      min-height: 40px;
      border-radius: 12px;
      min-width: 0;
    }

    .page-pipeline .add-form button {
      padding: 0 18px;
      font-weight: 700;
      white-space: nowrap;
    }

    .page-pipeline .dropzone {
      display: grid;
      gap: 10px;
      min-height: 220px;
      padding: 8px 2px 2px;
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255,255,255,0.45));
      border: 1px dashed transparent;
      transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
    }

    .page-pipeline .dropzone.drag-over {
      background: #edf4ff;
      border-color:#c9dafc;
      box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.06);
    }

    .pipeline-modal {
      position: fixed;
      inset: 0;
      z-index: 9999;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      overflow: auto;
      background: rgba(15, 23, 42, 0.08);
    }

    .pipeline-modal.open {
      display: flex !important;
      opacity: 1;
    }

    .pipeline-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.55);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
    }

    .pipeline-modal-dialog {
      position: relative;
      width: min(1060px, 100%);
      max-height: 92vh;
      /* allow native dropdowns to overflow the dialog bounds on small screens */
      overflow: visible;
      border-radius: 28px;
      border: 1px solid rgba(148, 163, 184, 0.22);
      background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
      box-shadow: 0 30px 80px rgba(15, 23, 42, 0.16);
    }

    .pipeline-modal-wide {
      width: min(940px, 96vw);
    }

    .pipeline-modal-sm {
      width: min(560px, 95vw);
    }

    .pipeline-modal-header {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 18px;
      padding: 24px 28px 18px;
      border-bottom: 1px solid rgba(148, 163, 184, 0.18);
      background: var(--panel);
      position: sticky;
      top: 0;
      z-index: 2;
    }

    .pipeline-modal-header h2 {
      margin: 0;
      font-size: 1.4rem;
      font-weight: 700;
      color: #0f172a;
      letter-spacing: -0.02em;
    }

    .pipeline-modal-header-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-left: auto;
    }

    .pipeline-modal-close {
      border: none;
      background: #1d4ed8;
      color: #ffffff;
      border-radius: 999px;
      width: 44px;
      height: 44px;
      font-size: 22px;
      display: grid;
      place-items: center;
      transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
      box-shadow: 0 16px 32px rgba(29, 78, 216, 0.18);
      cursor: pointer;
    }

    .pipeline-modal-close:hover {
      background: #2563eb;
      transform: translateY(-1px);
      box-shadow: 0 18px 36px rgba(29, 78, 216, 0.2);
    }


    .pipeline-modal-body::-webkit-scrollbar {
      width: 10px;
    }

    .pipeline-modal-body::-webkit-scrollbar-track {
      background: rgba(148, 163, 184, 0.12);
      border-radius: 999px;
    }

    .pipeline-modal-body::-webkit-scrollbar-thumb {
      background: rgba(59, 130, 246, 0.35);
      border-radius: 999px;
      border: 2px solid rgba(255, 255, 255, 0.8);
    }

    .pipeline-modal-body {
      scrollbar-width: thin;
      scrollbar-color: rgba(59, 130, 246, 0.35) rgba(148, 163, 184, 0.12);
      padding: 22px 28px 28px;
      color: #0f172a;
      max-height: calc(92vh - 100px);
      overflow-y: auto;
    }

    .pipeline-modal-form {
      display: grid;
      gap: 18px;
    }

    .movement-form-header,
    .movement-form-top {
      display: grid;
      gap: 16px;
      grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(180px, 1.1fr) minmax(180px, 1.4fr);
      align-items: start;
      min-width: 0;
    }

    .movement-form-header label,
    .movement-form-top label {
      display: grid;
      gap: 6px;
      font-size: 0.92rem;
      color: #334155;
      font-weight: 600;
      width: 100%;
      max-width: 100%;
      min-width: 0;
    }

    .movement-form-header input[readonly] {
      background: #f1f5f9;
      cursor: default;
    }

    .movement-table-header {
      display: grid;
      grid-template-columns: 2.8fr 1fr 1.5fr 0.4fr;
      gap: 12px;
      align-items: center;
      font-size: 0.9rem;
      font-weight: 700;
      color: #475569;
      padding: 10px 14px;
      border-radius: 16px;
      background: rgba(248, 250, 252, 0.95);
      border: 1px solid rgba(148, 163, 184, 0.14);
    }

    .movement-table-type {
      display: grid;
      gap: 6px;
      margin: 0;
    }

    .movement-actions-row {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      padding-top: 4px;
      min-width: 0;
      overflow: hidden;
    }

    .movement-rows {
      display: grid;
      gap: 12px;
    }

    .movement-row {
      display: grid;
      grid-template-columns: 2.5fr minmax(120px, 0.8fr) minmax(170px, 1fr) auto;
      gap: 12px;
      align-items: center;
      min-width: 0;
    }

    .movement-row > * {
      min-width: 0;
    }

    .movement-row label {
      display: grid;
      gap: 6px;
      margin: 0;
      font-size: 0.92rem;
      color: #334155;
      font-weight: 500;
      min-width: 0;
    }

    .product-search-wrapper {
      position: relative;
    }

    .product-search-input {
      width: 100%;
      min-height: 42px;
      border-radius: 14px;
      border: 1px solid rgba(148, 163, 184, 0.32);
      background: #f8fafc;
      color: #0f172a;
      padding: 12px 14px;
      font-size: 0.96rem;
      outline: none;
      transition: border-color .16s ease, box-shadow .16s ease;
    }

    .product-search-input:focus {
      border-color: rgba(37, 99, 235, 0.7);
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
    }

    .product-suggestions {
      position: absolute;
      z-index: 10;
      top: calc(100% + 8px);
      left: 0;
      right: 0;
      margin: 0;
      padding: 8px 0;
      list-style: none;
      border-radius: 16px;
      background: var(--panel);
      border: 1px solid rgba(148, 163, 184, 0.22);
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
      max-height: 220px;
      overflow-y: auto;
    }

    .product-stock-hint {
      margin-top: 6px;
      font-size: 0.78rem;
      color: #475569;
      padding: 6px 10px;
      border-radius: 10px;
      background: #f8fafc;
      border: 1px solid rgba(148, 163, 184, 0.12);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: inline-block;
    }

    /* small placeholder for quantity showing available stock */
    .pipeline-modal-form input.quantity-with-stock::placeholder {
      font-size: 0.78rem;
      color: #64748b;
      opacity: 1; /* keep visible */
    }

    .product-suggestions li {
      padding: 10px 14px;
      cursor: pointer;
      color: #0f172a;
      font-size: 0.95rem;
      transition: background .16s ease;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .product-suggestions li:hover {
      background: rgba(37, 99, 235, 0.08);
    }

    .product-suggestions .no-results {
      cursor: default;
      color: #64748b;
    }

    .movement-row .movement-row-remove {
      height: 42px;
      width: 42px;
      border: 1px solid rgba(148, 163, 184, 0.3);
      border-radius: 14px;
      background: var(--panel);
      color: #e11d48;
      font-size: 1.2rem;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      justify-self: center;
      align-self: end;
      cursor: pointer;
      transition: background .16s ease, border-color .16s ease, transform .16s ease;
      margin: 0;
    }

    .movement-row .movement-row-remove:hover {
      background: #fef2f2;
      border-color: #fca5a5;
      transform: translateY(-1px);
    }

    .pipeline-modal-form input,
    .pipeline-modal-form select,
    .pipeline-modal-form textarea {
      width: 100%;
      min-height: 42px;
      border-radius: 14px;
      border: 1px solid #cbd5e1;
      background: #f8fafc;
      color: #0f172a;
      padding: 12px 14px;
      font-size: 0.96rem;
      outline: none;
      transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    }

    .pipeline-modal-form input.input-error,
    .pipeline-modal-form textarea.input-error,
    .pipeline-modal-form select.input-error {
      border-color: #ef4444;
      box-shadow: 0 2px 8px rgba(239,68,68,0.08);
      background: #fff7f7;
    }

    .form-error {
      display: none;
      color: var(--danger);
      margin-top: 0.5rem;
      font-size: 0.92rem;
    }

    .pipeline-modal-form textarea {
      min-height: 130px;
      resize: vertical;
      line-height: 1.6;
    }

    .password-admin-value-wrap {
      display: none;
    }

    /* Previous notes block inside temperature modal */
    .temperature-previous-notes {
      margin: 8px 0 6px 0;
      padding: 8px;
      border: 1px solid #e6edf8;
      background: #fbfdff;
      border-radius: 8px;
      max-height: 160px;
      overflow: auto;
      font-size: 13px;
      color: #374151;
    }
    .temperature-previous-note {
      padding: 6px 8px;
      border-radius: 6px;
      background: var(--panel);
      margin-bottom: 6px;
      box-shadow: 0 1px 0 rgba(15,23,42,0.03);
      white-space: pre-wrap;
    }

    .pipeline-modal-form input:focus,
    .pipeline-modal-form select:focus,
    .pipeline-modal-form textarea:focus {
      border-color: #2563eb;
      background: var(--panel);
      box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    }

    .pipeline-modal-form select {
      appearance: none;
      background-image: linear-gradient(45deg, transparent 50%, #0f172a 50%), linear-gradient(135deg, #0f172a 50%, transparent 50%);
      background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
      background-size: 6px 6px, 6px 6px;
      background-repeat: no-repeat;
    }

    /* Custom select for mobile-friendly dropdown */
    .custom-select {
      position: relative;
      width: 100%;
      min-height: 42px;
      border-radius: 14px;
      border: 1px solid #cbd5e1;
      background: #f8fafc;
      display: block;
      box-sizing: border-box;
    }

    .custom-select-trigger {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      min-height: 42px;
      padding: 12px 14px;
      background: #f8fafc !important;
      border: 1px solid #cbd5e1;
      cursor: pointer;
      font-size: 0.96rem;
      color: #0f172a !important;
      text-align: left;
      outline: none;
      appearance: none;
      box-shadow: none !important;
      border-radius: 14px;
    }

    .custom-select-trigger:hover,
    .custom-select.open .custom-select-trigger {
      background: #f8fafc !important;
    }

    button.custom-select-trigger {
      background: #f8fafc !important;
      color: #0f172a !important;
      box-shadow: none !important;
    }

    .custom-select-value {
      display: inline-block;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .custom-select-arrow {
      margin-left: 12px;
      opacity: 0.9;
      font-size: 1.1rem;
      color: #0f172a;
    }

    .custom-select-options {
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 6px);
      z-index: 10050;
      background: var(--panel);
      border: 1px solid rgba(148,163,184,0.18);
      border-radius: 12px;
      box-shadow: 0 12px 30px rgba(15,23,42,0.12);
      max-height: 260px;
      overflow-y: auto;
      padding: 6px 0;
      -webkit-overflow-scrolling: touch;
      margin: 0;
      box-sizing: border-box;
      min-width: 0;
    }

    .custom-select-options li {
      list-style: none;
      padding: 10px 14px;
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: #0f172a;
    }

    .custom-select-trigger, .custom-select-value { box-sizing: border-box; }

    .custom-select-options li:hover,
    .custom-select-options li[aria-selected="true"] {
      background: rgba(37,99,235,0.08);
    }

    /* Ensure the options render inside modal visible area on very small screens */
    @media (max-height: 480px) {
      .custom-select-options { max-height: 36vh; }
    }

    .movement-add-row {
      width: fit-content;
      padding: 12px 16px;
      border-radius: 999px;
      border: 1px solid rgba(37, 99, 235, 0.18);
      background: #eff6ff;
      color: #1d4ed8;
      font-weight: 700;
      cursor: pointer;
      transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
    }

    .movement-add-row:hover {
      background: #dbeafe;
      transform: translateY(-1px);
      box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
    }

    .pipeline-modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 14px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .pipeline-modal-actions .btn {
      min-width: 150px;
      padding: 14px 20px;
      border-radius: 999px;
      font-weight: 700;
    }

    .pipeline-modal-actions .btn-secondary {
      background: #f1f5f9;
      color: #0f172a;
      border: 1px solid transparent;
      box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    }

    .pipeline-modal-actions .btn-secondary:hover {
      background: #e2e8f0;
    }

    .pipeline-modal-actions .btn-primary {
      background: #1d4ed8;
      color: #ffffff;
      box-shadow: 0 16px 30px rgba(29, 78, 216, 0.18);
      border: 1px solid transparent;
    }

    .pipeline-modal-actions .btn-primary:hover {
      background: #2563eb;
    }

    .pipeline-modal-actions .btn-primary:disabled {
      opacity: 0.65;
      cursor: not-allowed;
    }

    .pipeline-modal form .field-helper {
      font-size: 0.85rem;
      color: #64748b;
      margin-top: -8px;
      margin-bottom: 6px;
    }

    .pipeline-modal .section-title {
      margin: 0;
      color: #0f172a;
      font-size: 1rem;
      font-weight: 700;
    }

    .pipeline-modal .section-description {
      margin: 0;
      color: #64748b;
      font-size: 0.9rem;
      line-height: 1.5;
    }

    .pipeline-modal .input-row {
      display: grid;
      gap: 16px;
    }

    @media (max-width: 720px) {
      .pipeline-modal-dialog {
        width: min(92vw, 100%);
      }

      .pipeline-modal-header {
        padding: 18px 20px 16px;
        grid-template-columns: 1fr;
        row-gap: 12px;
      }

      .pipeline-modal-body {
        padding: 20px 20px 24px;
      }

      .page-pipeline .pipeline-modal-header-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
      }

      .page-pipeline .pipeline-modal-header-actions button,
      .page-pipeline .pipeline-modal-header-actions .btn-soft {
        width: 100%;
      }
    }

    .page-pipeline .pipeline-modal-header-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .page-pipeline .pipeline-modal-header h2 {
      margin: 0;
      font-size: 1.2rem;
      color: #1f2937;
    }

    .page-pipeline .pipeline-modal-close {
      border: none;
      background: var(--button-surface);
      color: var(--button-muted-text);
      border-radius: 14px;
      width: 40px;
      height: 40px;
      font-size: 20px;
      line-height: 1;
      box-shadow: 0 6px 16px rgba(37,99,235,0.12);
      padding: 0;
      transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
    }

    .page-pipeline .pipeline-modal-close:hover {
      background: #dbeafe;
      transform: translateY(-1px);
      box-shadow: 0 8px 18px rgba(37,99,235,0.16);
    }

    .page-pipeline .pipeline-modal-body {
      padding: 16px;
      color: #1f2937;
    }

    .page-pipeline .tracking-meta {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }

    .page-pipeline .tracking-chip {
      border: 1px solid #dce6f4;
      background: #f8fbff;
      border-radius: 12px;
      padding: 10px;
      font-size: 13px;
    }

    .page-pipeline .tracking-chip strong {
      display: block;
      color: #174ea6;
      margin-bottom: 3px;
    }

    .page-pipeline .tracking-section {
      border: 1px solid #e3e8f1;
      border-radius: 14px;
      padding: 12px;
      margin-bottom: 12px;
      background: var(--panel);
    }

    .page-pipeline .tracking-section h3 {
      margin: 0 0 10px;
      color: #1f2937;
      font-size: 15px;
    }

    .page-pipeline .tracking-table-wrap {
      overflow: auto;
    }

    .page-pipeline .tracking-table {
      width: 100%;
      min-width: 680px;
      border-collapse: collapse;
    }

    .page-pipeline .tracking-table th,
    .page-pipeline .tracking-table td {
      border-bottom: 1px solid #edf1f6;
      padding: 8px;
      color: #374151;
      font-size: 13px;
    }

    .page-pipeline .tracking-table th {
      color: #174ea6;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      font-size: 12px;
    }

    .page-pipeline .tracking-table input[type='datetime-local'] {
      min-width: 180px;
      padding: 8px 10px;
      font-size: 13px;
      border-radius: 10px;
    }

    .page-pipeline .tracking-inline-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .page-pipeline .btn-soft {
      background: var(--button-surface);
      color: var(--button-muted-text);
      box-shadow: none;
      border: 1px solid rgba(37,99,235,0.14);
    }

    .page-pipeline .btn-soft:hover {
      background: #dbeafe;
    }

    .page-pipeline .tracking-note {
      color: #5f6368;
      font-size: 12px;
      margin-top: 8px;
    }

    .page-pipeline .panel-surface {
      border: 1px solid #dfe8f5;
      border-radius: 16px;
      background: linear-gradient(180deg, #fbfdff, #fbfdff);
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    }

    .page-pipeline .split-form {
      display: grid;
      gap: 10px;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      align-items: end;
    }

    .page-pipeline .split-form label {
      display: grid;
      gap: 5px;
      font-size: 12px;
      color: #4b5563;
    }

    .page-pipeline .split-list {
      margin-top: 10px;
      border-top: 1px dashed #dce5f2;
      padding-top: 8px;
      display: grid;
      gap: 6px;
    }

    .page-pipeline .split-item {
      border: 1px solid #e7edf7;
      border-radius: 10px;
      padding: 8px;
      background: #fbfdff;
      font-size: 13px;
      color: #374151;
    }

    .page-pipeline .pipeline-modal-form {
      display: grid;
      gap: 10px;
    }

    .page-pipeline .pipeline-modal-form label {
      display: grid;
      gap: 5px;
      font-size: 13px;
      color: #4b5563;
    }

    .page-pipeline .pipeline-modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .page-pipeline .finished-toolbar {
      display: grid;
      gap: 14px;
      grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
      margin-bottom: 16px;
      padding: 14px;
    }

    .page-pipeline .finished-toolbar-search,
    .page-pipeline .finished-toolbar-hint {
      display: grid;
      gap: 8px;
      align-content: start;
    }

    .page-pipeline .finished-toolbar-search small,
    .page-pipeline .finished-toolbar-hint small {
      color: #64748b;
      font-size: 12px;
      line-height: 1.35;
    }

    .page-pipeline .finished-toolbar strong {
      display: block;
      color: #174ea6;
      font-size: 13px;
      letter-spacing: 0.02em;
    }

    .page-pipeline .finished-data-table {
      width: 100%;
      min-width: 760px;
      border-collapse: collapse;
    }

    .page-pipeline .finished-search-row {
      display: grid;
      grid-template-columns: minmax(260px, 1fr) minmax(180px, 320px);
      gap: 16px;
      align-items: start;
      margin-bottom: 14px;
    }

    .page-pipeline .finished-search-col {
      display: grid;
      gap: 8px;
      min-width: 0;
    }

    .page-pipeline .finished-search-col--search {
      min-width: 260px;
    }

    .page-pipeline .finished-search-col--dates {
      display: grid;
      gap: 10px;
    }

    .page-pipeline .finished-search-block {
      display: grid;
      gap: 8px;
      min-width: 0;
    }

    .page-pipeline .finished-search-block h3 {
      margin: 0;
      color: #174ea6;
      font-size: 14px;
      font-weight: 700;
    }

    .page-pipeline .finished-search-input-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .page-pipeline .finished-search-input-wrap .stock-search-input {
      width: 100%;
      height: 38px;
      padding: 0 12px;
      border-radius: 10px;
      font-size: 13px;
      border: 1px solid #d2d8e0;
      background: var(--panel);
      color: #202124;
      box-shadow: none;
    }

    .page-pipeline .finished-search-dates {
      display: grid;
      gap: 12px;
      padding: 14px;
      border: 1px solid #d2d8e0;
      border-radius: 12px;
      background: #f8fbff;
    }

    .page-pipeline .finished-date-field {
      display: grid;
      gap: 6px;
    }

    .page-pipeline .finished-date-field label {
      color: #475569;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.02em;
    }

    .page-pipeline .finished-search-dates input[type="date"] {
      width: 100%;
      height: 38px;
      padding: 0 12px;
      border-radius: 10px;
      border: 1px solid #d2d8e0;
      background: var(--panel);
      color: #202124;
      box-shadow: none;
    }

    @media (max-width: 720px) {
      .page-pipeline .finished-search-row {
        grid-template-columns: 1fr;
      }

      .page-pipeline .finished-search-col--search,
      .page-pipeline .finished-search-col--dates {
        width: 100%;
      }

      .page-pipeline .finished-search-dates {
        grid-template-columns: 1fr;
      }

      .page-pipeline .finished-search-input-wrap,
      .page-pipeline .finished-date-field {
        width: 100%;
      }
    }

    .page-pipeline .finished-search-help {
      display: grid;
      gap: 4px;
      flex: 0 1 320px;
      padding-top: 28px;
    }

    .page-pipeline .finished-search-help span {
      color: #174ea6;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .page-pipeline .finished-search-help small {
      color: #64748b;
      font-size: 12px;
      line-height: 1.35;
    }

    .page-pipeline .finished-search-row .stock-selected-filters {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      min-height: 28px;
      max-width: 100%;
    }

    .page-pipeline .stock-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 600;
      background: #e8f0fe;
      color: #174ea6;
      border: 1px solid #c9dafc;
      line-height: 1;
    }

/* ===== Login page: transparent card, Google-like clean inputs ===== */
.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 18px;
  background-position: center center;
  background-size: cover;
}

.page-login .login-shell {
  width: min(720px, 96%);
  max-width: 560px;
  background: rgba(255,255,255,0.45); /* más transparente */
  border-radius: 16px;
  padding: 36px 34px;
  box-shadow: 0 12px 36px rgba(2,6,23,0.12);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  backdrop-filter: blur(6px) saturate(120%);
  color: #0f172a;
  text-align: center;
}

.login-brand-circle {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg,#fbfdff,#f3f4f6);
  box-shadow: 0 6px 18px rgba(2,6,23,0.12);
  padding: 8px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0b1220;
}

.login-subtitle {
  margin: 0 0 18px;
  color: #475569;
  font-size: 0.95rem;
}

.login-error { color: var(--danger); margin-bottom: 6px; min-height: 18px; }

.login-form { margin-top: 6px; text-align: left; }
.login-form label { display: block; font-size: 0.85rem; color: #374151; margin-bottom: 6px; }

.login-form input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(15,23,42,0.12);
  padding: 12px 6px;
  font-size: 1rem;
  color: #0b1220;
  border-radius: 0;
  box-shadow: none;
}

.login-form input:focus {
  outline: none;
  border-bottom-color: rgba(24, 120, 255, 0.95);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.06);
}

.login-help { font-size: 0.82rem; color: #6b7280; margin: 6px 0 12px; }

.login-submit {
  width: 100%;
  display: inline-block;
  padding: 12px 14px;
      border-radius: 16px;
      background: var(--button-bg);
      color: var(--button-text);
      font-weight: 700;
      box-shadow: 0 10px 24px rgba(37,99,235,0.18);
      border: none;
      margin-top: 8px;
      transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    }

    .login-submit:hover { transform: translateY(-1px); background: #1e40af; }
  .login-title { font-size: 1.3rem; }


/* ===== Global polish: headers, menus, modals, tables ===== */
.header {
  background: transparent;
  padding: 8px 0 18px;
}

.header-left h1 {
  color: var(--accent);
}

.menu-content {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15,23,42,0.06);
}

.menu-link { color: var(--text); }
.menu-link:hover { background: rgba(26,115,232,0.06); color: var(--accent); }

.pipeline-modal-dialog,
.pipeline-modal-wide,
.pipeline-modal-sm {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Tables: clear, spaced, responsive */
table { background: transparent; border-radius: 8px; }
table thead th { background: transparent; color: var(--accent); font-weight: 700; }
table tbody td { color: #374151; }

/* Cards and panels: subtle elevation */
.card-panel, .panel { border-radius: 12px; padding: 16px; }
.card { box-shadow: 0 8px 20px rgba(15,23,42,0.04); }

/* Ensure modals are scrollable on small screens */
.pipeline-modal-dialog { max-height: 92vh; overflow: auto; }

@media (max-width: 900px) {
  .header { padding-bottom: 12px; }
  .menu-content { right: 8px; min-width: 200px; }
}

    .page-pipeline .stock-chip button {
      all: unset;
      cursor: pointer;
      font-weight: 700;
      line-height: 1;
      font-size: 12px;
      color: #174ea6;
    }

    .page-pipeline .finished-dt-table {
      overflow: hidden;
      border-radius: 12px;
      border: 1px solid #e3eaf4;
      background: var(--panel);
      box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
    }

    .page-pipeline .finished-data-table thead th {
      position: sticky;
      top: 0;
      background: #eff6ff;
      z-index: 1;
    }

    .page-pipeline .finished-data-table tbody tr:nth-child(even) {
      background: #fafcff;
    }

    .page-pipeline .finished-data-table tbody tr:hover {
      background: #eef5ff;
    }

    .page-pipeline .finished-data-table td:first-child,
    .page-pipeline .finished-data-table th:first-child {
      white-space: nowrap;
    }

    .page-pipeline .finished-data-table td:nth-child(2) {
      font-weight: 600;
      color: #1f2937;
    }

    .page-pipeline .dataTables_filter {
      margin-bottom: 12px;
      text-align: left;
    }

    .page-pipeline .dataTables_filter label {
      display: grid;
      gap: 6px;
      max-width: 420px;
      color: #475569;
      font-size: 13px;
      font-weight: 600;
    }

    .page-pipeline .dataTables_filter input {
      width: 100%;
      height: 44px;
      background: var(--panel);
      border: 1px solid #cfd9e6;
      border-radius: 12px;
      padding: 10px 14px;
      color: #1f2937;
      box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .page-pipeline .dataTables_filter input:focus {
      border-color: #7fb0ff;
      box-shadow: 0 0 0 3px rgba(23, 78, 166, 0.12);
      outline: none;
    }

    .page-pipeline .finished-dt-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid #e6edf7;
    }

    .page-pipeline .finished-dt-footer .dataTables_info {
      color: #64748b;
      font-size: 13px;
      padding-top: 0;
    }

    .page-pipeline .finished-dt-footer .dataTables_length label {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #475569;
      font-size: 13px;
    }

    .page-pipeline .finished-dt-footer .dataTables_paginate {
      padding-top: 0;
    }

    .page-pipeline .finished-data-table th,
    .page-pipeline .finished-data-table td {
      border-bottom: 1px solid #edf1f6;
      padding: 10px 8px;
      color: #374151;
      font-size: 13px;
      text-align: left;
    }

    .page-pipeline .finished-data-table th {
      color: #174ea6;
      font-weight: 700;
      text-transform: uppercase;
      font-size: 12px;
      letter-spacing: 0.03em;
    }

    .page-pipeline .finished-data-table tbody tr {
      cursor: pointer;
      transition: background .14s ease, transform .14s ease;
    }

    .page-pipeline .finished-data-table tbody tr:hover,
    .page-pipeline .finished-data-table tbody tr.active {
      background: #f8fbff;
    }

    .page-pipeline .finished-data-table tbody tr.active td:first-child {
      box-shadow: inset 3px 0 0 #174ea6;
    }

    .page-pipeline .finished-report {
      border: 1px solid #dfe8f5;
      border-radius: 14px;
      padding: 14px;
      background: linear-gradient(180deg, #fbfdff, var(--panel));
      min-height: 280px;
    }

    .page-pipeline .finished-report-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }

    .page-pipeline .finished-report-grid-compact {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      margin-bottom: 10px;
    }

    .page-pipeline .finished-report-section-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-top: 10px;
    }

    .page-pipeline .finished-report-section-card {
      border: 1px solid #dbe5f2;
      border-radius: 12px;
      padding: 12px;
      background: var(--panel);
      display: grid;
      gap: 7px;
    }

    .page-pipeline .finished-report-section-card strong {
      color: #174ea6;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .page-pipeline .finished-report-section-card div {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      border-bottom: 1px solid #edf1f6;
      padding-bottom: 4px;
      color: #374151;
      font-size: 12px;
    }

    .page-pipeline .finished-report-section-card div:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }

    .page-pipeline .finished-report-section-card span {
      color: #5f6368;
    }

    .page-pipeline .finished-report-section-card b {
      font-weight: 700;
      color: #1f2937;
      text-align: right;
    }

    .page-pipeline .finished-report-card {
      border: 1px solid #dbe5f2;
      border-radius: 12px;
      padding: 10px;
      background: #f8fbff;
    }

    .page-pipeline .finished-report-card strong {
      display: block;
      color: #174ea6;
      margin-bottom: 3px;
    }

    .page-pipeline .finished-report-summary {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }

    .page-pipeline .finished-report-summary-card {
      border: 1px solid #dbe5f2;
      border-radius: 12px;
      padding: 10px;
      background: #f8fbff;
    }

    .page-pipeline .finished-report-summary-card strong {
      display: block;
      color: #174ea6;
      margin-bottom: 3px;
    }

    .page-pipeline .finished-report-summary-card span {
      color: #1f2937;
      font-weight: 700;
      word-break: break-word;
    }

    .page-pipeline .finished-report-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 640px;
    }

    .page-pipeline .finished-report-table th,
    .page-pipeline .finished-report-table td {
      border-bottom: 1px solid #edf1f6;
      padding: 8px;
      font-size: 13px;
      color: #374151;
      vertical-align: top;
    }

    .page-pipeline .finished-report-table th {
      color: #174ea6;
      font-weight: 700;
      text-transform: uppercase;
      font-size: 12px;
    }

    .page-pipeline .finished-report-block {
      border: 1px solid #e4ebf5;
      border-radius: 12px;
      padding: 10px;
      background: var(--panel);
      margin-top: 10px;
    }

    .page-pipeline .dataTables_wrapper {
      margin-top: 4px;
      color: #334155;
    }

    .page-pipeline .dataTables_wrapper .dataTables_length,
    .page-pipeline .dataTables_wrapper .dataTables_info,
    .page-pipeline .dataTables_wrapper .dataTables_paginate {
      font-size: 13px;
      color: #475569;
    }

    .page-pipeline .dataTables_wrapper .dataTables_length select {
      background: var(--panel);
      border: 1px solid #cfd9e6;
      border-radius: 10px;
      padding: 6px 10px;
      color: #1f2937;
    }

    .page-pipeline .dataTables_wrapper .dataTables_paginate .paginate_button {
      border-radius: 10px !important;
      border: 1px solid #d8e2ef !important;
      background: var(--panel) !important;
      color: #174ea6 !important;
      box-shadow: none !important;
      margin-left: 4px;
    }

    .page-pipeline .dataTables_wrapper .dataTables_paginate .paginate_button.current,
    .page-pipeline .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
      background: #e8f0fe !important;
      border-color: #bcd4fb !important;
      color: #174ea6 !important;
    }

    .page-pipeline .finalize-top-grid {
      display: grid;
      gap: 10px;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .page-pipeline .finalize-section {
      border: 1px solid #dfe8f5;
      border-radius: 14px;
      padding: 12px;
      background: linear-gradient(180deg, #fbfdff, var(--panel));
    }

    .page-pipeline .finalize-section h3 {
      margin: 0 0 10px;
      font-size: 15px;
      color: #1f2937;
    }

    .page-pipeline .finalize-card-grid {
      display: grid;
      gap: 10px;
    }

    .page-pipeline .finalize-card-grid-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .page-pipeline .finalize-card-group {
      border: 1px solid #dce6f3;
      border-radius: 14px;
      background: var(--panel);
      padding: 12px;
      display: grid;
      gap: 10px;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
    }

    .page-pipeline .finalize-card-title {
      font-weight: 800;
      color: #174ea6;
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .page-pipeline .finalize-inline-extra {
      display: flex;
      justify-content: center;
      margin-top: 12px;
    }

    .page-pipeline .finalize-inline-extra label {
      min-width: min(240px, 100%);
      display: grid;
      gap: 6px;
      font-size: 13px;
      color: #4b5563;
      background: #f8fbff;
      border: 1px solid #dbe5f2;
      padding: 10px 12px;
      border-radius: 12px;
    }

    .page-pipeline .finalize-total-row {
      margin-top: 10px;
      border-radius: 10px;
      border: 1px solid #cfe0fa;
      background: #eef5ff;
      font-size: 13px;
      padding: 12px 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 24px;
      flex-wrap: wrap;
    }

    .page-pipeline .finalize-total-item {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 140px;
    }

    .page-pipeline .finalize-total-item span {
      color: #1f2937;
      display: inline-block;
    }

    .page-pipeline .finalize-total-item strong {
      font-size: 16px;
      color: #174ea6;
      min-width: 50px;
      text-align: right;
      display: inline-block;
    }

    .page-pipeline .finalize-total-row.double {
      justify-content: space-between;
    }

    .page-pipeline .panel {
      background: var(--panel);
      border:1px solid #dfe3eb;
      box-shadow:0 8px 24px rgba(26, 115, 232, 0.08);
      border-radius:20px;
    }

    .page-pipeline input,
    .page-pipeline select,
    .page-pipeline textarea {
      background:var(--panel);
      color:#202124;
      border:1px solid #d2d8e0;
    }

    .page-pipeline button {
      background:#1a73e8;
      color:#ffffff;
      box-shadow:0 6px 16px rgba(26, 115, 232, 0.28);
    }

    .page-pipeline button:hover {
      background:#1558b0;
    }

    /* Forecast page */
    body.page-forecast {
      padding: 20px;
      background: radial-gradient(circle at top right, rgba(26, 115, 232, 0.09), transparent 36%),
                  radial-gradient(circle at top left, rgba(251, 188, 5, 0.12), transparent 42%),
                  #f8f9fa;
      color: #202124;
    }
    .page-forecast .header {
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:16px;
      margin-bottom:18px;
      flex-wrap:wrap;
      background:var(--panel);
      border:1px solid #d3dae6;
      border-radius:18px;
      padding:14px 18px;
      box-shadow:0 10px 24px rgba(32, 33, 36, 0.12);
    }
    .page-forecast .header-left {
      display:flex;
      align-items:center;
      gap:12px;
      min-width:0;
      flex:1 1 auto;
      min-width:240px;
    }
    .page-forecast .header-title-block h1 {
      margin:0;
      color:#1f2937;
      font-size: clamp(1.45rem, 2vw, 2rem);
      line-height: 1.15;
    }
    .page-forecast .header-subtitle,
    .page-forecast .header-update {
      margin:2px 0 0;
      color:#4b5563;
      font-size:13px;
      line-height:1.25;
    }
    .page-forecast .table-header { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
    .page-forecast .table-wrapper {
      max-height: 68vh;
      overflow: auto;
      border-radius: 14px;
    }
    .page-forecast table { width:max-content; min-width: 1300px; border-collapse: collapse; }
    .page-forecast th, .page-forecast td { padding: 12px 10px; text-align:left; border-bottom: 1px solid #eceff3; font-size:12px; }
    .page-forecast th { color: #174ea6; font-weight:700; }
    .page-forecast td { color:#202124; }
    .page-forecast .panel { background: var(--panel); border:1px solid #dfe3eb; border-radius:20px; box-shadow:0 8px 24px rgba(26, 115, 232, 0.08); padding:20px; }
    .page-forecast .button-link {
      color: var(--button-muted-text);
      text-decoration: none;
      background: var(--button-surface);
      border: 1px solid rgba(37,99,235,0.14);
      border-radius: 16px;
      padding: 10px 16px;
      box-shadow: 0 8px 20px rgba(37,99,235,0.08);
    }
    .page-forecast .button-link:hover { background:#dbeafe; }
    .page-forecast button { background: var(--button-bg); color:#ffffff; box-shadow: 0 10px 24px rgba(37,99,235,0.18); }
    .page-forecast button:hover { background:#1e40af; }
    .page-forecast .alert { padding:14px 16px; border-radius:16px; background: #eff6ff; color: #1d4ed8; border:1px solid rgba(37,99,235,0.18); }
    .page-forecast .table-header-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
    .page-forecast .forecast-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 72px;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      color: #1f2937;
      background: rgba(248, 250, 252, 1);
      border: 1px solid transparent;
    }
    .page-forecast .forecast-pill--low {
      background: rgba(254, 226, 226, 0.9);
      border-color: rgba(239, 68, 68, 0.25);
      color: #991b1b;
    }
    .page-forecast .forecast-pill--medium {
      background: rgba(254, 240, 219, 0.9);
      border-color: rgba(245, 158, 11, 0.25);
      color: #92400e;
    }
    .page-forecast .forecast-pill--high {
      background: rgba(220, 252, 231, 0.9);
      border-color: rgba(52, 211, 153, 0.25);
      color: #166534;
    }
    .hidden-file-input { display:none; }
    .is-hidden-permission { display: none !important; }

    /* Consolidado page */
    body.page-consolidado {
      padding: 20px;
      background: radial-gradient(circle at top right, rgba(26, 115, 232, 0.09), transparent 36%),
                  radial-gradient(circle at top left, rgba(251, 188, 5, 0.12), transparent 42%),
                  #f8f9fa;
      color: #202124;
    }
    .page-consolidado .headline { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:18px; flex-wrap:wrap; }
    .page-consolidado .headline h1 { margin:0; font-size: clamp(2rem, 2.6vw, 2.6rem); color:#174ea6; }
    .page-consolidado .table-wrapper {
      max-height: 68vh;
      overflow: auto;
      border-radius: 14px;
    }
    .page-consolidado table { width:max-content; min-width: 1200px; border-collapse: collapse; }
    .page-consolidado th, .page-consolidado td { padding: 12px 10px; text-align:left; border-bottom: 1px solid #eceff3; font-size:12px; }
    .page-consolidado th { color: #174ea6; font-weight:700; }
    .page-consolidado td { color:#202124; }
    .page-consolidado .panel { background: var(--panel); border:1px solid #dfe3eb; border-radius:20px; box-shadow:0 8px 24px rgba(26, 115, 232, 0.08); padding:20px; }
    .page-consolidado .button-link {
      color: var(--button-muted-text);
      text-decoration: none;
      background: var(--button-surface);
      border: 1px solid rgba(37,99,235,0.14);
      border-radius: 16px;
      padding: 10px 16px;
      box-shadow: 0 8px 20px rgba(37,99,235,0.08);
    }
    .page-consolidado .button-link:hover { background:#dbeafe; }
    .page-consolidado button { background: var(--button-bg); color:#ffffff; box-shadow: 0 10px 24px rgba(37,99,235,0.18); }
    .page-consolidado button:hover { background:#1e40af; }
    .page-consolidado .alert { padding:14px 16px; border-radius:14px; background: #e8f0fe; color: #174ea6; border:1px solid #c9dafc; }
    .page-consolidado .headline-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

    .page-consolidado .stock-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      color: #1f2937;
      background: rgba(59, 130, 246, 0.12);
      border: 1px solid rgba(59, 130, 246, 0.22);
    }
    .page-consolidado .stock-pill small {
      display: inline-block;
      color: inherit;
      opacity: 0.7;
      font-weight: 600;
    }
    .page-consolidado .stock-pill--low {
      background: rgba(239, 68, 68, 0.13);
      border-color: rgba(239, 68, 68, 0.25);
      color: #b91c1c;
    }
    .page-consolidado .stock-pill--medium {
      background: rgba(249, 115, 22, 0.12);
      border-color: rgba(249, 115, 22, 0.25);
      color: #c2410c;
    }
    .page-consolidado .stock-pill--high {
      background: rgba(16, 185, 129, 0.14);
      border-color: rgba(16, 185, 129, 0.3);
      color: #047857;
    }

    @media (max-width:900px){
      .page-pipeline .pipeline-grid { grid-template-columns: 1fr; }
      .page-pipeline .finalize-card-grid-3 {
        grid-template-columns: 1fr;
      }
      .page-pipeline .finished-layout {
        grid-template-columns: 1fr;
      }
      .page-pipeline .finished-report-section-grid {
        grid-template-columns: 1fr;
      }
      .page-pipeline .finished-toolbar-actions {
        justify-content: flex-start;
      }
      .page-pipeline .pipeline-form-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
      }
      .page-pipeline .pipeline-form-row > * {
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
      }
      .page-pipeline .pipeline-form-row .grow-auto,
      .page-pipeline .pipeline-form-row .grow-1,
      .page-pipeline .pipeline-form-row .grow-2 {
        flex: 1 1 100% !important;
      }
      .page-pipeline .pipeline-form-row button {
        width: 100% !important;
      }

      /* Compactar tarjetas en móvil: mostrar sólo lote (strong) y nombre (primer small) */
      .page-pipeline .card small:nth-of-type(n+2) {
        display: none;
      }
      .page-pipeline .card {
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 0.92rem;
        line-height: 1.15;
      }
      .page-pipeline .card strong {
        display: block;
        margin-bottom: 6px;
      }

      /* Consolidado page mobile button stack */
      .page-consolidado .button-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
      }
      .page-consolidado .button-group > button,
      .page-consolidado .button-group .btn,
      .page-consolidado .button-group > a,
      .page-consolidado .dropdown > button {
        width: 100%;
        min-width: 0;
      }
      .page-consolidado .dropdown > button#btnMenu {
        width: 100%;
        min-width: 0;
      }
    }

    /* Index page */
    body.page-index {
      background: radial-gradient(circle at top right, rgba(26, 115, 232, 0.06), transparent 34%),
                  radial-gradient(circle at top left, rgba(251, 188, 5, 0.08), transparent 40%),
                  #f8f9fa;
      color: #202124;
    }

    body.page-index::before {
      background: none;
    }

    /* Login page */
    body.page-login {
      min-height: 100vh;
      background: url('../../img/slider_950px_5.webp') center center / cover no-repeat;
      color: #1f2937;
      display: grid;
      place-items: center;
      padding: 24px;
      position: relative;
    }

    body.page-login::before {
      content: '';
      position: fixed;
      inset: 0;
      background: linear-gradient(135deg, rgba(7, 18, 51, 0.34), rgba(18, 78, 132, 0.2));
      pointer-events: none;
    }

    .login-shell {
      position: relative;
      z-index: 1;
      width: min(430px, 100%);
      padding: 22px;
      border-radius: 28px;
      background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(245,248,252,0.9));
      border: 1px solid rgba(255,255,255,0.76);
      box-shadow: 0 26px 60px rgba(8, 15, 38, 0.28);
    }

    .login-brand {
      display: grid;
      place-items: center;
      margin-bottom: 14px;
    }

    .login-brand-circle {
      width: 134px;
      height: 134px;
      border-radius: 50%;
      background: rgba(255,255,255,0.52);
      display: grid;
      place-items: center;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
    }

    .login-brand-circle img {
      width: 86px;
      height: 86px;
      object-fit: contain;
    }

    .login-title {
      text-align: center;
      margin: 0;
      font-size: clamp(1.45rem, 2vw, 1.8rem);
      color: #0f172a;
      letter-spacing: -0.02em;
    }

    .login-subtitle {
      text-align: center;
      margin: 8px 0 20px;
      color: #64748b;
      font-size: 14px;
    }

    .login-form {
      display: grid;
      gap: 14px;
    }

    .login-form label {
      display: grid;
      gap: 7px;
      font-weight: 700;
      color: #334155;
      font-size: 14px;
    }

    .login-form input {
      width: 100%;
      height: 50px;
      border-radius: 14px;
      border: 1px solid #cfd8e3;
      background: rgba(255,255,255,0.96);
      color: #0f172a;
      padding: 0 16px;
      font-size: 15px;
      box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
    }

    .login-form input:focus {
      outline: none;
      border-color: #39a0ff;
      box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
    }

    .login-help {
      color: #64748b;
      font-size: 12px;
      line-height: 1.4;
      margin-top: -6px;
    }

    .login-error {
      display: none;
      padding: 12px 14px;
      border-radius: 14px;
      background: rgba(248, 113, 113, 0.12);
      border: 1px solid rgba(248, 113, 113, 0.26);
      color: #b91c1c;
      font-size: 13px;
    }

    .login-error.is-visible { display: block; }

    .login-submit {
      width: 100%;
      height: 50px;
      border: 0;
      border-radius: 14px;
      background: linear-gradient(135deg, #1e88e5, #0f8ecf);
      color: #ffffff;
      font-size: 16px;
      font-weight: 800;
      letter-spacing: 0.02em;
      box-shadow: 0 12px 28px rgba(14, 116, 144, 0.26);
    }

    .login-submit:hover {
      filter: brightness(1.03);
      transform: translateY(-1px);
    }

    .login-footer {
      margin-top: 14px;
      text-align: center;
      color: #e2e8f0;
      font-size: 12px;
      position: relative;
      z-index: 1;
    }

    .page-index .admin-modal .pipeline-modal-dialog {
      background: transparent;
      border: none;
      box-shadow: none;
      overflow: visible;
    }

    .page-index .pipeline-modal-xl {
      width: min(1180px, 96vw);
    }

    .page-index .admin-modal-layout {
      display: grid;
      grid-template-columns: minmax(290px, 0.92fr) minmax(0, 1.45fr);
      min-height: 680px;
      border-radius: 26px;
      overflow: hidden;
      background: rgba(255,255,255,0.94);
      border: 1px solid #d7e0ea;
      box-shadow: 0 26px 56px rgba(15, 23, 42, 0.24);
    }

    .page-index .admin-modal-hero {
      position: relative;
      padding: 28px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      color: #ffffff;
      background: linear-gradient(180deg, rgba(4, 16, 42, 0.2), rgba(4, 16, 42, 0.4)), url('../../img/slider_950px_5.webp') center center / cover no-repeat;
    }

    .page-index .admin-modal-hero::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(14, 165, 233, 0.03), rgba(17, 24, 39, 0.14));
    }

    .page-index .admin-modal-hero > * {
      position: relative;
      z-index: 1;
    }

    .page-index .admin-modal-hero h2 {
      margin: 14px 0 10px;
      font-size: clamp(1.65rem, 2.4vw, 2.2rem);
      line-height: 1.05;
      letter-spacing: -0.03em;
    }

    .page-index .admin-modal-hero p {
      margin: 0;
      max-width: 26ch;
      color: rgba(255,255,255,0.9);
      line-height: 1.45;
    }

    .page-index .admin-modal-hero-badge {
      display: inline-flex;
      align-items: center;
      align-self: flex-start;
      padding: 7px 12px;
      border-radius: 999px;
      background: rgba(255,255,255,0.16);
      border: 1px solid rgba(255,255,255,0.28);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .page-index .admin-modal-hero-stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin-top: 24px;
    }

    .page-index .admin-modal-hero-stats > div {
      padding: 14px;
      border-radius: 18px;
      background: rgba(255,255,255,0.15);
      border: 1px solid rgba(255,255,255,0.22);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
    }

    .page-index .admin-modal-hero-stats strong {
      display: block;
      font-size: 1.7rem;
      line-height: 1;
      margin-bottom: 4px;
    }

    .page-index .admin-modal-hero-stats span {
      font-size: 12px;
      color: rgba(255,255,255,0.88);
    }

    .page-index .admin-user-hero { background-image: linear-gradient(180deg, rgba(4, 16, 42, 0.2), rgba(4, 16, 42, 0.4)), url('../../img/slider_950px_5.webp'); }
    .page-index .admin-role-hero { background-image: linear-gradient(180deg, rgba(4, 16, 42, 0.2), rgba(4, 16, 42, 0.4)), url('../../img/slider_950px_5.webp'); }

    .page-index .admin-modal-content {
      padding: 0;
      background: linear-gradient(180deg, #fbfdff, #f8fbff);
    }

    .page-index .admin-modal-header {
      padding: 20px 22px 12px;
      margin: 0;
      border-bottom: 1px solid #e6edf5;
      background: rgba(255,255,255,0.92);
    }

    .page-index .admin-modal-header h2 {
      margin: 0;
      font-size: 1.2rem;
      color: #0f172a;
    }

    .page-index .admin-modal-header p {
      margin: 4px 0 0;
      color: #64748b;
      font-size: 13px;
    }

    .page-index .admin-form-grid {
      display: grid;
      gap: 16px;
      padding: 20px 22px 0;
    }

    .page-index .admin-form-grid-two {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .page-index .admin-form-grid label {
      display: grid;
      gap: 6px;
      color: #334155;
      font-size: 13px;
      font-weight: 700;
    }

    .page-index .admin-form-grid input,
    .page-index .admin-form-grid select,
    .page-index .admin-form-grid textarea {
      background: var(--panel);
      color: #0f172a;
      border: 1px solid #cfd8e3;
      box-shadow: inset 0 1px 2px rgba(15,23,42,0.03);
    }

    .page-index .admin-form-grid textarea {
      min-height: 88px;
      resize: vertical;
    }

    .page-index .user-active-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border-radius: 16px;
      border: 1px solid #dbe5f0;
      background: #f8fbff;
    }

    .page-index .admin-form-grid label.user-active-card {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .page-index .user-active-card strong {
      display: block;
      font-size: 14px;
      color: #0f172a;
    }

    .page-index .user-active-card small {
      display: block;
      color: #64748b;
      font-weight: 500;
    }

    .page-index .admin-modal-actions {
      justify-content: flex-end;
      padding-top: 0;
      margin-top: 0;
    }

    .page-index .admin-table-block {
      padding: 0 22px 22px;
      margin-top: 4px;
    }

    .page-index .admin-table-title {
      margin: 0 0 10px;
      color: #174ea6;
      font-size: 13px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .page-index .admin-data-table {
      width: 100%;
      min-width: 680px;
      border-collapse: collapse;
    }

    .page-index .admin-data-table th,
    .page-index .admin-data-table td {
      padding: 10px 8px;
      border-bottom: 1px solid #edf2f7;
      color: #334155;
      font-size: 13px;
    }

    .page-index .admin-data-table th {
      color: #174ea6;
      font-weight: 800;
      text-transform: uppercase;
      font-size: 12px;
      letter-spacing: 0.04em;
    }

    .page-index .role-manager-layout {
      display: grid;
      grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1.15fr);
      gap: 16px;
      padding: 0 22px 22px;
    }

    .page-index .role-list-panel,
    .page-index .role-form-panel {
      background: var(--panel);
      border: 1px solid #dbe5f0;
      border-radius: 18px;
      padding: 16px;
      box-shadow: 0 12px 22px rgba(15,23,42,0.05);
    }

    .page-index .role-card-list {
      display: grid;
      gap: 10px;
    }

    .page-index .role-card {
      width: 100%;
      display: block;
      text-align: left;
      white-space: normal;
      border: 1px solid #dbe5f0;
      border-radius: 16px;
      padding: 14px;
      background: #f8fbff;
      color: #0f172a;
      box-shadow: none;
    }

    .page-index .role-card.active {
      border-color: #8cc3ff;
      background: linear-gradient(180deg, #eff6ff, var(--panel));
      box-shadow: 0 10px 18px rgba(23,78,166,0.08);
    }

    .page-index .role-card strong {
      display: block;
      font-size: 16px;
      color: #174ea6;
      margin-bottom: 5px;
    }

    .page-index .role-card span,
    .page-index .role-card small {
      display: block;
      color: #64748b;
      font-size: 12px;
      line-height: 1.35;
    }

    .page-index .permission-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .page-index .permission-card {
      display: flex !important;
      align-items: center;
      gap: 10px;
      padding: 12px 14px;
      border-radius: 14px;
      background: #f8fbff;
      border: 1px solid #dbe5f0;
      font-size: 13px;
      font-weight: 600;
      color: #334155;
    }

    .page-index .permission-card input {
      width: 18px;
      height: 18px;
      accent-color: #1e88e5;
      box-shadow: none;
    }

    .page-index .pipeline-modal-xl.admin-modal-dialog,
    .page-index .pipeline-modal-sm.admin-modal-dialog {
      width: min(1180px, 96vw);
    }

    .page-index .login-error.is-error {
      display: block;
      background: rgba(248,113,113,0.12);
      border-color: rgba(248,113,113,0.26);
      color: #b91c1c;
    }

    .page-index .login-error.is-visible {
      display: block;
    }

    .page-index.page-users .admin-page-panel,
    .page-index.page-roles .admin-page-panel {
      margin-top: 18px;
      padding-bottom: 12px;
    }

    .page-index.page-users .admin-modal-layout,
    .page-index.page-roles .admin-modal-layout {
      min-height: 0;
      background: rgba(255, 255, 255, 0.97);
    }

    .page-index .admin-modal-layout {
      max-width: min(1180px, 100%);
      margin: 0 auto;
    }

    .page-index.page-users .admin-table-block .table-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .page-index.page-users .admin-data-table {
      width: max-content;
      min-width: 100%;
    }

    .page-index.page-users .admin-data-table th,
    .page-index.page-users .admin-data-table td {
      white-space: nowrap;
    }

    .page-index .button-group .button-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 46px;
      padding: 0 18px;
      border-radius: 16px;
      border: 1px solid rgba(37,99,235,0.14);
      background: var(--button-surface);
      color: var(--button-muted-text);
      font-weight: 700;
      text-decoration: none;
      box-shadow: 0 10px 24px rgba(37,99,235,0.12);
      transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
    }

    .page-index .button-group .button-link:hover {
      background: #dbeafe;
      transform: translateY(-1px);
    }

    @media (max-width: 1020px) {
      .page-index .admin-modal-layout {
        grid-template-columns: 1fr;
        min-height: 0;
        width: 100%;
        overflow-x: hidden;
      }

      .page-index .admin-modal-hero p {
        max-width: none;
      }

      .page-index .role-manager-layout {
        grid-template-columns: 1fr;
      }

      .page-index .admin-form-grid-two,
      .page-index .permission-grid {
        grid-template-columns: 1fr;
      }

      .page-index .admin-form-grid label {
        width: 100%;
      }

      .page-index .admin-form-grid input,
      .page-index .admin-form-grid select,
      .page-index .admin-form-grid textarea {
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }
    }

    @media (max-width: 900px) {
      .page-index.page-users .admin-modal-layout {
        grid-template-columns: 1fr !important;
        width: 100%;
        overflow-x: hidden;
      }

      .page-index.page-users .admin-modal-content {
        width: 100%;
        overflow-x: hidden;
      }

      .page-index.page-users .admin-modal-hero,
      .page-index.page-users .admin-modal-content,
      .page-index.page-users .admin-form-grid,
      .page-index.page-users .admin-form-grid-two,
      .page-index.page-users .permission-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .page-index.page-users .admin-form-grid label {
        width: 100%;
      }

      .page-index.page-users .admin-form-grid input,
      .page-index.page-users .admin-form-grid select,
      .page-index.page-users .admin-form-grid textarea {
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .page-index.page-users .admin-modal-actions {
        justify-content: flex-end;
        width: 100%;
      }

      .page-index.page-users .pipeline-modal-actions.admin-modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        width: 100%;
      }

      .page-index.page-users .admin-form-grid-two,
      .page-index.page-users .permission-grid {
        grid-template-columns: 1fr;
      }
    }

    .page-index .brand-row {
      margin-bottom: 8px;
    }

    .page-index .brand-logo,
    .page-pipeline .brand-logo,
    .page-forecast .brand-logo {
      width: 74px;
      height: 74px;
      max-width: 100%;
      object-fit: contain;
      display: block;
      border-radius: 999px;
      border: 1px solid #d9e0ea;
      background: var(--panel);
      padding: 4px;
    }

    .page-pipeline .header-left,
    .page-forecast .header-left,
    .page-index .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
      flex: 1 1 0;
      min-width: 180px;
    }

    .page-pipeline .header,
    .page-forecast .header,
    .page-index .header {
      background: var(--panel);
      border: 1px solid #d3dae6;
      border-radius: 18px;
      padding: 14px 18px;
      box-shadow: 0 10px 24px rgba(32, 33, 36, 0.12);
      gap: 18px;
    }

    /* Consolidado header should match dashboard/pipeline/forecast */
    .page-consolidado .brand-logo {
      width: 74px;
      height: 74px;
      object-fit: contain;
      border-radius: 999px;
      border: 1px solid #d9e0ea;
      background: var(--panel);
      padding: 4px;
      display: block;
    }

    .page-consolidado .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
      flex: 1 1 auto;
      min-width: 240px;
    }

    .page-consolidado .header {
      background: var(--panel);
      border: 1px solid #d3dae6;
      border-radius: 18px;
      padding: 14px 18px;
      box-shadow: 0 10px 24px rgba(32, 33, 36, 0.12);
      gap: 18px;
    }

    .page-consolidado .button-group {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-left: auto;
      justify-content: flex-end;
      min-width: 0;
    }

    .page-consolidado .button-group > .btn {
      min-width: 140px;
    }

    .page-consolidado .button-group > button:not(.btn),
    .page-consolidado .dropdown > button:not(.btn),
    .page-consolidado .button-group .button-link:not(.btn),
    .page-consolidado .button-group .btn {
      border: none;
      border-radius: 999px;
      min-height: 36px;
      min-width: 130px;
      padding: 0 18px;
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.01em;
      color: #ffffff;
      background: var(--button-bg);
      box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
      transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .page-consolidado .button-group > button:hover,
    .page-consolidado .button-group .btn:hover,
    .page-consolidado .dropdown > button:hover {
      transform: translateY(-1px);
      background: #1e40af;
      box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
    }

    .page-consolidado .button-group > button#btnMenu,
    .page-consolidado .dropdown > button#btnMenu {
      width: 52px;
      min-width: 52px;
      height: 40px;
      padding: 0;
      border-radius: 16px;
    }

    .page-consolidado .button-group > button:focus-visible,
    .page-consolidado .dropdown > button:focus-visible,
    .page-consolidado .menu-link:focus-visible {
      outline: 3px solid rgba(26, 115, 232, 0.24);
      outline-offset: 2px;
    }

    .page-index .container { max-width: 1800px; }

    .page-index .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
      flex: 1 1 auto;
      min-width: 240px;
    }

    .page-index .brand-logo {
      width: 74px;
      height: 74px;
      object-fit: contain;
      border-radius: 999px;
      border: 1px solid #d9e0ea;
      background: var(--panel);
      padding: 4px;
    }

    .page-index .header-title-block h1 {
      margin: 0;
      color: #1f2937;
      font-size: clamp(1.45rem, 2vw, 2rem);
      line-height: 1.15;
    }

    .page-index .header-subtitle,
    .page-index .header-update {
      margin: 2px 0 0;
      color: #4b5563;
      font-size: 13px;
      line-height: 1.25;
    }

    .page-index .button-group {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-left: auto;
      justify-content: flex-end;
      min-width: 0;
    }

    .page-index .button-group > .btn {
      min-width: 140px;
    }

    .page-index .button-group > button:not(.btn),
    .page-index .dropdown > button:not(.btn),
    .page-index .button-group .button-link:not(.btn),
    .page-index .button-group .btn {
      border: none;
      border-radius: 999px;
      min-height: 36px;
      min-width: 130px;
      padding: 0 18px;
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.01em;
      color: #ffffff;
      background: var(--button-bg);
      box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
      transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .page-index .button-group > button:hover,
    .page-index .button-group .btn:hover,
    .page-index .dropdown > button:hover {
      transform: translateY(-1px);
      background: #1e40af;
      box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
    }

    .page-index .button-group > button:focus-visible,
    .page-index .dropdown > button:focus-visible,
    .page-index .menu-link:focus-visible {
      outline: 3px solid rgba(26, 115, 232, 0.24);
      outline-offset: 2px;
    }

    .page-index #btnProductJsonImport {
      background: #3b82f6;
      color: #ffffff;
    }

    .page-index #btnProductJsonImport:hover {
      background: #2563eb;
    }

    .page-index #btnMenu {
      width: 46px;
      min-width: 46px;
      padding: 0;
      border-radius: 16px;
      background: #4338ca;
      color: #ffffff;
      font-size: 19px;
      font-weight: 800;
    }

    .page-index #btnMenu:hover {
      background: #3730a3;
    }

    .page-index #btnShowImport {
      background: #10b981;
      color: #ffffff;
    }

    .page-index #btnShowImport:hover {
      background: #059669;
    }

    .page-index #btnRefresh {
      background: #2563eb;
      color: #ffffff;
    }

    .page-index #btnRefresh:hover {
      background: #1d4ed8;
    }

    .page-index .panel,
    .page-index .card-panel,
    .page-index .metric-card {
      background: var(--panel);
      border: 1px solid #d3dae6;
      box-shadow: 0 10px 22px rgba(26, 115, 232, 0.09);
    }

    .page-index .main-grid .table-wrapper {
      max-height: 56vh;
      overflow: auto;
      border-radius: 14px;
    }

    .page-index #vinedoStock table,
    .page-index #romanoStock table {
      width: max-content;
      min-width: 100%;
    }

    /* Highlight zero stock rows in red and provide hide-zero support */
    .stock-zero td {
      color: #c62828 !important;
      font-weight: 600;
    }
    .stock-zero-toggle {
      margin-left: 8px;
      font-size: 0.85rem;
      color: #666;
    }
    .stock-zero-toggle input {
      margin-right: 6px;
    }

    .page-index #vinedoStock table,
    .page-index #romanoStock table,
    .page-index #vinedoStock th,
    .page-index #vinedoStock td,
    .page-index #romanoStock th,
    .page-index #romanoStock td {
      font-size: 12px;
    }

    .page-index .metric-card span { color: #5f6368; }
    .page-index .metric-card strong { color: #202124; }

    .page-index .panel button,
    .page-index #btnImportJson,
    .page-index #btnImportFile {
      background: #1a73e8;
      color: #ffffff;
      box-shadow: 0 6px 16px rgba(26, 115, 232, 0.28);
    }

    .page-index .panel button:hover,
    .page-index #btnImportJson:hover,
    .page-index #btnImportFile:hover {
      background: #1558b0;
    }

    .page-index .panel-fullwidth {
      width: 100%;
      max-width: 100%;
      margin-bottom: 18px;
    }

    .page-index .panel-fullwidth .table-wrapper {
      max-height: 68vh;
      overflow: auto;
      border-radius: 14px;
    }

    .page-index .panel-fullwidth .inventory-table {
      min-width: 1450px;
      width: max-content;
    }

    .page-index .table-wrapper { overflow-x: visible; }
    .page-index table { width: auto; min-width: 100%; border-collapse: collapse; }
    .page-index #inventoryReport table { width: 100%; }

    .page-index th {
      color: #174ea6;
      border-bottom-color: #dfe3eb;
    }

    .page-index td {
      color: #202124;
      border-bottom-color: #eceff3;
    }

    .page-index .panel-header h2 {
      color: #202124;
    }

    .page-index .panel-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .page-index .panel-actions .btn-export-mini {
      min-height: 34px;
      padding: 0 12px;
      border-radius: 10px;
      font-size: 12px;
      font-weight: 700;
      background: #e8f0fe;
      color: #174ea6;
      border: 1px solid #c9dafc;
      box-shadow: none;
    }

    .page-index .panel-actions .btn-export-mini:hover {
      background: #d8e6fd;
      color: #174ea6;
    }

    .page-index .stock-filter-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin: 0;
    }

    .page-index .stock-title-search {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      min-width: 0;
      flex: 1;
    }

    .page-index .stock-title-search h2 {
      margin: 0;
      white-space: nowrap;
    }

    .page-index .stock-search-input {
      width: 160px;
      max-width: 100%;
      height: 30px;
      padding: 0 10px;
      border-radius: 10px;
      font-size: 12px;
      border: 1px solid #d2d8e0;
      background: var(--panel);
      color: #202124;
    }

    .page-index .stock-selected-filters {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      min-height: 28px;
      max-width: 360px;
    }

    .page-index .stock-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 600;
      background: #e8f0fe;
      color: #174ea6;
      border: 1px solid #c9dafc;
      line-height: 1;
    }

    .page-index .stock-chip button {
      all: unset;
      cursor: pointer;
      font-weight: 700;
      line-height: 1;
      font-size: 12px;
      color: #174ea6;
    }

    .page-index .panel-fullwidth .panel-header {
      align-items: center;
      gap: 14px;
      flex-wrap: wrap;
    }

    .page-index .inventory-title-actions {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: nowrap;
      min-width: 0;
      flex: 1;
    }

    .page-index .inventory-title-actions h2 {
      margin-right: 4px;
      white-space: nowrap;
    }

    .page-index .inventory-search-row {
      margin-left: 2px;
      flex-wrap: nowrap;
      min-width: 0;
    }

    .page-index .inventory-search-row .stock-search-input {
      width: 190px;
      flex: 0 0 190px;
    }

    .page-index .inventory-search-row .stock-selected-filters {
      max-width: 260px;
      overflow: hidden;
    }

    .page-index .report-filter-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-left: auto;
      flex-wrap: wrap;
    }

    .page-index .report-filter-row input,
    .page-index .report-filter-row button {
      height: 34px;
      padding: 0 12px;
      border-radius: 12px;
      font-size: 13px;
    }

    .page-index .report-filter-row input[type="date"] {
      width: 150px;
      min-width: 150px;
    }

    .page-index .report-filter-row button {
      min-width: 92px;
    }

    .page-index input,
    .page-index select,
    .page-index textarea {
      background: var(--panel);
      color: #202124;
      border-color: #d2d8e0;
    }

    .page-index .alert {
      background: #e8f0fe;
      color: #174ea6;
      border-color: #c9dafc;
    }

    .page-index .inventory-table th:nth-child(2),
    .page-index .inventory-table td:nth-child(2) { min-width: 220px; max-width: 320px; }

    .page-index .inventory-table th:nth-child(1),
    .page-index .inventory-table td:nth-child(1) { width: 80px; }

    .page-index .inventory-table th:nth-child(3),
    .page-index .inventory-table td:nth-child(3),
    .page-index .inventory-table th:nth-child(4),
    .page-index .inventory-table td:nth-child(4) { width: 80px; }

    .page-index .inventory-table th:nth-child(5),
    .page-index .inventory-table td:nth-child(5),
    .page-index .inventory-table th:nth-child(6),
    .page-index .inventory-table td:nth-child(6),
    .page-index .inventory-table th:nth-child(7),
    .page-index .inventory-table td:nth-child(7),
    .page-index .inventory-table th:nth-child(8),
    .page-index .inventory-table td:nth-child(8),
    .page-index .inventory-table th:nth-child(9),
    .page-index .inventory-table td:nth-child(9) { width: 90px; }

    .page-index .inventory-table th:nth-child(10),
    .page-index .inventory-table td:nth-child(10),
    .page-index .inventory-table th:nth-child(11),
    .page-index .inventory-table td:nth-child(11),
    .page-index .inventory-table th:nth-child(12),
    .page-index .inventory-table td:nth-child(12),
    .page-index .inventory-table th:nth-child(13),
    .page-index .inventory-table td:nth-child(13),
    .page-index .inventory-table th:nth-child(14),
    .page-index .inventory-table td:nth-child(14),
    .page-index .inventory-table th:nth-child(15),
    .page-index .inventory-table td:nth-child(15),
    .page-index .inventory-table th:nth-child(16),
    .page-index .inventory-table td:nth-child(16),
    .page-index .inventory-table th:nth-child(17),
    .page-index .inventory-table td:nth-child(17) { width: 110px; }

    .page-index .inventory-table th,
    .page-index .inventory-table td {
      font-size: 12px;
      padding-top: 8px;
      padding-bottom: 8px;
      line-height: 1.15;
    }

    .page-index th,
    .page-index td {
      white-space: normal;
      line-height: 1.3;
    }

    .page-index .stock-req-pill {
      display: inline-block;
      padding: 2px 6px;
      border-radius: 999px;
      font-weight: 700;
      white-space: nowrap;
    }

    .page-index .stock-req-pill.semaforo-rojo {
      background: #fde8e8;
      color: #b3261e;
      border: 1px solid #f6c7c7;
    }

    .page-index .stock-req-pill.semaforo-anaranjado {
      background: #fff4db;
      color: #9a6700;
      border: 1px solid #ffe2a6;
    }

    .page-index .stock-req-pill.semaforo-verde {
      background: #e6f4ea;
      color: #137333;
      border: 1px solid #b7dfc4;
    }

    .page-index .status-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 999px;
      font-weight: 700;
      font-size: 11px;
      line-height: 1;
      border: 1px solid transparent;
    }

    .page-index .status-icon.status-ok {
      background: #e6f4ea;
      color: #137333;
      border-color: #b7dfc4;
    }

    .page-index .status-icon.status-bad {
      background: #fde8e8;
      color: #b3261e;
      border-color: #f6c7c7;
    }

    .page-index .dropdown { position: relative; }

    .page-index .menu-content {
      display: none;
      position: absolute;
      right: 0;
      top: calc(100% + 10px);
      background: var(--panel);
      border: 1px solid #d1d9e6;
      border-radius: 12px;
      padding: 8px;
      min-width: 260px;
      box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      z-index: 40;
    }

    .page-index .menu-content.is-open { display: block; }

    .page-index .menu-link {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      color: #202124;
      text-decoration: none;
      border-radius: 9px;
      font-size: 14px;
      font-weight: 600;
      line-height: 1.25;
    }

    .page-index .menu-link + .menu-link {
      margin-top: 4px;
    }

    .page-index .menu-link:hover {
      background: #edf4ff;
      color: #174ea6;
    }

    .page-index .report-filter-row { align-items: center; margin-bottom: 16px; }

    .page-index .report-filter-row {
      grid-template-columns: 170px 170px 120px;
      align-items: center;
      gap: 10px;
    }

    .page-index .report-filter-row input,
    .page-index .report-filter-row button {
      height: 40px;
      padding: 0 14px;
      font-size: 13px;
      border-radius: 12px;
    }

    .page-index .report-filter-row button {
      min-width: 120px;
    }

    .page-index .report-filter-row input[type="date"] {
      min-width: 0;
    }

    .page-index .report-filter-row button {
      justify-self: end;
    }

    .page-index .imports-section { margin-top: 12px; }
    .page-index .imports-title { margin: 6px 0 10px; }

    @media (max-width: 900px) {
      .page-index .container { padding: 20px; }
      .page-index .panel-fullwidth { width: 100%; }
      .page-index .header {
        border-radius: 14px;
      }
      .page-index .button-group {
        width: 100%;
        justify-content: flex-start;
      }
      .page-index .button-group > button,
      .page-index .dropdown > button,
      .page-index .button-group .button-link,
      .page-index .button-group .btn {
        min-height: 40px;
        padding: 0 14px;
        font-size: 13px;
      }

      .page-index .panel-fullwidth .panel-header {
        align-items: flex-start;
      }

      .page-index .stock-title-search {
        width: 100%;
      }

      .page-index .stock-title-search h2 {
        width: 100%;
      }

      .page-index .inventory-search-row {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
      }

      .page-index .inventory-search-row .stock-search-input,
      .page-index .inventory-search-row .stock-selected-filters {
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
      }

      .page-index .inventory-title-actions {
        width: 100%;
        flex-wrap: wrap;
      }

      .page-index .stock-title-search {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
      }

      .page-index .stock-title-search h2 {
        width: 100%;
      }

      .page-index .stock-filter-row {
        flex-direction: column;
        align-items: stretch;
      }

      .page-index .stock-filter-row .stock-search-input,
      .page-index .stock-filter-row .stock-selected-filters {
        width: 100%;
        max-width: 100%;
      }

      .page-index .panel-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
      }

      .page-index .panel-actions button,
      .page-index .panel-actions .button-link {
        width: 100%;
      }

      .page-index .report-filter-row {
        width: 100%;
        margin-left: 0;
      }

      .page-index .stock-filter-row {
        gap: 12px;
      }

      .page-index .stock-title-search,
      .page-index .inventory-title-actions,
      .page-index .panel-actions {
        width: 100%;
      }

      .page-index .header {
        padding: 18px;
      }

      .page-index .button-group {
        justify-content: center;
      }

      .page-index .button-group > button,
      .page-index .button-group .button-link,
      .page-index .button-group .btn,
      .page-index .dropdown > button {
        width: 100%;
        min-width: 0;
      }

      .page-index .header {
        flex-direction: column;
        align-items: stretch;
      }

      .page-index .header-left {
        width: 100%;
        align-items: center;
      }

      .page-index .header-title-block {
        width: 100%;
        text-align: center;
      }

      .page-index .header-title-block h1 {
        margin-bottom: 0;
      }

      .page-index .panel-header {
        flex-direction: column;
        align-items: stretch;
      }
      .page-index .panel-header .panel-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
      }
      .page-index .panel-header .panel-actions .btn {
        flex: 0 0 auto;
      }
      /* Inventory panel: order and sizing specifically for mobile to keep controls tidy */
      .page-index .panel.panel-fullwidth .panel-header .inventory-title-actions { order: 1; }
      .page-index .panel.panel-fullwidth .panel-header .inventory-search-row { order: 2; width: 100%; margin-top: 8px; }
      .page-index .panel.panel-fullwidth .panel-header .inventory-search-row .stock-search-input { width: 100%; flex: 1 1 100%; }
      .page-index .panel.panel-fullwidth .panel-header .report-filter-row { order: 3; width: 100%; margin-top: 8px; display: flex; gap: 8px; align-items: center; }
      .page-index .panel.panel-fullwidth .panel-header .report-filter-row input[type="date"] { width: calc(50% - 4px); min-width: 0; }
      .page-index .panel.panel-fullwidth .panel-header .report-filter-row button { width: 100%; }
      /* Make the inventory search input more prominent on mobile */
      .page-index .panel.panel-fullwidth .panel-header .inventory-search-row .stock-search-input {
        height: 40px;
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 10px;
      }
    }

    @media (max-width: 900px) {
      .page-index .report-filter-row input[type="date"],
      .page-index .report-filter-row button {
        width: 100%;
        min-width: 0;
      }

      .page-index .report-filter-row {
        grid-template-columns: 1fr;
      }

      .page-index .report-filter-row button {
        width: 100%;
        justify-self: stretch;
      }
    }
    
