 :root {
     --red: #C8102E;
     --navy: #1A2540;
     --gray-light: #F4F5F7;
     --gray-mid: #D8DCE6;
     --gray-text: #5A6070;
     --white: #FFFFFF;
     --border: #C2C8D8;
     --focus: #2563EB;
     --black: #000000;
 }

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

 body {
     font-family: 'IBM Plex Sans', sans-serif;
     background: #EAECF2;
     color: var(--navy);
     min-height: 100vh;
     padding: 40px 20px;
     font-size: 14px;
 }

 .page {
     max-width: 820px;
     margin: 0 auto;
     background: var(--white);
     box-shadow: 0 4px 32px rgba(26, 37, 64, 0.13);
     border-radius: 2px;
     overflow: hidden;
 }

 /* ── HEADER ── */
 .header {
     display: grid;
     grid-template-columns: 1fr auto;
     border: 1px solid var(--black);
     margin-bottom: 20px
 }

 .header-left {
     display: grid;
     grid-template-rows: auto auto;
     border-right: 1px solid var(--navy);
 }

 .logo-cell {
     padding: 18px 24px;
     border-bottom: 1px solid var(--navy);
     display: flex;
     align-items: center;
 }

 .logo-svg {
     height: 44px;
     width: auto;
 }

 .ref-row {
     display: grid;
     grid-template-columns: 110px 1fr;
 }

 .ref-col {
     display: flex;
     flex-direction: column;
     border-right: 1px solid var(--black);
 }

 .ref-box {
     padding: 8px 12px;
     font-size: 11px;
     /* color: var(--gray-text); */
     line-height: 1.5;
     flex: 1;
     border-top: 1px solid var(--black);
 }

 /* .ref-box:first-child {
            border-bottom: 1px solid var(--navy);
        } */

 .title-box {
     padding: 8px 16px;
     display: flex;
     align-items: center;
     border-top: 1px solid var(--black);
     justify-content: center;
 }

 .title-box h1 {
     font-family: "GFS Didot", serif;
     font-size: 15px;
     font-weight: 700;
     color: var(--navy);
     text-align: center;
     text-transform: uppercase;
     letter-spacing: 0.03em;
     line-height: 1.3;
 }

 .header-right {
     min-width: 200px;
     display: grid;
     grid-template-rows: 1fr 1fr;
 }

 .meta-cell {
     padding: 10px 16px;
     display: flex;
     flex-direction: column;
     justify-content: center;
 }

 .meta-cell:first-child {
     border-bottom: 1px solid var(--navy);
 }

 .meta-label {
     font-size: 10px;
     text-transform: uppercase;
     letter-spacing: 0.08em;
     color: var(--gray-text);
     margin-bottom: 2px;
 }

 .meta-value {
     font-size: 13px;
     font-weight: 600;
     color: var(--navy);
 }

 /* ── BODY ── */
 .form-body {
     padding: 0;
 }

 .section-title {
     background: var(--gray-light);
     color: var(--black);
     font-family: "GFS Didot", serif;
     font-size: 13px;
     font-weight: 700;
     padding: 9px 20px;
     letter-spacing: 0.04em;
     text-transform: uppercase;
     border-right: 1px solid var(--black);
     border-bottom: 1px solid var(--black);
     border-left: 1px solid var(--black);
 }

 .section-title:first-of-type {
     border-top: 1px solid var(--black);
 }

 .datos-grid {
     display: flex;
     flex-direction: column;
     border-right: 1px solid var(--black);
     border-bottom: 1px solid var(--black);
     border-left: 1px solid var(--black);
 }

 .field-row {
     display: grid;
     grid-template-columns: 1fr 1fr;
     border-bottom: 1px solid var(--border);
     min-height: 44px;
 }

 .field-row:last-child {
     border-bottom: none;
 }

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

 .field-label {
     background: var(--white);
     padding: 10px 14px;
     font-size: 12px;
     font-weight: 600;
     color: var(--navy);
     min-width: 210px;
     /* max-width: 210px; */
     display: flex;
     /* align-items: center; */
     border-right: 1px solid var(--border);
     line-height: 1.3;
 }

 .label-with-note {
     display: flex;
     flex-direction: column;
 }

 .field-label-text {
     align-items: center;
 }

 .field-note {
     font-size: 10px;
     font-weight: 400;
     color: var(--gray-text);
     display: block;
     margin-top: 2px;
     font-style: italic;
 }

 .field-input {
     flex: 1;
     padding: 8px 12px;
     display: flex;
     align-items: center;
 }

 .field-input input,
 .field-input textarea,
 .field-input select {
     width: 100%;
     border: 1px solid transparent;
     border-radius: 3px;
     font-family: 'IBM Plex Sans', sans-serif;
     font-size: 13px;
     color: var(--navy);
     background: transparent;
     padding: 4px 6px;
     transition: border-color 0.15s, background 0.15s;
     resize: none;
 }

 .field-input input:focus,
 .field-input textarea:focus,
 .field-input select:focus {
     outline: none;
     border-color: var(--focus);
     background: #EFF4FF;
 }

 .field-input input::placeholder,
 .field-input textarea::placeholder {
     color: #B0B8CC;
 }

 /* Separador entre columnas */
 .datos-grid .field-row:nth-child(odd):not(.full) {
     border-right: 1px solid var(--border);
 }

 /* ── SECCIÓN HECHOS ── */
 .sub-section {
     border-right: 1px solid var(--black);
     border-bottom: 1px solid var(--black);
     border-left: 1px solid var(--black);
 }


 .sub-title {
     padding: 8px 20px;
     font-size: 12.5px;
     font-weight: 700;
     color: var(--navy);
     letter-spacing: 0.02em;
 }

 .sub-title span {
     margin-right: 4px;
 }

 .sub-content {
     padding: 16px 20px;
 }

 .sub-desc {
     font-size: 12px;
     color: var(--gray-text);
     line-height: 1.6;
     margin-bottom: 12px;
 }

 /* Tipo de queja */
 .tipo-options {
     display: flex;
     gap: 24px;
     flex-wrap: wrap;
 }

 .tipo-option {
     display: flex;
     align-items: center;
     gap: 8px;
     cursor: pointer;
     font-size: 13px;
     font-weight: 500;
     color: var(--navy);
     padding: 6px 0;
 }

 .tipo-option input[type="radio"] {
     appearance: none;
     width: 18px;
     height: 18px;
     border: 2px solid var(--border);
     border-radius: 50%;
     cursor: pointer;
     transition: border-color 0.15s;
     flex-shrink: 0;
     position: relative;
 }

 .tipo-option input[type="radio"]:checked {
     border-color: var(--red);
     background: var(--red);
     box-shadow: inset 0 0 0 3px white;
 }

 .tipo-option input[type="radio"]:focus {
     outline: 2px solid var(--focus);
 }

 .tipo-otro-input {
     margin-top: 10px;
     display: flex;
     align-items: center;
     gap: 10px;
 }

 .tipo-otro-input label {
     font-size: 12px;
     color: var(--gray-text);
     white-space: nowrap;
 }

 .tipo-otro-input input {
     flex: 1;
     border: 1px solid var(--border);
     border-radius: 3px;
     padding: 5px 10px;
     font-size: 13px;
     font-family: 'IBM Plex Sans', sans-serif;
     color: var(--navy);
     transition: border-color 0.15s;
 }

 .tipo-otro-input input:focus {
     outline: none;
     border-color: var(--focus);
     background: #EFF4FF;
 }

 /* Textarea grande */
 .textarea-tall {
     width: 100%;
     border: 1px solid var(--border);
     border-radius: 4px;
     padding: 12px 14px;
     font-family: 'IBM Plex Sans', sans-serif;
     font-size: 13px;
     color: var(--navy);
     line-height: 1.6;
     min-height: 180px;
     resize: vertical;
     transition: border-color 0.15s, background 0.15s;
 }

 .textarea-tall:focus {
     outline: none;
     border-color: var(--focus);
     background: #EFF4FF;
 }

 .textarea-tall::placeholder {
     color: #B0B8CC;
 }

 .nota-pie {
     margin-top: 8px;
     font-size: 11px;
     color: var(--gray-text);
     font-style: italic;
     padding: 6px 10px;
     background: #F8F9FB;
     border-left: 3px solid var(--gray-mid);
     border-radius: 0 3px 3px 0;
 }

 /* ── BOTONES ── */
 .actions {
     padding: 20px 24px;
     display: flex;
     gap: 12px;
     justify-content: flex-end;
     border-top: 1px solid var(--border);
 }

 .btn {
     font-family: 'IBM Plex Sans', sans-serif;
     font-size: 13px;
     font-weight: 600;
     padding: 9px 22px;
     border-radius: 3px;
     cursor: pointer;
     letter-spacing: 0.03em;
     transition: all 0.15s;
     border: none;
 }

 .btn-primary {
     background: darkturquoise;
     color: black;
 }

 .btn-primary:hover {
     background: #243060;
     color: white;
 }

 .btn-outline {
     background: transparent;
     color: var(--navy);
     border: 1.5px solid var(--navy);
 }

 .btn-outline:hover {
     background: var(--navy);
     color: white;
 }

 .btn-danger {
     background: var(--red);
     color: white;
 }

 .btn-danger:hover {
     background: #a80d25;
 }


 @media (max-width: 600px) {
     .datos-grid {
         grid-template-columns: 1fr;
     }

     .datos-grid .field-row:nth-child(odd):not(.full) {
         border-right: none;
     }

     .header {
         grid-template-columns: 1fr;
     }

     .header-right {
         grid-template-rows: auto auto;
         grid-template-columns: 1fr 1fr;
     }

     .firma-box:first-child {
         border-right: none;
         border-bottom: 1px solid var(--border);
     }

     .ref-row {
         grid-template-columns: 100px 1fr;
     }

     .title-box h1 {
         font-size: 13px;
     }
 }

 .custom-file-upload {
     width: 100%;
 }

 .file-input {
     display: none;
 }

 .upload-label {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     background: darkturquoise;
     color: #000;
     padding: 10px 18px;
     border-radius: 4px;
     cursor: pointer;
     font-size: 13px;
     font-weight: 600;
     transition: all .2s ease;
     margin-bottom: 12px;
 }

 .upload-label:hover {
     background: #243060;
     color: #fff;
 }

 .upload-icon {
     font-size: 16px;
 }

 .file-name {
     font-size: 12px;
     color: #5A6070;
     padding: 10px 12px;
     border: 1px dashed #C2C8D8;
     border-radius: 4px;
     background: #F8F9FB;
     word-break: break-word;
 }

 .invalid-feedback {
     margin-top: 8px;
     color: #C8102E;
     font-size: 12px;
     font-weight: 500;
 }