:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  /* Paleta global de colores: cambia aquí para modificar toda la web */
  --bg: linear-gradient(135deg, #f4f8ff 0%, #eaf2ff 45%, #f7fbff 100%);
  --surface: rgba(255, 255, 255, 0.96);
  --surface-soft: #f8fbff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(148, 163, 184, 0.24);
  --primary: #1d4ed8;
  --primary-strong: #2563eb;
  --accent: #60a5fa;
  --success: #047857;
  --danger: #b91c1c;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-sm: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 24px 60px rgba(15, 23, 42, 0.14);
  --transition: 220ms ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.topbar-brand img {
  height: 34px;
  width: auto;
  display: block;
}

.topbar-links {
  display: flex;
  gap: 12px;
}

.topbar-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar-links a:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.auth-shell {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 18px;
  align-items: stretch;
}

main,
.login-card,
form,
.field,
input,
button {
  transition: var(--transition);
}

main,
.login-card,
.info-panel {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.info-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 430px;
  background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(239,245,255,0.95));
}

.brand-logo {
  width: min(100%, 180px);
  height: auto;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
}

.info-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  color: var(--text);
}

.info-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-card {
  width: 100%;
  padding: 26px;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand h1 {
  margin: 0 0 2px;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--text);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #334155;
}

input,
button,
select,
textarea {
  font: inherit;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

input {
  width: 100%;
  padding: 11px 12px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  background: linear-gradient(90deg, #f9fbff 0%, #f3f8ff 100%);
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

button {
  margin-top: 6px;
  border: none;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.28);
}

.contact-info {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.contact-info a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.auth-status {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-status.success {
  color: var(--success);
}

.auth-status.error {
  color: var(--danger);
}

.auth-status.loading {
  color: var(--primary);
}

.hidden {
  display: none !important;
}

.panel-page {
  min-height: 100vh;
  display: block;
  padding: 18px 24px 32px;
  position: relative;
}

.floating-topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  width: min(100%, 1200px);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.floating-topbar .topbar-brand img {
  height: 24px;
  width: auto;
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  margin-top: 0;
  padding: 9px 13px;
  border: none;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  position: relative;
  min-width: 40px;
  min-height: 40px;
}

.icon-btn + .icon-btn {
  margin-left: 8px;
}

.icon-btn:hover,
.icon-btn.is-active {
  transform: translateY(-1px);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: none;
}

.icon-btn.is-restricted {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  cursor: not-allowed;
  opacity: 0.9;
  border: 1px dashed rgba(148, 163, 184, 0.45);
}

.icon-btn.is-restricted i {
  opacity: 0.55;
}

.icon-btn.is-restricted:hover {
  transform: none;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

.logout-btn {
  margin-left: 6px;
  color: var(--danger);
}

.logout-btn:hover {
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
}

.panel-card {
  width: min(100%, 1200px);
  min-height: calc(100vh - 140px);
  margin: 0 auto;
  padding: clamp(24px, 3vw, 38px);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-md);
}

.panel-shell {
  display: grid;
  gap: 22px;
}

.panel-view {
  display: none;
}

.panel-view.is-active {
  display: grid;
  gap: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.panel-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  line-height: 1.05;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
}

.date-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-weight: 700;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.panel-feature-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 16px;
}

.panel-brand-card {
  min-height: 180px;
}

.panel-identity-block {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 100%;
}

.panel-media-badge {
  width: 112px;
  height: 112px;
  border-radius: 22px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.panel-media-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.panel-media-logo.has-image {
  display: block;
}

.panel-media-fallback {
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  color: #1e3a8a;
}

.company-logo-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-action-btn {
  margin: 0;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: none;
}

.inline-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: none;
  background: rgba(37, 99, 235, 0.12);
}

.inline-action-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.inline-action-btn.primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.inline-action-btn.secondary {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.32);
  color: #334155;
}

.inline-action-btn.secondary:hover {
  background: rgba(148, 163, 184, 0.2);
}

.inline-action-btn.ghost {
  background: transparent;
  border-color: rgba(37, 99, 235, 0.28);
}

.company-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-edit-form {
  margin-top: 8px;
}

.company-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.company-edit-card {
  display: grid;
  gap: 10px;
}

.company-meta-line {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #64748b;
}

.compact-field {
  gap: 4px;
}

.compact-field span {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
}

.section-intro h3 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
}

.inline-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.inline-status {
  color: var(--muted);
  font-size: 0.84rem;
}

.inline-status.is-error {
  color: var(--danger);
}

.inline-status.is-success {
  color: var(--success);
}

.inline-status.is-info {
  color: var(--primary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.company-edit-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
}

.info-card:hover,
.list-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.info-card,
.list-card {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.info-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.info-card p,
.list-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.list-card {
  display: grid;
  gap: 12px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.list-row strong {
  font-size: 0.98rem;
}

.list-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.list-row span {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.panel-user {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.panel-tip {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .info-panel {
    min-height: auto;
    order: 2;
  }

  .login-card {
    order: 1;
  }
}

@media (max-width: 700px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .panel-feature-grid {
    grid-template-columns: 1fr;
  }

  .company-edit-grid {
    grid-template-columns: 1fr;
  }

  .panel-identity-block {
    align-items: flex-start;
  }

  .panel-media-badge {
    width: 84px;
    height: 84px;
    border-radius: 18px;
  }

  .company-edit-actions-row {
    justify-content: flex-start;
    margin-top: 0;
    flex-wrap: wrap;
  }

  .list-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-row span {
    text-align: left;
  }

  .panel-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .panel-page {
    padding: 10px 14px 24px;
  }

  .floating-topbar {
    width: 100%;
    padding: 8px 10px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .icon-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 7px 9px;
  }

  .panel-card {
    min-height: auto;
    padding: 20px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .floating-topbar {
    top: 8px;
    padding: 9px 12px;
    width: 100%;
  }

  .topbar {
    padding: 12px 14px;
  }

  .topbar-links {
    gap: 6px;
  }

  .topbar-links a {
    padding: 7px 8px;
    font-size: 0.92rem;
  }

  .page {
    padding: 12px;
    align-items: stretch;
  }

  .auth-shell {
    gap: 12px;
  }

  .info-panel,
  .login-card {
    padding: 18px;
    border-radius: 18px;
  }

  .brand-logo {
    width: 170px;
    margin-bottom: 16px;
  }

  .login-form {
    gap: 12px;
  }

  input {
    padding: 11px 12px;
  }

  button {
    padding: 12px 14px;
  }
}
