/* ============ VARIABLES Y RESET ============ */
:root {
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --secondary-color: #6c757d;
  --background: #f0f2f5;
  --card-bg: #ffffff;
  --text-color: #333333;
  --border-color: #dddddd;
  --error-color: #dc3545;
  --success-color: #28a745;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--text-color);
  line-height: 1.6;
  padding: 20px;
}

/* ============ LAYOUT PRINCIPAL ============ */
.container {
  max-width: 1000px;
  width: 100%;
  margin: 2rem auto;
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  overflow-wrap: break-word;
}

/* ============ COMPONENTES DE FORMULARIO ============ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select {
  width: 100%;
  max-width: 400px;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* ============ BOTONES ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background-color: #5a6268;
}

/* ============ TABLAS ============ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  background: var(--card-bg);
}

th, td {
  padding: 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
  white-space: nowrap;
}

tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* ============ TIPOGRAFÍA ============ */
h1, h2, h3, h4 {
  margin: 1.5rem 0 1rem;
  color: var(--text-color);
  line-height: 1.2;
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.8rem;
}

/* ============ FOOTER ============ */
.footer {
  margin-top: 3rem;
  padding: 1.5rem;
  background-color: #f8f9fa;
  text-align: center;
  font-size: 0.9rem;
  color: var(--secondary-color);
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

/* ============ MEDIA QUERIES ============ */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 1.5rem;
    border-radius: 0;
    box-shadow: none;
  }

  input,
  select,
  .btn {
    max-width: 100%;
  }

  table {
    min-width: 100%;
  }
}

/* ============ UTILIDADES ============ */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ============ ESTADOS ============ */
.error-message {
  color: var(--error-color);
  padding: 0.5rem;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 4px;
}

.success-message {
  color: var(--success-color);
  padding: 0.5rem;
  background: rgba(40, 167, 69, 0.1);
  border-radius: 4px;
}

.btn-light-success {
  background-color: #bff2c1;
  color: #155724;
}

.btn-light-success:hover {
  background-color: #a1dd9e;
}

.btn-copy {
    margin-left: 8px;
    padding: 3px 6px;
    font-size: 0.9rem;
    cursor: pointer;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
  }
  .btn-copy:hover {
    background: #0056b3;
}

/* ============ TABLA DE TOKENS PERSONALIZADA ============ */
.table-responsive {
  overflow-x: auto;
  margin-top: 1.5rem;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--card-bg);
  font-size: 0.92rem;
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: #e6f0ff; /* Fondo azul claro */
  font-weight: 600;
  color: #003366;
  white-space: nowrap;
}

tr:hover {
  background-color: rgba(0, 123, 255, 0.03);
}

td {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 300px;
}
