/* Wireframe Styles - Valores Documentales Module (Revisado) */
/* Single-column layout for Claude Code direct generation */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.5;
}

/* ==========================================
   WIREFRAME LABEL (fixed top bar)
   ========================================== */

.wireframe-label {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #333;
  color: #fff;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  z-index: 1000;
}

.wireframe-label + .wireframe-container {
  margin-top: 40px;
}

/* ==========================================
   SINGLE-COLUMN LAYOUT
   ========================================== */

.wireframe-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 16px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-info {
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.user-icon {
  width: 32px;
  height: 32px;
  background: #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.main-content {
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 24px;
  min-height: 500px;
}

/* ==========================================
   APP SHELL LAYOUT (header + sidebar + content) — legacy
   ========================================== */

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  height: 56px;
  background: #fff;
  border-bottom: 2px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
}

.app-header-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: #0066cc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.app-header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
}

.app-header-user .user-avatar {
  width: 32px;
  height: 32px;
  background: #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #666;
}

.app-body {
  display: grid;
  grid-template-columns: 260px 1fr;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 16px 0;
  overflow-y: auto;
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
}

.sidebar-group {
  margin-bottom: 4px;
}

.sidebar-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  padding: 12px 20px 4px;
}

.sidebar-item {
  display: block;
  padding: 8px 20px 8px 24px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover {
  background: #f5f5f5;
  color: #333;
}

.sidebar-item.active {
  background: #e8f0fe;
  color: #0066cc;
  border-left-color: #0066cc;
  font-weight: 500;
}

.sidebar-item .item-id {
  font-size: 11px;
  color: #999;
  margin-right: 6px;
}

.sidebar-item.active .item-id {
  color: #4d94db;
}

/* ==========================================
   CONTENT AREA
   ========================================== */

.content {
  padding: 24px;
  background: #f5f5f5;
  min-height: calc(100vh - 56px);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}

.breadcrumb a {
  color: #0066cc;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.page-subtitle {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}

/* Content Card (white box for each section) */
.content-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.content-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: #0066cc;
  color: #fff;
}

.btn-primary:hover {
  background: #0052a3;
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-success {
  background: #28a745;
  color: #fff;
}

.btn-success:hover {
  background: #218838;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

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

.btn-warning {
  background: #ffc107;
  color: #333;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* ==========================================
   FILTERS SECTION
   ========================================== */

.filters-section {
  background: #fafafa;
  border: 1px dashed #bbb;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
}

.filters-title {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.filter-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.filter-input,
.filter-select {
  height: 36px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
}

.filter-select {
  min-width: 160px;
}

/* ==========================================
   CARDS GRID
   ========================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-icon {
  width: 40px;
  height: 40px;
  background: #e8f0fe;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
  color: #0066cc;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.card-description {
  font-size: 13px;
  color: #666;
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.card-meta {
  font-size: 11px;
  color: #999;
  margin-top: 8px;
}

/* ==========================================
   KPI CARDS
   ========================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  padding: 20px;
  color: #fff;
}

.kpi-card:nth-child(2) {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.kpi-card:nth-child(3) {
  background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.kpi-card:nth-child(4) {
  background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
}

.kpi-card:nth-child(5) {
  background: linear-gradient(135deg, #5b86e5 0%, #36d1dc 100%);
}

.kpi-card:nth-child(6) {
  background: linear-gradient(135deg, #c94b4b 0%, #4b134f 100%);
}

.kpi-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
}

.kpi-sublabel {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 4px;
}

/* ==========================================
   DATA TABLE
   ========================================== */

.table-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f8f8f8;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
}

.data-table tr:hover {
  background: #f9f9f9;
}

.data-table .link {
  color: #0066cc;
  text-decoration: none;
}

.data-table .link:hover {
  text-decoration: underline;
}

.data-table .checkbox-cell {
  width: 40px;
  text-align: center;
}

.data-table .checkbox-cell input {
  width: 16px;
  height: 16px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-secondary {
  background: #e2e3e5;
  color: #383d41;
}

.badge-primary {
  background: #cce5ff;
  color: #004085;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #eee;
}

.pagination-info {
  font-size: 13px;
  color: #666;
}

.pagination-controls {
  display: flex;
  gap: 4px;
}

.pagination-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.pagination-btn.active {
  background: #0066cc;
  color: #fff;
  border-color: #0066cc;
}

/* ==========================================
   TABS
   ========================================== */

.tabs {
  display: flex;
  border-bottom: 2px solid #eee;
  margin-bottom: 20px;
}

.tab {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
  color: #333;
}

.tab.active {
  color: #0066cc;
  border-bottom-color: #0066cc;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: #dc3545;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 8px;
}

.tab-panel {
  display: none;
}

.tab-panel-hidden {
  display: none;
}

/* ==========================================
   FORM SECTIONS
   ========================================== */

.form-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

.form-label .required {
  color: #dc3545;
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.1);
}

.form-textarea {
  min-height: 110px;
  width: 100%;
  resize: vertical;
}

/* Default styling for ANY textarea (even without .form-textarea class)
   prevents the recurring issue of textareas rendering as tiny browser-default
   monospace boxes. Override locally only when truly justified.
   See auto-memory feedback_textarea_minimum_size_in_styles.md */
textarea {
  min-height: 110px;
  min-width: 280px;
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
}
textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.1);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-checkbox input {
  width: 18px;
  height: 18px;
}

.form-hint {
  font-size: 12px;
  color: #888;
}

.form-readonly {
  background: #f5f5f5;
  color: #666;
}

/* ==========================================
   ALERTS
   ========================================== */

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  align-items: flex-start;
  display: block;
  gap: 10px;
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.alert-content {
  flex: 1;
}

.alert-action {
  flex-shrink: 0;
}

.alert-info {
  background: #e7f3ff;
  border: 1px solid #b6d4fe;
  color: #084298;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffecb5;
  color: #664d03;
}

.alert-success {
  background: #d1e7dd;
  border: 1px solid #badbcc;
  color: #0f5132;
}

.alert-danger {
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  color: #842029;
}

/* ==========================================
   ACTIONS BAR
   ========================================== */

.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid #eee;
  margin-top: 24px;
}

.actions-left,
.actions-right {
  display: flex;
  gap: 8px;
}

/* ==========================================
   PROGRESS STEPS (Wizard Tracker)
   ========================================== */

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 10px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #ddd;
}

.step:last-child::after {
  display: none;
}

.step.completed::after {
  background: #28a745;
}

.step.active::after {
  background: #ddd;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.step.active .step-circle {
  background: #0066cc;
}

.step.completed .step-circle {
  background: #28a745;
}

.step-label {
  font-size: 11px;
  color: #666;
  margin-top: 8px;
  text-align: center;
  max-width: 100px;
}

.step.active .step-label {
  color: #0066cc;
  font-weight: 600;
}

/* Wizard Navigation */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid #eee;
  margin-top: 24px;
}

.wizard-nav-info {
  font-size: 13px;
  color: #666;
}

/* ==========================================
   CHART PLACEHOLDER
   ========================================== */

.chart-placeholder {
  background: #f8f8f8;
  border: 2px dashed #ccc;
  border-radius: 8px;
  height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 20px;
  gap: 8px;
}

.chart-placeholder .chart-icon {
  font-size: 36px;
  opacity: 0.5;
}

.chart-placeholder .chart-label {
  font-weight: 500;
}

.chart-placeholder .chart-type {
  font-size: 12px;
  opacity: 0.7;
}

/* ==========================================
   INFO BLOCK
   ========================================== */

.info-block {
  background: #f9f9f9;
  border-left: 4px solid #0066cc;
  padding: 16px;
  margin-bottom: 16px;
}

.info-block-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.info-block-content {
  font-size: 13px;
  color: #555;
}

/* ==========================================
   SPLIT LAYOUT
   ========================================== */

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
  background: #f8f8f8;
  border: 1px dashed #ccc;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 20px;
  font-size: 12px;
  color: #666;
}

/* ==========================================
   NEW COMPONENTS — TOGGLE SWITCH
   ========================================== */

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.toggle-track.on {
  background: #0066cc;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-track.on::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 13px;
  color: #555;
}

/* ==========================================
   NEW COMPONENTS — UPLOAD ZONE
   ========================================== */

.upload-zone {
  border: 2px dashed #bbb;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  background: #fafafa;
  margin-bottom: 16px;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover {
  border-color: #0066cc;
  background: #f0f7ff;
}

.upload-zone-icon {
  font-size: 36px;
  color: #aaa;
  margin-bottom: 8px;
}

.upload-zone-text {
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

.upload-zone-hint {
  font-size: 12px;
  color: #999;
}

/* ==========================================
   NEW COMPONENTS — PERMISSION MATRIX
   ========================================== */

.permission-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.permission-matrix th,
.permission-matrix td {
  padding: 10px 12px;
  border: 1px solid #ddd;
  text-align: center;
}

.permission-matrix th {
  background: #f0f0f0;
  font-weight: 600;
  font-size: 12px;
  color: #555;
}

.permission-matrix td:first-child {
  text-align: left;
  font-weight: 500;
  background: #fafafa;
  min-width: 200px;
}

.permission-matrix input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.permission-check {
  color: #28a745;
  font-weight: 700;
}

.permission-deny {
  color: #ccc;
}

/* ==========================================
   NEW COMPONENTS — BULK ACTION BAR
   ========================================== */

.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #e8f0fe;
  border: 1px solid #b6d4fe;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.bulk-action-bar .selection-count {
  font-size: 14px;
  font-weight: 500;
  color: #0066cc;
}

.bulk-action-bar .bulk-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================
   NEW COMPONENTS — TIMELINE
   ========================================== */

.timeline {
  position: relative;
  padding-left: 28px;
  margin-bottom: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #ddd;
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0066cc;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #0066cc;
}

.timeline-dot.completed {
  background: #28a745;
  box-shadow: 0 0 0 2px #28a745;
}

.timeline-dot.alert {
  padding: 0px;
  background: #dc3545;
  box-shadow: 0 0 0 2px #dc3545;
}

.timeline-date {
  font-size: 12px;
  color: #999;
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.timeline-details {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

/* ==========================================
   NEW COMPONENTS — FIELD CONDITIONAL
   ========================================== */

.field-conditional {
  border-left: 3px solid #ffc107;
  padding-left: 12px;
  margin-left: 4px;
}

.field-conditional-label {
  font-size: 11px;
  color: #856404;
  margin-bottom: 4px;
}

/* ==========================================
   NEW COMPONENTS — EDITABLE TABLE
   ========================================== */

.editable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 16px;
}

.editable-table th,
.editable-table td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.editable-table th {
  background: #f8f8f8;
  font-weight: 600;
  color: #555;
  font-size: 12px;
}

.editable-table td input,
.editable-table td select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 13px;
  background: #fff;
}

.editable-table .row-actions {
  white-space: nowrap;
  width: 80px;
  text-align: center;
}

.editable-table .btn-add-row {
  width: 100%;
  padding: 8px;
  background: #f8f8f8;
  border: 1px dashed #ccc;
  border-radius: 4px;
  cursor: pointer;
  color: #0066cc;
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

.editable-table .btn-add-row:hover {
  background: #e8f0fe;
}

/* Totals Row */
.totals-row td {
  background: #f0f4f8;
  font-weight: 600;
  border-top: 2px solid #0066cc;
}

/* ==========================================
   MODAL (for reference)
   ========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ==========================================
   DOCUMENT LIST
   ========================================== */

.doc-list {
  list-style: none;
}

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #fff;
}

.doc-item .doc-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-icon {
  width: 40px;
  height: 40px;
  background: #f0f0f0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.doc-name {
  font-weight: 500;
}

.doc-status {
  font-size: 12px;
  color: #666;
}

/* ==========================================
   DETAIL GRID (for read-only detail views)
   ========================================== */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  color: #888;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-value {
  font-size: 14px;
  color: #333;
}

.detail-value a {
  color: #0066cc;
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

/* ==========================================
   INDEX PAGE — screen list
   ========================================== */

.index-group {
  margin-bottom: 24px;
}

.index-group-title {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.index-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.index-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.15s;
}

.index-card:hover {
  border-color: #0066cc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.index-card-id {
  font-size: 12px;
  font-weight: 600;
  color: #0066cc;
  min-width: 50px;
}

.index-card-title {
  font-size: 14px;
  color: #333;
  flex: 1;
}

.index-card-meta {
  font-size: 11px;
  color: #999;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

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

  .header-right {
    flex-wrap: wrap;
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

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

  .filters-row {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

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

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

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

  .progress-steps {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .step::after {
    display: none;
  }
}

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

  .page-header {
    flex-direction: column;
    gap: 12px;
  }
}

/* ==========================================
   INTERACTIVE JS PATTERNS (Tab & Wizard)
   ========================================== */

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

.step-panel {
  display: none;
}

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

/* ==========================================
   ICON UTILITIES (inline SVG via mask-image)
   No external dependencies, color inherits from text (currentColor).
   ========================================== */

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.icon-star {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/></svg>");
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.icon-star-empty {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z'/></svg>");
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: #ccc;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.icon-check {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>");
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.icon-arrow-up {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 4L22 20H2z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 4L22 20H2z'/></svg>");
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.05em;
  flex-shrink: 0;
}

.icon-arrow-down {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 20L2 4h20z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 20L2 4h20z'/></svg>");
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.05em;
  flex-shrink: 0;
}

.icon-warning {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/></svg>");
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.icon-plus {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z'/></svg>");
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* Wizard: when a step is completed, render an SVG check inside the step-circle
   instead of the ✓ character. The number stays in the DOM for accessibility
   but is hidden visually via color: transparent. */
.step.completed .step-circle {
  color: transparent;
  position: relative;
}

.step.completed .step-circle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65%;
  height: 65%;
  background-color: #fff;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>");
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
}

/* ============================================================
   PATRÓN CANÓNICO DE ÍNDICE DE MÓDULO
   Estructura: <section class="module-group"> con
   <h2 class="index-group-title"> + <p class="group-desc"> +
   <ul class="screen-list"> de <li> con <a> + <span class="screen-type">
   Replicado de wireframes/servicios-generales/styles.css el 2026-05-12.
   ============================================================ */
.module-group {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eee;
}

.module-group:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.group-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 14px;
  line-height: 1.55;
}

.screen-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.15s;
}

.screen-list li:hover {
  border-color: #0066cc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.screen-list a {
  font-size: 14px;
  font-weight: 600;
  color: #0066cc;
  text-decoration: none;
}

.screen-list a:hover {
  text-decoration: underline;
}

.screen-type {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  white-space: normal;
}

.module-footer {
  margin-top: 28px;
  padding: 14px 20px;
  background: #f8f8f8;
  border: 1px dashed #ccc;
  border-radius: 6px;
  font-size: 13px;
  color: #555;
  line-height: 1.8;
}

.module-footer code {
  background: #eee;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: #444;
}

.module-footer a {
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
}

.module-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .screen-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .screen-type {
    white-space: normal;
  }
}
