:root {
  --bg: #f5eee6;
  --surface: rgba(255, 251, 246, 0.88);
  --surface-strong: #fff8ee;
  --ink: #1e2522;
  --muted: #5d645f;
  --line: rgba(43, 49, 44, 0.12);
  --accent: #b73535;
  --accent-strong: #8d2323;
  --accent-soft: rgba(183, 53, 53, 0.12);
  --success: #2f6b47;
  --warn: #b27317;
  --shadow: 0 22px 60px rgba(70, 39, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(183, 53, 53, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(141, 35, 35, 0.14), transparent 24%),
    linear-gradient(180deg, #faf4ee 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 88%);
  opacity: 0.5;
}

body.login-page,
body.moro-admin-body {
  background:
    radial-gradient(circle at top left, rgba(183, 53, 53, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(141, 35, 35, 0.14), transparent 24%),
    linear-gradient(180deg, #faf4ee 0%, var(--bg) 100%);
}

.moro-login-page .login-box {
  width: 420px;
}

.moro-login-logo {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(183, 53, 53, 0.18);
}

.moro-brand-image {
  object-fit: cover;
}

.moro-user-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(183, 53, 53, 0.2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shell {
  width: min(1220px, calc(100% - 30px));
  margin: 0 auto;
  padding: 28px 0 42px;
  position: relative;
  z-index: 1;
}

.shell-login {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.hidden {
  display: none !important;
}

.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-strong);
  font-weight: 700;
}

.login-card,
.hero,
.toolbar,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(520px, 100%);
  padding: 34px;
  border-radius: 28px;
}

.login-brand,
.hero-brand {
  display: flex;
  gap: 18px;
  align-items: center;
}

.login-brand img,
.hero-brand img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(183, 53, 53, 0.18);
}

.login-card h1,
.hero h2,
.panel h3 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
}

.login-copy,
.hero p,
.panel-header p,
.flash,
.login-meta,
.chart-legend span,
.alerts small {
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(59, 53, 39, 0.14);
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

button,
.action-link {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

button:hover,
.action-link:hover {
  transform: translateY(-1px);
}

.login-form button {
  margin-top: 6px;
  background: linear-gradient(135deg, var(--accent) 0%, #cf5252 100%);
  color: white;
  box-shadow: 0 16px 34px rgba(183, 53, 53, 0.24);
}

.secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border: 1px solid var(--line);
}

.login-meta {
  margin-top: 18px;
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
}

.flash {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
}

.flash-error {
  background: rgba(183, 53, 53, 0.1);
  border-color: rgba(183, 53, 53, 0.18);
  color: var(--accent-strong);
}

.flash-info {
  background: rgba(47, 107, 71, 0.1);
  border-color: rgba(47, 107, 71, 0.16);
  color: var(--success);
}

.dashboard {
  display: grid;
  gap: 18px;
  animation: rise 500ms ease;
}

.app-hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  padding: 26px;
  border-radius: 28px;
}

.hero-main h2 {
  font-size: clamp(1.9rem, 3vw, 3.3rem);
}

.hero-side {
  display: grid;
  gap: 14px;
}

.hero-stat {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 239, 0.76));
  border: 1px solid rgba(87, 68, 57, 0.08);
}

.hero-stat span,
.metric-card span,
.ranking-line span,
.chart-legend span,
.mix-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-stat strong,
.metric-card strong,
.mix-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  justify-content: space-between;
  padding: 18px 22px;
  border-radius: 24px;
  margin-top: 18px;
}

.toolbar-block {
  min-width: 240px;
  flex: 1;
}

.toolbar-summary {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.summary-grid,
.content-grid,
.roadmap-grid,
.mix-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.mix-card {
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 238, 0.78));
  border: 1px solid rgba(70, 65, 54, 0.08);
}

.metric-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel,
.wide {
  border-radius: 28px;
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.stack {
  display: grid;
  gap: 12px;
}

.ranking-line {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 14px;
}

.ranking-line strong {
  font-size: 0.96rem;
}

.bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(78, 70, 59, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #cf5252 0%, #8d2323 100%);
}

.chart {
  min-height: 290px;
}

.chart svg {
  width: 100%;
  height: 280px;
  overflow: visible;
}

.chart-axis,
.chart-label {
  fill: var(--muted);
  font-size: 12px;
}

.chart-grid {
  stroke: rgba(38, 43, 39, 0.12);
  stroke-dasharray: 4 6;
}

.chart-line-sales,
.chart-line-net {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-sales {
  stroke: #cf5252;
}

.chart-line-net {
  stroke: #2f6b47;
}

.chart-dot {
  stroke: white;
  stroke-width: 2;
}

.mix-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mix-meter {
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  background: rgba(73, 74, 71, 0.08);
  overflow: hidden;
}

.mix-meter > div {
  height: 100%;
  border-radius: inherit;
}

.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.alerts li {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(67, 58, 40, 0.08);
}

.alerts small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(50, 46, 35, 0.08);
}

thead th {
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.5);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .app-hero,
  .content-grid,
  .summary-grid,
  .mix-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .ranking-line {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 1220px);
    padding-top: 18px;
  }

  .login-card,
  .hero,
  .panel,
  .toolbar {
    padding: 18px;
    border-radius: 22px;
  }

  .login-brand,
  .hero-brand {
    align-items: start;
  }

  .login-brand img,
  .hero-brand img {
    width: 72px;
    height: 72px;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .toolbar-summary {
    display: grid;
    gap: 12px;
  }
}

/* AdminLTE puro: overrides finales para neutralizar el look custom anterior */

body,
body.login-page,
body.moro-admin-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f9 !important;
  color: #212529;
}

body::before {
  display: none !important;
}

.moro-home-page {
  min-height: 100vh;
  margin: 0;
  background: #fff !important;
  color: #212529;
}

.moro-home-page::before {
  display: none !important;
}

.moro-home {
  background: #fff;
}

.moro-home-navbar {
  position: relative;
  z-index: 2;
}

.moro-home-brand {
  color: #111827;
}

.moro-home-brand:hover {
  color: #111827;
}

.moro-home-brand-logo {
  width: 92px;
  height: 70px;
  object-fit: cover;
  border-radius: 0.25rem;
}

.moro-home-brand strong {
  display: block;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.05;
}

.moro-home-brand small {
  display: block;
  margin-top: 0.25rem;
  color: #5f6670;
  font-size: 1rem;
}

.moro-login-button,
.moro-home-cta {
  border-radius: 0.25rem;
  font-weight: 700;
}

.moro-login-button:hover {
  transform: translateY(-1px);
}

.moro-home-hero {
  min-height: calc(100vh - 102px);
  position: relative;
  background:
    linear-gradient(rgba(65, 14, 18, 0.58), rgba(65, 14, 18, 0.58)),
    url("https://images.unsplash.com/photo-1607623814075-e51df1bdc82f?auto=format&fit=crop&w=1800&q=80") center center / cover no-repeat;
}

.moro-home-hero-logo {
  width: min(44vw, 280px);
  max-height: 220px;
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.24);
}

.moro-home-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.45);
}

.moro-home-subtitle {
  font-size: clamp(1.35rem, 2.7vw, 2.1rem);
  font-weight: 700;
  text-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.45);
}

.moro-home-cta {
  min-width: 170px;
  color: #ad2b32;
}

.moro-login-page .login-box {
  width: 420px;
}

.moro-login-logo {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: none;
}

.moro-brand-image {
  object-fit: cover;
}

.moro-user-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.moro-admin-body .card-header {
  background: #f7d7db;
  border-bottom-color: #efb8bf;
}

.moro-admin-body .card-header .card-title {
  color: #212529;
  font-weight: 700;
}

.shell,
.shell-login,
.login-card,
.hero,
.toolbar,
.panel,
.dashboard,
.app-hero,
.hero-main,
.hero-side,
.toolbar-block,
.toolbar-summary,
.toolbar-actions,
.content-grid,
.summary-grid {
  all: unset;
}

.stack {
  display: grid;
  gap: 12px;
}

.ranking-line {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 14px;
  align-items: center;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e9ecef;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #dc3545;
}

.chart {
  min-height: 290px;
}

.chart svg {
  width: 100%;
  height: 280px;
  overflow: visible;
}

.chart-axis,
.chart-label {
  fill: #6c757d;
  font-size: 12px;
}

.chart-grid {
  stroke: #dee2e6;
  stroke-dasharray: 4 6;
}

.chart-line-sales,
.chart-line-net {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-sales {
  stroke: #dc3545;
}

.chart-line-net {
  stroke: #28a745;
}

.chart-dot {
  stroke: #fff;
  stroke-width: 2;
}

.chart-legend {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  color: #6c757d;
  font-size: 0.9rem;
}

.mix-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.mix-card {
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 1rem;
  background: #fff;
}

.mix-card span {
  display: block;
  color: #6c757d;
}

.mix-card strong {
  display: block;
  font-size: 1.25rem;
  margin: 0.35rem 0;
}

.mix-meter {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  background: #e9ecef;
  overflow: hidden;
}

.mix-meter > div {
  height: 100%;
}

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

.alerts li {
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background: #fff;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.alerts li:last-child {
  margin-bottom: 0;
}

.alerts small {
  display: block;
  color: #6c757d;
  margin-top: 0.3rem;
}

@media (max-width: 991.98px) {
  .mix-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .ranking-line {
    grid-template-columns: 1fr;
  }

  .chart-legend {
    flex-direction: column;
    gap: 6px;
  }

  .moro-home-brand-logo {
    width: 70px;
    height: 56px;
  }

  .moro-home-brand strong {
    font-size: 1.25rem;
  }

  .moro-home-brand small {
    font-size: 0.85rem;
  }

  .moro-login-button {
    min-width: auto;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .moro-home-hero {
    min-height: calc(100vh - 88px);
  }

  .moro-home-hero-logo {
    width: min(68vw, 260px);
  }
}

.info-box-number {
  font-size: 1.1rem;
}

#closuresTable_filter {
  padding-right: 1rem;
}

.date-card {
  border-top: 3px solid #dc3545;
}

.date-card .card-body {
  padding: 1rem 1.25rem;
}

.date-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.date-toolbar-label {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.date-toolbar-label span {
  color: #dc3545;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.date-toolbar-label strong {
  color: #212529;
  font-size: 1.45rem;
  line-height: 1.1;
}

.daily-total-card {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.daily-total-card > div {
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background: #fff;
  padding: 1rem;
}

.daily-total-card span,
.daily-total-card small {
  display: block;
  color: #6c757d;
}

.daily-total-card strong {
  display: block;
  margin: 0.25rem 0;
  font-size: 1.2rem;
}

.closure-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.closure-card {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  min-height: 238px;
  text-align: left;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background: #fff;
  color: #212529;
  padding: 1rem;
  box-shadow: none;
}

.closure-card:hover {
  border-color: #dc3545;
  box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.08);
}

.closure-card.is-selected {
  border-color: #dc3545;
  box-shadow: inset 0 0 0 1px #dc3545;
}

.closure-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
  margin: -1rem -1rem 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
}

.closure-card-head strong {
  font-size: 1.1rem;
}

.closure-card-head span {
  color: #6c757d;
  font-size: 0.85rem;
  white-space: nowrap;
}

.closure-card-main {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
}

.closure-card-lines {
  display: grid;
  gap: 0.3rem;
}

.closure-card-lines span {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  color: #6c757d;
}

.closure-card-lines b {
  color: #212529;
}

.closure-info-button {
  align-self: end;
  justify-self: stretch;
  margin-top: 0.35rem;
}

.chart-legend i {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.15rem;
  margin-right: 0.35rem;
  vertical-align: -0.05rem;
}

@media (max-width: 991.98px) {
  .daily-total-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .date-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .date-toolbar .btn-group {
    width: 100%;
  }

  .date-toolbar .btn {
    flex: 1;
  }

  .daily-total-card {
    grid-template-columns: 1fr;
  }
}
