@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");

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

html, body {
  height: 100%;
  font-family: Inter, system-ui, sans-serif;
  background: #f4f6f8;
  color: #111;
}

.app {
  min-height: 100svh; /* viewport real en móvil */
  display: grid;
  grid-template-rows: 64px 1fr 56px;
}


.header {
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  position: relative;
}

.logo {
  font-weight: 700;
  letter-spacing: .14em;
}

.logo span {
  color: #d63447;
}

.actions {
  position: absolute;
  right: 24px;
  display: flex;
  gap: 12px;
}

.btn-logout {
  color: #d63447;
  border-radius:12px;
  font-size: 20px;
  text-decoration: none;
  transition:all 0.2s;
  padding:10px;
  width:auto;
  height:auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout:hover{
  color:#fff;
  background:#d63447;
  font-size: 20px;
  text-decoration: none;
}
.btn-secondary {
  font-size: 18px;
  text-decoration: none;
  color: #333;
}

.main {
  display: flex;
  justify-content: center;
  align-items: center;        /* centra vertical */
  padding: 24px 16px;         /* SOLO padding razonable */
}

/* =========================
   TABLA PRESUPUESTOS
========================= */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 32px;
  font-size: 14px;
  background: #fff;
}

.table thead {
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.table th {
  text-align: left;
  font-weight: 600;
  padding: 12px 10px;
  color: #374151;
  white-space: nowrap;
}

.table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.table tr:hover {
  background: #f9fafb;
}

/* =========================
   ACCIONES
========================= */

.table td:last-child {
  white-space: nowrap;
}

.table button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  margin-right: 6px;
  padding: 4px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.table button:hover {
  transform: scale(1.15);
  opacity: 0.85;
}

.table button:last-child {
  margin-right: 0;
}

/* Colores semánticos */
.table button:nth-child(1) {
  color: #374151; /* ver */
}

.table button:nth-child(2) {
  color: #2563eb; /* editar */
}

.table button:nth-child(3) {
  color: #dc2626; /* eliminar */
}

/* =========================
   ESTADOS
========================= */

.estado {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.estado-0 { color: #6b7280; } /* generado */
.estado-1 { color: #16a34a; } /* aceptado */
.estado-2 { color: #dc2626; } /* rechazado */
.estado-3 { color: #ca8a04; } /* expirado */

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

@media (max-width: 768px) {
  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    border: 1px solid #e5e7eb;
    margin-bottom: 16px;
    padding: 12px;
  }

  .table td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    margin-right: 12px;
  }
}
.mt-4{
  margin-top:20px;
}
hr{
  background:#dc2626;
  margin-top:20px;
  margin-bottom:20px;
}
.btn-sm{
  padding-left:5px;
  padding-right:5px;
}
.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 30px;
  height:auto;
  max-width: 720px;
  width: 100%;
}

.panel-login {
  max-width: 420px;
}

h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.muted {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
}
input.error,
textarea.error,
select.error {
  border-bottom: 2px solid #d63447 !important;
}

input.error::placeholder,
textarea.error::placeholder {
  color: #d63447;
}


.badge {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #d63447;
  margin-bottom: 12px;
  display: inline-block;
}

input, textarea, select {
  width: 100%;
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 12px 0;
  margin-bottom: 5px;
  margin-top:10px;
  background: transparent;
  padding-left:10px;
}

button {
  width: 100%;
  background: #d63447;
  color: #fff;
  border: none;
  margin-top:20px;
  padding: 14px;
  cursor: pointer;
}

.list-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 0;
}

.totals {
  margin-top: 24px;
  line-height: 2;
}

.total {
  font-size: 20px;
  font-weight: 700;
}

.footer {
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  background: #fff;
  color: #666;
}


/* =========================
   FIELD STATES
========================= */

.field {
  margin-bottom: 24px;
  position: relative;
}

.field-error {
  font-size: 12px;
  color: #d63447;
  margin-top: 6px;
  opacity: 0;
  padding-left:20px;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.mr-4{
  margin-right:10px;
  font-size:0.9rem;
  padding-top:2px;
  display:flex;
  border-radius:12px;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding-left:5px;
  padding-right:5px;
  color:#0e7ae6;
}
.mr-4:hover{
  background:#0e7ae6;
  color:#fff;
}
.field.has-error .field-error {
  opacity: 1;
  transform: translateY(0);
}

.field-success input,
.field-success textarea,
.field-success select {
  border-bottom: 2px solid #16a34a;
}

.field-success::after {
  content: "✓";
  position: absolute;
  right: 4px;
  bottom: 14px;
  color: #16a34a;
  font-size: 14px;
}

/* =========================
   TOAST STATES
========================= */

#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111;
  color: #fff;
  padding: 14px 18px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
  z-index: 9999;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

#toast.success {
  background: #16a34a;
}

#toast.error {
  background: #d63447;
}


@media (max-width: 480px) {
  .main {
    padding: 16px;
  }

  .panel {
    padding: 20px;
  }
}
