:root {
  --bg: #0b1020;
  --bg-2: #111827;
  --panel: #121a2f;
  --panel-2: #18233f;
  --border: rgba(255,255,255,0.08);
  --text: #f3f7ff;
  --muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --shadow: 0 24px 60px rgba(0,0,0,0.35);
  --radius: 18px;
  --radius-sm: 12px;

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.16);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.16);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #08111f 0%, #0d1528 100%);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loginBox {
  width: 100%;
  max-width: 420px;
  background: rgba(18, 26, 47, 0.96);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.loginBox h2 {
  margin: 0 0 22px;
  font-size: 30px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: rgba(9, 14, 28, 0.96);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  padding: 14px 16px;
  border-radius: 12px;
  color: #dbe7ff;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: #18233f;
}

.main-content {
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h2 {
  margin: 0 0 6px;
  font-size: 30px;
}

.muted {
  color: var(--muted);
}

.panel {
  background: rgba(18, 26, 47, 0.94);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.form-panel {
  max-width: 1100px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 14px;
  color: #dbe7ff;
  font-weight: 600;
}

.field-full {
  grid-column: 1 / -1;
}

.input,
input,
textarea,
select {
  width: 100%;
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37, 99, 235, 0.9);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.input.error,
input.error,
textarea.error,
select.error {
  border-color: rgba(239, 68, 68, 0.88);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

input[type="file"] {
  padding: 12px;
  background: #0f172a;
}

.actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #1f2937;
  color: white;
}

.btn-secondary:hover {
  background: #2b3648;
}

.btn-full {
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  background: rgba(18, 26, 47, 0.94);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  display: block;
  margin-bottom: 10px;
}

.stat-card h3 {
  margin: 0;
  font-size: 22px;
}

.ads-list {
  display: grid;
  gap: 14px;
}

.ad-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  align-items: center;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.ad-thumb {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  object-fit: cover;
  background: #111827;
}

.ad-meta h4 {
  margin: 0 0 6px;
  font-size: 18px;
}

.ad-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.screen {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: white;
}

#screenContainer {
  width: 100%;
  min-height: 100vh;
}

.ad {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #000;
}

.ad img,
.ad video {
  width: 100%;
  height: 100vh;
  object-fit: cover;
  display: block;
}

.ad-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.72) 100%);
}

.ad-content {
  position: absolute;
  left: 60px;
  right: 60px;
  bottom: 60px;
  z-index: 2;
}

.ad-title {
  margin: 0 0 10px;
  font-size: 54px;
  line-height: 1;
  font-weight: 800;
}

.ad-price {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
}

.ad-extra {
  margin: 0;
  font-size: 20px;
  color: #e2e8f0;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .form-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== Login profesional ===== */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 30%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.18), transparent 28%),
    linear-gradient(180deg, #07111e 0%, #0a1325 100%);
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-showcase {
  padding: 64px clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.login-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(255,255,255,0.08);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-showcase h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.login-lead {
  max-width: 620px;
  margin: 0;
  color: #b5c3dc;
  font-size: 18px;
  line-height: 1.7;
}

.login-feature-list {
  display: grid;
  gap: 16px;
  max-width: 640px;
  margin-top: 10px;
}

.login-feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px;
  border-radius: 18px;
  background: rgba(17, 24, 39, 0.45);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(6px);
}

.login-feature-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.login-feature-item p {
  margin: 0;
  color: #9db0cf;
  line-height: 1.55;
}

.login-feature-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}


.brand-with-logo {
  align-items: center;
}

.brand-mark-logo {
  width: 84px;
  height: 84px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 40px rgba(0,0,0,0.22);
}

.brand-mark-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-hero-logo-wrap {
  width: min(440px, 100%);
  padding: 18px;
  border-radius: 28px;
  background: radial-gradient(circle at top, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 28px 80px rgba(0,0,0,0.28);
}

.login-hero-logo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(0,0,0,0.28));
}

.login-logo-image {
  width: 84px;
  height: 84px;
  padding: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}

.login-logo-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel-card {
  width: 100%;
  max-width: 470px;
  background: rgba(10, 17, 31, 0.82);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.login-panel-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.login-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.3);
}

.login-eyebrow {
  margin: 0 0 6px;
  color: #8fb3ff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-panel-card h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.login-panel-text {
  margin: 0 0 24px;
  color: #9fb0cb;
  line-height: 1.6;
}

.login-panel-card .field {
  margin-bottom: 16px;
}

.login-submit {
  margin-top: 8px;
  min-height: 52px;
  font-size: 15px;
}

.login-submit[disabled] {
  opacity: 0.76;
  cursor: wait;
}

.login-footnote {
  margin: 18px 0 0;
  text-align: center;
  color: #7889a8;
  font-size: 13px;
}

/* ===== Mensaje inline ===== */
.inline-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1.5;
  animation: fadeUp 0.22s ease;
}

.inline-message.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.26);
  color: #fecaca;
}

.inline-message.success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.24);
  color: #bbf7d0;
}

.inline-message.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.24);
  color: #fde68a;
}

.inline-message.info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.24);
  color: #bfdbfe;
}

/* ===== Toasts ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr 28px;
  align-items: start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(9, 15, 28, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 50px rgba(0,0,0,0.35);
  animation: toastIn 0.26s ease;
}

.toast-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.toast-content strong {
  display: block;
  margin: 2px 0 4px;
  font-size: 14px;
}

.toast-content p {
  margin: 0;
  color: #c8d4eb;
  font-size: 13px;
  line-height: 1.45;
}

.toast-close {
  border: 0;
  background: transparent;
  color: #9fb0cb;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.toast-close:hover {
  color: #fff;
}

.toast-success .toast-icon {
  background: linear-gradient(135deg, #22c55e, #15803d);
}

.toast-error .toast-icon {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.toast-warning .toast-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.toast-info .toast-icon {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

/* ===== Modal ===== */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.app-modal.hidden,
.hidden {
  display: none !important;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.app-modal-card {
  position: relative;
  z-index: 2;
  width: min(460px, 100%);
  background: rgba(11, 18, 33, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  padding: 28px;
  animation: modalIn 0.2s ease;
}

.app-modal-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.app-modal-eyebrow {
  margin: 0 0 8px;
  color: #8fb3ff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-modal-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.app-modal-message {
  margin: 0;
  color: #b8c7e2;
  line-height: 1.6;
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-showcase {
    padding-bottom: 18px;
  }


.login-panel-wrap {
    padding-top: 0;
    padding-bottom: 36px;
  }
}

@media (max-width: 640px) {
  .login-showcase {
    padding: 28px 20px 12px;
  }


.login-panel-wrap {
    padding: 12px 16px 24px;
  }

  .login-panel-card {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .login-showcase h1 {
    font-size: 40px;
  }

  .login-lead {
    font-size: 16px;
  }

  .toast-container {
    top: 14px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

.field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.password-wrap {
  position: relative;
}

.password-input {
  padding-right: 110px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #dbe7ff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.password-toggle:hover {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.34);
}

.forgot-link {
  font-size: 13px;
  font-weight: 600;
  color: #9db8ff;
  transition: 0.2s ease;
}

.forgot-link:hover {
  color: #dbe7ff;
}

@media (max-width: 640px) {
  .field-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .password-input {
    padding-right: 96px;
  }

  .password-toggle {
    padding: 7px 10px;
    font-size: 12px;
  }
}
