:root {
  --primary: #625bff;
  --primary-light: #857dfb;
  --sidebar-bg: #191c30;
  --sidebar-active: #fff;
  --sidebar-link: #bbbce4;
  --sidebar-active-bg: #332fb1;
  --workbar-top: #f5f8fe;
  --workbar-bottom: #d3daf7;
  --content-bg: #f8faff;
  --text-main: #212337;
  --shadow: 0 4px 18px rgba(60,80,120,0.08);
}

[data-theme="dark"] {
  --sidebar-bg: #141624;
  --sidebar-link: #e0e1f5;
  --sidebar-active-bg: #29295a;
  --workbar-top: #22243a;
  --workbar-bottom: #151524;
  --content-bg: #20223a;
  --text-main: #f3f3fb;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--content-bg);
  color: var(--text-main);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(44,44,84,0.09);
}

.sidebar .logo-box {
  padding: 32px 0 12px;
  text-align: center;
}

.sidebar .logo {
  max-width: 130px;
  max-height: 60px;
  margin-bottom: 8px;
  border-radius: 10px;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu li {
  margin: 0 20px 13px;
}

.menu li a {
  display: block;
  padding: 13px 20px;
  border-radius: 10px;
  color: var(--sidebar-link);
  font-weight: 600;
  text-decoration: none;
  transition: background .16s, color .16s;
}

.menu li a.active,
.menu li a:hover {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  box-shadow: 0 2px 12px #0002;
}

.sidebar-bottom {
  padding: 20px 0 10px;
  text-align: center;
  border-top: 1px solid #29295a33;
  margin-top: auto;
}

.sidebar-bottom .brand {
  margin-top: 8px;
  font-size: 1rem;
  color: #fff8;
}

.sidebar-bottom .version {
  font-size: 0.7rem;
  color: #fff5;
  margin-top: 2px;
}

.main-content {
  margin-left: 250px;
  display: flex;
  flex-direction: column;
  background: var(--content-bg);
  min-height: 100vh;
}

.workbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between; /* texto a la izquierda, botón a la derecha */
  /* arriba, derecha, abajo, izquierda */
  padding: 20px 50px 20px 50px;
  background: var(--workbar-top);
  box-shadow: var(--shadow);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  font-size: 1.1rem;
}

/* Quitar cualquier fondo del engranaje */
/* Botón esquemático “⚙️” sin fondo */
.icon-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.4rem;
  padding: 4px;
  line-height: 1;
}

/* Efecto hover para el engranaje */
.icon-btn:hover {
  color: var(--primary);
}

/* Asegura que el welcome-text conserve su espacio y no comprima */


/* El contenedor del texto no debe envolverse ni centrar nada raro */
.workbar-top .welcome-text {
  white-space: nowrap;
}

.workbar-bottom {
  background: var(--workbar-bottom);
  height: 20px;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  box-shadow: 0 -2px 10px #0001;
}

.dashboard-content {
  flex: 1;
  padding: 38px;
}

.theme-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 16px;
  font-weight: 600;
  transition: background .17s;
}

.theme-btn:hover {
  background: var(--primary-light);
}

/* Login */
.login-box {
  max-width: 420px;
  margin: 90px auto;
  padding: 38px 32px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 18px #19194414;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  padding: 11px;
  margin-bottom: 17px;
}

.login-box button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
}

.error {
  color: #c0392b;
  text-align: center;
  font-weight: 500;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 60px;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
}

.table thead th {
  background: var(--workbar-top);
}

.table tbody tr:nth-child(even) {
  background: #f0f4ff;
}

/* Cards & charts */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.card p {
  font-size: 1.5rem;
  font-weight: 600;
}

.chart-placeholder {
  height: 260px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  margin-bottom: 24px;
  font-size: 1rem;
}

/* Dark theme adjustments */
[data-theme="dark"] .card,
[data-theme="dark"] .chart-placeholder,
[data-theme="dark"] .form-section,
[data-theme="dark"] .login-box {
  background: #28294a;
  border: 1px solid rgba(255,255,255,0.08);
}

[data-theme="dark"] .card h3,
[data-theme="dark"] .card p,
[data-theme="dark"] .chart-placeholder,
[data-theme="dark"] .form-section label,
[data-theme="dark"] .login-box h2,
[data-theme="dark"] .login-box input,
[data-theme="dark"] .login-box button,
[data-theme="dark"] .error {
  color: var(--text-main);
}

/* Formulario full-width */
.form-section {
  max-width: 600px;
  margin: 32px auto;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #c6c6e2;
  border-radius: 6px;
  box-sizing: border-box;
}


/* Responsive */
@media (max-width: 700px) {
  .sidebar,
  .main-content {
    margin-left: 0 !important;
    width: 100vw !important;
  }
  .sidebar {
    display: none;
  }
}

/* ✏️ Ajustes para el formulario de cotización */
.form-section.cotizador fieldset {
  border: 1px solid #e5e5e5;
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: 8px;
}

.form-section.cotizador legend {
  font-weight: bold;
  margin-bottom: 12px;
}

/* Cada grupo con borde inferior tenue */
.form-section.cotizador .form-group {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
}

/* El último no lleva línea */
.form-section.cotizador .form-group:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Etiqueta encima, bien separada */
.form-section.cotizador .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-main);
}

/* Inputs y selects a todo ancho */
.form-section.cotizador input[type="text"],
.form-section.cotizador input[type="email"],
.form-section.cotizador select,
.form-section.cotizador textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #c6c6e2;
  border-radius: 6px;
}

/* Checkbox alineado debajo de su label */
.form-section.cotizador .form-group input[type="checkbox"] {
  margin-right: 8px;
  transform: translateY(2px);
}

/* Textarea más alto */
.form-section.cotizador textarea {
  min-height: 120px;
  resize: vertical;
}

/* Botón separado de la última línea */
.form-section.cotizador button[type="submit"] {
  margin-top: 28px;
  display: inline-block;
}

/* Errores en lista legible */
.form-section.cotizador .error {
  color: #c0392b;
  margin-bottom: 16px;
}

