*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: 'Segoe UI', Arial, sans-serif;
      background: #f4f4f4;
      color: #222;
      min-height: 100vh;
      padding: 20px;
    }

    .container {
      max-width: 1040px;
      margin: 0 auto;
      background: #fff;
      padding: 24px 28px 32px;
      border-radius: 4px;
      box-shadow: 0 1px 6px rgba(0,0,0,0.10);
      
    }

    h1 {
      font-size: 1.25rem;
      font-weight: 700;
      color: #111;
      margin-bottom: 2px;
    }
    .subtitle {
      font-size: 0.82rem;
      color: #555;
      margin-bottom: 20px;
    }

    /* ── Form grid ── */
    .form-row {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      margin-bottom: 16px;
    }
    .form-group {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .form-group label {
      color: var(--Negro-Text, #373737);
      font-family: Roboto;
      font-size: 16px !important;
      font-style: normal;
      font-weight: 700;
      line-height: 150%; /* 24px */

    }
    .form-group label .req { color: #c00; }
    .upload-group label .req { color: #c00; }
    .form-group input[type="text"] {
      border: 1px solid #bbb !important;
      border-radius: 3px;
      padding: 6px 10px;
      font-size: 0.85rem;
      height: 34px;
      outline: none;
      transition: border-color .2s;
      background-color: #fff !important;
    }
    .form-group input[type="text"]:focus { border-color: #1a5fa8; }

    .group-nombre { flex: 1 1 240px; }
    .group-estado { flex: 1 1 200px; }
    .group-archivo-kobotoolbox { flex: 1 1 200px; }
    .group-archivo-rut { flex: 1 1 200px; }
    .group-archivo-fas { flex: 1 1 200px; }

    /* ── File upload row ── */
    .upload-row {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: flex-end;
      margin-bottom: 14px;
    }
    .upload-group {
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1 1 160px;
    }
    .upload-group label {
      color: var(--Negro-Text, #373737);
      font-family: Roboto;
      font-size: 16px !important;
      font-style: normal;
      font-weight: 700;
      line-height: 150%;
    }
    .upload-input-wrap {
      display: flex;
      align-items: center;
      border: 1px solid #bbb;
      border-radius: 3px;
      overflow: hidden;
      height: 34px;
    }
    .upload-input-wrap input[type="file"] { display: none; }
    .upload-filename {
      flex: 1;
      padding: 0 8px;
      font-size: 0.78rem;
      color: #666;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }
    .btn-upload {
      background: #e0e0e0;
      border: none;
      border-left: 1px solid #bbb;
      padding: 0 12px;
      height: 34px;
      cursor: pointer;
      font-size: 0.78rem;
      display: flex;
      align-items: center;
      gap: 5px;
      white-space: nowrap;
      transition: background .2s;
    }
    .btn-upload:hover { background: #c9c9c9; }
    .btn-upload svg { width:13px; height:13px; fill:#444; }

    /* ── Action buttons row ── */
    .action-row {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-bottom: 10px;
    }
    .btn-primary, .btn-secondary {
      height: 34px;
      padding: 0 18px;
      border-radius: 3px;
      border: 1px solid;
      cursor: pointer;
      font-size: 0.84rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 7px;
      transition: background .2s, border-color .2s;
    }
    .btn-primary {
      background: #fff;
      border-color: #1a5fa8;
      color: #1a5fa8;
    }
    .btn-primary:hover { background: #eaf1fb; }
    .btn-secondary {
      background: #e0e0e0;
      border-color: #bbb;
      color: #888;
    }
    .btn-secondary:disabled {
      cursor: not-allowed;
      opacity: 0.6;
    }

    /* ── Spinner ── */
    .spinner {
      display: none;
      width: 16px;
      height: 16px;
      border: 2px solid #1a5fa8;
      border-top-color: transparent;
      border-radius: 50%;
      animation: spin .7s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── Download row ── */
    .download-row {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 18px;
    }
    .btn-download {
      background: #1a5fa8;
      color: #fff !important;
      border: none;
      border-radius: 3px;
      padding: 7px 16px;
      font-size: 0.80rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: background .2s;
    }
    .btn-download:hover { background: #154e8e; }
    .btn-download svg { width:14px; height:14px; fill:#fff; }

    /* ── Section label ── */
    .section-label {
      font-size: 0.8rem;
      color: #333;
      margin-bottom: 8px;
    }

    /* ── Accordion ── */
    .accordion { display: flex; flex-direction: column; gap: 10px; }

    .accordion-item {
      border: 1px solid #d0d0d0;
      border-radius: 3px;
      overflow: hidden;
    }

    .accordion-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 16px;
      background: #e8e8e8;
      cursor: pointer;
      user-select: none;
      gap: 10px;
      transition: background .15s;
    }
    .accordion-header:hover { background: #d8d8d8; }
    .accordion-header span {
      font-size: 0.85rem;
      font-weight: 500;
      color: #222;
    }
    .accordion-icon {
      font-size: 1.1rem;
      color: #444;
      transform: rotate(180deg);
      flex-shrink: 0;
    }
    .accordion-item.open .accordion-icon { transform: rotate(0deg); }

    .accordion-body {
      max-height: 0;
      overflow: hidden;
      transition: max-height .35s ease;
      background: #fff;
    }
    .accordion-item.open .accordion-body { max-height: 600px; }

    .accordion-inner { padding: 16px; }

    /* ── Table ── */
    .table-wrapper { overflow-x: auto; }

    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.8rem;
    }

    /* header top row: code + title */
    .data-table .row-code td:first-child {
      background: #1a3a6b;
      color: #fff;
      font-weight: 700;
      text-align: center;
      width: 80px;
      font-size: 0.95rem;
      padding: 8px 10px;
    }
    .data-table .row-code td:last-child {
      background: #1a5fa8;
      color: #fff;
      font-weight: 600;
      text-align: center;
      padding: 8px 10px;
      font-size: 0.8rem;
    }

    /* column headers */
    .data-table .row-head th {
      background: #1a5fa8;
      color: #fff;
      text-align: center;
      padding: 7px 10px;
      font-weight: 500;
    }

    /* data rows */
    .data-table tbody tr { border-bottom: 1px solid #e4e4e4; }
    .data-table tbody td {
      padding: 7px 10px;
      text-align: center;
      color: #333;
    }
    .data-table tbody tr:nth-child(even) { background: #f8f8f8; }

    .table-footnote {
      font-size: 0.75rem;
      color: #555;
      margin-top: 10px;
    }

    /* ── Responsive ── */
    @media (max-width: 540px) {
      .container { padding: 14px 10px 24px; }
      .upload-row { gap: 8px; }
      .download-row { flex-direction: column; align-items: stretch; }
      .btn-download { justify-content: center; }
      .action-row { justify-content: stretch; }
      .btn-primary, .btn-secondary { flex: 1; justify-content: center; }
    }








    

    @media (max-width: 520px) {
      .ac-actividades-grid {
        grid-template-columns: 1fr;
      }

      .link-actividad {
        font-size: 16px;
      }
    }
    /* Css del alert */
    .ac-toast-container {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 99999;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .ac-toast {
      min-width: 250px;
      max-width: 350px;
      padding: 12px 16px;
      border-radius: 8px;
      color: #fff;
      font-size: 14px;
      box-shadow: 0 6px 15px rgba(0,0,0,0.2);
      animation: fadeIn 0.3s ease;
    }

    /* tipos */
    .ac-toast.success { background: #2e7d32; }
    .ac-toast.error   { background: #d32f2f; }
    .ac-toast.warning { background: #ed6c02; }
    .ac-toast.info    { background: #1976d2; }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateX(20px); }
      to   { opacity: 1; transform: translateX(0); }
    }


    /* Css del spiner */
    .ac-spinner {
      width: 40px;
      height: 40px;
      border: 4px solid #ddd;
      border-top: 4px solid #1976d2;
      border-radius: 50%;
      margin: 0 auto;
      animation: spin 1s linear infinite;
    }

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