body {
      margin: 0;
      font-family: Arial, sans-serif;
      background: #f5f5f5;
      color: #1f2933;
    }

    .auth-screen {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background:
        radial-gradient(circle at top left, rgba(240, 180, 41, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(32, 129, 226, 0.12), transparent 36%),
        #f5f7fa;
    }

    .auth-card {
      width: min(100%, 440px);
      display: flex;
      flex-direction: column;
      gap: 18px;
      padding: 28px;
      border: 1px solid #dbe3ee;
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.94);
      box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    }

    .auth-card-copy h1 {
      margin: 0 0 8px;
      font-size: 28px;
      color: #102a43;
    }

    .auth-card-copy p {
      margin: 0;
      color: #52606d;
      line-height: 1.45;
    }

    .auth-kicker {
      margin-bottom: 8px;
      color: #7c5e10;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .auth-form {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .auth-field {
      display: flex;
      flex-direction: column;
      gap: 6px;
      font-size: 13px;
      color: #334e68;
    }

    .auth-field input {
      width: 100%;
      box-sizing: border-box;
      padding: 11px 12px;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      background: #fff;
      font: inherit;
      color: #102a43;
    }

    .auth-error {
      padding: 10px 12px;
      border-radius: 10px;
      background: #fff1f2;
      color: #b42318;
      font-size: 13px;
      line-height: 1.35;
    }

    .auth-actions {
      display: flex;
      justify-content: flex-end;
    }

    .icon-svg {
      width: 1em;
      height: 1em;
      display: inline-block;
      vertical-align: middle;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      flex-shrink: 0;
    }

    body.modal-open {
      overflow: hidden;
      touch-action: none;
    }

    .page {
      max-width: 1100px;
      margin: 0 auto;
      padding: 24px;
    }

    .sidebar-user {
      flex-shrink: 0;
      padding-top: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border-top: 1px solid rgba(148, 163, 184, 0.18);
    }

    .sidebar-user-copy {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .sidebar-user-label {
      color: #94a3b8;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .sidebar-user-email {
      color: #e2e8f0;
      font-size: 13px;
      line-height: 1.25;
      word-break: break-word;
    }

    .sidebar-user-role {
      color: #94a3b8;
      font-size: 11px;
      line-height: 1.2;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .sidebar-user-logout {
      flex-shrink: 0;
    }

    .sidebar-user-avatar {
      display: none;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: #1d4ed8;
      color: #fff;
      font-size: 16px;
      font-weight: 700;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      text-transform: uppercase;
      cursor: default;
      user-select: none;
    }

    .topbar {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 16px;
      margin-bottom: 24px;
    }

    .topbar h1 {
      margin: 0;
    }

    .tabs {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .tab-button {
      background: #dbe4f3;
      color: #1e293b;
    }

    .tab-button.active {
      background: #1d4ed8;
      color: white;
    }

    .tab-panel {
      display: none;
    }

    .tab-panel.active {
      display: block;
    }

    .hidden {
      display: none !important;
    }

    .panel {
      background: white;
      border-radius: 12px;
      padding: 20px;
      box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    }

    .panel h2 {
      margin-top: 0;
      margin-bottom: 16px;
      font-size: 22px;
    }

    .panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
    }

    .plancha,
    .material-item,
    .cliente-item,
    .modelo-item,
    .dia-card {
      border: 1px solid #e5e7eb;
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 12px;
      background: #fff;
    }

    .material-item strong,
    .cliente-item strong,
    .plancha strong,
    .modelo-item strong,
    .dia-card strong {
      display: block;
      margin-bottom: 6px;
    }

    .calendar-list {
      margin-bottom: 20px;
    }

    .calendar-toolbar {
      display: flex;
      justify-content: flex-start;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .proyectos-filtros {
      display: grid;
      grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, 1fr));
      gap: 8px;
      margin-bottom: 12px;
    }

    .proyectos-filtros-bar {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 8px;
    }

    .proyectos-filtros-bar-actions {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .proyectos-columnas {
      position: relative;
    }

    .proyectos-columnas-wrap {
      position: relative;
    }

    .proyectos-columnas-toggle {
      min-width: 24px;
      width: 24px;
      height: 24px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      border-radius: 7px;
      border: 1px solid #d9e2ec;
      background: #f8fafc;
      color: #52606d;
      box-shadow: none;
    }

    .proyectos-columnas-toggle:hover {
      background: #f1f5f9;
      color: #334e68;
    }

    .proyectos-filtros-toggle {
      border: 0;
      background: transparent;
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      padding: 4px 0;
      cursor: pointer;
    }

    .proyectos-filtros-toggle:hover {
      color: #334e68;
    }

    #proyectos-columnas-menu {
      left: auto;
      right: 0;
      min-width: 180px;
    }

    #presupuestos-columnas-menu {
      left: auto;
      right: 0;
      min-width: 180px;
    }

    #facturas-columnas-menu {
      left: auto;
      right: 0;
      min-width: 180px;
    }

    .proyectos-filtros input,
    .proyectos-filtros select {
      width: 100%;
      margin: 0;
      background: #ffffff;
    }

    #proyectos-busqueda {
      border: 1px solid #d9e2ec;
      background: #ffffff;
      color: #334e68;
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.2;
    }

    #proyectos-busqueda::placeholder {
      color: #829ab1;
    }

    .proyectos-multifiltro {
      position: relative;
    }

    .proyectos-multifiltro-btn {
      width: 100%;
      border: 1px solid #d9e2ec;
      background: #ffffff;
      color: #334e68;
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.2;
      text-align: left;
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
    }

    .proyectos-multifiltro-menu {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      z-index: 20;
      border: 1px solid #d9e2ec;
      border-radius: 12px;
      background: #ffffff;
      box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
      padding: 8px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .proyectos-multifiltro-menu input[type="search"] {
      width: 100%;
      margin: 0 0 4px 0;
      border: 1px solid #d9e2ec;
      background: #ffffff;
      color: #334e68;
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.2;
    }

    .proyectos-multifiltro-menu input[type="search"]::placeholder {
      color: #829ab1;
    }

    #proyectos-filtro-cliente-lista {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: 220px;
      overflow: auto;
    }

    #facturas-filtro-cliente-lista {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: 220px;
      overflow: auto;
    }

    .proyectos-multifiltro-option {
      display: grid;
      grid-template-columns: 16px minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      padding: 6px 8px;
      border-radius: 8px;
      color: #243b53;
      font-size: 14px;
      cursor: pointer;
      white-space: nowrap;
    }

    .proyectos-multifiltro-option:hover {
      background: #f8fafc;
    }

    .proyectos-multifiltro-option input {
      margin: 0;
      justify-self: start;
      align-self: center;
    }

    .proyectos-multifiltro-label {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    @media (max-width: 900px) {
      .proyectos-filtros {
        grid-template-columns: 1fr;
      }

      .proyectos-filtros-bar {
        justify-content: flex-start;
      }

      .cliente-form-grid {
        grid-template-columns: 1fr;
      }

      .cliente-form-grid .campo-full {
        grid-column: auto;
      }
    }

    .proyectos-table-wrap {
      overflow-x: auto;
      width: 100%;
    }

    .proyectos-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 760px;
    }

    .proyectos-table thead th {
      background: #f8fafc;
      color: #52606d;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-align: left;
      padding: 12px 14px;
      border-bottom: 1px solid #e5e7eb;
      white-space: nowrap;
    }

    .proyectos-table-sort-btn {
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      font-weight: inherit;
      letter-spacing: inherit;
      padding: 0;
      cursor: pointer;
    }

    .proyectos-table-sort-btn:hover {
      color: #243b53;
    }

    .proyectos-table-sort-btn-stack {
      display: inline-flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
      white-space: nowrap;
    }

    .proyectos-table-price-head {
      white-space: normal;
    }

    .proyectos-table-price-total {
      font-size: 10px;
      font-weight: 600;
      line-height: 1.1;
      color: #829ab1;
    }

    .proyectos-table tbody td {
      padding: 13px 14px;
      border-bottom: 1px solid #e3eaf2;
      vertical-align: middle;
      color: #243b53;
      font-size: 14px;
    }

    .proyectos-table tbody tr:last-child td {
      border-bottom: 0;
    }

    .proyectos-table tbody tr:hover {
      background: #fbfdff;
    }

    .proyectos-table tbody tr {
      cursor: pointer;
    }

    .proyectos-table-title {
      font-weight: 700;
      color: #102a43;
      line-height: 1.25;
    }

    .proyectos-table-status {
      display: inline-flex;
      align-items: center;
      padding: 4px 8px;
      border-radius: 999px;
      background: #eef2f6;
      color: #486581;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      white-space: nowrap;
    }

    .proyectos-table-status-cell {
      min-width: 150px;
    }

    .proyectos-table-status-select {
      width: 100%;
      max-width: 170px;
      border: 1px solid #d9e2ec;
      background: #f8fafc;
      color: #334e68;
      border-radius: 999px;
      padding: 6px 28px 6px 10px;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.1;
      cursor: pointer;
    }

    .proyectos-table-status-select:focus {
      outline: none;
      border-color: #9fb3c8;
      background: #ffffff;
    }

    .proyectos-table-actions-col {
      width: 1%;
    }

    .proyectos-table-actions {
      white-space: nowrap;
      text-align: right;
    }

    .proyectos-table-actions .secundario,
    .proyectos-table-actions .editar-modelo-btn,
    .proyectos-table-actions .icono-cuadrado-btn {
      margin-left: 6px;
    }

    .proyectos-table-actions .editar-modelo-btn {
      width: 32px;
      height: 32px;
      min-width: 32px;
      padding: 0;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .clientes-filtros-bar {
      justify-content: flex-start;
      margin-bottom: 12px;
    }

    .clientes-filtros-bar-actions {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .clientes-busqueda-input {
      width: min(360px, 100%);
      flex: 1 1 280px;
      margin: 0;
      border: 1px solid #d9e2ec;
      background: #ffffff;
      color: #334e68;
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.2;
    }

    .clientes-busqueda-input::placeholder {
      color: #829ab1;
    }

    .input-bloqueado {
      background: #f8fafc !important;
      color: #627d98;
      cursor: default;
    }

    .clientes-sync-btn {
      min-width: 94px;
      padding: 7px 10px;
      border-radius: 8px;
      background: #f8fafc !important;
      border: 1px solid #d9e2ec;
      color: #52606d;
      font-size: 12px;
      font-weight: 600;
      box-shadow: none;
    }

    .clientes-sync-btn:hover {
      background: #f1f5f9 !important;
      color: #334e68;
    }

    .clientes-sync-resumen {
      margin: -2px 0 12px;
      color: #627d98;
      font-size: 12px;
      line-height: 1.4;
    }

    .clientes-sync-resumen.success {
      color: #1f7a4c;
    }

    .clientes-sync-resumen.error {
      color: #b93838;
    }

    .panel-subtitle {
      margin: 4px 0 0;
      color: #627d98;
      font-size: 13px;
      line-height: 1.35;
    }

    .clientes-table {
      min-width: 820px;
    }

    .clientes-table-subtitle {
      margin-top: 2px;
      color: #829ab1;
      font-size: 11px;
      line-height: 1.2;
    }

    .clientes-table-address {
      max-width: 240px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .clientes-table-count {
      display: inline-flex;
      min-width: 24px;
      align-items: center;
      justify-content: center;
      padding: 4px 8px;
      border-radius: 999px;
      background: #eef2f6;
      color: #486581;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
    }

    .clientes-table-project {
      font-size: 13px;
    }

    .clientes-table-project-link {
      appearance: none;
      border: none;
      background: transparent;
      padding: 0;
      margin: 0;
      color: #102a43;
      font: inherit;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.25;
      text-align: left;
      cursor: pointer;
    }

    .clientes-table-project-link:hover {
      color: #0f6fff;
      text-decoration: underline;
    }

    .clientes-sync-chip {
      display: inline-flex;
      align-items: center;
      padding: 5px 10px;
      border-radius: 999px;
      background: #eef2f6;
      color: #486581;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      white-space: nowrap;
    }

    .clientes-sync-chip.synced {
      background: #dcfce7;
      color: #166534;
    }

    .clientes-sync-chip.pending {
      background: #fef3c7;
      color: #92400e;
    }

    .clientes-sync-chip.error {
      background: #fee2e2;
      color: #b91c1c;
    }

    .presupuestos-filtros-bar-actions {
      width: 100%;
    }

    #facturas-filtros-row {
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 10px;
      overflow: visible;
      padding-bottom: 2px;
      margin-bottom: 12px;
      position: relative;
      z-index: 5;
    }

    #facturas-filtros-row.hidden {
      display: none !important;
    }

    #facturas-filtros-row .proyectos-multifiltro {
      flex: 0 0 auto;
      min-width: 170px;
    }


    .presupuestos-table {
      min-width: 760px;
    }

    .presupuestos-table th:last-child,
    .presupuestos-table td:last-child {
      width: 1%;
      min-width: 96px;
    }

    .presupuestos-table .proyectos-table-status-cell {
      width: 120px;
      min-width: 120px;
    }

    .presupuestos-table .proyectos-table-status-select {
      max-width: 120px;
      padding-right: 22px;
    }

    .presupuestos-status-chip {
      display: inline-flex;
      align-items: center;
      padding: 5px 10px;
      border-radius: 999px;
      background: #eef2f6;
      color: #486581;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      white-space: nowrap;
    }

    button.presupuestos-status-chip {
      border: none;
      cursor: pointer;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    }

    button.presupuestos-status-chip:hover {
      transform: translateY(-1px);
      filter: saturate(1.05);
    }

    .presupuestos-status-chip.pending {
      background: #e0f2fe;
      color: #075985;
    }

    .factura-status-action {
      min-width: 0;
      justify-content: center;
      padding: 5px 10px;
      font-size: 12px;
      position: relative;
      overflow: visible;
    }

    .factura-status-action::after {
      content: attr(data-hover-label);
      position: absolute;
      left: 50%;
      top: calc(100% + 6px);
      transform: translateX(-50%);
      padding: 6px 9px;
      border-radius: 999px;
      background: #102a43;
      color: #f8fafc;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      white-space: nowrap;
      opacity: 0;
      pointer-events: none;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
      transition: opacity 0.15s ease, transform 0.15s ease;
      z-index: 20;
    }

    .factura-status-action:hover::after {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .presupuestos-status-chip.accepted {
      background: #dcfce7;
      color: #166534;
    }

    .presupuestos-status-chip.draft {
      background: #e2e8f0;
      color: #475569;
    }

    .presupuestos-status-chip.overdue {
      background: #fee2e2;
      color: #b91c1c;
    }

    .presupuestos-status-chip.paid {
      background: #dcfce7;
      color: #166534;
    }

    .presupuestos-status-chip.overpaid {
      background: #ede9fe;
      color: #6d28d9;
    }

    .presupuestos-status-chip.voided {
      background: #f1f5f9;
      color: #64748b;
    }

    .presupuestos-status-chip.converted {
      background: #ede9fe;
      color: #6d28d9;
    }

    .presupuestos-table-muted {
      color: #829ab1;
      font-size: 13px;
    }

    .presupuesto-pdf-btn {
      width: 28px;
      height: 28px;
      min-width: 28px;
      padding: 0;
      border-radius: 7px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .presupuesto-pdf-btn .icon-svg {
      width: 14px;
      height: 14px;
    }

    .presupuestos-table-actions {
      white-space: nowrap;
      text-align: right;
      padding-left: 8px;
      padding-right: 8px;
    }

    .presupuestos-table-actions .presupuesto-pdf-btn + .presupuesto-pdf-btn {
      margin-left: 4px;
    }

    .contabilidad-placeholder {
      border: 1px dashed #d9e2ec;
      border-radius: 14px;
      padding: 20px;
      background: #fbfdff;
      color: #486581;
    }

    .contabilidad-placeholder-title {
      font-size: 16px;
      font-weight: 700;
      color: #102a43;
      margin-bottom: 6px;
    }

    .contabilidad-placeholder-copy {
      font-size: 14px;
      line-height: 1.5;
      max-width: 640px;
    }

    .proyecto-cliente-icon-btn {
      width: 32px;
      height: 32px;
      min-width: 32px;
      padding: 0;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .proyecto-vista.hidden {
      display: none;
    }

    .proyecto-vista {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .proyecto-vista-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .proyecto-vista-back {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 0;
      background: transparent;
      color: #486581;
      font-size: 13px;
      font-weight: 700;
      padding: 0;
      cursor: pointer;
    }

    .proyecto-vista-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
      padding: 8px 0 2px;
    }

    .proyecto-vista-title-wrap {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .proyecto-vista-title-line {
      display: flex;
      align-items: baseline;
      gap: 10px;
      flex-wrap: wrap;
    }

    .proyecto-vista-title {
      margin: 0;
      font-size: 28px;
      line-height: 1;
      color: #102a43;
    }

    .proyecto-vista-cliente {
      color: #52606d;
      font-size: 16px;
      font-style: italic;
    }

    .proyecto-vista-cliente-link {
      background: none;
      border: none;
      padding: 0;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
      text-decoration-color: transparent;
      transition: color 0.15s, text-decoration-color 0.15s;
    }

    .proyecto-vista-cliente-link:hover {
      color: #1d4ed8;
      text-decoration-color: #1d4ed8;
    }

    .proyecto-vista-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      color: #64748b;
      font-size: 13px;
    }

    .proyecto-vista-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .proyecto-vista-status {
      appearance: none;
      border: 1px solid #cbd5e1;
      border-radius: 999px;
      background: #f8fafc;
      color: #243b53;
      padding: 7px 22px;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      text-align: center;
      text-align-last: center;
    }

    .proyecto-vista-edit-btn {
      width: 32px;
      height: 32px;
      min-width: 32px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .proyecto-vista-tabs {
      display: flex;
      align-items: center;
      gap: 8px;
      border-bottom: 1px solid #e2e8f0;
      padding-bottom: 8px;
    }

    .proyecto-vista-tab {
      border: 0;
      background: transparent;
      color: #64748b;
      padding: 6px 10px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
    }

    .proyecto-vista-tab:hover {
      background: #f8fafc;
      color: #243b53;
    }

    .proyecto-vista-tab.active {
      background: #eff6ff;
      color: #1d4ed8;
    }

    .proyecto-vista-body {
      min-height: 220px;
    }

    .proyecto-talleres-view {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .proyecto-talleres-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .proyecto-talleres-copy {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .proyecto-talleres-title {
      color: #102a43;
      font-size: 18px;
      font-weight: 800;
      line-height: 1.1;
    }

    .proyecto-talleres-meta {
      color: #64748b;
      font-size: 13px;
    }

    button.secundario.proyecto-talleres-add-btn {
      white-space: nowrap;
      padding: 4px 8px;
      min-height: 28px;
      border-radius: 8px;
      font-size: 11px;
      color: #334e68;
      border-color: #e2e8f0;
      background: transparent;
      box-shadow: none;
    }

    button.secundario.proyecto-talleres-add-btn:hover {
      color: #243b53;
      background: #f1f5f9;
      border-color: #d5dee8;
    }

    .proyecto-talleres-list {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .talleres-view-switch {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px;
      border: 1px solid #d9e2ec;
      border-radius: 999px;
      background: #f8fafc;
    }

    button.talleres-view-switch-btn {
      border: 0;
      background: transparent;
      color: #52606d;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
    }

    button.talleres-view-switch-btn.active {
      background: #ffffff;
      color: #102a43;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    }

    .talleres-calendar-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .talleres-calendar-nav {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    button.secundario.talleres-calendar-nav-btn {
      width: 32px;
      min-width: 32px;
      height: 32px;
      padding: 0;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      line-height: 1;
      background: #f8fafc;
      color: #334e68;
    }

    button.secundario.talleres-calendar-nav-btn:hover {
      background: #f1f5f9;
      color: #243b53;
    }

    .talleres-calendar-month {
      min-width: 170px;
      color: #102a43;
      font-size: 18px;
      font-weight: 800;
      text-transform: capitalize;
    }

    .talleres-calendar-legend {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      color: #52606d;
      font-size: 12px;
    }

    .talleres-calendar-legend-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .talleres-calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 8px;
      margin-bottom: 16px;
    }

    .talleres-calendar-weekday {
      text-align: center;
      color: #829ab1;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }

    button.talleres-calendar-day {
      min-height: 92px;
      padding: 10px;
      border: 1px solid #dbe3ee;
      border-radius: 14px;
      background: #ffffff;
      color: #102a43;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: space-between;
      text-align: left;
      box-shadow: none;
      position: relative;
    }

    button.talleres-calendar-day.con-pendientes::after {
      content: "";
      position: absolute;
      top: 0;
      right: 0;
      width: 0;
      height: 0;
      border-top: 14px solid #f59e0b;
      border-left: 14px solid transparent;
      border-top-right-radius: 14px;
    }

    .talleres-calendar-day.filler {
      min-height: 92px;
      border-radius: 14px;
      background: transparent;
    }

    button.talleres-calendar-day:hover {
      background: #f8fafc;
      border-color: #cbd5e1;
    }

    button.talleres-calendar-day.hoy {
      border-color: #bfdbfe;
      background: #f8fbff;
    }

    button.talleres-calendar-day.selected {
      border-color: #93c5fd;
      box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.16);
    }

    button.talleres-calendar-day.con-talleres .talleres-calendar-day-number {
      font-weight: 800;
    }

    .talleres-calendar-day-top {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .talleres-calendar-day-number {
      font-size: 15px;
      line-height: 1;
    }

    .talleres-calendar-day-count {
      color: #829ab1;
      font-size: 11px;
      font-weight: 700;
    }

    .talleres-calendar-day-names {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-top: 6px;
      flex: 1;
    }

    .talleres-calendar-day-name {
      width: 100%;
      font-size: 11px;
      line-height: 1.2;
      padding-left: 6px;
      border-left: 3px solid #cbd5e1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: #334e68;
      box-sizing: border-box;
    }

    .talleres-calendar-day-name.safor {
      border-left-color: #22c55e;
    }

    .talleres-calendar-day-name.barcelona {
      border-left-color: #3b82f6;
    }

    .talleres-calendar-dot {
      width: 9px;
      height: 9px;
      border-radius: 999px;
      display: inline-block;
    }

    .talleres-calendar-dot.safor {
      background: #22c55e;
    }

    .talleres-calendar-dot.barcelona {
      background: #3b82f6;
    }

    .talleres-calendar-detail {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .talleres-calendar-detail-title {
      color: #102a43;
      font-size: 16px;
      font-weight: 800;
    }

    .talleres-calendar-detail-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .proyecto-taller-card {
      border: 1px solid #dbe3ee;
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .proyecto-taller-card.con-cambios {
      border-color: #cbd5e1;
      box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.18);
    }

    .proyecto-taller-card.urgente {
      border-color: #fbbf24;
      box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2);
    }

    .proyecto-taller-card.pasado {
      background: #f8fafc;
      border-color: #e2e8f0;
    }

    .proyecto-taller-card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .proyecto-taller-card-head-copy {
      display: flex;
      flex-direction: column;
      gap: 5px;
      min-width: 0;
    }

    .proyecto-taller-card-kicker-line {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      min-width: 0;
    }

    .proyecto-taller-card-kicker {
      color: #64748b;
      font-size: 15px;
      font-weight: 800;
      line-height: 1.1;
    }

    .proyecto-taller-card-inline-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      color: #52606d;
      font-size: 14px;
      line-height: 1.1;
    }

    .proyecto-taller-save-state {
      color: #829ab1;
      font-size: 11px;
      line-height: 1.2;
    }

    .proyecto-taller-card.con-cambios .proyecto-taller-save-state {
      color: #9f580a;
      font-weight: 700;
    }

    .proyecto-taller-card-inline-meta span {
      display: inline-flex;
      align-items: center;
      white-space: nowrap;
    }

    .proyecto-taller-card-inline-meta span::before {
      content: "-";
      margin-right: 8px;
      color: #9aa5b1;
    }

    .proyecto-taller-card-actions,
    .proyecto-taller-footer-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .proyecto-taller-footer-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      width: 100%;
      max-width: 340px;
    }

    .proyecto-taller-copy-column {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .proyecto-taller-footer-actions .proyecto-taller-action-btn {
      width: 100%;
      justify-content: center;
    }

    .proyecto-taller-icon-btn {
      width: 30px;
      height: 30px;
      min-width: 30px;
      padding: 0;
      border-radius: 7px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .proyecto-taller-action-btn {
      padding: 5px 9px;
      font-size: 11px;
      line-height: 1.1;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .proyecto-taller-save-btn-card[disabled] {
      opacity: 0.55;
      cursor: default;
    }

    .proyecto-taller-save-btn-card {
      min-height: 30px;
      border-radius: 8px;
    }

    .proyecto-taller-delete-btn {
      color: #b91c1c;
      border-color: #fecaca;
      background: #fff5f5;
    }

    .proyecto-taller-delete-btn:hover {
      background: #fee2e2;
      border-color: #fca5a5;
    }

    .proyecto-taller-form {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .proyecto-taller-field {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
      width: 100%;
    }

    .proyecto-taller-field-full {
      grid-column: 1 / -1;
    }

    .proyecto-taller-field span {
      color: #52606d;
      font-size: 11px;
      font-weight: 700;
    }

    .proyecto-taller-field.proyecto-taller-field-error span {
      color: #b91c1c;
    }

    .proyecto-taller-field input,
    .proyecto-taller-field select,
    .proyecto-taller-field textarea {
      box-sizing: border-box;
      width: 100%;
      min-width: 0;
      max-width: 100%;
      border: 1px solid #d5dee8;
      border-radius: 12px;
      background: #ffffff;
      color: #102a43;
      font: inherit;
      padding: 8px 10px;
    }

    .proyecto-taller-field.proyecto-taller-field-error input,
    .proyecto-taller-field.proyecto-taller-field-error select,
    .proyecto-taller-field.proyecto-taller-field-error textarea {
      border-color: #fca5a5;
      background: #fff7f7;
      box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.12);
    }

    .proyecto-taller-field textarea {
      resize: vertical;
      min-height: 72px;
      line-height: 1.35;
    }

    .proyecto-taller-field-pair textarea {
      min-height: 92px;
      height: 92px;
    }

    .proyecto-taller-save-btn {
      padding: 7px 11px;
      font-size: 12px;
      line-height: 1.1;
      white-space: nowrap;
    }

    .proyecto-taller-confirm-btn {
      min-height: 30px;
      border-radius: 8px;
      background: #fff1f2;
      color: #9f1239;
      border: 1px solid #fecdd3;
    }

    .proyecto-taller-confirm-btn:hover {
      background: #ffe4e6;
      border-color: #fda4af;
      color: #881337;
    }

    .proyecto-taller-confirm-btn.confirmado {
      background: #f0fdf4;
      color: #166534;
      border-color: #bbf7d0;
    }

    .proyecto-taller-copy-field {
      align-self: start;
    }

    .proyecto-talleres-empty {
      border: 1px dashed #cbd5e1;
      border-radius: 18px;
      background: #f8fafc;
      padding: 22px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
    }

    .proyecto-talleres-empty-title {
      color: #102a43;
      font-size: 18px;
      font-weight: 800;
      line-height: 1.1;
    }

    .proyecto-talleres-empty-copy {
      color: #64748b;
      font-size: 14px;
      line-height: 1.45;
      max-width: 620px;
    }

    .proyecto-general-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .proyecto-general-card {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
      min-height: 168px;
      border: 1px solid #dbe3ee;
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
      padding: 18px;
      color: #102a43;
      text-align: left;
      cursor: pointer;
      transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    }

    .proyecto-general-card:hover {
      border-color: #c3d4e6;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
      transform: translateY(-1px);
    }

    .proyecto-general-card-static {
      cursor: default;
    }

    .proyecto-general-card-static:hover {
      border-color: #dbe3ee;
      box-shadow: none;
      transform: none;
    }

    .proyecto-general-card-title {
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .proyecto-general-card-main {
      color: #102a43;
      font-size: 30px;
      font-weight: 800;
      line-height: 1;
    }

    .proyecto-general-card-main-contacto {
      font-size: 20px;
    }

    .proyecto-general-card-meta {
      color: #52606d;
      font-size: 13px;
      line-height: 1.35;
    }

    .proyecto-general-preview-list {
      width: 100%;
      margin-top: 0;
      padding-top: 4px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .proyecto-general-preview-list-inline {
      margin-top: 0;
      padding-top: 0;
    }

    .proyecto-general-preview-item {
      width: 100%;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      border-top: 1px solid #edf2f7;
      padding-top: 6px;
    }

    .proyecto-general-preview-copy {
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
      }

    .proyecto-general-preview-text {
      color: #243b53;
      font-size: 13px;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .proyecto-general-preview-text-completada {
      color: #64748b;
      text-decoration: line-through;
      text-decoration-thickness: 1.5px;
    }

    .proyecto-general-preview-status {
      color: #94a3b8;
      font-size: 11px;
      line-height: 1.2;
    }

    .proyecto-general-preview-date {
      flex-shrink: 0;
      color: #829ab1;
      font-size: 11px;
      font-weight: 700;
      text-transform: lowercase;
    }

    .proyecto-general-preview-item-completada .proyecto-general-preview-date {
      color: #94a3b8;
    }

    .proyecto-general-preview-empty {
      margin-top: auto;
      color: #9aa5b1;
      font-size: 13px;
      line-height: 1.3;
      padding-top: 8px;
    }

    .proyecto-general-facturacion-preview {
      width: 100%;
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .proyecto-general-preview-group {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .proyecto-general-preview-group-title {
      color: #64748b;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }

    .proyecto-facturacion-view {
      display: flex;
      flex-direction: column;
      gap: 18px;
      padding-top: 4px;
    }

    .proyecto-facturacion-group {
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 16px 18px;
      border: 1px solid #dbe3ee;
      border-radius: 18px;
      background: #ffffff;
    }

    .proyecto-facturacion-group-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .proyecto-facturacion-group-title {
      color: #102a43;
      font-size: 15px;
      font-weight: 800;
    }

    .proyecto-facturacion-group-meta {
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
    }

    .proyecto-facturacion-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .proyecto-facturacion-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 12px 14px;
      border: 1px solid #edf2f7;
      border-radius: 14px;
      background: #f8fafc;
      cursor: pointer;
      transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    }

    .proyecto-facturacion-item:hover {
      border-color: #cbd5e1;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
      transform: translateY(-1px);
    }

    .proyecto-facturacion-item-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1;
    }

    .proyecto-facturacion-item-top {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .proyecto-facturacion-item-doc {
      color: #102a43;
      font-size: 14px;
      font-weight: 700;
      line-height: 1.2;
    }

    .proyecto-facturacion-item-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      color: #64748b;
      font-size: 12px;
      line-height: 1.25;
    }

    .proyecto-facturacion-item-actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .proyecto-facturacion-empty {
        color: #829ab1;
        font-size: 13px;
        line-height: 1.35;
      }
    .proyecto-planchas-view {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .proyecto-planchas-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .proyecto-planchas-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .proyecto-plancha-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 12px 14px;
      border: 1px solid #dbe3ee;
      border-radius: 16px;
      background: #ffffff;
      cursor: pointer;
      transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    }
    .proyecto-plancha-item:hover {
      border-color: #cbd5e1;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
      transform: translateY(-1px);
    }
    .proyecto-plancha-item-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .proyecto-plancha-item-top {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .proyecto-plancha-item-title {
      color: #102a43;
      font-size: 14px;
      font-weight: 700;
      line-height: 1.2;
    }
    .proyecto-plancha-item-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      color: #64748b;
      font-size: 12px;
      line-height: 1.25;
    }
    .proyecto-plancha-item-receta {
      color: #52606d;
      font-size: 12px;
      line-height: 1.3;
    }
    .proyecto-plancha-fecha-programada.is-warning {
      color: #b4690e;
      font-weight: 700;
    }
    .proyecto-plancha-fecha-programada.is-danger {
      color: #c81e1e;
      font-weight: 700;
    }
    .proyecto-plancha-item-actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .proyecto-planchas-empty {
      color: #829ab1;
      font-size: 13px;
      line-height: 1.35;
      padding: 8px 2px;
    }

    .proyecto-general-contact-list {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 2px;
    }

    .proyecto-general-contact-line {
      color: #243b53;
      font-size: 13px;
      line-height: 1.3;
      word-break: break-word;
    }

    .proyecto-vista-placeholder {
      padding: 26px 4px 10px;
      color: #829ab1;
      font-size: 14px;
    }

    /* ── Cliente detalle ─────────────────────────────────────── */

    .cliente-vista {
      display: flex;
      flex-direction: column;
      gap: 20px;
      padding: 0;
    }

    .cliente-vista-badge-vencido {
      background: #fee2e2;
      color: #dc2626;
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 20px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .cliente-general-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .cliente-datos-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
    }

    .cliente-datos-row {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      gap: 8px;
      font-size: 13px;
      border-top: 1px solid #edf2f7;
      padding-top: 6px;
    }

    .cliente-datos-label {
      color: #64748b;
      flex-shrink: 0;
    }

    .cliente-datos-value {
      color: #102a43;
      font-weight: 600;
      text-align: right;
      word-break: break-word;
    }

    .cliente-estado-bar {
      display: flex;
      flex-direction: row;
      gap: 4px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .cliente-estado-chip {
      font-size: 11px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 20px;
      background: #f1f5f9;
      color: #475569;
    }

    .cliente-estado-chip.activo {
      background: #dcfce7;
      color: #16a34a;
    }

    .cliente-estado-chip.terminado {
      background: #f1f5f9;
      color: #64748b;
    }

    .cliente-estado-chip.cancelado {
      background: #fee2e2;
      color: #dc2626;
    }

    .cliente-estado-chip.pausa {
      background: #fef9c3;
      color: #a16207;
    }

    .cliente-money-row {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      border-top: 1px solid #edf2f7;
      padding-top: 8px;
      width: 100%;
    }

    .cliente-money-label {
      color: #64748b;
      font-size: 13px;
    }

    .cliente-money-value {
      color: #102a43;
      font-size: 16px;
      font-weight: 700;
    }

    .cliente-money-value.vencido {
      color: #dc2626;
    }

    .cliente-money-value.advertencia {
      color: #d97706;
    }

    .cliente-proyectos-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .cliente-proyecto-row {
      border: 1px solid #dbe3ee;
      border-radius: 12px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      background: white;
    }

    .cliente-proyecto-row-header {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .cliente-proyecto-nombre {
      font-size: 15px;
      font-weight: 700;
      color: #102a43;
    }

    .cliente-proyecto-meta {
      font-size: 12px;
      color: #64748b;
      display: flex;
      flex-direction: row;
      gap: 12px;
    }

    .cliente-taller-subrow {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 6px 0 0 12px;
      border-top: 1px solid #f1f5f9;
      font-size: 13px;
      color: #475569;
    }

    .cliente-taller-fecha {
      font-size: 12px;
      font-weight: 700;
      color: #1d4ed8;
      background: #eff6ff;
      padding: 1px 7px;
      border-radius: 20px;
      flex-shrink: 0;
    }

    .cliente-contacto-section {
      margin-bottom: 20px;
    }

    .cliente-contacto-section h4 {
      font-size: 13px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #64748b;
      margin: 0 0 10px;
    }

    .cliente-contacto-card {
      border: 1px solid #dbe3ee;
      border-radius: 12px;
      padding: 12px 16px;
      background: white;
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 8px;
    }

    .cliente-contacto-nombre {
      font-size: 14px;
      font-weight: 700;
      color: #102a43;
    }

    .cliente-contacto-detail {
      font-size: 13px;
      color: #52606d;
    }

    .contacto-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .contacto-card {
      border: 1px solid #dbe3ee;
      border-radius: 14px;
      background: #fff;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .contacto-card-origen {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      border-bottom: 1px solid #edf2f7;
    }

    .contacto-card-origen.origen-cliente  { background: #eff6ff; }
    .contacto-card-origen.origen-proyecto { background: #f0fdf4; }
    .contacto-card-origen.origen-taller   { background: #fefce8; }

    .contacto-card-origen-tipo {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: #64748b;
      flex-shrink: 0;
    }

    .contacto-card-origen-sub {
      font-size: 12px;
      color: #475569;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .contacto-card-body {
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex: 1;
    }

    .contacto-card-nombre {
      font-size: 15px;
      font-weight: 700;
      color: #102a43;
      line-height: 1.2;
    }

    .contacto-card-linea {
      display: flex;
      align-items: flex-start;
      gap: 7px;
      font-size: 13px;
      color: #475569;
      line-height: 1.35;
    }

    .contacto-card-icono {
      flex-shrink: 0;
      font-size: 12px;
      margin-top: 1px;
    }

    .contacto-card-link {
      color: #1d4ed8;
      text-decoration: none;
    }

    .contacto-card-link:hover {
      text-decoration: underline;
    }

    @media (max-width: 980px) {
      .contacto-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 980px) {
      .cliente-general-grid {
        grid-template-columns: 1fr;
      }
    }

    /* ── fin Cliente detalle ─────────────────────────────────── */

    @media (max-width: 820px) {
      .talleres-calendar-toolbar {
        align-items: flex-start;
      }

      .talleres-calendar-month {
        min-width: 0;
      }

      .talleres-calendar-grid {
        gap: 6px;
      }

      button.talleres-calendar-day {
        min-height: 78px;
        padding: 8px;
      }

      .proyecto-taller-card-kicker-line {
        align-items: flex-start;
      }

      .proyecto-taller-form {
        grid-template-columns: 1fr;
      }

      .proyecto-taller-footer-actions {
        max-width: none;
      }

      .proyecto-general-grid {
        grid-template-columns: 1fr;
      }
    }

    .programacion-pendientes-aviso {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
      padding: 12px 14px;
      border: 1px solid #fcd34d;
      border-radius: 10px;
      background: #fffbeb;
      color: #92400e;
    }

    .programacion-pendientes-aviso p {
      margin: 0;
      font-size: 14px;
    }

    .dia-card.hoy {
      border-color: #1d4ed8;
      background: #eff6ff;
    }

    .dia-card.pasado {
      background: #f1f5f9;
      color: #64748b;
    }

    .dia-card.sin-produccion {
      background: #f8fafc;
      border-color: #d7dee8;
      color: #64748b;
      padding-top: 10px;
      padding-bottom: 10px;
    }

    .dia-meta {
      font-size: 13px;
      margin-bottom: 8px;
      color: #475569;
    }

    .dia-card.pasado .dia-meta {
      color: #64748b;
    }

    .dia-card.sin-produccion .dia-meta {
      margin-bottom: 0;
      color: #64748b;
    }

    .dia-titulo {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
    }

    .dia-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }

    .dia-titulo strong {
      margin-bottom: 0;
    }

    .fecha-fin-semana {
      color: #9a3412;
    }

    .editar-dia-btn {
      flex-shrink: 0;
      width: 36px;
      height: 36px;
      padding: 0;
      border-radius: 8px;
      font-size: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
    }

    .dia-menu-wrapper {
      position: relative;
      flex-shrink: 0;
    }

    .dia-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 22px;
      height: 22px;
      padding: 0 6px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: bold;
      background: #dbeafe;
      color: #1d4ed8;
    }

    .dia-badge.limitado {
      background: #fef3c7;
      color: #b45309;
    }

    .dia-badge.extra {
      background: #ffedd5;
      color: #c2410c;
    }

    .slot-linea {
      padding: 10px 12px;
      border-radius: 10px;
      background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
      border: 1px solid #e2e8f0;
      margin-bottom: 8px;
      transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    }

    .slot-linea:last-child {
      margin-bottom: 0;
    }

    .slot-linea.interactiva:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
      border-color: #cbd5e1;
    }

    .slot-linea.hecha {
      background: #dcfce7;
      border: 1px solid #86efac;
    }

    .slot-linea.interactiva {
      cursor: pointer;
    }

    .slot-linea.interactiva .slot-acciones {
      display: none;
    }

    .slot-linea.interactiva.abierta .slot-acciones {
      display: flex;
    }

    .slot-contenido {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .slot-texto {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .slot-nombre {
      font-weight: 700;
      color: #0f172a;
      line-height: 1.2;
      word-break: break-word;
    }

    .slot-meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
      font-size: 13px;
      color: #475569;
    }

    .slot-estado {
      color: #64748b;
      font-size: 14px;
    }

    .slot-vacio {
      color: #94a3b8;
    }

    .slot-acciones {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 8px;
    }

    .slot-acciones button {
      width: 34px;
      height: 34px;
      padding: 0;
      font-size: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
    }

    .slot-acciones .accion-hecha {
      background: #15803d;
    }

    .slot-acciones .accion-reprogramar {
      background: #2563eb;
    }

    .slot-acciones .accion-editar {
      background: #7c3aed;
    }

    .slot-acciones .accion-info {
      background: #0f766e;
    }

    .slot-acciones .accion-congelar {
      background: #64748b;
    }

    .slot-acciones .accion-eliminar {
      background: #dc2626;
    }

    .material-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .material-resumen {
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-width: 0;
    }

    .material-resumen strong {
      margin-bottom: 0;
    }

    .material-item {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }

    .material-item.alerta {
      border-width: 2px;
    }

    .material-item.bajo-minimo {
      border-color: #f59e0b;
      box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
    }

    .material-item.sin-stock {
      border-color: #dc2626;
      box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.08);
    }

    .material-header {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .material-metricas {
      display: flex;
      gap: 10px 14px;
      flex-wrap: wrap;
      color: #475569;
      font-size: 14px;
    }

    .material-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
    }

    .material-badge.bajo-minimo {
      background: #fef3c7;
      color: #b45309;
    }

    .material-badge.sin-stock {
      background: #fee2e2;
      color: #b91c1c;
    }

    .material-actions {
      display: flex;
      gap: 8px;
      flex-shrink: 0;
      margin-left: auto;
    }

    .material-favorito-btn,
    .editar-material-btn {
      width: 36px;
      height: 36px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      font-size: 16px;
    }

    .material-favorito-btn {
      background: #f8fafc;
      color: #64748b;
    }

    .material-favorito-btn.activo {
      background: #fef3c7;
      color: #b45309;
    }

    .modelo-actions {
      display: flex;
      gap: 8px;
      margin-top: 10px;
    }

    .stock-toolbar {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
      margin-bottom: 16px;
    }

    .stock-filtros {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 16px;
    }

    .stock-chip {
      background: #e2e8f0;
      color: #334155;
    }

    .stock-chip.active {
      background: #1d4ed8;
      color: white;
    }

    .stock-toolbar input {
      flex: 1 1 260px;
      min-width: 220px;
      padding: 10px;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      box-sizing: border-box;
      font: inherit;
    }

    .dias-especiales-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
      gap: 18px;
      align-items: start;
    }

    .dias-especiales-bloque {
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      padding: 16px;
      background: #fff;
    }

    .dias-especiales-bloque h3 {
      margin: 0 0 12px;
      font-size: 16px;
    }

    .dias-especiales-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 12px;
    }

    .dias-especiales-toolbar h3 {
      margin: 0;
      text-transform: capitalize;
    }

    .dias-especiales-toolbar .acciones-mes {
      display: flex;
      gap: 8px;
    }

    .dias-especiales-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 8px;
      touch-action: none;
      user-select: none;
    }

    .dias-especiales-cabecera {
      text-align: center;
      font-size: 12px;
      font-weight: 700;
      color: #64748b;
    }

    .dias-especiales-dia {
      min-height: 72px;
      padding: 8px;
      border: 1px solid #dbe1ea;
      border-radius: 10px;
      background: #f8fafc;
      color: #0f172a;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: space-between;
      text-align: left;
      touch-action: none;
    }

    .dias-especiales-dia.vacio {
      visibility: hidden;
      pointer-events: none;
    }

    .dias-especiales-dia.hoy {
      border-color: #1d4ed8;
    }

    .dias-especiales-dia.seleccionada {
      box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.18);
    }

    .dias-especiales-dia.en-rango {
      background: #eff6ff;
      border-color: #bfdbfe;
    }

    .dias-especiales-numero {
      font-weight: 700;
    }

    .dias-especiales-badge {
      font-size: 11px;
      font-weight: 700;
      border-radius: 999px;
      padding: 2px 6px;
      background: #e2e8f0;
      color: #334155;
    }

    .tipo-limitado .dias-especiales-badge,
    .dia-especial-chip.tipo-limitado,
    .dia-rapido-chip.actual.tipo-limitado {
      background: #fef3c7;
      color: #b45309;
    }

    .dia-rapido-chip.tipo-limitado {
      color: #b45309;
    }

    .tipo-extra .dias-especiales-badge,
    .dia-especial-chip.tipo-extra,
    .dia-rapido-chip.actual.tipo-extra {
      background: #ffedd5;
      color: #c2410c;
    }

    .dia-rapido-chip.tipo-extra {
      color: #c2410c;
    }

    .tipo-sin-produccion .dias-especiales-badge,
    .dia-especial-chip.tipo-sin-produccion,
    .dia-rapido-chip.actual.tipo-sin-produccion {
      background: #e2e8f0;
      color: #475569;
    }

    .dia-rapido-chip.tipo-sin-produccion {
      color: #475569;
    }

    .tipo-normal .dias-especiales-badge,
    .dia-especial-chip.tipo-normal,
    .dia-rapido-chip.actual.tipo-normal {
      background: #dbeafe;
      color: #1d4ed8;
    }

    .dia-rapido-chip.tipo-normal {
      color: #1d4ed8;
    }

    .dia-especial-form {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .dia-especial-form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px 12px;
    }

    .dia-especial-form-grid .campo {
      margin-bottom: 0;
    }

    .dia-especial-form-grid .campo-full {
      grid-column: 1 / -1;
    }

    .dia-especial-item {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid #eef2f7;
      cursor: pointer;
    }

    .dia-especial-item:last-child {
      border-bottom: none;
    }

    .dia-especial-item:hover {
      background: #f8fafc;
    }

    .dia-especial-item-info {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .dia-especial-item-info strong {
      margin-bottom: 0;
    }

    .dia-especial-item-motivo {
      color: #475569;
      font-size: 13px;
      word-break: break-word;
    }

    .dia-especial-item-acciones {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .dia-especial-chip,
    .dia-rapido-chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 32px;
      height: 32px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid transparent;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      background: #e2e8f0;
      color: #334155;
    }

    .dia-rapido-chip {
      cursor: pointer;
      background: transparent;
      border-color: currentColor;
    }

    .dia-rapido-chip.actual {
      border-color: transparent;
      cursor: default;
      box-shadow: none;
    }

    .dia-especial-eliminar {
      width: 30px;
      height: 30px;
      padding: 0;
      border-radius: 999px;
      background: #fff1f2;
      color: #be123c;
      font-size: 18px;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .icono-cuadrado-btn {
      width: 36px;
      height: 36px;
      padding: 0;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
    }

    .dia-rapido-tipos {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .plancha.resumen {
      cursor: pointer;
    }

    .plancha-resumen-linea {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }

    .plancha-resumen-principal {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
      min-width: 0;
    }

    .plancha-resumen-linea strong {
      margin-bottom: 0;
    }

    .stock-warning-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      line-height: 1;
      vertical-align: middle;
    }

    .stock-warning-icon.bajo-minimo {
      color: #eab308;
    }

    .stock-warning-icon.sin-stock {
      color: #dc2626;
    }

    .date-warning-dot {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      display: inline-block;
      flex-shrink: 0;
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
    }

    .date-warning-dot.margen-corto {
      background: #eab308;
    }

    .date-warning-dot.fuera-de-fecha {
      background: #dc2626;
    }

    .plancha-usada-btn {
      flex-shrink: 0;
      padding: 7px 10px;
      font-size: 13px;
    }

    .plancha-detalle {
      display: none;
      margin-top: 10px;
      padding-top: 12px;
      border-top: 1px solid #e5e7eb;
      color: #475569;
      display: none;
      flex-direction: column;
      gap: 8px;
      background: #f8fafc;
      border-radius: 12px;
      padding: 12px;
    }

    .plancha.resumen.abierta .plancha-detalle {
      display: flex;
    }

    .plancha-resumen-linea {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .plancha-resumen-principal {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 1;
      flex-wrap: wrap;
    }

    .plancha-resumen-titulo {
      min-width: 0;
      display: inline-flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: nowrap;
      justify-content: flex-start;
    }

    .plancha-resumen-titulo strong {
      margin-bottom: 0;
      color: #102a43;
      text-align: left;
    }

    .plancha-resumen-proyecto {
      color: #64748b;
      font-size: 12px;
      font-weight: 600;
    }

    .plancha-resumen-meta {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: nowrap;
      justify-content: flex-start;
    }

    .plancha-resumen-chip {
      display: inline-flex;
      align-items: center;
      padding: 3px 8px;
      border-radius: 999px;
      background: #eef2f6;
      color: #52606d;
      font-size: 11px;
      font-weight: 700;
      line-height: 1;
    }

    .plancha-resumen-acciones {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .plancha-lista-editar-btn {
      width: 30px;
      height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #dbe3ee;
      border-radius: 10px;
      background: #fff;
      color: #52606d;
      cursor: pointer;
      transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
    }

    .plancha-lista-editar-btn:hover {
      border-color: #bfd0e2;
      background: #f8fafc;
      color: #102a43;
    }

    .plancha-lista-editar-btn svg {
      width: 15px;
      height: 15px;
      stroke-width: 2;
    }

    .plancha-detalle-stats {
      color: #243b53;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.35;
    }

    .plancha-detalle-linea {
      color: #52606d;
      font-size: 13px;
      line-height: 1.4;
    }

    .plancha-detalle-linea.is-warning {
      color: #b45309;
      font-weight: 700;
    }

    .plancha-detalle-linea.is-danger {
      color: #b91c1c;
      font-weight: 700;
    }

    .plancha-detalle-label {
      color: #64748b;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .plancha-detalle-receta {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .plancha-detalle-receta-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 10px;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      background: #ffffff;
      font-size: 13px;
    }

    .plancha-detalle-receta-item.is-warning {
      border-color: #f59e0b;
      background: #fffbeb;
    }

    .plancha-detalle-receta-item.is-danger {
      border-color: #fca5a5;
      background: #fef2f2;
    }

    .plancha-detalle-receta-material {
      color: #243b53;
      font-weight: 600;
    }

    .plancha-detalle-receta-peso {
      color: #52606d;
      font-weight: 700;
      white-space: nowrap;
    }

    .plancha-detalle-comentarios {
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      background: #ffffff;
      padding: 10px 12px;
      color: #243b53;
      font-size: 13px;
      line-height: 1.45;
      white-space: pre-wrap;
    }

    .plancha-stock-warning-detalle {
      color: #9a3412;
    }

    .plancha-stock-warning-detalle div + div {
      margin-top: 4px;
    }

    .plancha-date-warning-detalle {
        color: #92400e;
      }

    #info-plancha-modal .modal-content {
      width: min(620px, calc(100vw - 32px));
      max-width: 620px;
    }

    #info-plancha-modal .acciones {
      margin-top: 10px;
      padding-top: 6px;
    }

    #info-plancha-modal .acciones button {
      padding: 9px 14px;
    }

    #info-plancha-titulo {
      display: flex;
      align-items: baseline;
      gap: 10px;
      flex-wrap: wrap;
    }

    .info-plancha-title-main {
      color: #102a43;
    }

    .info-plancha-title-project {
      color: #64748b;
      font-size: 13px;
      font-weight: 600;
    }

    .info-plancha-layout {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .info-plancha-stats {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }

    .info-plancha-stat {
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      background: #f8fafc;
      padding: 10px 12px;
    }

    .info-plancha-stat-label {
      color: #64748b;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 4px;
    }

    .info-plancha-stat-value {
      color: #102a43;
      font-size: 17px;
      font-weight: 800;
      line-height: 1.1;
    }

    .info-plancha-details {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px 14px;
    }

    .info-plancha-detail-line {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      border-bottom: 1px solid #edf2f7;
      padding-bottom: 6px;
      color: #243b53;
      font-size: 13px;
    }

    .info-plancha-detail-line strong {
      color: #64748b;
      font-weight: 700;
    }

    .info-plancha-detail-line.is-warning {
      color: #92400e;
      font-weight: 700;
    }

    .info-plancha-detail-line.is-warning strong {
      color: #92400e;
    }

    .info-plancha-detail-line.is-danger {
      color: #b91c1c;
      font-weight: 700;
    }

    .info-plancha-detail-line.is-danger strong {
      color: #b91c1c;
    }

    .info-plancha-section {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .info-plancha-section-title {
      color: #102a43;
      font-size: 13px;
      font-weight: 800;
    }

    .info-plancha-receta {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .info-plancha-receta-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      background: #ffffff;
      padding: 8px 10px;
      font-size: 13px;
    }

    .info-plancha-receta-item.is-warning {
      border-color: #f59e0b;
      background: #fffbeb;
    }

    .info-plancha-receta-item.is-danger {
      border-color: #fca5a5;
      background: #fef2f2;
    }

    .info-plancha-receta-material {
      color: #243b53;
      font-weight: 600;
    }

    .info-plancha-receta-peso {
      color: #52606d;
      font-weight: 700;
      white-space: nowrap;
    }

    .info-plancha-comments {
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      background: #ffffff;
      padding: 10px 12px;
      color: #243b53;
      font-size: 13px;
      line-height: 1.45;
      white-space: pre-wrap;
    }

    .info-plancha-empty {
      color: #829ab1;
      font-size: 13px;
    }

    .modelo-item.resumen {
      cursor: pointer;
    }

    .modelo-resumen-linea {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
    }

    .cliente-resumen-linea {
      justify-content: space-between;
      align-items: flex-start;
    }

    .cliente-resumen-principal {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
      min-width: 0;
      flex: 1;
    }

    .modelo-resumen-linea strong {
      margin-bottom: 0;
    }

    .modelo-detalle {
      display: none;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid #e5e7eb;
      color: #475569;
    }

    .modelo-item.resumen.abierta .modelo-detalle {
      display: block;
    }

    .taller-global-item {
      margin-bottom: 3px;
      padding: 10px 12px;
      border-radius: 12px;
    }

    .taller-global-item-pasado {
      background: #f8fafc;
      border-color: #e2e8f0;
      box-shadow: none;
    }

    .taller-global-item-pasado .taller-resumen-principal strong,
    .taller-global-item-pasado .taller-detalle,
    .taller-global-item-pasado .taller-detalle-texto,
    .taller-global-item-pasado .taller-detalle-notas {
      color: #64748b;
    }

    .taller-global-item-pasado .taller-global-fecha,
    .taller-global-item-pasado .taller-global-equipo {
      background: #f1f5f9;
      border-color: #dbe3ee;
      color: #64748b;
    }

    .talleres-grupos {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .talleres-grupo {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .talleres-grupo-titulo {
      margin: 0 0 2px;
      font-size: 13px;
      font-weight: 700;
      color: #52606d;
    }

    .talleres-floating-add {
      position: fixed;
      right: 24px;
      bottom: 24px;
      z-index: 40;
    }

    .talleres-floating-add.fab {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .taller-resumen-linea {
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      flex-wrap: nowrap;
    }

    .taller-resumen-principal {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex: 1;
      flex-wrap: wrap;
    }

    .taller-resumen-principal strong {
      display: inline;
      margin-bottom: 0;
      font-size: 15px;
      line-height: 1.25;
    }

    .taller-resumen-aside {
      display: flex;
      align-items: flex-start;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
      flex-shrink: 0;
    }

    .taller-resumen-meta {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
      color: #52606d;
      font-size: 12px;
    }

    .taller-resumen-acciones {
      display: flex;
      align-items: center;
      gap: 6px;
      margin: 0;
      flex-shrink: 0;
    }

    .taller-resumen-acciones .icono-cuadrado-btn,
    .taller-resumen-acciones .editar-modelo-btn,
    .taller-resumen-acciones .dia-especial-eliminar {
      width: 30px;
      height: 30px;
      min-width: 30px;
      border-radius: 7px;
    }

    .taller-global-fecha,
    .taller-global-equipo,
    .taller-global-estado,
    .taller-global-flag {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 0 8px;
      border-radius: 999px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      white-space: nowrap;
    }

    .taller-global-flag {
      color: #9a3412;
      background: #fff7ed;
      border-color: #fed7aa;
      font-weight: 600;
      box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.18);
    }

    .taller-global-estado {
      cursor: pointer;
      color: #9f1239;
      background: #fff1f2;
      border-color: #fecdd3;
      transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    }

    .taller-global-estado:hover {
      background: #ffe4e6;
      border-color: #fda4af;
      color: #881337;
    }

    .taller-global-estado.confirmado {
      color: #166534;
      background: #f0fdf4;
      border-color: #bbf7d0;
    }

    .taller-detalle {
      margin-top: 8px;
      padding-top: 8px;
      font-size: 13px;
      line-height: 1.45;
    }

    .taller-detalle-layout {
      display: block;
    }

    .taller-detalle-contenido {
      min-width: 0;
    }

    .taller-detalle-linea + .taller-detalle-linea,
    .taller-detalle-linea + .taller-detalle-notas,
    .taller-detalle-notas + .taller-detalle-acciones {
      margin-top: 6px;
    }

    .taller-detalle-linea-direccion {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .taller-detalle-texto {
      user-select: text;
      cursor: text;
    }

    .taller-detalle-notas {
      color: #334e68;
    }

    .taller-detalle-notas p:first-child {
      margin-top: 0;
    }

    .taller-detalle-notas p:last-child {
      margin-bottom: 0;
    }

    @media (max-width: 720px) {
      .taller-resumen-linea {
        flex-wrap: wrap;
      }

      .taller-resumen-aside {
        width: 100%;
        justify-content: space-between;
      }
    }

    .taller-detalle-copy-btn {
      padding: 0;
      color: #475569;
      background: #ffffff;
      border: 1px solid #dbe3ee;
    }

    .taller-detalle-copy-btn:hover {
      color: #334e68;
      background: #f8fafc;
      border-color: #cbd5e1;
    }

    .taller-detalle-direccion-btn {
      padding: 3px 8px;
      font-size: 12px;
      white-space: nowrap;
    }

    .empty {
      color: #6b7280;
      font-size: 14px;
    }

    button {
      border: none;
      border-radius: 8px;
      background: #1d4ed8;
      color: white;
      padding: 10px 14px;
      cursor: pointer;
      font: inherit;
    }

    button.secundario {
      background: #64748b;
    }

    .fab {
      position: fixed;
      right: 24px;
      bottom: 24px;
      width: 60px;
      height: 60px;
      border-radius: 50%;
      font-size: 30px;
      box-shadow: 0 10px 24px rgba(29, 78, 216, 0.28);
    }

    .fab-menu {
      position: fixed;
      right: 24px;
      bottom: 94px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      align-items: flex-end;
      z-index: 60;
    }

    .fab-menu-item {
      min-width: 118px;
      padding: 9px 12px;
      border-radius: 999px;
      background: #ffffff;
      color: #1f2937;
      border: 1px solid #dbe3ee;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
      font-size: 13px;
      font-weight: 700;
    }

    .fab-menu-item:hover {
      background: #f8fafc;
      border-color: #cbd5e1;
    }

    .modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      align-items: center;
      justify-content: center;
      padding: 16px;
      z-index: 100;
    }

    .modal-content {
      width: 100%;
      max-width: 720px;
      max-height: calc(100vh - 32px);
      overflow-y: auto;
      overflow-x: hidden;
      background: white;
      border-radius: 14px;
      padding: 20px 20px 18px;
      box-sizing: border-box;
    }

    .campo {
      margin-bottom: 10px;
    }

    .campo label {
      display: block;
      margin-bottom: 4px;
      font-size: 13px;
      font-weight: bold;
    }

    .campo input,
    .campo select,
    .campo textarea {
      width: 100%;
      padding: 10px;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      box-sizing: border-box;
      font: inherit;
    }

    .campo textarea {
      min-height: 84px;
      line-height: 1.4;
      resize: vertical;
    }

    .plancha-form {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px 16px;
      align-items: start;
    }

    .plancha-form .campo {
      margin-bottom: 0;
      min-width: 0;
    }

    .plancha-form .campo-full {
      grid-column: 1 / -1;
    }

    .tarea-form {
      display: grid;
      grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.95fr);
      gap: 14px 18px;
      align-items: start;
    }

    .tarea-form .campo {
      margin-bottom: 0;
      min-width: 0;
    }

    .tarea-form-main,
    .tarea-form-side {
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-width: 0;
    }

    .tarea-responsables-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .tarea-responsable-chip {
      padding: 4px 12px;
      border-radius: 99px;
      border: 1.5px solid #cbd5e1;
      background: transparent;
      color: #64748b;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: background 0.1s, border-color 0.1s, color 0.1s;
    }

    .tarea-responsable-chip.selected {
      background: #0f172a;
      border-color: #0f172a;
      color: #fff;
    }

    .tarea-form-main textarea {
      min-height: 180px;
    }

    #tarea-modal .modal-content {
      max-width: 760px;
    }

    #proyecto-modal .modal-content {
      max-width: 820px;
    }

    #taller-modal .modal-content {
      max-width: 820px;
    }

    .taller-proyecto-nuevo {
      border: 1px solid #dbe1ea;
      border-radius: 12px;
      padding: 12px;
      background: #f8fafc;
      display: grid;
      gap: 10px;
    }

    .taller-proyecto-nuevo.hidden {
      display: none;
    }

    .taller-proyecto-nuevo-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      font-size: 13px;
      color: #52607a;
    }

    .taller-proyecto-nuevo-header span {
      font-weight: 600;
      color: #27324a;
    }

    .taller-proyecto-nuevo-back {
      border: 0;
      background: transparent;
      color: #486183;
      font-size: 12px;
      padding: 0;
      cursor: pointer;
    }

    .taller-proyecto-nuevo-back:hover {
      color: #233654;
      text-decoration: underline;
    }

    .proyecto-form .campo {
      margin-bottom: 0;
    }

    .proyecto-automatizacion {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .proyecto-more {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .proyecto-more-toggle {
      align-self: flex-start;
      border: 0;
      background: transparent;
      color: #486581;
      padding: 0;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.2;
      cursor: pointer;
    }

    .proyecto-more-toggle:hover {
      color: #243b53;
      text-decoration: underline;
    }

    .proyecto-more-fields {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .taller-form .campo {
      margin-bottom: 0;
    }

    .taller-fecha-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }

    .taller-fecha-header label {
      margin-bottom: 0;
    }

    .taller-add-date-btn {
      border: 0;
      background: transparent;
      color: #486581;
      padding: 0;
      font-size: 12px;
      font-weight: 600;
      line-height: 1.2;
      cursor: pointer;
    }

    .taller-add-date-btn:hover {
      color: #243b53;
      text-decoration: underline;
    }

    .taller-fechas-extra {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 6px;
    }

    .taller-fecha-extra-linea {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 6px;
      align-items: center;
    }

    .taller-fecha-extra-linea input {
      min-width: 0;
      height: 34px;
      padding: 6px 10px;
      font-size: 13px;
    }

    .taller-fecha-extra-eliminar {
      width: 28px;
      height: 28px;
      min-width: 28px;
      border-radius: 8px;
      border: 1px solid #f6d0d0;
      background: #fff8f8;
      color: #c24141;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }

    .taller-fecha-extra-eliminar:hover {
      background: #fee2e2;
      border-color: #f1a7a7;
    }

    #tarea-modal h3 {
      font-size: 16px;
      line-height: 1.1;
      margin-bottom: 12px;
      color: #334155;
      font-weight: 700;
    }

    .rich-editor {
      border: 1px solid #dbe3ee;
      border-radius: 10px;
      overflow: hidden;
      background: #ffffff;
    }

    .rich-editor-toolbar {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      padding: 8px;
      background: #f8fafc;
      border-bottom: 1px solid #e2e8f0;
    }

    .rich-editor-toolbar button {
      width: 30px;
      height: 30px;
      min-width: 30px;
      padding: 0;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: 0;
      box-shadow: none;
      color: #334155;
      font-size: 13px;
      line-height: 1;
    }

    .rich-editor-toolbar button:hover {
      background: #eff6ff;
    }

    .rich-editor-surface {
      min-height: 180px;
      padding: 10px 12px;
      font-family: inherit;
      font-size: 14px;
      line-height: 1.45;
      outline: none;
      white-space: pre-wrap;
    }

    .rich-editor-surface:empty::before {
      content: attr(data-placeholder);
      color: #94a3b8;
    }

    .rich-editor-surface .is-editor-empty:first-child::before,
    .rich-editor-surface p.is-editor-empty:first-child::before {
      content: attr(data-placeholder);
      color: #94a3b8;
      float: left;
      height: 0;
      pointer-events: none;
    }

    .rich-editor-surface p {
      margin: 0 0 0.55em;
    }

    .rich-editor-surface p:last-child {
      margin-bottom: 0;
    }

    .rich-editor-surface ul,
    .rich-editor-surface ol {
      margin: 0.35em 0 0.55em 1.1em;
      padding: 0;
    }

    .rich-editor-surface a {
      color: #1d4ed8;
      text-decoration: underline;
      cursor: text;
    }

    body.rich-link-modifier .rich-editor-surface a:hover {
      cursor: pointer;
      background: #dbeafe;
      border-radius: 4px;
      box-shadow: 0 0 0 2px #dbeafe;
    }

    .rich-rendered p {
      margin: 0 0 0.45em;
    }

    .rich-rendered p:last-child {
      margin-bottom: 0;
    }

    .rich-rendered ul,
    .rich-rendered ol {
      margin: 0.35em 0 0.45em 1.1em;
      padding: 0;
    }

    .rich-rendered a {
      color: #1d4ed8;
      text-decoration: underline;
    }

    #campo-nombre {
      order: 1;
      grid-column: 1 / span 3;
    }

    #campo-grosor {
      order: 2;
      grid-column: 4;
    }

    #campo-fecha {
      order: 3;
      grid-column: 1 / span 2;
    }

    #campo-tiempo {
      order: 4;
      grid-column: 3 / span 2;
    }

    #campo-proyecto-plancha {
      order: 5;
      grid-column: 1 / -1;
    }

    #campo-cantidad {
      order: 6;
      grid-column: 1 / span 2;
    }

    #campo-temperatura {
      order: 7;
      grid-column: 3;
    }

    #campo-presion {
      order: 8;
      grid-column: 4;
    }

    #campo-receta {
      order: 9;
    }

    .plancha-mas-wrap {
      order: 10;
      grid-column: 1 / -1;
    }

    #campo-plancha-comentarios {
      order: 11;
      grid-column: 1 / -1;
    }

    .plancha-acciones {
      order: 12;
      grid-column: 1 / -1;
    }

    .campo-error {
      margin-bottom: 6px;
      color: #dc2626;
      font-size: 13px;
      font-weight: 600;
    }

    .campo input.input-error,
    .campo select.input-error,
    .campo textarea.input-error {
      border-color: #dc2626;
      box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
    }

    .campo input[type="date"] {
      min-width: 0;
    }

    #material-modal .modal-content {
      max-width: 420px;
    }

    #cliente-modal .modal-content {
      max-width: 700px;
    }

    #presupuesto-modal .modal-content {
      max-width: 860px;
    }

    .presupuesto-form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px 12px;
    }

    .presupuesto-form-grid .campo {
      margin-bottom: 0;
    }

    .presupuesto-form-grid .campo-full {
      grid-column: 1 / -1;
    }

    .presupuesto-lineas {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 4px;
    }

    .presupuesto-linea {
      display: grid;
      grid-template-columns: minmax(0, 2.4fr) 0.8fr 0.9fr 1fr auto;
      gap: 8px;
      padding: 10px;
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      background: #fbfdff;
      align-items: end;
    }

    .presupuesto-linea .campo {
      margin-bottom: 0;
    }

    .presupuesto-linea-texto {
      min-width: 0;
    }

    .presupuesto-linea-acciones {
      display: flex;
      align-items: center;
      justify-content: center;
      padding-bottom: 2px;
    }

    .presupuesto-add-linea {
      margin-top: 10px;
    }

    .presupuesto-inline-state {
      margin-top: 6px;
      color: #486581;
      font-size: 12px;
      font-weight: 600;
      line-height: 1.3;
    }

    .presupuesto-inline-state-create {
      color: #0f766e;
    }

    .presupuesto-inline-warning {
      margin-top: 6px;
      color: #92400e;
      font-size: 12px;
      font-weight: 600;
      line-height: 1.35;
    }

    .sugerencia-item-create {
      color: #0f6fff;
      font-weight: 700;
    }

    @media (max-width: 900px) {
      .presupuesto-form-grid {
        grid-template-columns: 1fr;
      }

      .presupuesto-linea {
        grid-template-columns: 1fr 1fr;
      }

      .presupuesto-linea-texto {
        grid-column: 1 / -1;
      }

      .presupuesto-linea-acciones {
        justify-content: flex-start;
      }
    }

    .cliente-form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px 10px;
    }

    .cliente-form-grid .campo {
      margin-bottom: 0;
    }

    .cliente-form-grid .campo-full {
      grid-column: 1 / -1;
    }

    .cliente-direcciones-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px 10px;
      align-items: start;
    }

    .cliente-direcciones-columna {
      display: grid;
      gap: 8px;
      min-width: 0;
    }

    #cliente-modal textarea {
      min-height: 72px;
    }

    #cliente-modal .rich-editor-surface {
      min-height: 110px;
    }

    .cliente-form-error {
      margin-top: 10px;
      padding: 10px 12px;
      border-radius: 10px;
      background: #fef2f2;
      color: #b91c1c;
      font-size: 12px;
      line-height: 1.4;
      border: 1px solid #fecaca;
    }

    .cliente-inline-error {
      margin-top: 5px;
      color: #b91c1c;
      font-size: 12px;
      line-height: 1.35;
    }

    #cliente-email.input-error {
      border-color: #dc2626;
      box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
    }

    .cliente-sync-meta {
      margin-top: 10px;
      font-size: 12px;
      line-height: 1.45;
      color: #5b6472;
    }

    .cliente-sync-meta strong {
      color: #364152;
    }

    .cliente-modal-acciones {
      position: sticky;
      bottom: -8px;
      z-index: 2;
      padding-top: 12px;
      padding-bottom: 10px;
      margin-top: 10px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 24px);
      justify-content: flex-end;
    }

    #reprogramar-modal .modal-content.dialog-compact,
    #dia-rapido-modal .modal-content.dialog-compact,
    #confirmacion-modal .modal-content {
      width: min(420px, calc(100vw - 32px));
      max-width: 420px;
    }

    #reprogramar-modal .campo,
    #dia-rapido-modal .campo,
    #confirmacion-modal .campo,
    #info-plancha-modal .campo {
      margin-left: 2px;
      margin-right: 2px;
    }

    .autocomplete,
    .material-autocomplete {
      position: relative;
    }

    .sugerencias,
    .material-sugerencias {
      display: none;
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      z-index: 20;
      border: 1px solid #dbe1ea;
      border-radius: 10px;
      background: white;
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
      overflow: hidden;
      max-height: 220px;
      overflow-y: auto;
    }

    .sugerencia-item {
      padding: 10px 12px;
      cursor: pointer;
      border-bottom: 1px solid #eef2f7;
      transition: background 120ms ease;
    }

    .sugerencia-item:last-child {
      border-bottom: 0;
    }

    .sugerencia-item:hover {
      background: #f8fafc;
    }

    .sugerencia-titulo {
      color: #0f172a;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.25;
    }

    .sugerencia-subtitulo {
      color: #64748b;
      font-size: 12px;
      margin-top: 2px;
      line-height: 1.25;
    }

    .sugerencia-item-neutra .sugerencia-titulo {
      color: #1d4ed8;
    }

    .sugerencia,
    .material-sugerencia {
      padding: 10px 12px;
      cursor: pointer;
      border-bottom: 1px solid #eef2f7;
    }

    .sugerencia:last-child,
    .material-sugerencia:last-child {
      border-bottom: none;
    }

    .sugerencia:hover,
    .material-sugerencia:hover {
      background: #eff6ff;
    }

    .receta-header,
    .receta-linea {
      display: grid;
      grid-template-columns: 1.4fr 0.7fr auto;
      gap: 8px;
      align-items: start;
    }

    .receta-header {
      margin-bottom: 8px;
      font-size: 12px;
      font-weight: bold;
      color: #475569;
    }

    .receta-linea {
      margin-bottom: 8px;
    }

    .receta-eliminar,
    #agregar-linea-receta {
      min-width: 28px;
      height: 28px;
      padding: 0;
      border: none;
      background: transparent;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      line-height: 1;
      font-weight: 700;
      cursor: pointer;
    }

    #agregar-linea-receta {
      align-self: flex-start;
      margin-top: 2px;
      color: #16a34a;
    }

    .receta-eliminar {
      color: #dc2626;
      font-size: 28px;
    }

    .acciones {
      display: flex;
      gap: 10px;
      margin-top: 4px;
    }

    .plancha-acciones {
      position: sticky;
      bottom: -18px;
      padding-top: 12px;
      padding-bottom: 2px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 24px);
      justify-content: flex-end;
    }

    .plancha-mas-wrap {
      display: flex;
      justify-content: flex-start;
      margin-top: 2px;
      margin-bottom: -2px;
    }

    .plancha-mostrar-mas-btn {
      border: 0;
      background: transparent;
      color: #64748b;
      font-size: 12px;
      font-weight: 600;
      padding: 0;
      cursor: pointer;
    }

    .plancha-mostrar-mas-btn:hover {
      color: #243b53;
      text-decoration: underline;
    }

    @media (max-width: 640px) {
      .page {
        padding: 16px;
      }

      /* Empujar el modal por encima de la barra de navegación móvil (60px) */
      .modal {
        padding: 16px 16px 76px;
      }

      .modal-content {
        padding: 8px 14px 14px;
        max-height: calc(100dvh - 32px - 60px);
        display: flex;
        flex-direction: column;
      }

      /* Botones de acción: suben al top y se quedan pegados al scrollear */
      .modal-content .acciones,
      .modal-content .cliente-modal-acciones {
        order: -1;
        position: sticky;
        top: -8px;
        z-index: 10;
        background: white;
        padding: 8px 0 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        gap: 8px;
        align-items: center;
      }

      .modal-content .acciones button,
      .modal-content .cliente-modal-acciones button {
        flex: 1;
        padding: 7px 10px;
        font-size: 0.8rem;
        min-height: unset !important;
      }

      /* Evitar zoom automático de iOS al enfocar inputs (font-size < 16px lo dispara) */
      .modal-content input,
      .modal-content select,
      .modal-content textarea {
        font-size: 16px !important;
      }

      /* Título del modal: un poco más pequeño en móvil */
      .modal-content > h3 {
        font-size: 1rem;
        margin: 0 0 10px;
        order: 0;
      }

      /* Modales de confirmación/diálogo compacto: no tocar */
      #reprogramar-modal .modal-content .acciones,
      #dia-rapido-modal .modal-content .acciones,
      #confirmacion-modal .modal-content .acciones,
      #info-plancha-modal .modal-content .acciones {
        position: static;
        order: unset;
        border-bottom: none;
        border-top: 1px solid #e5e7eb;
        padding: 10px 0 0;
        margin-top: 10px;
        margin-bottom: 0;
      }

      .cliente-direcciones-grid {
        grid-template-columns: 1fr;
      }

      #reprogramar-modal .modal-content.dialog-compact,
      #dia-rapido-modal .modal-content.dialog-compact,
      #confirmacion-modal .modal-content {
        width: min(420px, calc(100vw - 32px));
        margin: 0 auto;
        padding: 16px 18px 14px !important;
      }

      #reprogramar-modal .campo,
      #dia-rapido-modal .campo,
      #confirmacion-modal .campo,
      #info-plancha-modal .campo {
        margin-left: 0;
        margin-right: 0;
      }

      #reprogramar-modal input[type="date"] {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        padding: 10px 36px 10px 10px;
        box-sizing: border-box;
      }

      #reprogramar-modal input[type="date"]::-webkit-date-and-time-value {
        text-align: left;
      }

      #reprogramar-modal input[type="date"]::-webkit-calendar-picker-indicator {
        margin: 0;
        padding: 0;
      }

      .plancha-form {
        grid-template-columns: 1fr;
        gap: 10px;
      }

      .tarea-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      /* Flatten main/side so all campos are direct flex children → orderable */
      #tarea-modal .tarea-form-main,
      #tarea-modal .tarea-form-side {
        display: contents;
      }

      /* Ensure all campos stretch to full width inside the flex column */
      #tarea-modal .tarea-form .campo {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      /* Reorder: Título → Fecha inicio → Proyecto → Tipo → Categoría → Responsables → Fecha fin → Notas */
      #tarea-modal .tarea-form-main .campo:first-child  { order: 1; }  /* título */
      #tarea-fecha-inicio-campo                         { order: 2; }  /* fecha inicio */
      #tarea-modal .tarea-form-side .campo:nth-child(1) { order: 3; }  /* proyecto */
      #tarea-modal .tarea-form-side .campo:nth-child(2) { order: 4; }  /* tipo */
      #tarea-modal .tarea-form-side .campo:nth-child(3) { order: 5; }  /* categoría */
      #tarea-responsable-campo                          { order: 6; }  /* responsables */
      #tarea-modal .tarea-form-side .campo:last-child   { order: 7; }  /* fecha fin */
      #tarea-modal .tarea-form-main .campo:last-child   { order: 8; }  /* notas (al final) */

      /* === Taller modal: mismo tratamiento === */
      #taller-modal .tarea-form-main,
      #taller-modal .tarea-form-side {
        display: contents;
      }

      #taller-modal .tarea-form .campo,
      #taller-modal .tarea-form #taller-proyecto-nuevo {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      /* Orden: Nombre → Fecha → Equipo → Proyecto → Estado → Contacto/Email/Tel → Dirección → Notas */
      #taller-modal .tarea-form-main .campo:nth-child(1) { order: 1; }  /* nombre */
      #taller-fecha-campo                                { order: 2; }  /* fecha */
      #taller-equipo-campo                               { order: 3; }  /* equipo */
      #taller-proyecto-existente-campo                   { order: 4; }  /* proyecto */
      #taller-proyecto-nuevo                             { order: 4; }  /* proyecto nuevo (junto al anterior) */
      #taller-modal .tarea-form-side .campo:nth-child(4) { order: 5; }  /* estado */
      #taller-modal .tarea-form-side .campo:nth-child(6) { order: 6; }  /* contacto */
      #taller-modal .tarea-form-side .campo:nth-child(7) { order: 7; }  /* email */
      #taller-modal .tarea-form-side .campo:nth-child(8) { order: 8; }  /* teléfono */
      #taller-modal .tarea-form-main .campo:nth-child(3) { order: 9; }  /* dirección */
      #taller-modal .tarea-form-main .campo:nth-child(2) { order: 10; } /* notas (al final) */

      #campo-nombre,
      #campo-grosor,
      #campo-fecha {
        grid-column: 1 / -1;
      }

      #campo-tiempo,
      #campo-presion,
      #campo-temperatura,
      #campo-cantidad,
      #campo-receta,
      .plancha-mas-wrap,
      #campo-plancha-comentarios,
      .plancha-acciones {
        order: 10;
      }

      #campo-nombre {
        order: 1;
      }

      #campo-grosor {
        order: 2;
      }

      #campo-fecha {
        order: 3;
      }

      #campo-tiempo {
        order: 4;
      }

      #campo-proyecto-plancha {
        order: 5;
      }

      #campo-presion {
        order: 6;
      }

      #campo-temperatura {
        order: 7;
      }

      #campo-cantidad {
        order: 8;
      }

      #campo-receta {
        order: 9;
      }

      .plancha-mas-wrap {
        order: 10;
      }

      #campo-plancha-comentarios {
        order: 11;
      }

      .plancha-acciones {
        order: 12;
      }

      .campo input[type="date"] {
        font-size: 16px;
        min-height: 42px;
        padding: 10px 36px 10px 10px;
      }

      .campo input[type="date"]::-webkit-date-and-time-value {
        text-align: left;
      }

      .campo input[type="date"]::-webkit-calendar-picker-indicator {
        margin: 0;
        padding: 0;
      }

      .receta-header {
        display: none;
      }

      .receta-linea {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 10px;
        align-items: center;
      }

      .receta-linea .material-autocomplete {
        grid-column: 1 / -1;
      }

      .receta-linea .receta-peso {
        grid-column: 1;
      }

      .receta-linea .receta-eliminar {
        grid-column: 2;
        justify-self: end;
      }

      .receta-eliminar,
      #agregar-linea-receta {
        min-width: 30px;
        height: 30px;
      }

      .material-item {
        align-items: flex-start;
      }

      .plancha-acciones {
        bottom: -14px;
        flex-direction: column;
      }

      .plancha-acciones button {
        width: 100%;
      }

      .dias-especiales-layout {
        grid-template-columns: 1fr;
      }

      .dias-especiales-grid {
        gap: 6px;
      }

      .dias-especiales-dia {
        min-height: 58px;
        padding: 6px;
      }

      .dia-especial-form-grid {
        grid-template-columns: 1fr;
      }

      .dia-especial-item {
        flex-direction: column;
      }

      .dia-especial-item-acciones {
        width: 100%;
      }

      .dia-especial-item-acciones button {
        flex: 1;
      }

      .info-plancha-stats {
        grid-template-columns: 1fr;
      }

      .info-plancha-details {
        grid-template-columns: 1fr;
      }

      .dia-header {
        align-items: center;
        gap: 8px;
      }

      .dia-titulo {
        min-width: 0;
        margin-bottom: 0;
      }

      .dia-titulo strong {
        font-size: 14px;
        line-height: 1.2;
      }

      .editar-dia-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
      }

    }

    .app-shell {
      display: grid;
      grid-template-columns: 280px minmax(0, 1fr);
      min-height: 100vh;
      background: #f2f4f8;
      transition: grid-template-columns 180ms ease;
    }

    .app-shell.sidebar-collapsed {
      grid-template-columns: 92px minmax(0, 1fr);
    }

    .sidebar {
      background: linear-gradient(180deg, #15335b 0%, #0f2744 100%);
      color: #e2e8f0;
      padding: 16px 14px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      gap: 12px;
      position: sticky;
      top: 0;
      height: 100vh;
      overflow: hidden;
      transition: padding 180ms ease;
    }

    .sidebar-nav-scroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .sidebar-nav-scroll::-webkit-scrollbar {
      width: 4px;
    }

    .sidebar-nav-scroll::-webkit-scrollbar-thumb {
      background: rgba(255,255,255,0.15);
      border-radius: 4px;
    }

    .sidebar-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 6px 8px;
      border-bottom: 1px solid rgba(226, 232, 240, 0.14);
      position: relative;
    }

    .sidebar-brand-copy {
      min-width: 0;
      flex: 1;
    }

    .sidebar-brand-mark {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.12);
      color: #f8fafc;
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .sidebar-brand strong {
      display: block;
      color: #f8fafc;
      margin-bottom: 2px;
      font-size: 14px;
      line-height: 1.15;
    }

    .sidebar-brand-subtitle {
      font-size: 11px;
      color: #93c5fd;
      line-height: 1.2;
    }

    .sidebar-toggle {
      width: 14px;
      height: 14px;
      border-radius: 5px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background: rgba(255, 255, 255, 0.08);
      color: #f8fafc;
      font-size: 9px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      position: absolute;
      top: -2px;
      right: 8px;
      padding: 0;
      line-height: 1;
    }

    .sidebar-toggle:hover {
      background: rgba(255, 255, 255, 0.14);
    }

    .sidebar-section {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .sidebar-section-title,
    .sidebar-group summary {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #93c5fd;
      margin-bottom: 2px;
      list-style: none;
    }

    .sidebar-group summary {
      cursor: pointer;
      margin-bottom: 2px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .sidebar-group summary::-webkit-details-marker {
      display: none;
    }

    .sidebar-submenu {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .page {
      max-width: none;
      margin: 0;
      padding: 28px;
      min-width: 0;
    }

    .topbar {
      flex-direction: row;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 24px;
    }

    .topbar h1 {
      font-size: 34px;
      line-height: 1.05;
      margin-bottom: 8px;
    }

    #page-subtitle {
      margin: 0;
      color: #64748b;
      font-size: 15px;
    }

    .tabs {
      display: none;
    }

    .nav-button.tab-button {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 10px;
      justify-content: flex-start;
      text-align: left;
      border-radius: 8px;
      padding: 5px 10px;
      background: transparent;
      color: #cbd5e1;
      border: 1px solid transparent;
      font-weight: 600;
      min-height: 30px;
      font-size: 13px;
    }

    .nav-button.tab-button:hover {
      background: rgba(255, 255, 255, 0.08);
      color: #f8fafc;
    }

    .nav-button.tab-button.active {
      background: #f8fafc;
      color: #0f2744;
      border-color: #e2e8f0;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
    }

    .nav-button-icon {
      width: 16px;
      min-width: 16px;
      text-align: center;
      font-size: 16px;
      line-height: 1;
    }

    .nav-button-label,
    .sidebar-group-label {
      white-space: nowrap;
    }

    .sidebar-group-icon {
      width: 20px;
      text-align: center;
      font-size: 20px;
      line-height: 1;
    }

    .app-shell.sidebar-collapsed .sidebar {
      padding-left: 12px;
      padding-right: 12px;
    }

    .app-shell.sidebar-collapsed .sidebar-brand {
      gap: 0;
      justify-content: center;
    }

    .app-shell.sidebar-collapsed .sidebar-brand-copy,
    .app-shell.sidebar-collapsed .sidebar-section-title,
    .app-shell.sidebar-collapsed .nav-button-label,
    .app-shell.sidebar-collapsed .sidebar-group-label {
      display: none;
    }

    .app-shell.sidebar-collapsed .sidebar-group summary {
      justify-content: center;
    }

    .app-shell.sidebar-collapsed .sidebar-submenu {
      align-items: center;
    }

    .app-shell.sidebar-collapsed .nav-button.tab-button {
      justify-content: center;
      padding-left: 10px;
      padding-right: 10px;
      gap: 0;
    }

    .app-shell.sidebar-collapsed .sidebar-toggle {
      right: 2px;
      top: -2px;
    }

    .app-shell.sidebar-collapsed .sidebar-user {
      justify-content: center;
    }

    .app-shell.sidebar-collapsed .sidebar-user-copy,
    .app-shell.sidebar-collapsed .sidebar-user-logout {
      display: none;
    }

    .app-shell.sidebar-collapsed .sidebar-user-avatar {
      display: flex;
    }

    .agenda-panel {
      background: transparent;
      border-radius: 0;
      box-shadow: none;
      padding: 0;
    }

    .proyectos-panel {
      background: transparent;
      border-radius: 0;
      box-shadow: none;
      padding: 0;
    }

    .agenda-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
    }

    .agenda-scope-tabs {
      display: inline-flex;
      gap: 4px;
      padding: 4px;
      border-radius: 14px;
      background: #edf2f7;
      border: 1px solid #d9e2ec;
    }

    .agenda-scope-button {
      border: 0;
      background: transparent;
      color: #5b6777;
      padding: 7px 12px;
      border-radius: 10px;
      font-weight: 600;
      font-size: 13px;
      cursor: pointer;
    }

    .agenda-scope-button.active {
      background: #ffffff;
      color: #102a43;
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .agenda-scope-button:hover {
      color: #243b53;
      background: rgba(255, 255, 255, 0.55);
    }

    .agenda-quick-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .agenda-quick-action {
      border: 1px solid #d9e2ec;
      background: #ffffff;
      color: #334e68;
      border-radius: 10px;
      padding: 7px 10px;
      font-size: 13px;
      font-weight: 600;
      line-height: 1;
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    }

    .agenda-quick-action:hover {
      background: #f8fafc;
      border-color: #bcccdc;
      color: #102a43;
    }

    .agenda-stack {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    @media (max-width: 900px) {
      .agenda-toolbar {
        align-items: flex-start;
        flex-direction: column;
      }

      .agenda-quick-actions {
        justify-content: flex-start;
      }
    }

    .agenda-block {
      border: 1px solid #dbe3ee;
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
      overflow: hidden;
    }

    .agenda-block-head {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: center;
      padding: 16px 18px 12px;
      border-bottom: 1px solid #edf2f7;
    }

    .agenda-block-head h3 {
      margin: 0;
      font-size: 18px;
    }

    .agenda-block-meta {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      color: #64748b;
      font-size: 13px;
      margin-top: 4px;
    }

    .agenda-block-body {
      padding: 8px 10px 12px;
    }

    .agenda-group {
      margin-top: 8px;
    }

    .agenda-group:first-child {
      margin-top: 0;
    }

    .agenda-group-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 6px 8px;
      color: #475569;
      font-size: 13px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .agenda-toggle {
      border: 0;
      background: transparent;
      color: #2563eb;
      font-weight: 700;
      cursor: pointer;
      padding: 0;
    }

    .agenda-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .agenda-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 10px 12px;
      border-radius: 12px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
    }

    .agenda-item-main {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex: 1;
    }

    .agenda-kind {
      flex-shrink: 0;
      border-radius: 999px;
      padding: 5px 8px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .agenda-kind.tarea { background: #e2e8f0; color: #334155; }
    .agenda-kind.plancha { background: #dbeafe; color: #1d4ed8; }
    .agenda-kind.taller { background: #dcfce7; color: #166534; }

    .agenda-item-text {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .agenda-item-title {
      font-weight: 700;
      color: #0f172a;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .agenda-item-meta {
      color: #64748b;
      font-size: 13px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .agenda-item-actions {
      display: flex;
      gap: 8px;
      flex-shrink: 0;
    }

    .agenda-block-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 16px 18px 10px;
      border-bottom: 1px solid #edf2f7;
    }

    .agenda-block-header h3 {
      margin: 0;
      font-size: 15px;
      display: flex;
      align-items: baseline;
      gap: 10px;
      flex-wrap: wrap;
    }

    .agenda-block-date {
      color: #64748b;
      font-size: 13px;
      font-weight: 600;
    }

    .agenda-subsection {
      padding: 8px 10px 12px;
    }

    .agenda-subsection + .agenda-subsection {
      padding-top: 0;
    }

    .agenda-subsection-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 2px 6px 5px;
      color: #475569;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .agenda-inline-count {
      font-size: 10px;
      font-weight: 600;
      color: #94a3b8;
    }

    .agenda-subsection-tools {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .agenda-collapse-toggle {
      border: 0;
      background: transparent;
      color: #2563eb;
      font-weight: 700;
      cursor: pointer;
      padding: 0;
    }

    .agenda-subsection-body {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .agenda-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 5px 9px;
      border-radius: 10px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
    }

    .agenda-row-taller {
      cursor: pointer;
    }
    .agenda-row-taller:hover {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    /* Modal info taller */
    .taller-info-meta {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 14px;
    }
    .taller-info-fila {
      display: flex;
      align-items: baseline;
      gap: 8px;
      font-size: 0.875rem;
    }
    .taller-info-label {
      color: #64748b;
      font-size: 0.72rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      min-width: 64px;
      flex-shrink: 0;
    }
    .taller-info-seccion {
      margin-top: 12px;
    }
    .taller-info-seccion > .taller-info-label {
      display: block;
      margin-bottom: 4px;
    }
    .taller-info-texto {
      font-size: 0.875rem;
      color: #1f2933;
      white-space: pre-wrap;
    }
    .taller-info-notas {
      font-size: 0.875rem;
    }

    .agenda-row-tarea {
      display: grid;
      grid-template-columns: 11px minmax(0, 1fr) auto;
      align-items: center;
      column-gap: 10px;
      width: 100%;
      padding-left: 2px;
      padding-right: 2px;
      border: 0;
      border-radius: 0;
      background: transparent;
      border-bottom: 1px solid #e2e8f0;
    }

    .agenda-row-tarea:last-child {
      border-bottom: 0;
    }

    .agenda-row-tarea.agenda-row-tarea-expandida {
      align-items: start;
    }

    .agenda-row-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 0;
      flex: 1;
    }

    .agenda-row-title {
      display: inline-flex;
      align-items: center;
      font-weight: 700;
      color: #0f172a;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.05;
      font-size: 14px;
    }

    .agenda-task-title-line {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      min-height: 14px;
    }

    .agenda-task-continuacion {
      display: inline-flex;
      align-items: center;
      flex-shrink: 0;
      color: #94a3b8;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.01em;
    }

    .agenda-task-responsable {
      display: inline-flex;
      align-items: center;
      flex-shrink: 0;
      background: #f1f5f9;
      color: #64748b;
      font-size: 10px;
      font-weight: 500;
      padding: 1px 6px;
      border-radius: 99px;
    }

    .agenda-plancha-line {
      display: flex;
      align-items: baseline;
      gap: 6px;
      min-width: 0;
    }

    .agenda-plancha-proyecto {
      color: #64748b;
      font-size: 12px;
      font-style: italic;
      font-weight: 400;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .agenda-taller-title-line {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }

    .agenda-taller-estado {
      color: #94a3b8;
      font-size: 11px;
      font-weight: 500;
      white-space: nowrap;
    }

    .agenda-row-subtitle {
      color: #64748b;
      font-size: 10px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.05;
    }

    .agenda-row-actions {
      display: flex;
      gap: 6px;
      flex-shrink: 0;
    }

    .agenda-row-actions-compact {
      gap: 4px;
      flex-wrap: wrap;
      align-items: center;
    }

    .agenda-row-completada .agenda-row-title {
      color: #64748b;
      text-decoration: line-through;
      text-decoration-thickness: 1.5px;
    }

    .agenda-row-actions button {
      min-width: 0;
    }

    .agenda-task-date {
      display: inline-flex;
      align-items: center;
      flex-shrink: 0;
      color: #64748b;
      font-size: 10px;
      font-weight: 700;
      text-transform: lowercase;
    }

    .agenda-task-backlog-chip {
      color: #7c2d12;
      background: #ffedd5;
      border-radius: 999px;
      padding: 2px 6px;
      font-size: 10px;
      line-height: 1;
      text-transform: lowercase;
    }

    .agenda-task-type-chip {
        display: inline-flex;
        align-items: center;
        border-radius: 999px;
        padding: 2px 7px;
      font-size: 10px;
      font-weight: 700;
      line-height: 1;
      white-space: nowrap;
      background: #e2e8f0;
      color: #334155;
    }

    .agenda-task-type-chip-envio_papeleras {
      background: #dbeafe;
      color: #1d4ed8;
    }

    .agenda-task-type-chip-recogida_papeleras {
      background: #dcfce7;
      color: #15803d;
    }

    .agenda-task-type-chip-fabricacion_mobiliario {
      background: #ede9fe;
      color: #6d28d9;
    }

    .agenda-task-type-chip-envio_producto {
      background: #fee2e2;
        color: #b91c1c;
      }

    .tareas-lista-stack {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .tareas-filtros-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
        flex-wrap: wrap;
      }

    .tareas-filtros-bar .proyectos-multifiltro {
        min-width: 220px;
      }

      .proyecto-tareas-filtros-bar {
        margin-bottom: 14px;
      }

      .tareas-filtro-select {
        min-width: 180px;
        max-width: 240px;
        border: 1px solid #d7e0ea;
        border-radius: 10px;
      background: #fff;
      color: #102a43;
      padding: 8px 10px;
      font-size: 13px;
      font-weight: 600;
    }

    .tareas-lista-bloque {
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      background: #fff;
      padding: 12px 14px;
    }

    .tareas-lista-bloque-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }

    .tareas-lista-bloque-titulo {
      color: #102a43;
      font-size: 14px;
      font-weight: 800;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .tareas-lista-bloque-count {
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
    }

    .tareas-lista-toggle {
      border: 0;
      background: transparent;
      color: #2563eb;
      font-size: 12px;
      font-weight: 700;
      padding: 0;
    }

    .tareas-lista-bloque-body {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .agenda-task-toggle {
      width: 11px;
      height: 11px;
      min-width: 11px;
      grid-column: 1;
      border-radius: 999px;
      border: 1.5px solid #94a3b8;
      background: #ffffff;
      color: #ffffff;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      line-height: 1;
      flex-shrink: 0;
      align-self: center;
    }

    .agenda-task-toggle.completada {
      background: #16a34a;
      border-color: #16a34a;
      color: #ffffff;
    }

    .agenda-row-tarea.agenda-row-tarea-expandida .agenda-task-toggle {
      align-self: start;
      margin-top: 1.8px;
    }

    .agenda-row-tarea .agenda-row-main {
      grid-column: 2;
      justify-content: center;
    }

    .agenda-project-chip {
      display: inline-flex;
      align-items: center;
      max-width: 180px;
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid #cbd5e1;
      background: #eef2ff;
      color: #334155;
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex-shrink: 0;
    }

    .agenda-project-chip:hover {
      background: #e0e7ff;
      border-color: #a5b4fc;
    }

    .agenda-row-actions-tarea {
      grid-column: 3;
      align-self: center;
      justify-content: flex-end;
      align-items: center;
      margin-left: auto;
    }

    .agenda-row-tarea.agenda-row-tarea-expandida .agenda-row-actions-tarea {
      align-self: start;
    }

    .agenda-task-calendar-btn {
      width: 18px;
      height: 18px;
      min-width: 18px;
      border-radius: 6px;
      font-size: 10px;
      color: #475569;
      background: #ffffff;
      border: 1px solid #cbd5e1;
      flex-shrink: 0;
    }

    .agenda-task-calendar-btn:hover {
      background: #f8fafc;
      border-color: #94a3b8;
    }

    .agenda-task-edit-btn {
      width: 18px;
      height: 18px;
      min-width: 18px;
      border-radius: 6px;
      font-size: 10px;
      flex-shrink: 0;
    }

    .agenda-task-delete-btn {
      width: 18px;
      height: 18px;
      min-width: 18px;
      border-radius: 6px;
      font-size: 10px;
      flex-shrink: 0;
      color: #b91c1c;
      background: #fef2f2;
      border-color: #fecaca;
    }

    .agenda-task-delete-btn:hover {
      background: #fee2e2;
      border-color: #fca5a5;
      color: #991b1b;
    }

    .agenda-task-notes-btn {
      width: 18px;
      height: 18px;
      min-width: 18px;
      border-radius: 6px;
      font-size: 10px;
      flex-shrink: 0;
      background: #e2e8f0;
      border-color: #cbd5e1;
      color: #475569;
    }

    .agenda-task-notes-btn.has-notes {
      background: #1d4ed8;
      border-color: #1d4ed8;
      color: #ffffff;
    }

    .agenda-task-notes-btn.active {
      background: #f8fafc;
      border-color: #dbeafe;
      color: #64748b;
    }

    .agenda-task-inline-calendar {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 4px;
    }

    .agenda-task-inline-calendar input[type="date"] {
      width: 132px;
      min-width: 132px;
      padding: 2px 6px;
      font-size: 11px;
      border-radius: 7px;
    }

    .agenda-inline-cancel {
      width: 18px;
      height: 18px;
      min-width: 18px;
      border-radius: 999px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      line-height: 1;
      background: #fff1f2;
      color: #be123c;
      border: 1px solid #fecdd3;
    }

    .agenda-task-inline-notes {
      display: flex;
      flex-direction: column;
      margin-top: 6px;
      max-width: 360px;
      gap: 4px;
    }

    .agenda-task-notes-toolbar {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
    }

    .agenda-task-notes-toolbar button {
      width: 20px;
      height: 20px;
      min-width: 20px;
      padding: 0;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: 0;
      box-shadow: none;
      color: #475569;
      font-size: 10px;
      line-height: 1;
    }

    .agenda-task-notes-toolbar button:hover {
      background: #eff6ff;
    }

    .agenda-rich-editor {
      border-radius: 8px;
      border: 1px solid #dbe3ee;
      background: #f8fafc;
      overflow: hidden;
    }

    .agenda-rich-editor .agenda-task-notes-toolbar {
      display: none !important;
      padding: 4px 6px;
      border-bottom: 1px solid #e2e8f0;
      background: rgba(255, 255, 255, 0.55);
    }

    .agenda-rich-editor:focus-within .agenda-task-notes-toolbar {
      display: inline-flex !important;
    }

    .agenda-task-notes-inline {
      min-height: 24px;
      padding: 6px 8px;
      border-radius: 0;
      border: 0;
      background: transparent;
      color: #475569;
      font-family: inherit;
      font-size: 13px;
      font-weight: 400;
      line-height: 1.35;
      white-space: pre-wrap;
      cursor: text;
      transition: background 120ms ease, border-color 120ms ease;
    }

    .agenda-task-notes-inline:hover,
    .agenda-task-notes-inline:focus {
      background: rgba(241, 245, 249, 0.75);
      outline: none;
    }

    .agenda-icon-btn {
      width: 24px;
      height: 24px;
      border-radius: 8px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      line-height: 1;
    }

    .agenda-row-actions-compact .secundario,
    .agenda-row-actions-compact .editar-modelo-btn {
      width: 20px;
      height: 20px;
      min-width: 20px;
      padding: 0;
      border-radius: 7px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      line-height: 1;
    }

    .agenda-chip-compact {
      min-height: 20px;
      padding: 0 7px;
      font-size: 10px;
      line-height: 1;
    }

    .agenda-taller-edit-btn {
      width: 22px;
      height: 22px;
      min-width: 22px;
      border-radius: 7px;
      font-size: 12px;
    }

    .agenda-plancha-check-btn,
    .agenda-plancha-edit-btn {
      width: 22px;
      height: 22px;
      border-radius: 7px;
      font-size: 12px;
    }

    .agenda-plancha-check-btn {
      background: #e0efff;
      color: #1d4ed8;
      border: 1px solid #bfdbfe;
    }

    .agenda-plancha-check-btn:hover {
      background: #dbeafe;
    }

    .agenda-item-actions button {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .agenda-empty {
      padding: 8px 12px 12px;
      color: #64748b;
      font-size: 14px;
    }

    .agenda-block.overdue {
      border-color: #fecaca;
      background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
    }

    .list-simple {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    @media (max-width: 980px) {
      .app-shell {
        grid-template-columns: 1fr;
      }

      .app-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
      }

      .sidebar {
        position: static;
        height: auto;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
      }

      .app-shell.sidebar-collapsed .sidebar-brand-copy,
      .app-shell.sidebar-collapsed .sidebar-section-title,
      .app-shell.sidebar-collapsed .nav-button-label,
      .app-shell.sidebar-collapsed .sidebar-group-label {
        display: initial;
      }

      .app-shell.sidebar-collapsed .sidebar-user {
        justify-content: space-between;
      }

      .app-shell.sidebar-collapsed .sidebar-user-copy,
      .app-shell.sidebar-collapsed .sidebar-user-logout {
        display: flex;
      }

      .app-shell.sidebar-collapsed .sidebar-user-avatar {
        display: none;
      }

      .app-shell.sidebar-collapsed .nav-button.tab-button {
        justify-content: flex-start;
        gap: 12px;
      }

      .app-shell.sidebar-collapsed .sidebar-group summary {
        justify-content: flex-start;
      }

      .app-shell.sidebar-collapsed .sidebar-toggle {
        position: absolute;
      }

      .page {
        padding: 20px;
      }
    }

/* ===== TIPTAP FALLBACK TEXTAREA ===== */
.rich-editor-fallback-textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--borde, #d1d5db);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  background: var(--fondo-input, #fff);
  color: var(--texto, #111827);
  box-sizing: border-box;
}

.rich-editor-fallback-textarea:focus {
  outline: none;
  border-color: var(--primario, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  pointer-events: all;
  animation: toast-in 0.22s ease;
  word-break: break-word;
}

.toast.toast-saliendo {
  animation: toast-out 0.22s ease forwards;
}

.toast-icono {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 1px;
}

.toast-mensaje {
  flex: 1;
}

.toast-cerrar {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
  padding: 0;
  margin-top: 1px;
  color: inherit;
}

.toast-cerrar:hover {
  opacity: 1;
}

.toast-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.toast-exito {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.toast-aviso {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.toast-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.97); }
}

/* ===== TABLET VIEW (641px – 1024px) ===== */
@media (min-width: 641px) and (max-width: 1024px) {

  /* Sidebar més estret */
  .app-shell {
    grid-template-columns: 168px minmax(0, 1fr);
  }

  /* Cap: amagar text "Plàstic Preciós" i subtítol, deixar només PP */
  .sidebar-brand-copy {
    display: none;
  }
  .sidebar-toggle {
    margin-left: auto;
  }

  /* Peu: amagar email/rol, deixar avatar + botó sortir */
  .sidebar-user-copy {
    display: none;
  }
  .sidebar-user {
    justify-content: space-between;
    gap: 8px;
  }
  /* Botó sortir — icona ⏻ sense text */
  .sidebar-user-logout {
    font-size: 0;
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .sidebar-user-logout::before {
    content: "⏻";
    font-size: 16px;
  }

  /* Sidebar — nav items còmodes per al dit */
  .sidebar-nav-link {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  .sidebar-nav-icon {
    width: 20px;
    height: 20px;
  }

  /* Tabs principals */
  .tab-button {
    padding: 14px 16px;
    font-size: 0.9rem;
  }

  /* Botons generals — touch target mínim */
  button:not(.mobile-nav-btn):not(.mobile-fab):not(.agenda-project-chip):not(.taller-global-estado):not(.presupuestos-status-chip):not(.agenda-chip-compact) {
    min-height: 40px;
  }

  /* Chips de projecte i estat — mateixa alçada que l'equip (24px natural) */
  .agenda-project-chip,
  .taller-global-estado,
  .agenda-chip-compact {
    min-height: 24px !important;
    padding: 2px 8px;
  }

  /* Inputs, selects — evita zoom iPadOS i facilita el toc */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
    padding: 10px 12px;
    min-height: 44px;
  }
  textarea {
    min-height: auto;
  }

  /* Calendari planchas — cel·les i botons d'acció (ús principal de Miguel) */
  .slot-linea {
    min-height: 52px;
    padding: 10px 12px;
  }
  .agenda-icon-btn {
    width: 40px;
    height: 40px;
    min-height: unset;
  }

  .editar-plancha-btn,
  .reprogramar-plancha-btn,
  .marcar-hecha-btn,
  .congelar-plancha-btn,
  .info-plancha-btn,
  .eliminar-plancha-btn,
  .editar-dia-btn {
    width: 40px;
    height: 40px;
    min-height: unset;
    min-width: unset;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  /* Boles marcar fet/no fet — 20×20px */
  .agenda-task-toggle,
  .agenda-plancha-check-btn {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: unset !important;
    font-size: 13px;
  }

  /* Separació bola–text a les files de tarea */
  .agenda-row-tarea {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    column-gap: 14px;
    padding-left: 18px;
    box-sizing: border-box;
  }

  /* Materiales — mantenir 3 columnes fins a 1024px */
  .materiales-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Talleres tab — botó editar quadrat i alineació centrada */
  .taller-resumen-acciones .icono-cuadrado-btn,
  .taller-resumen-acciones .editar-modelo-btn,
  .taller-resumen-acciones .dia-especial-eliminar {
    width: 40px !important;
    height: 40px !important;
    min-height: unset !important;
  }

  .taller-resumen-linea,
  .taller-resumen-aside {
    align-items: center;
  }

  /* Employee — amagar chips, botó copiar i controls de pasados/filtres a talleres */
  body[data-rol="employee"] .taller-global-equipo,
  body[data-rol="employee"] .taller-global-flag,
  body[data-rol="employee"] .taller-global-estado,
  body[data-rol="employee"] .agenda-project-chip,
  body[data-rol="employee"] .taller-detalle-copy-btn,
  body[data-rol="employee"] #talleres-pasados-toggle,
  body[data-rol="employee"] #talleres-filtros-toggle {
    display: none !important;
  }
}

/* ===== MOBILE VIEW (≤640px) ===== */
#mobile-view { display: none; }

@media (max-width: 640px) {
  .app-shell { display: none !important; }
  #fab-principal, #fab-menu { display: none !important; }
  #toast-container { bottom: 70px; }
  #mobile-view {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: #f3f4f6;
  }
}

.mobile-header {
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 80px;
}

.mobile-panel.active { display: block; }

.mobile-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  user-select: none;
}

.mobile-item:active { background: #f9fafb; }

.mobile-item-check {
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #d1d5db;
}

.mobile-item-body {
  flex: 1;
  min-width: 0;
}

.mobile-item-titulo {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-item-sub {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
}

.mobile-item-fecha {
  font-size: 0.75rem;
  color: #6b7280;
  flex-shrink: 0;
}

.mobile-item-fecha.hoy {
  color: #2563eb;
  font-weight: 600;
}

.mobile-empty {
  text-align: center;
  color: #9ca3af;
  padding: 48px 0;
  font-size: 0.9rem;
}

.mobile-fab {
  display: none;
  position: fixed;
  bottom: 72px;
  right: 20px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  font-size: 1.7rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

@media (max-width: 640px) {
  .mobile-fab { display: flex; }
}

.mobile-tareas-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 4px;
  flex-wrap: wrap;
}

.mobile-scope-pills {
  display: flex;
  gap: 6px;
  flex: 1;
}

.mobile-scope-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  background: white;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
}

.mobile-scope-pill.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.mobile-backlog-toggle {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  background: white;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}

.mobile-backlog-toggle.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.mobile-item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.mobile-chip {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

.mobile-item-backlog {
  border-left: 3px solid #f59e0b;
}

.mobile-bottom-nav {
  display: flex;
  height: 60px;
  background: white;
  border-top: 1px solid #e5e7eb;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.68rem;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-nav-btn.active {
  color: #3b82f6;
  font-weight: 600;
}

.mobile-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}
