* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f3; color: #1a1a1a; font-size: 14px; }
.app { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 12px; }
.header-title { font-size: 20px; font-weight: 600; color: #1a1a1a; }
.header-sub { font-size: 13px; color: #666; margin-top: 2px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e0e0e0; margin-bottom: 1.5rem; }
.tab { padding: 9px 18px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; color: #666; background: none; border-top: none; border-left: none; border-right: none; transition: all 0.15s; font-weight: 500; }
.tab.active { color: #1a1a1a; border-bottom-color: #1a1a1a; }
.tab:hover:not(.active) { color: #1a1a1a; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.metric { background: #fff; border-radius: 10px; padding: 1rem; border: 1px solid #e8e8e8; }
.metric-label { font-size: 12px; color: #888; margin-bottom: 6px; }
.metric-value { font-size: 20px; font-weight: 600; color: #1a1a1a; }
.metric-sub { font-size: 11px; color: #aaa; margin-top: 2px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar input, .toolbar select { font-size: 13px; padding: 7px 10px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fff; color: #1a1a1a; }
.btn { font-size: 13px; padding: 7px 16px; border: 1px solid #e0e0e0; border-radius: 8px; cursor: pointer; background: #fff; color: #1a1a1a; transition: all 0.15s; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: #f5f5f3; }
.btn-primary { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.btn-primary:hover { background: #333; opacity: 1; }
.table-wrap { border: 1px solid #e8e8e8; border-radius: 10px; overflow: hidden; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
th { background: #f9f9f7; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; color: #888; border-bottom: 1px solid #e8e8e8; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; color: #1a1a1a; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600; margin: 1px; }
.badge-activo { background: #e8f5e3; color: #2d6a1a; }
.badge-pausado { background: #fef3e2; color: #8a5200; }
.badge-suspendido { background: #fde8e8; color: #8a1a1a; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; overflow-y: auto; padding: 2rem 1rem; }
.modal { background: #fff; border-radius: 14px; border: 1px solid #e8e8e8; width: 100%; max-width: 580px; padding: 1.5rem; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #aaa; padding: 4px 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1/-1; }
.form-label { font-size: 12px; color: #666; font-weight: 600; }
.form-input { font-size: 13px; padding: 8px 10px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fff; color: #1a1a1a; }
.form-input:focus { outline: none; border-color: #1a1a1a; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #f0f0f0; }
.tipos-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.tipo-chip { display: inline-flex; align-items: center; padding: 4px 12px; border: 1px solid #e0e0e0; border-radius: 99px; font-size: 12px; cursor: pointer; color: #666; background: #fff; transition: all 0.15s; font-weight: 500; }
.tipo-chip.selected { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.tipo-chip:hover:not(.selected) { background: #f5f5f3; }
.sim-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.sim-section-title { font-size: 14px; font-weight: 600; margin-bottom: 1rem; }
.sim-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sim-label { font-size: 13px; color: #666; min-width: 100px; }
.sim-toggle { display: flex; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.sim-toggle button { padding: 7px 16px; font-size: 13px; border: none; cursor: pointer; background: #fff; color: #666; transition: all 0.15s; font-weight: 500; }
.sim-toggle button.active { background: #1a1a1a; color: #fff; }
.sim-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 1rem; }
.sim-metric { background: #f9f9f7; border-radius: 8px; padding: 12px; }
.sim-metric-label { font-size: 11px; color: #888; margin-bottom: 4px; }
.sim-metric-value { font-size: 17px; font-weight: 600; color: #1a1a1a; }
.sim-metric-value.highlight { color: #2d6a1a; }
.separator { border: none; border-top: 1px solid #f0f0f0; margin: 1.25rem 0; }
.chart-container { background: #fff; border: 1px solid #e8e8e8; border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 1rem; color: #1a1a1a; }
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 12px; color: #666; width: 160px; min-width: 160px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: #f0f0f0; border-radius: 4px; height: 24px; }
.bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.bar-val { font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; }
.donut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: #aaa; font-size: 14px; }
.action-btn { background: none; border: none; cursor: pointer; color: #aaa; padding: 4px 6px; font-size: 14px; border-radius: 4px; }
.action-btn:hover { color: #1a1a1a; background: #f0f0f0; }
.action-btn.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.action-btn.icon-btn:hover {
  background-color: #f3f4f6; /* Un gris muy clarito de fondo al pasar el mouse */
  border-color: #e5e7eb;
}
.toast { position: fixed; bottom: 24px; right: 24px; background: #1a1a1a; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 999; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toast.show { opacity: 1; }
.loading { text-align: center; padding: 2rem; color: #aaa; }

/* Estilos extra para pantalla de Login */
.login-container { max-width: 380px; width: 100%; background: #fff; padding: 2rem; border-radius: 14px; border: 1px solid #e8e8e8; box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: center; }
.divider { display: flex; align-items: center; text-align: center; margin: 1.5rem 0; color: #aaa; font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid #e0e0e0; }
.divider:not(:empty)::before { margin-right: .5em; }
.divider:not(:empty)::after { margin-left: .5em; }
