/* Cork Admin shell (carpeta template/) — layout boxed + menú lateral */

:root {
  --primary_50: #e8f4fc;
  --primary_100: #d9effc;
  --primary_500: #459DDD;
  --primary_600: #2f7fb8;
  --dark_500: #232248;
  --dark_400: #4B5563;
  --x_2: #F2F4F7;
  --x_4: #e2e6ee;
  --x_7: #4B5563;
  --x_11: #4B5563;
  --x_12: #232248;
}

body.cork-app {
  font-family: Montserrat, Helvetica, Arial, sans-serif;
  background: var(--x_2) !important;
  color: var(--x_11);
  letter-spacing: 0.02em;
}

body.cork-app h1,
body.cork-app h2,
body.cork-app .font-display {
  font-family: Montserrat, Helvetica, Arial, sans-serif !important;
  font-weight: 600;
  color: var(--dark_500);
}

body.cork-app .bg-navy h1,
body.cork-app .bg-navy h2,
body.cork-app .bg-navy .font-display,
body.cork-app .text-white.font-display,
body.cork-app .text-white .font-display {
  color: inherit;
}

/* Top bar */
.header-container {
  position: fixed;
  top: 16px;
  right: 16px;
  left: 292px;
  height: 64px;
  z-index: 50;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 40px 0 rgb(94 92 154 / 8%);
  padding: 0 1.25rem;
  gap: 0.75rem;
}

.header-container .btn-toggle {
  display: none;
  border: 0;
  background: var(--primary_50);
  color: var(--primary_500);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.header-container .header-crumb {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--x_7);
}

.header-container .header-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark_500);
  margin: 0;
}

.header-container .header-spacer {
  flex: 1;
}

.header-container .btn-lock {
  border: 1px solid var(--x_4);
  background: #fff;
  color: var(--dark_500);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
}

.header-container .btn-lock:hover {
  background: var(--primary_50);
  border-color: var(--primary_500);
  color: var(--primary_600);
}

.header-container .btn-theme,
.login-theme-wrap .btn-theme {
  width: 38px;
  height: 38px;
  border: 1px solid var(--x_4);
  background: #fff;
  color: var(--dark_500);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-container .btn-theme:hover,
.login-theme-wrap .btn-theme:hover {
  background: var(--primary_50);
  border-color: var(--primary_500);
  color: var(--primary_600);
}

.btn-theme .icon-sun {
  display: none;
}

html.dark .btn-theme .icon-moon {
  display: none;
}

html.dark .btn-theme .icon-sun {
  display: block;
}

.login-theme-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 70;
}

/* Sidebar */
body.cork-app [data-nav],
.sidebar-wrapper {
  position: fixed;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 260px;
  z-index: 60;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 40px 0 rgb(94 92 154 / 8%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-wrapper #sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.theme-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.15rem 1.1rem 0.9rem;
  border-bottom: 1px solid var(--x_4);
}

.theme-brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--dark_500);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-brand .brand-text {
  min-width: 0;
}

.theme-brand .brand-text a {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark_500);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.theme-brand .brand-text span {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary_500);
  margin-top: 2px;
}

.menu-categories {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.7rem 1rem;
  overflow-y: auto;
  flex: 1;
}

.menu-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.6rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--x_7);
}

.menu-heading svg {
  width: 12px;
  height: 12px;
}

.menu-categories .menu a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--x_11);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.menu-categories .menu a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}

.menu-categories .menu a:hover {
  background: var(--primary_50);
  color: var(--primary_600);
}

.menu-categories .menu.active a {
  background: var(--primary_500);
  color: #fff;
  font-weight: 600;
}

.sidebar-foot {
  padding: 0.75rem;
  border-top: 1px solid var(--x_4);
}

.sidebar-foot .btn-lock {
  width: 100%;
  border: 1px solid var(--x_4);
  background: var(--x_2);
  color: var(--dark_500);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}

.sidebar-foot .btn-lock:hover {
  background: #fbeced;
  border-color: #e67980;
  color: #db4049;
}

/* Content offset */
body.cork-app > .flex {
  display: block !important;
  min-height: 100vh;
}

body.cork-app > .flex > main,
body.cork-app .cork-main {
  margin-left: 292px;
  padding: 96px 20px 28px 8px !important;
  min-height: 100vh;
}

body.cork-app .cork-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(14 23 38 / 45%);
  z-index: 55;
}

body.cork-app.sidebar-open .cork-overlay {
  display: block;
}

@media (max-width: 991px) {
  .header-container {
    left: 16px;
  }

  .header-container .btn-toggle {
    display: inline-flex;
  }

  body.cork-app [data-nav],
  .sidebar-wrapper {
    transform: translateX(-120%);
    transition: transform 0.2s ease;
  }

  body.cork-app.sidebar-open [data-nav] {
    transform: none;
  }

  body.cork-app > .flex > main,
  body.cork-app .cork-main {
    margin-left: 0;
    padding: 96px 16px 24px !important;
  }
}

.list-unstyled {
  padding-left: 0;
  margin: 0;
}

body.cork-app h1 {
  font-size: 1.75rem !important;
  letter-spacing: -0.02em;
}

body.cork-app .thread {
  max-height: calc(100vh - 22rem);
}

/* Login */
body.cork-login {
  font-family: Montserrat, Helvetica, Arial, sans-serif;
  background: var(--x_2) !important;
}

body.cork-login .cork-login-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 40px 0 rgb(94 92 154 / 12%);
}

/* Dark mode — paleta MultiRL sobre navy */
html.dark {
  color-scheme: dark;
  --primary_50: #2c2b5a;
  --primary_100: #232248;
  --dark_500: #f3f4f8;
  --dark_400: #cbd5e1;
  --x_2: #16152a;
  --x_4: #2e2d4a;
  --x_7: #9ca3af;
  --x_11: #d1d5db;
  --x_12: #f3f4f8;
}

html.dark body,
html.dark body.cork-app,
html.dark body.cork-login {
  background: var(--x_2) !important;
  color: var(--x_11);
}

html.dark body.cork-app h1,
html.dark body.cork-app h2,
html.dark body.cork-app .font-display {
  color: var(--dark_500);
}

html.dark .header-container,
html.dark .sidebar-wrapper,
html.dark body.cork-app [data-nav] {
  background: #1e1d36;
  box-shadow: 0 0 40px 0 rgb(0 0 0 / 35%);
}

html.dark .header-container .btn-lock,
html.dark .header-container .btn-theme,
html.dark .login-theme-wrap .btn-theme {
  background: #16152a;
  border-color: var(--x_4);
  color: var(--dark_500);
}

html.dark .header-container .btn-lock:hover,
html.dark .header-container .btn-theme:hover,
html.dark .login-theme-wrap .btn-theme:hover {
  background: var(--primary_50);
  color: #7cc7f5;
}

html.dark .sidebar-foot .btn-lock {
  background: #16152a;
  border-color: var(--x_4);
  color: var(--dark_500);
}

html.dark .cork-login-card {
  background: #1e1d36;
}

html.dark .bg-white {
  background-color: #1e1d36 !important;
}

html.dark .bg-tech {
  background-color: #16152a !important;
}

html.dark .text-navy {
  color: #e8e8f0 !important;
}

html.dark .text-mute,
html.dark .text-mute-soft {
  color: #9ca3af !important;
}

html.dark .border-tech-line {
  border-color: #2e2d4a !important;
}

html.dark .bg-innov-soft {
  background-color: #2c2b5a !important;
}

html.dark .text-innov-dark {
  color: #7cc7f5 !important;
}

html.dark .shadow-card,
html.dark .shadow-soft {
  box-shadow: 0 10px 40px -18px rgb(0 0 0 / 55%) !important;
}

html.dark .bg-navy,
html.dark .bg-navy .text-navy,
html.dark .bg-navy .font-display {
  color: #fff !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  color-scheme: dark;
}

html.dark table thead {
  color: #9ca3af;
}

html.dark body.cork-app .bg-navy h1,
html.dark body.cork-app .bg-navy h2,
html.dark body.cork-app .bg-navy .font-display,
html.dark .bg-navy .text-white {
  color: #fff !important;
}

.usage-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .usage-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .usage-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.usage-kpi {
  border: 1px solid var(--x_4);
  background: var(--x_2);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
}

.usage-kpi p {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary_500);
}

.usage-kpi strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark_500);
}

.usage-kpi span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--x_7);
}

.usage-range {
  display: inline-flex;
  border: 1px solid var(--x_4);
  border-radius: 0.7rem;
  overflow: hidden;
}

.usage-range button {
  background: transparent;
  border: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--x_7);
  cursor: pointer;
}

.usage-range button.is-active {
  background: var(--primary_500);
  color: #fff;
}

.usage-chart-wrap {
  position: relative;
  height: 280px;
}

.usage-chart-wrap--sm {
  height: 240px;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.usage-table th,
.usage-table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--x_4);
  text-align: left;
}

.usage-table th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--x_7);
}

html.dark .usage-kpi,
html.dark .usage-range {
  background: #16152a;
  border-color: #2e2d4a;
}

html.dark .usage-range button.is-active {
  background: var(--primary_500);
  color: #fff;
}
