/* ============================================================
   MiEDS — AdminKit / Bootstrap 5 Override
   Paleta Copec Oficial + Efectos
   Cargar DESPUÉS de app.css
   ============================================================ */

/* ============================================================
   0. BOOTSTRAP ROOT VARIABLES — Copec Rebrand
   Override :root to match AdminKit's `:root,[data-bs-theme=light]`
   ============================================================ */
:root,
[data-bs-theme="light"] {
  /* Copec Primary = Blue 293 C */
  --bs-primary: #0046AD;
  --bs-primary-rgb: 0, 70, 173;
  --bs-primary-subtle: #809FD6;
  --bs-primary-subtle-rgb: 128, 159, 214;
  --bs-primary-text-emphasis: #001C45;
  --bs-primary-bg-subtle: #CCE0F5;
  --bs-primary-border-subtle: #99C1EB;
  --bs-blue: #0046AD;

  /* Copec Danger = Red Bright Red C */
  --bs-danger: #E20A1F;
  --bs-danger-rgb: 226, 10, 31;
  --bs-danger-text-emphasis: #5A040C;
  --bs-danger-bg-subtle: #F9CED3;
  --bs-danger-border-subtle: #F39DA7;
  --bs-red: #E20A1F;

  /* Copec Secondary = Gray Cool Gray 11 C */
  --bs-secondary: #4D4F53;
  --bs-secondary-rgb: 77, 79, 83;

  /* Copec Success */
  --bs-success: #22c55e;
  --bs-success-rgb: 34, 197, 94;

  /* Copec Warning */
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;

  /* Copec Info = Blue lighter */
  --bs-info: #1A5EC0;
  --bs-info-rgb: 26, 94, 192;

  /* Link colors */
  --bs-link-color: #0046AD;
  --bs-link-color-rgb: 0, 70, 173;
  --bs-link-hover-color: #1A5EC0;
  --bs-link-hover-color-rgb: 26, 94, 192;

  /* Body */
  --bs-body-bg: #F5F5F7;
  --bs-body-color: #1A1C20;
  --bs-body-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bs-font-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-bs-theme="dark"] {
  --bs-primary: #4D8FE0;
  --bs-primary-rgb: 77, 143, 224;
  --bs-blue: #4D8FE0;
  --bs-danger: #EE3124;
  --bs-danger-rgb: 238, 49, 36;
  --bs-red: #EE3124;
  --bs-success: #22c55e;
  --bs-success-rgb: 34, 197, 94;
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;
  --bs-info: #4D8FE0;
  --bs-info-rgb: 77, 143, 224;

  /* Deep blue surfaces instead of AdminKit's gray (#202634, #293042) */
  --bs-body-bg: #001233;
  --bs-body-bg-rgb: 0, 18, 51;
  --bs-body-color: #adb5bd;
  --bs-body-color-rgb: 173, 181, 189;
  --bs-secondary-bg: #001845;
  --bs-secondary-bg-rgb: 0, 24, 69;
  --bs-tertiary-bg: #002566;
  --bs-tertiary-bg-rgb: 0, 37, 102;
  --bs-quaternary-bg: #003380;
  --bs-border-color: rgba(77, 79, 83, 0.3);
  --bs-emphasis-color: #F1F2F8;
  --bs-emphasis-color-rgb: 241, 242, 248;
  --bs-secondary-color: rgba(173, 181, 189, 0.75);

  /* Override AdminKit dark defaults */
  --bs-light: #001845;
  --bs-dark: #F1F2F8;
}


/* ============================================================
   1. SIDEBAR — Copec style (matches demo.html)
   Uses demo variables: --mieds-bg-card-solid, --mieds-border,
   --mieds-text-secondary, --mieds-bg-elevated, --mieds-primary
   app.js dynamically sets data-sidebar-theme, so we need all variants
   ============================================================ */

/* --- Sidebar container --- */
/* Default / dark page = navy */
.sidebar,
html[data-sidebar-theme="dark"] .sidebar {
  background: #001845 !important;
  border-right: 1px solid rgba(77, 79, 83, 0.2) !important;
}

.sidebar-content,
html[data-sidebar-theme="dark"] .sidebar-content {
  background: #001845 !important;
  padding: 0 10px !important;
}

.sidebar-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

/* Light page = white sidebar (like demo.html) — overrides data-sidebar-theme */
html[data-bs-theme="light"] .sidebar,
html[data-bs-theme="light"][data-sidebar-theme="dark"] .sidebar {
  background: #ffffff !important;
  border-right: 1px solid rgba(77, 79, 83, 0.15) !important;
}

html[data-bs-theme="light"] .sidebar-content,
html[data-bs-theme="light"][data-sidebar-theme="dark"] .sidebar-content {
  background: #ffffff !important;
  padding: 0 10px !important;
}

/* Colored sidebar = Copec Blue */
html[data-sidebar-theme="colored"] .sidebar,
html[data-sidebar-theme="colored"] .sidebar-content {
  background: #0046AD !important;
}

/* --- Sidebar brand/logo — gradient text like demo --- */
.sidebar-brand {
  background: transparent !important;
  padding: 20px 14px 16px !important;
  justify-content: flex-start !important;
}

.sidebar-brand span {
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  background: linear-gradient(90deg, #0046AD, #ffffff) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

html[data-bs-theme="light"] .sidebar-brand span {
  background: linear-gradient(90deg, #0046AD, #1A5EC0) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Gradient bar under logo (copec-gradient-bar) */
.sidebar-brand::after {
  content: "";
  display: block;
  height: 4px;
  margin-top: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, #E20A1F, #0046AD);
}

/* Sidebar SVG fill override */
.sidebar-brand svg {
  fill: #4D8FE0 !important;
}

.sidebar-brand svg path:first-child {
  fill: #809FD6 !important;
}

html[data-bs-theme="light"] .sidebar-brand svg {
  fill: #0046AD !important;
}

html[data-bs-theme="light"] .sidebar-brand svg path:first-child {
  fill: #4D8FE0 !important;
}

/* --- Sidebar nav links (mieds-nav-item style) --- */
/* Dark page defaults */
.sidebar-link,
a.sidebar-link {
  transition: all 150ms ease !important;
  border-radius: 10px !important;
  margin: 0 !important;
  padding: 10px 16px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #A0A5BE !important;
  position: relative;
}

.sidebar-link i,
.sidebar-link svg {
  color: #A0A5BE !important;
}

/* Hover — dark */
.sidebar-link:hover,
html[data-sidebar-theme="dark"] .sidebar-link:hover {
  background: rgba(0, 70, 173, 0.1) !important;
  color: #F1F2F8 !important;
}

.sidebar-link:hover i,
.sidebar-link:hover svg,
html[data-sidebar-theme="dark"] .sidebar-link:hover i,
html[data-sidebar-theme="dark"] .sidebar-link:hover svg {
  color: #F1F2F8 !important;
}

/* Light page = dark text on white sidebar (like demo screenshot) */
html[data-bs-theme="light"] .sidebar-link,
html[data-bs-theme="light"] a.sidebar-link {
  color: #4D4F53 !important;
}

html[data-bs-theme="light"] .sidebar-link i,
html[data-bs-theme="light"] .sidebar-link svg {
  color: #4D4F53 !important;
}

html[data-bs-theme="light"] .sidebar-link:hover {
  background: rgba(0, 70, 173, 0.04) !important;
  color: #1A1C20 !important;
}

html[data-bs-theme="light"] .sidebar-link:hover i,
html[data-bs-theme="light"] .sidebar-link:hover svg {
  color: #1A1C20 !important;
}

/* --- Active sidebar item (mieds-nav-item--active) --- */
/* Dark page */
.sidebar-item.active > .sidebar-link,
.sidebar-item.active .sidebar-link:hover,
html[data-sidebar-theme="dark"] .sidebar-item.active > .sidebar-link,
html[data-sidebar-theme="dark"] .sidebar-item.active .sidebar-link:hover {
  background: rgba(226, 10, 31, 0.1) !important;
  color: #EE3124 !important;
}

.sidebar-item.active > .sidebar-link i,
.sidebar-item.active > .sidebar-link svg,
.sidebar-item.active .sidebar-link:hover i,
.sidebar-item.active .sidebar-link:hover svg,
html[data-sidebar-theme="dark"] .sidebar-item.active > .sidebar-link i,
html[data-sidebar-theme="dark"] .sidebar-item.active > .sidebar-link svg {
  color: #EE3124 !important;
}

/* Light page */
html[data-bs-theme="light"] .sidebar-item.active > .sidebar-link,
html[data-bs-theme="light"] .sidebar-item.active .sidebar-link:hover {
  background: rgba(226, 10, 31, 0.08) !important;
  color: #E20A1F !important;
}

html[data-bs-theme="light"] .sidebar-item.active > .sidebar-link i,
html[data-bs-theme="light"] .sidebar-item.active > .sidebar-link svg,
html[data-bs-theme="light"] .sidebar-item.active .sidebar-link:hover i,
html[data-bs-theme="light"] .sidebar-item.active .sidebar-link:hover svg {
  color: #E20A1F !important;
}

/* Active indicator bar (left) — use ::after to avoid conflict with AdminKit collapse ::before */
.sidebar-item.active > .sidebar-link::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 6px !important;
  bottom: 6px !important;
  width: 3px !important;
  border-radius: 0 2px 2px 0 !important;
  background: #E20A1F !important;
  transform: none !important;
}

/* --- Sidebar header (sidebar-section style) --- */
.sidebar-header {
  text-transform: uppercase !important;
  font-size: 0.6rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  color: #7A7C82 !important;
  padding: 14px 14px 4px !important;
  opacity: 1 !important;
}

/* --- Sidebar dropdown items --- */
/* Dark page */
.sidebar-dropdown .sidebar-item.active .sidebar-link,
html[data-sidebar-theme="dark"] .sidebar-dropdown .sidebar-item.active .sidebar-link {
  color: #EE3124 !important;
  background: rgba(226, 10, 31, 0.1) !important;
}

/* Light page */
html[data-bs-theme="light"] .sidebar-dropdown .sidebar-item.active .sidebar-link {
  color: #E20A1F !important;
  background: rgba(226, 10, 31, 0.08) !important;
}

.sidebar-dropdown .sidebar-item .sidebar-link {
  font-size: 0.84rem !important;
  padding: 8px 16px 8px 28px !important;
  border-radius: 10px !important;
}

/* Dark page hover */
.sidebar-dropdown .sidebar-item .sidebar-link:hover,
html[data-sidebar-theme="dark"] .sidebar-dropdown .sidebar-item .sidebar-link:hover {
  color: #F1F2F8 !important;
  background: rgba(0, 70, 173, 0.1) !important;
}

/* Light page hover */
html[data-bs-theme="light"] .sidebar-dropdown .sidebar-item .sidebar-link:hover {
  color: #1A1C20 !important;
  background: rgba(0, 70, 173, 0.04) !important;
}

/* --- mieds-nav-item classes (from demo.html) --- */
.mieds-nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: all 150ms ease !important;
  position: relative !important;
}

.mieds-nav-item--active {
  background: rgba(226, 10, 31, 0.1) !important;
  color: #EE3124 !important;
}

.mieds-nav-item--active i,
.mieds-nav-item--active svg {
  color: #EE3124 !important;
}

.mieds-nav-item--active::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 6px !important;
  bottom: 6px !important;
  width: 3px !important;
  border-radius: 0 2px 2px 0 !important;
  background: #E20A1F !important;
  transform: none !important;
}

html[data-bs-theme="light"] .mieds-nav-item--active {
  background: rgba(226, 10, 31, 0.08) !important;
  color: #E20A1F !important;
}

html[data-bs-theme="light"] .mieds-nav-item--active i,
html[data-bs-theme="light"] .mieds-nav-item--active svg {
  color: #E20A1F !important;
}

/* mieds-nav-item--highlight (Copec Blue accent) */
.mieds-nav-item--highlight {
  background: rgba(0, 70, 173, 0.08) !important;
  color: #0046AD !important;
}

.mieds-nav-item--highlight i,
.mieds-nav-item--highlight svg {
  color: #0046AD !important;
}

.mieds-nav-item--highlight::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 6px !important;
  bottom: 6px !important;
  width: 3px !important;
  border-radius: 0 2px 2px 0 !important;
  background: #0046AD !important;
  transform: none !important;
}

/* Badge in sidebar */
.badge-sidebar-primary,
html[data-sidebar-theme="dark"] .badge-sidebar-primary {
  background: #0046AD !important;
}

html[data-sidebar-theme="light"] .badge-sidebar-primary {
  background: #0046AD !important;
}

/* CTA in sidebar */
.sidebar-cta-content {
  background: #002566 !important;
}


/* ============================================================
   2. CARDS — Elevation + Subtle effects
   AdminKit sets --bs-card-border-width: 0 by default
   ============================================================ */
.card {
  --bs-card-border-color: rgba(77, 79, 83, 0.15);
  --bs-card-border-width: 1px;
  --bs-card-bg: #ffffff;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06),
              0 1px 3px rgba(0, 0, 0, 0.08) !important;
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1),
              0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

/* Card with Copec accent border */
.card.border-primary {
  border-left: 4px solid #0046AD !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

.card.border-danger {
  border-left: 4px solid #E20A1F !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

.card.border-success {
  border-left: 4px solid #22c55e !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

.card.border-warning {
  border-left: 4px solid #f59e0b !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

/* Card header */
.card-header {
  border-bottom-color: rgba(77, 79, 83, 0.08) !important;
}

[data-bs-theme="dark"] .card {
  --bs-card-bg: #001845;
  --bs-card-border-color: rgba(77, 79, 83, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2),
              0 1px 3px rgba(0, 0, 0, 0.15) !important;
}

[data-bs-theme="dark"] .card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3),
              0 2px 6px rgba(0, 0, 0, 0.2) !important;
}


/* ============================================================
   3. BUTTONS — Copec Colors + Glow hover
   ============================================================ */
.btn-primary {
  --bs-btn-bg: #0046AD;
  --bs-btn-border-color: #0046AD;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1A5EC0;
  --bs-btn-hover-border-color: #1A5EC0;
  --bs-btn-focus-shadow-rgb: 0, 70, 173;
  --bs-btn-active-bg: #003A8F;
  --bs-btn-active-border-color: #003380;
  --bs-btn-disabled-bg: #0046AD;
  --bs-btn-disabled-border-color: #0046AD;
  transition: all 150ms ease !important;
}

.btn-primary:hover {
  box-shadow: 0 0 12px rgba(0, 70, 173, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-danger {
  --bs-btn-bg: #E20A1F;
  --bs-btn-border-color: #E20A1F;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #B50818;
  --bs-btn-hover-border-color: #B50818;
  --bs-btn-focus-shadow-rgb: 226, 10, 31;
  --bs-btn-active-bg: #9A0714;
  --bs-btn-active-border-color: #9A0714;
  --bs-btn-disabled-bg: #E20A1F;
  --bs-btn-disabled-border-color: #E20A1F;
  transition: all 150ms ease !important;
}

.btn-danger:hover {
  box-shadow: 0 0 12px rgba(226, 10, 31, 0.3);
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-success {
  --bs-btn-bg: #22c55e;
  --bs-btn-border-color: #22c55e;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1ba54e;
  --bs-btn-hover-border-color: #1ba54e;
  transition: all 150ms ease !important;
}

.btn-success:hover {
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
  transform: translateY(-1px);
}

.btn-warning {
  --bs-btn-bg: #f59e0b;
  --bs-btn-border-color: #f59e0b;
  --bs-btn-hover-bg: #d48a09;
  --bs-btn-hover-border-color: #d48a09;
  transition: all 150ms ease !important;
}

.btn-info {
  --bs-btn-bg: #1A5EC0;
  --bs-btn-border-color: #1A5EC0;
  --bs-btn-hover-bg: #0046AD;
  --bs-btn-hover-border-color: #0046AD;
  transition: all 150ms ease !important;
}

/* Copec Red button (special) */
.btn-copec-red {
  --bs-btn-color: #fff;
  --bs-btn-bg: #EE3124;
  --bs-btn-border-color: #EE3124;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #E20A1F;
  --bs-btn-hover-border-color: #E20A1F;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #B50818;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  transition: all 150ms ease;
}

.btn-copec-red:hover {
  box-shadow: 0 0 12px rgba(226, 10, 31, 0.3);
  transform: translateY(-1px);
}

/* Outline variants */
.btn-outline-primary {
  --bs-btn-color: #0046AD;
  --bs-btn-border-color: #0046AD;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0046AD;
  --bs-btn-hover-border-color: #0046AD;
  --bs-btn-active-bg: #003A8F;
  --bs-btn-active-border-color: #003380;
}

.btn-outline-danger {
  --bs-btn-color: #E20A1F;
  --bs-btn-border-color: #E20A1F;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #E20A1F;
  --bs-btn-hover-border-color: #E20A1F;
  --bs-btn-active-bg: #B50818;
  --bs-btn-active-border-color: #B50818;
}

.btn-outline-success {
  --bs-btn-color: #22c55e;
  --bs-btn-border-color: #22c55e;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #22c55e;
  --bs-btn-hover-border-color: #22c55e;
}

/* All buttons — subtle lift */
.btn {
  transition: all 150ms ease !important;
  border-radius: 8px;
}

.btn:focus-visible {
  outline: 2px solid #0046AD;
  outline-offset: 2px;
}


/* ============================================================
   4. TABLES — Status rows + Copec accents
   DataTables v2 BS5 wraps table in div.dt-container.
   We kill DT box-shadow and use background-color directly.
   ============================================================ */
.table {
  --bs-table-border-color: rgba(77, 79, 83, 0.1);
}

/* --- Rounded wrapper ---
   DT restructures DOM: .mieds-table-wrap > div.dt-container > ... > table
   overflow:hidden on the wrapper clips everything inside */
.mieds-table-wrap {
  border: 1px solid rgba(77, 79, 83, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

[data-bs-theme="dark"] .mieds-table-wrap {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--bs-body-bg);
}

.mieds-table-wrap .table {
  margin-bottom: 0;
  border: none;
}

/* Remove DT bottom margin & table border inside wrapper */
.mieds-table-wrap .dt-container .table {
  margin-bottom: 0 !important;
}

/* DT pagination/info bar inside wrapper — slight padding */
.mieds-table-wrap .dt-container .dt-layout-row:last-child {
  padding: 8px 16px;
}

/* --- Force white background at every level --- */
table.table.dataTable,
table.table.dataTable > tbody,
table.table.dataTable > tbody > tr,
table.table.dataTable > tbody > tr > * {
  background-color: #ffffff !important;
  box-shadow: none !important;
}

table.table.dataTable > tbody > tr > * {
  transition: background-color 150ms ease;
}

[data-bs-theme="dark"] table.table.dataTable,
[data-bs-theme="dark"] table.table.dataTable > tbody,
[data-bs-theme="dark"] table.table.dataTable > tbody > tr,
[data-bs-theme="dark"] table.table.dataTable > tbody > tr > * {
  background-color: #202634 !important;
}

table.table.dataTable > tbody > tr:hover > * {
  background-color: rgba(0, 70, 173, 0.05) !important;
}

[data-bs-theme="dark"] table.table.dataTable > tbody > tr:hover > * {
  background-color: rgba(0, 70, 173, 0.1) !important;
}

/* --- thead --- */
table.table.dataTable > thead > tr > th {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: var(--bs-secondary) !important;
  background-color: rgba(0, 70, 173, 0.04) !important;
  border-bottom: 1px solid rgba(77, 79, 83, 0.12) !important;
}

[data-bs-theme="dark"] table.table.dataTable > thead > tr > th {
  background-color: rgba(0, 70, 173, 0.1) !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

/* --- tbody rows — consistent height --- */
table.table.dataTable > tbody > tr > td {
  vertical-align: middle;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(77, 79, 83, 0.08);
}

/* --- Status row classes --- */
table.table.dataTable > tbody > tr.row-active {
  border-left: 3px solid #22c55e;
}

table.table.dataTable > tbody > tr.row-pending {
  border-left: 3px solid #f59e0b;
}

table.table.dataTable > tbody > tr.row-urgent {
  border-left: 3px solid #E20A1F;
}

table.table.dataTable > tbody > tr.row-urgent > * {
  background-color: rgba(226, 10, 31, 0.03) !important;
}

table.table.dataTable > tbody > tr.row-urgent:hover > * {
  background-color: rgba(226, 10, 31, 0.07) !important;
}

table.table.dataTable > tbody > tr.row-info {
  border-left: 3px solid #0046AD;
}


/* ============================================================
   5. BADGES — Copec palette
   Override --bs-badge-border-radius to force pill shape
   Override badge-subtle-* (AdminKit naming) with Copec colors
   ============================================================ */
.badge {
  --bs-badge-border-radius: 9999px !important;
  border-radius: 9999px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

.bg-primary,
.badge.bg-primary {
  background-color: #0046AD !important;
}

.bg-danger,
.badge.bg-danger {
  background-color: #E20A1F !important;
}

.bg-success,
.badge.bg-success {
  background-color: #22c55e !important;
}

.bg-warning,
.badge.bg-warning {
  background-color: #f59e0b !important;
}

.bg-info,
.badge.bg-info {
  background-color: #1A5EC0 !important;
}

.bg-secondary,
.badge.bg-secondary {
  background-color: #4D4F53 !important;
}

/* AdminKit badge-subtle-* overrides (hardcoded in AdminKit) */
.badge-subtle-primary {
  background-color: rgba(0, 70, 173, 0.175) !important;
  color: #0046AD !important;
}

.badge-subtle-danger {
  background-color: rgba(226, 10, 31, 0.175) !important;
  color: #E20A1F !important;
}

.badge-subtle-success {
  background-color: rgba(34, 197, 94, 0.175) !important;
  color: #22c55e !important;
}

.badge-subtle-warning {
  background-color: rgba(245, 158, 11, 0.175) !important;
  color: #f59e0b !important;
}

.badge-subtle-info {
  background-color: rgba(26, 94, 192, 0.175) !important;
  color: #1A5EC0 !important;
}

.badge-subtle-secondary {
  background-color: rgba(77, 79, 83, 0.175) !important;
  color: #4D4F53 !important;
}

/* Soft badges (custom addition — alias for badge-subtle but lighter) */
.badge-soft-primary {
  background: rgba(0, 70, 173, 0.1) !important;
  color: #0046AD !important;
}

.badge-soft-danger {
  background: rgba(226, 10, 31, 0.1) !important;
  color: #E20A1F !important;
}

.badge-soft-success {
  background: rgba(34, 197, 94, 0.1) !important;
  color: #22c55e !important;
}

.badge-soft-warning {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #d48a09 !important;
}

.badge-soft-info {
  background: rgba(0, 70, 173, 0.08) !important;
  color: #1A5EC0 !important;
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4D4F53;
  margin-right: 4px;
  flex-shrink: 0;
}

.status-dot--active  { background: #22c55e; box-shadow: 0 0 5px rgba(34, 197, 94, 0.5); }
.status-dot--pending { background: #f59e0b; box-shadow: 0 0 5px rgba(245, 158, 11, 0.5); }
.status-dot--urgent  { background: #E20A1F; box-shadow: 0 0 5px rgba(226, 10, 31, 0.5); animation: mieds-dot-pulse 1.5s ease-in-out infinite; }
.status-dot--info    { background: #0046AD; box-shadow: 0 0 5px rgba(0, 70, 173, 0.5); }

@keyframes mieds-dot-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(226, 10, 31, 0.4); }
  50%      { box-shadow: 0 0 12px rgba(226, 10, 31, 0.7), 0 0 20px rgba(226, 10, 31, 0.3); }
}


/* ============================================================
   6. ALERTS — Copec colors
   ============================================================ */
.alert-primary {
  --bs-alert-color: #002D70;
  --bs-alert-bg: #CCE0F5;
  --bs-alert-border-color: #99C1EB;
}

.alert-danger {
  --bs-alert-color: #7A0613;
  --bs-alert-bg: #F9CED3;
  --bs-alert-border-color: #F39DA7;
}

.alert-success {
  --bs-alert-color: #0e5e2e;
  --bs-alert-bg: #d4f4df;
  --bs-alert-border-color: #a8e9be;
}


/* ============================================================
   7. NAVBAR / HEADER — Glassmorphism
   AdminKit uses .navbar-bg for background color
   ============================================================ */
.navbar {
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(77, 79, 83, 0.08) !important;
  transition: all 250ms ease;
}

/* Override AdminKit's .navbar-bg background */
.navbar.navbar-bg,
.navbar-bg {
  background: rgba(255, 255, 255, 0.85) !important;
}

[data-bs-theme="dark"] .navbar.navbar-bg,
[data-bs-theme="dark"] .navbar-bg {
  background: rgba(0, 24, 69, 0.7) !important;
}

[data-bs-theme="light"] .navbar.navbar-bg,
[data-bs-theme="light"] .navbar-bg {
  background: rgba(255, 255, 255, 0.85) !important;
}

/* Hamburger color */
.sidebar-toggle:hover .hamburger,
.sidebar-toggle:hover .hamburger:before,
.sidebar-toggle:hover .hamburger:after {
  background: #0046AD !important;
}


/* ============================================================
   8. MODAL — Backdrop blur + scale animation
   ============================================================ */
.modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  border-radius: 16px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
  animation: mieds-modal-in 200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes mieds-modal-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

[data-bs-theme="dark"] .modal-content {
  background-color: #001845 !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}


/* ============================================================
   9. FORMS — Copec focus ring
   ============================================================ */
.form-control:focus,
.form-select:focus {
  border-color: #0046AD !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 70, 173, 0.15) !important;
}

.form-check-input:checked {
  background-color: #0046AD !important;
  border-color: #0046AD !important;
}

.form-check-input:focus {
  border-color: #0046AD !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 70, 173, 0.15) !important;
}


/* ============================================================
   10. NAV TABS / PILLS — Copec active
   ============================================================ */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: #0046AD !important;
}

.nav-link {
  transition: color 150ms ease, background 150ms ease;
  border-radius: 6px;
}

.nav-tabs .nav-link.active {
  border-bottom-color: #0046AD !important;
  color: #0046AD !important;
  font-weight: 600;
}


/* ============================================================
   11. PROGRESS BAR — Copec gradient
   ============================================================ */
.progress-bar {
  background-color: #0046AD !important;
}

.progress-bar.bg-gradient-copec,
.progress-bar-copec {
  background: linear-gradient(90deg, #E20A1F, #0046AD) !important;
}


/* ============================================================
   12. PAGINATION — Copec
   ============================================================ */
.page-link {
  transition: all 150ms ease;
  border-radius: 6px;
}

.page-item.active .page-link {
  background-color: #0046AD !important;
  border-color: #0046AD !important;
}

/* DataTables pagination override */
.dataTables_wrapper .page-item.active .page-link {
  background-color: #0046AD !important;
  border-color: #0046AD !important;
}


/* ============================================================
   13. TEXT COLOR UTILITIES — Copec
   ============================================================ */
.text-primary { color: #0046AD !important; }
.text-danger  { color: #E20A1F !important; }
.text-success { color: #22c55e !important; }
.text-warning { color: #f59e0b !important; }
.text-info    { color: #1A5EC0 !important; }

[data-bs-theme="dark"] .text-primary { color: #4D8FE0 !important; }
[data-bs-theme="dark"] .text-danger  { color: #EE3124 !important; }
[data-bs-theme="dark"] .text-info    { color: #4D8FE0 !important; }


/* ============================================================
   14. DARK MODE — Body & main area backgrounds
   AdminKit hardcodes bg on body and .main
   ============================================================ */
[data-bs-theme="dark"] body {
  background-color: #001233 !important;
}

[data-bs-theme="dark"] .main {
  background-color: #001233 !important;
}

[data-bs-theme="dark"] .content {
  background-color: transparent !important;
}

[data-bs-theme="dark"] .footer {
  background-color: transparent !important;
  border-top: 1px solid rgba(77, 79, 83, 0.15);
}

/* Dark dropdown menus */
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #001845 !important;
  border-color: rgba(77, 79, 83, 0.2) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: rgba(0, 70, 173, 0.12) !important;
}


/* ============================================================
   15. COPEC-SPECIFIC UTILITY CLASSES
   ============================================================ */

/* Gradient bar */
.copec-bar {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #E20A1F, #0046AD);
}

[data-bs-theme="light"] .copec-bar {
  background: linear-gradient(90deg, #0046AD, #C8D0E0);
}

/* Copec KPI card */
.card-copec-kpi {
  background: linear-gradient(135deg, #002566 0%, #0046AD 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 37, 102, 0.35),
              0 1px 4px rgba(0, 0, 0, 0.15) !important;
}

.card-copec-kpi:hover {
  box-shadow: 0 8px 24px rgba(0, 37, 102, 0.4),
              0 2px 6px rgba(0, 0, 0, 0.18) !important;
  transform: translateY(-2px);
}

.card-copec-kpi::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #E20A1F, #EE3124, transparent);
}

.card-copec-kpi::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 0%, transparent 70%);
}

.card-copec-kpi .card-body {
  position: relative;
  z-index: 1;
}

.card-copec-kpi .text-muted {
  color: rgba(255, 255, 255, 0.7) !important;
}

.card-copec-kpi h2,
.card-copec-kpi .h2 {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

.card-copec-kpi .text-success {
  color: #6ee7a0 !important;
}

.card-copec-kpi .badge {
  font-weight: 700;
}

/* Copec-branded left accent card */
.card-copec-accent {
  border-left: 4px solid #E20A1F !important;
  border-radius: 0 12px 12px 0 !important;
}

.card-copec-accent:hover {
  border-left-color: #EE3124 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06),
              -3px 0 10px rgba(226, 10, 31, 0.08) !important;
  transform: translateX(2px);
}

/* Gradient text Copec */
.text-gradient-copec {
  background: linear-gradient(90deg, #0046AD, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-bs-theme="light"] .text-gradient-copec {
  background: linear-gradient(90deg, #0046AD, #C8D0E0);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Copec progress with gradient */
.copec-progress .progress-bar {
  background: linear-gradient(90deg, #E20A1F, #0046AD) !important;
}

/* Status bar — vertical left bar on any element */
.copec-status-active  { border-left: 4px solid #22c55e !important; }
.copec-status-pending { border-left: 4px solid #f59e0b !important; }
.copec-status-urgent  { border-left: 4px solid #E20A1F !important; }
.copec-status-info    { border-left: 4px solid #0046AD !important; }

/* Glow on hover */
.copec-glow:hover { box-shadow: 0 0 20px rgba(0, 70, 173, 0.3), 0 0 40px rgba(0, 70, 173, 0.12) !important; }
.copec-glow-red:hover { box-shadow: 0 0 20px rgba(226, 10, 31, 0.3), 0 0 40px rgba(226, 10, 31, 0.12) !important; }
.copec-glow-success:hover { box-shadow: 0 0 20px rgba(34, 197, 94, 0.3), 0 0 40px rgba(34, 197, 94, 0.12) !important; }

/* Glow buttons */
.btn-glow-blue {
  --bs-btn-color: #fff;
  --bs-btn-bg: #0046AD;
  --bs-btn-border-color: #0046AD;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1A5EC0;
  --bs-btn-hover-border-color: #1A5EC0;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #003A8F;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-glow-blue:hover {
  box-shadow: 0 0 20px rgba(0, 70, 173, 0.4),
              0 0 40px rgba(0, 70, 173, 0.2);
  transform: translateY(-2px);
}

.btn-glow-blue:active {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(0, 70, 173, 0.3);
}

.btn-glow-green {
  --bs-btn-color: #fff;
  --bs-btn-bg: #22c55e;
  --bs-btn-border-color: #22c55e;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1ba54e;
  --bs-btn-hover-border-color: #1ba54e;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #168a40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-glow-green:hover {
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4),
              0 0 40px rgba(34, 197, 94, 0.2);
  transform: translateY(-2px);
}

.btn-glow-green:active {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.btn-glow-red {
  --bs-btn-color: #fff;
  --bs-btn-bg: #E20A1F;
  --bs-btn-border-color: #E20A1F;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #B50818;
  --bs-btn-hover-border-color: #B50818;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #9A0714;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-glow-red:hover {
  box-shadow: 0 0 20px rgba(226, 10, 31, 0.4),
              0 0 40px rgba(226, 10, 31, 0.2);
  transform: translateY(-2px);
}

.btn-glow-red:active {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(226, 10, 31, 0.3);
}

/* Glow pulsante */
.copec-pulse-blue {
  animation: copec-glow-pulse-blue 2s ease-in-out infinite;
}

@keyframes copec-glow-pulse-blue {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 70, 173, 0.2); }
  50%      { box-shadow: 0 0 28px rgba(0, 70, 173, 0.45),
                         0 0 56px rgba(0, 70, 173, 0.15); }
}

.copec-pulse-red {
  animation: copec-glow-pulse-red 2s ease-in-out infinite;
}

@keyframes copec-glow-pulse-red {
  0%, 100% { box-shadow: 0 0 12px rgba(226, 10, 31, 0.2); }
  50%      { box-shadow: 0 0 28px rgba(226, 10, 31, 0.45),
                         0 0 56px rgba(226, 10, 31, 0.15); }
}

.copec-pulse-green {
  animation: copec-glow-pulse-green 2s ease-in-out infinite;
}

@keyframes copec-glow-pulse-green {
  0%, 100% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.2); }
  50%      { box-shadow: 0 0 28px rgba(34, 197, 94, 0.45),
                         0 0 56px rgba(34, 197, 94, 0.15); }
}

/* Animated entry */
.copec-fade-in {
  animation: copec-fade-up 400ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes copec-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger children */
.copec-stagger > *:nth-child(1) { animation-delay: 0ms; }
.copec-stagger > *:nth-child(2) { animation-delay: 60ms; }
.copec-stagger > *:nth-child(3) { animation-delay: 120ms; }
.copec-stagger > *:nth-child(4) { animation-delay: 180ms; }
.copec-stagger > *:nth-child(5) { animation-delay: 240ms; }
.copec-stagger > *:nth-child(6) { animation-delay: 300ms; }
.copec-stagger > *:nth-child(7) { animation-delay: 360ms; }
.copec-stagger > *:nth-child(8) { animation-delay: 420ms; }

.copec-stagger > * {
  animation: copec-fade-up 400ms cubic-bezier(0.4, 0, 0.2, 1) both;
}


/* ============================================================
   16. LIST COMPONENT — Turnos, Facturas, Actividad
   ============================================================ */
.copec-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.copec-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(77, 79, 83, 0.08);
  transition: background 150ms ease;
}

.copec-list-item:last-child {
  border-bottom: none;
}

.copec-list-item:hover {
  background: rgba(0, 70, 173, 0.03);
}

/* Icon circle */
.copec-list-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  background: #0046AD;
}

.copec-list-icon--red     { background: #E20A1F; }
.copec-list-icon--green   { background: #22c55e; }
.copec-list-icon--warning { background: #f59e0b; }
.copec-list-icon--gray    { background: #4D4F53; }
.copec-list-icon--soft {
  background: rgba(0, 70, 173, 0.1);
  color: #0046AD;
}
.copec-list-icon--soft-red {
  background: rgba(226, 10, 31, 0.1);
  color: #E20A1F;
}
.copec-list-icon--soft-green {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

/* Content */
.copec-list-content {
  flex: 1;
  min-width: 0;
}

.copec-list-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin: 0;
  line-height: 1.3;
}

.copec-list-subtitle {
  font-size: 0.75rem;
  color: var(--bs-secondary);
  margin: 0;
  line-height: 1.4;
}

/* Right side */
.copec-list-end {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.copec-list-amount {
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--bs-body-color);
}

.copec-list-amount--danger {
  color: #E20A1F;
}

.copec-list-amount--success {
  color: #22c55e;
}

.copec-list-time {
  font-size: 0.65rem;
  color: var(--bs-secondary);
}

/* Status variant */
.copec-list-item--active {
  border-left: 3px solid #22c55e;
  padding-left: 13px;
}

.copec-list-item--pending {
  border-left: 3px solid #f59e0b;
  padding-left: 13px;
}

.copec-list-item--urgent {
  border-left: 3px solid #E20A1F;
  padding-left: 13px;
  background: rgba(226, 10, 31, 0.02);
}

.copec-list-item--urgent:hover {
  background: rgba(226, 10, 31, 0.05);
}

/* Clickable list item */
a.copec-list-item,
button.copec-list-item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border: none;
  width: 100%;
  background: none;
}

a.copec-list-item:hover,
button.copec-list-item:hover {
  background: rgba(0, 70, 173, 0.04);
}

/* Dark mode list */
[data-bs-theme="dark"] .copec-list-item {
  border-bottom-color: rgba(77, 79, 83, 0.15);
}

[data-bs-theme="dark"] .copec-list-item:hover {
  background: rgba(0, 70, 173, 0.08);
}

[data-bs-theme="dark"] .copec-list-icon--soft {
  background: rgba(0, 70, 173, 0.2);
}


/* ============================================================
   17. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(77, 79, 83, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(77, 79, 83, 0.35);
}


/* ============================================================
   18. MISC AdminKit OVERRIDES
   ============================================================ */

/* Indicator (notification dot) */
.indicator {
  background: #E20A1F !important;
}

/* Simplebar scrollbar in sidebar */
.simplebar-scrollbar::before {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* AdminKit stat component */
.stat {
  border-left-color: #0046AD !important;
}

/* Auth pages (login) */
.auth-full-page {
  background-color: #001233;
}

[data-bs-theme="light"] .auth-full-page {
  background-color: #F5F5F7;
}

/* Breadcrumb */
.breadcrumb-item a {
  color: #0046AD;
}

.breadcrumb-item.active {
  color: var(--bs-secondary);
}

/* List group */
.list-group-item {
  transition: background 150ms ease;
}

.list-group-item:hover {
  background: rgba(0, 70, 173, 0.03);
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #001845;
  border-color: rgba(77, 79, 83, 0.2);
}

[data-bs-theme="dark"] .list-group-item:hover {
  background-color: rgba(0, 70, 173, 0.1);
}

/* DataTables search/filter */
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: #0046AD !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 70, 173, 0.15) !important;
}


/* ============================================================
   19. PAGE TITLES — Demo-style section labels
   ============================================================ */
.content h1.h3 {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7A7C82 !important;
  margin-bottom: 14px !important;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(77, 79, 83, 0.2);
}

[data-bs-theme="dark"] .content h1.h3 {
  border-bottom-color: rgba(77, 79, 83, 0.15);
}

.content h1.h3 b {
  font-weight: 700 !important;
}


/* ============================================================
   20. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
