/* ==========================================================
   Panel de Automatizacion Orbex — base
   Variables, reset, tipografia, tarjetas, formularios y botones.
   Se carga en TODAS las paginas (index.php y negocio.php).
   ========================================================== */

:root {
  --bg: #050706;
  --surface: #0d1211;
  --surface-2: #131a18;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.62);
  --text-faint: rgba(255, 255, 255, 0.4);
  --teal: #00a896;
  --teal-soft: #00c9b3;
  --teal-glow: rgba(0, 168, 150, 0.16);
  --danger: #ff6b5e;
  --warn: #e8b93e;
  --ok: #4ade80;
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(900px 560px at 10% -8%, rgba(0, 168, 150, 0.22), transparent 60%),
    radial-gradient(800px 520px at 95% 105%, rgba(0, 201, 179, 0.13), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  padding: 2rem 1.5rem;
}

.wrap { max-width: 960px; margin: 0 auto; }

h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.sub { color: var(--text-dim); font-size: 14px; margin: 0 0 1.5rem; }

a { color: var(--teal-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header (comun a dashboard y pagina de negocio) ---------- */
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 1.75rem; flex-wrap: wrap;
}
.panel-header-acciones { display: flex; gap: 8px; }

/* ---------- Cards / superficies ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.25rem;
}
.card h2 { font-size: 15px; font-weight: 600; margin: 0 0 1rem; }
.card-desc { color: var(--text-dim); font-size: 13px; line-height: 1.55; margin: -6px 0 16px; }

/* ---------- Formularios ---------- */
label.field-label {
  font-size: 12px; color: var(--text-dim); display: block;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: var(--surface-2); color: var(--text);
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; }

.row { display: flex; gap: 12px; margin-bottom: 14px; }
.row > div { flex: 1; }
.field { margin-bottom: 14px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
  padding: 0 16px; height: 40px; transition: background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn-primario { background: var(--teal); color: #04110f; }
.btn-primario:hover { background: var(--teal-soft); }
.btn-secundario {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border-strong);
}
.btn-secundario:hover { background: var(--surface-2); color: var(--text); }
.btn-peligro { background: transparent; color: var(--danger); border: 1px solid rgba(255, 107, 94, 0.4); }
.btn-peligro:hover { background: rgba(255, 107, 94, 0.1); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; font-size: 13px; padding: 0 12px; }
.btn-icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: transparent; color: var(--text-dim);
  cursor: pointer; font-size: 15px; transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-icono:hover { border-color: var(--teal); color: var(--teal-soft); }
.btn-icono-peligro:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { padding: 1rem 0.75rem; }
  .card { padding: 1.1rem; border-radius: var(--radius); }
  .card h2 { font-size: 14px; }
  /* Campos que en desktop van lado a lado se apilan en movil, para
     que no queden espachurrados en pantallas angostas. Solo los .row
     cuyos hijos directos son bloques de campo (.row > div); los .row
     con botones/checkboxes sueltos (align-items:center inline) se
     dejan como estan para no romper "Probar" al lado de un selector. */
  .row:not([style*="align-items"]) { flex-direction: column; gap: 10px; }
  .row:not([style*="align-items"]) > div { width: 100%; }
}
