:root {
  --ink: #091b2a;
  --ink-soft: #163246;
  --blue: #0d7ea5;
  --aqua: #28c4b3;
  --coral: #ff6b4a;
  --yellow: #ffc857;
  --paper: #f3f6f7;
  --white: #fff;
  --muted: #6c7e89;
  --line: #dce5e9;
  --green: #138a72;
  --red: #c94343;
  --orange: #b86a22;
  --sidebar: 264px;
  --shadow: 0 20px 60px rgba(9, 27, 42, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(40, 196, 179, .28);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -.04em;
}
.brand > span:last-child > span { color: var(--aqua); }
.brand-mark {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px 14px 14px 5px;
  background: linear-gradient(145deg, var(--blue), var(--aqua));
  box-shadow: 0 10px 25px rgba(13,126,165,.23);
}
.brand-login { margin-bottom: 42px; color: var(--ink); }
.brand-dark { color: #fff; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: #fff; }
.login-aside {
  position: relative;
  min-height: 100vh;
  padding: 64px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 25% 75%, rgba(40,196,179,.27), transparent 28%),
    linear-gradient(138deg, #071721 0%, #10384e 62%, #087d99 100%);
}
.login-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image: radial-gradient(rgba(255,255,255,.42) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(130deg, #000, transparent 85%);
}
.login-orbit { position: absolute; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; right: -170px; top: -130px; }
.orbit-two { width: 380px; height: 380px; left: -170px; bottom: -120px; }
.login-visual { position: relative; z-index: 2; max-width: 650px; }
.visual-pill {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #a6f1e7;
  background: rgba(255,255,255,.07);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 800;
}
.login-visual h1 { margin: 20px 0; font-size: clamp(46px, 6vw, 78px); line-height: .98; letter-spacing: -.065em; }
.login-visual h1 em { color: var(--yellow); font-style: normal; }
.login-visual p { max-width: 570px; color: #c8dce4; font-size: 19px; line-height: 1.6; }
.visual-stats { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 10px; }
.visual-stats span { padding: 10px 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 11px; background: rgba(4,24,36,.32); font-weight: 700; }
.login-panel { min-height: 100vh; padding: 44px; display: grid; place-items: center; }
.login-card { width: min(440px, 100%); }
.eyebrow, .page-eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.login-card h2 { margin: 0; font-size: 37px; letter-spacing: -.045em; }
.form-intro { margin: 10px 0 30px; color: var(--muted); line-height: 1.55; }
.field { display: grid; gap: 8px; margin: 17px 0; }
.field > span { color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.field input, .field select, .field textarea, .control {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.field textarea { min-height: 92px; resize: vertical; }
.form-error { min-height: 20px; margin: 8px 0; color: var(--red); font-size: 13px; font-weight: 700; }
.secure-note { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 12px; }

.button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 780;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: #fff; background: var(--coral); box-shadow: 0 10px 25px rgba(255,107,74,.2); }
.button-secondary { border-color: var(--line); background: #fff; }
.button-dark { color: #fff; background: var(--ink); }
.button-green { color: #fff; background: var(--green); }
.button-danger { color: var(--red); border-color: #f1caca; background: #fff7f7; }
.button-small { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 12px; }
.button-block { width: 100%; min-height: 50px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.admin-app { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar);
  padding: 22px 15px 16px;
  display: flex;
  flex-direction: column;
  color: #d9e9ef;
  background: linear-gradient(180deg, #081a28, #0d2b3d);
  box-shadow: 14px 0 45px rgba(9,27,42,.13);
}
.sidebar-top { padding: 0 9px 22px; display: flex; align-items: center; justify-content: space-between; }
.close-menu { display: none; color: #fff; }
.side-nav { flex: 1; display: grid; align-content: start; gap: 4px; overflow-y: auto; }
.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #b8ced7;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}
.nav-item > span { width: 23px; color: #7fcfc5; text-align: center; font-size: 18px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(13,126,165,.55), rgba(40,196,179,.18)); }
.sidebar-footer { padding: 15px 7px 0; border-top: 1px solid rgba(255,255,255,.1); }
.admin-mini { display: flex; align-items: center; gap: 10px; }
.admin-mini > div { min-width: 0; }
.admin-mini strong, .admin-mini small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-mini strong { color: #fff; font-size: 13px; }
.admin-mini small { margin-top: 2px; color: #9db6c0; font-size: 10px; }
.avatar { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, var(--blue), var(--aqua)); font-weight: 850; }
.logout-button { margin-top: 12px; padding: 6px 0; color: #ffb9a9; border: 0; background: transparent; font-size: 12px; font-weight: 750; cursor: pointer; }
.menu-backdrop { display: none; }

.main-area { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  min-height: 82px;
  padding: 16px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(243,246,247,.91);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 25;
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.page-eyebrow { margin-bottom: 3px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 22px; }
.menu-button { display: none; }
.status-pill { padding: 8px 11px; display: inline-flex; align-items: center; gap: 7px; color: var(--green); border: 1px solid #cde8df; border-radius: 999px; background: #edf9f5; font-size: 11px; font-weight: 800; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(19,138,114,.11); }
.status-pill.offline { color: var(--red); border-color: #f2cece; background: #fff7f7; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 28px 30px 80px; }

.loading-card { min-height: 340px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 38px; height: 38px; margin: 0 auto 12px; border: 4px solid #dbe8eb; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.section-head { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.section-head h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; }
.metric-card, .panel, .country-card, .review-card, .asset-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(9,27,42,.045);
}
.metric-card { position: relative; min-height: 132px; padding: 19px; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 80px; height: 80px; right: -30px; bottom: -34px; border-radius: 50%; background: var(--metric, #dff3f0); }
.metric-card small { color: var(--muted); font-weight: 750; }
.metric-card strong { margin-top: 10px; display: block; font-size: 31px; letter-spacing: -.045em; }
.metric-card span { margin-top: 5px; display: block; color: var(--blue); font-size: 11px; font-weight: 750; }
.dashboard-grid { margin-top: 16px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.panel { padding: 19px; }
.panel-head { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.queue-list { display: grid; gap: 9px; }
.queue-item { padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e9eff1; border-radius: 12px; background: #fafcfc; }
.queue-item strong { display: block; font-size: 13px; }
.queue-item small { color: var(--muted); }
.queue-number { min-width: 36px; height: 32px; padding: 0 8px; display: grid; place-items: center; color: var(--blue); border-radius: 9px; background: #e7f4f7; font-weight: 850; }

.toolbar { margin-bottom: 15px; padding: 12px; display: flex; flex-wrap: wrap; gap: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.toolbar input, .toolbar select { min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.toolbar input { min-width: 240px; flex: 1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { padding: 12px 13px; border-bottom: 1px solid #edf1f2; text-align: left; vertical-align: middle; white-space: nowrap; }
.data-table th { color: var(--muted); background: #f9fbfb; text-transform: uppercase; letter-spacing: .055em; font-size: 10px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.wrap { min-width: 210px; white-space: normal; }
.table-person { display: flex; align-items: center; gap: 9px; }
.table-person strong, .table-person small { display: block; }
.table-person small { margin-top: 2px; color: var(--muted); }
.thumb { width: 46px; height: 38px; object-fit: cover; border-radius: 8px; background: #e5ecef; }
.thumb-placeholder { width: 46px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: #e5ecef; font-size: 19px; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: #536671; background: #edf2f4; font-size: 10px; font-weight: 850; text-transform: capitalize; }
.badge.aprobado, .badge.activo, .badge.verificado, .badge.completado, .badge.pagado { color: #0e755f; background: #e5f6f0; }
.badge.revision, .badge.pendiente, .badge.procesando { color: #9c5d1f; background: #fff2df; }
.badge.rechazado, .badge.suspendido, .badge.cancelado, .badge.vencido { color: #b43d3d; background: #fdeaea; }
.badge.vence_pronto { color: #9c5d1f; background: #fff2df; }
.badge.sin_plan { color: #536671; background: #edf2f4; }
.badge.pausado { color: #6956a0; background: #f0ebfa; }
.empty-state { min-height: 260px; padding: 35px; display: grid; place-items: center; color: var(--muted); text-align: center; border: 1px dashed #cfdcdf; border-radius: 16px; background: rgba(255,255,255,.56); }
.empty-state span { display: block; margin-bottom: 10px; font-size: 38px; }
.notice { margin-bottom: 17px; padding: 14px 16px; color: #795019; border: 1px solid #f0d6ac; border-radius: 13px; background: #fff7e9; font-size: 13px; line-height: 1.5; }

.review-grid, .country-grid, .asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.review-card, .country-card, .asset-card { padding: 17px; }
.review-card h3, .country-card h3, .asset-card h3 { margin: 0 0 5px; font-size: 16px; }
.review-card p, .country-card p, .asset-card p { margin: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.review-meta { margin: 13px 0; padding: 10px; display: grid; gap: 5px; border-radius: 11px; background: #f5f8f9; font-size: 12px; }
.plan-prices { margin: 14px 0; display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }
.price-chip { padding: 9px; border: 1px solid #e2eaed; border-radius: 10px; background: #fafcfc; }
.price-chip small, .price-chip strong { display: block; }
.price-chip small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.price-chip strong { margin-top: 3px; font-size: 13px; }
.qr-preview, .asset-preview { width: 100%; height: 130px; margin: 12px 0; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; background: #edf2f4; }
.asset-preview { height: 150px; }
.asset-placeholder { height: 150px; margin: 12px 0; display: grid; place-items: center; color: #8ba0aa; border: 1px dashed #c8d5da; border-radius: 12px; background: #f5f8f9; font-size: 30px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.settings-card { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.settings-card h3 { margin: 0; }
.settings-card > p { margin: 6px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.notification-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 16px; }
.notification-form { display: grid; gap: 14px; }
.notification-master { border-color: #b9e4dc; background: linear-gradient(135deg, #f4fcfa, #fff); }
.toggle-list { display: grid; gap: 9px; }
.notification-toggle {
  position: relative;
  min-height: 64px;
  padding: 11px 66px 11px 13px;
  display: flex;
  align-items: center;
  border: 1px solid #e4ecee;
  border-radius: 12px;
  background: #fafcfc;
  cursor: pointer;
}
.notification-toggle > span { display: grid; gap: 4px; }
.notification-toggle strong { font-size: 13px; }
.notification-toggle small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.notification-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.notification-toggle i {
  position: absolute;
  right: 14px;
  width: 41px;
  height: 23px;
  border-radius: 999px;
  background: #c7d2d7;
  transition: .18s ease;
}
.notification-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(9,27,42,.2);
  transition: .18s ease;
}
.notification-toggle input:checked + i { background: var(--green); }
.notification-toggle input:checked + i::after { transform: translateX(18px); }
.notification-toggle input:focus-visible + i { outline: 3px solid rgba(40,196,179,.28); outline-offset: 2px; }
.notification-status { position: sticky; top: 102px; }
.notification-status h3 { margin-bottom: 18px; }
.status-check-list { display: grid; gap: 11px; }
.status-check-list > div { display: flex; align-items: center; gap: 10px; }
.status-check-list strong, .status-check-list small { display: block; }
.status-check-list strong { font-size: 12px; }
.status-check-list small { margin-top: 2px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.status-check { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px rgba(255,200,87,.16); }
.status-check.ready { background: var(--green); box-shadow: 0 0 0 4px rgba(19,138,114,.13); }
.last-test { margin-top: 18px; padding: 12px; display: grid; gap: 4px; border-radius: 11px; color: #0e755f; background: #edf9f5; }
.last-test.failed { color: var(--red); background: #fff2f2; }
.last-test strong { font-size: 12px; }
.last-test span, .last-test small { font-size: 10px; line-height: 1.45; }
.helper-text { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(5,20,30,.62); backdrop-filter: blur(5px); }
.modal-card { position: relative; z-index: 2; width: min(680px,100%); max-height: calc(100vh - 36px); overflow-y: auto; border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.modal-head { position: sticky; top: 0; z-index: 2; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.modal-head h2 { margin: 0; font-size: 21px; }
.modal-body { padding: 20px; }
.admin-gallery { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.admin-gallery figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f5f8f9; }
.admin-gallery img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; }
.admin-gallery figcaption { padding: 8px 10px; color: var(--muted); font-size: 11px; font-weight: 750; }
.listing-review-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payment-proof-preview { margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.payment-proof-preview strong { display: block; margin-bottom: 9px; }
.payment-proof-preview img { width: 100%; max-height: 280px; object-fit: contain; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 150; max-width: min(420px,calc(100% - 44px)); padding: 12px 16px; color: #fff; border-radius: 12px; background: var(--ink); box-shadow: var(--shadow); transform: translateY(25px); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 13px; font-weight: 700; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #9f3636; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .review-grid, .country-grid, .asset-grid { grid-template-columns: repeat(2,1fr); }
  .notification-layout { grid-template-columns: 1fr; }
  .notification-status { position: static; }
}

@media (max-width: 860px) {
  .login-view { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-panel { padding: 28px; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .close-menu, .menu-button { display: grid; }
  .menu-backdrop.open { position: fixed; inset: 0; z-index: 45; display: block; background: rgba(5,20,30,.48); }
  .main-area { margin-left: 0; }
  .settings-grid, .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { padding: 13px 15px; }
  .content { padding: 20px 15px 70px; }
  .topbar-actions .status-pill { display: none; }
  .metric-grid, .review-grid, .country-grid, .asset-grid { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .toolbar input { min-width: 100%; }
  .admin-gallery, .listing-review-meta { grid-template-columns: 1fr; }
}
