:root {
  --is-navy: #073578;
  --is-navy-deep: #05285a;
  --is-blue: #0a4f9c;
  --is-cyan: #4db8e8;
  --is-sky: #caeBf6;
  --is-mist: #eef4fa;
  --is-surface: #f5f8fc;
  --is-text: #1a2b3c;
  --is-muted: #5b6b7c;
  --is-radius: 14px;
  --is-shadow: 0 10px 30px rgba(7, 53, 120, 0.08);
  --is-shadow-sm: 0 4px 14px rgba(7, 53, 120, 0.06);
  --bs-primary: #073578;
  --bs-primary-rgb: 7, 53, 120;
  --bs-link-color: #0a4f9c;
  --bs-link-hover-color: #073578;
  --bs-body-font-family: "Source Sans 3", "Manrope", system-ui, sans-serif;
  --bs-body-bg: var(--is-surface);
  --bs-body-color: var(--is-text);
}

html,
body {
  font-family: var(--bs-body-font-family);
  color: var(--is-text);
  background: var(--is-surface);
}

body.is-theme {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(77, 184, 232, 0.18), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(7, 53, 120, 0.10), transparent 55%),
    linear-gradient(180deg, #f7fbff 0%, var(--is-surface) 45%, #eef3f8 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, .brand-text, .app-content-header h3, .app-content-header h4 {
  font-family: "Manrope", "Source Sans 3", sans-serif;
  letter-spacing: -0.02em;
}

/* Navbar */
.is-navbar {
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(7, 53, 120, 0.08);
  box-shadow: var(--is-shadow-sm);
  min-height: 64px;
}

.is-navbar .nav-link {
  color: var(--is-navy) !important;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.45rem 0.85rem !important;
  transition: background-color .2s ease, color .2s ease;
}

.is-navbar .nav-link:hover,
.is-navbar .nav-link.active {
  background: rgba(7, 53, 120, 0.08);
  color: var(--is-blue) !important;
}

/* Menú de notificaciones: más ancho y badge en la misma línea */
.is-notifications-menu.dropdown-menu-lg {
  min-width: 380px;
  max-width: 420px;
  width: max-content;
}

.is-notification-item {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  white-space: nowrap;
}

.is-notification-item__content {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.is-notification-item__text {
  white-space: nowrap;
}

.is-notification-item__badge {
  flex: 0 0 auto;
  margin-left: 0.5rem;
}

.is-sidebar-toggle {
  font-size: 1.35rem;
  color: var(--is-navy) !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(7, 53, 120, 0.15);
}

@media (max-width: 991.98px) {
  .app-header {
    z-index: 1040;
  }

  .is-sidebar-toggle {
    position: relative;
    z-index: 1045;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .sidebar-expand-lg .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1038;
    margin-left: calc(var(--lte-sidebar-width, 250px) * -1);
  }

  .sidebar-expand-lg.sidebar-open .app-sidebar {
    margin-left: 0;
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar-expand-lg.sidebar-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1036;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.35);
  }
}

.is-brand-cluster {
  gap: 0.55rem;
  margin-right: 0.75rem;
}

.is-brand-logo img {
  height: 36px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(7, 53, 120, 0.12));
  transition: transform .2s ease;
}

.is-brand-logo:hover img {
  transform: translateY(-1px) scale(1.02);
}

.is-brand-logo--compact img {
  height: 28px;
  max-width: 110px;
}

.is-brand-sep {
  width: 1px;
  height: 24px;
  background: linear-gradient(180deg, transparent, rgba(7, 53, 120, 0.25), transparent);
}

.is-user-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.is-user-toggle .user-image {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 2px solid rgba(77, 184, 232, 0.55);
}

.is-user-header {
  background: linear-gradient(135deg, var(--is-navy) 0%, var(--is-blue) 55%, var(--is-cyan) 140%) !important;
}

/* Sidebar */
.is-sidebar {
  background:
    linear-gradient(180deg, var(--is-navy-deep) 0%, var(--is-navy) 42%, #0a3f86 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.is-sidebar.is-sidebar-development {
  background:
    linear-gradient(180deg, #5c1010 0%, #8b1a1a 42%, #b42323 100%) !important;
}

.is-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem !important;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.is-sidebar-logo {
  height: 42px !important;
  width: auto !important;
  max-width: 150px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 0.25rem 0.4rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.is-sidebar-brand-text {
  color: #fff !important;
  font-family: "Manrope", sans-serif;
  font-weight: 700 !important;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.is-sidebar .sidebar-menu .nav-header {
  color: rgba(202, 235, 246, 0.75);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.75rem;
}

.is-sidebar .sidebar-menu .nav-link {
  color: rgba(255, 255, 255, 0.86);
  border-radius: 10px;
  margin: 0.15rem 0.55rem;
  transition: background-color .2s ease, transform .2s ease;
}

.is-sidebar .sidebar-menu .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.is-sidebar .sidebar-menu .nav-link.active {
  background: linear-gradient(90deg, rgba(77, 184, 232, 0.28), rgba(255, 255, 255, 0.08));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--is-cyan);
}

.is-sidebar .nav-icon {
  color: var(--is-sky);
}

/* Content */
.app-main {
  min-height: calc(100vh - 120px);
}

.app-content-header {
  padding-top: 1.1rem;
}

.app-content-header h3,
.app-content-header h4 {
  color: var(--is-navy);
}

.app-content .card,
.card.card-outline {
  border: 1px solid rgba(7, 53, 120, 0.08);
  border-radius: var(--is-radius);
  box-shadow: var(--is-shadow);
  /* visible: evita que v-select/dropdowns queden recortados por la card */
  overflow: visible;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

.card.card-outline.card-primary {
  border-top: 3px solid var(--is-cyan);
}

.card-header {
  background: linear-gradient(180deg, #fff, var(--is-mist));
  border-bottom: 1px solid rgba(7, 53, 120, 0.06);
}

.btn-primary {
  --bs-btn-bg: var(--is-navy);
  --bs-btn-border-color: var(--is-navy);
  --bs-btn-hover-bg: var(--is-blue);
  --bs-btn-hover-border-color: var(--is-blue);
  --bs-btn-active-bg: var(--is-navy-deep);
  --bs-btn-active-border-color: var(--is-navy-deep);
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(7, 53, 120, 0.18);
}

.btn-secondary,
.btn-info,
.btn-outline-secondary {
  border-radius: 10px;
  font-weight: 600;
}

.form-control,
.form-select,
.VueTables__search-field input,
.v-select .vs__dropdown-toggle {
  border-radius: 10px !important;
  border-color: rgba(7, 53, 120, 0.15);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--is-cyan);
  box-shadow: 0 0 0 0.2rem rgba(77, 184, 232, 0.25);
}

.table {
  --bs-table-striped-bg: rgba(7, 53, 120, 0.03);
}

.badge {
  border-radius: 999px;
  font-weight: 600;
}

.purchase-criticality-orange {
  background-color: #fd7e14;
  color: #fff;
}

/* Multi-select de estados: una sola “pill” resumen, sin apilar chips */
.purchase-status-multiselect .vs__selected-options {
  flex-wrap: nowrap;
  overflow: hidden;
}
.purchase-status-multiselect .vs__selected {
  max-width: 100%;
  white-space: nowrap;
}

/* Footer */
.is-footer {
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(7, 53, 120, 0.08);
  padding: 0.85rem 1rem;
}

.is-footer-brands {
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.is-footer-brands img {
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  opacity: 0.9;
}

.is-footer-logo--acam {
  height: 22px !important;
}

.is-footer-meta {
  color: var(--is-muted);
  font-size: 0.9rem;
}

/* Vue tables polish */
.VueTables__table {
  border-radius: 12px;
  overflow: hidden;
}

.VueTables__search,
.VueTables__limit {
  margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 991.98px) {
  .is-brand-cluster {
    display: none !important;
  }

  .is-navbar-inner {
    padding-inline: 0.25rem;
  }

  .app-content-header h3,
  .app-content-header h4 {
    font-size: 1.15rem;
  }
}

@media (max-width: 575.98px) {
  .is-navbar .nav-link {
    padding: 0.4rem 0.55rem !important;
  }

  .card {
    border-radius: 12px;
  }
}

/* Existing calendar event colors */
.vuecal__event.recervetion1 {background-color: rgba(253, 156, 66, 0.9);border: 1px solid rgb(233, 136, 46);color: #fff;}
.vuecal__event.recervetion2 {background-color: rgba(90, 151, 221, 0.9);border: 1px solid rgb(90, 151, 221);color: #fff;}
.vuecal__event.recervetion3 {background-color: rgba(131, 238, 129, 0.9);border: 1px solid rgb(131, 238, 129);color: #fff;}
.vuecal__event.recervetion4 {background-color: rgba(105, 154, 222, 0.8);border: 2px solid rgba(65, 120, 196);color: #fff;}
.vuecal__event.recervetion5 {background-color: rgba(255, 102, 102, 0.9);border: 1px solid rgb(235, 82, 82);color: #fff;}
.vuecal__event-title {
  font-size: 1.8em;
  font-weight: bold;
  margin: 4px 0 8px;
}

/* Purchase analytics dashboard */
.purchase-dashboard .pd-kpi {
  border-radius: var(--is-radius);
  padding: 1rem 1.1rem;
  min-height: 112px;
  box-shadow: var(--is-shadow-sm);
  border: 1px solid rgba(7, 53, 120, 0.08);
  background: rgba(255, 255, 255, 0.92);
  height: 100%;
}

.purchase-dashboard .pd-kpi__label {
  font-size: 0.82rem;
  color: var(--is-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.purchase-dashboard .pd-kpi__value {
  font-family: "Manrope", "Source Sans 3", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--is-navy);
}

.purchase-dashboard .pd-kpi__hint {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--is-muted);
}

.purchase-dashboard .pd-kpi--navy { border-top: 3px solid var(--is-navy); }
.purchase-dashboard .pd-kpi--cyan { border-top: 3px solid var(--is-cyan); }
.purchase-dashboard .pd-kpi--info { border-top: 3px solid #0dcaf0; }
.purchase-dashboard .pd-kpi--warn { border-top: 3px solid #fd7e14; }
.purchase-dashboard .pd-kpi--ok { border-top: 3px solid #198754; }
.purchase-dashboard .pd-kpi--danger { border-top: 3px solid #dc3545; }

.purchase-dashboard .pd-card {
  overflow: visible;
}

.purchase-dashboard .pd-card .card-body {
  min-height: 260px;
}

.purchase-dashboard .pd-card .card-body.p-0 {
  min-height: 0;
}

.purchase-dashboard .pd-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--is-muted);
  background: var(--is-mist);
}

.purchase-dashboard .pd-table td {
  font-size: 0.9rem;
  vertical-align: middle;
}

.purchase-dashboard .pd-progress {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(7, 53, 120, 0.08);
}

/* Dark mode: sigue el esquema del navegador (prefers-color-scheme) */
html {
  color-scheme: light;
}

html[data-bs-theme="dark"] {
  color-scheme: dark;
  --is-navy: #8ec8f0;
  --is-navy-deep: #caeBf6;
  --is-blue: #4db8e8;
  --is-cyan: #4db8e8;
  --is-sky: #7ec8e8;
  --is-mist: #1c2533;
  --is-surface: #121820;
  --is-text: #e8eef5;
  --is-muted: #9aa8b8;
  --is-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --is-shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);
  --bs-body-bg: var(--is-surface);
  --bs-body-color: var(--is-text);
  --bs-tertiary-bg: #18202b;
  --bs-secondary-bg: #1c2533;
  --bs-border-color: rgba(255, 255, 255, 0.12);
}

html[data-bs-theme="dark"],
html[data-bs-theme="dark"] body,
html[data-bs-theme="dark"] body.is-theme {
  color: var(--is-text);
  background: var(--is-surface);
}

html[data-bs-theme="dark"] body.is-theme {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(77, 184, 232, 0.10), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(7, 53, 120, 0.22), transparent 55%),
    linear-gradient(180deg, #10151c 0%, var(--is-surface) 45%, #0e131a 100%);
  background-attachment: fixed;
}

html[data-bs-theme="dark"] .is-navbar {
  background: rgba(18, 24, 32, 0.92) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .is-navbar .nav-link {
  color: #d7e4f0 !important;
}

html[data-bs-theme="dark"] .is-navbar .nav-link:hover,
html[data-bs-theme="dark"] .is-navbar .nav-link.active {
  background: rgba(77, 184, 232, 0.16);
  color: #fff !important;
}

html[data-bs-theme="dark"] .is-sidebar-toggle {
  color: #d7e4f0 !important;
}

html[data-bs-theme="dark"] .app-content-header h3,
html[data-bs-theme="dark"] .app-content-header h4,
html[data-bs-theme="dark"] .app-content-header label,
html[data-bs-theme="dark"] .content-header h4,
html[data-bs-theme="dark"] .content-header label {
  color: var(--is-text);
}

html[data-bs-theme="dark"] .app-content .card,
html[data-bs-theme="dark"] .card.card-outline,
html[data-bs-theme="dark"] .card.card-widget,
html[data-bs-theme="dark"] .card {
  background: rgba(24, 32, 43, 0.96);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--is-text);
}

html[data-bs-theme="dark"] .card-header {
  background: linear-gradient(180deg, #1e2836, #18202b);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: var(--is-text);
}

html[data-bs-theme="dark"] .card-header h5,
html[data-bs-theme="dark"] .card-title,
html[data-bs-theme="dark"] .card-title label {
  color: var(--is-text);
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] input[type="date"].form-control,
html[data-bs-theme="dark"] input[type="text"].form-control,
html[data-bs-theme="dark"] textarea.form-control {
  background-color: #121820;
  color: var(--is-text);
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
  background-color: #121820;
  color: var(--is-text);
  border-color: var(--is-cyan);
}

html[data-bs-theme="dark"] .form-control::placeholder,
html[data-bs-theme="dark"] textarea.form-control::placeholder {
  color: #8a99a8;
}

html[data-bs-theme="dark"] .nav-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

html[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: var(--is-muted);
}

html[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: #18202b;
  color: var(--is-text);
  border-color: rgba(255, 255, 255, 0.12) rgba(255, 255, 255, 0.12) #18202b;
}

html[data-bs-theme="dark"] .table,
html[data-bs-theme="dark"] .VueTables__table,
html[data-bs-theme="dark"] table.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--is-text);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
  --bs-table-striped-color: var(--is-text);
  --bs-table-hover-bg: rgba(77, 184, 232, 0.12);
  --bs-table-hover-color: #fff;
  --bs-table-border-color: rgba(255, 255, 255, 0.12);
  color: var(--is-text);
  background-color: transparent;
}

html[data-bs-theme="dark"] .table > :not(caption) > * > *,
html[data-bs-theme="dark"] .VueTables__table > :not(caption) > * > * {
  background-color: var(--bs-table-bg);
  color: var(--bs-table-color);
  border-bottom-color: var(--bs-table-border-color);
}

html[data-bs-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .VueTables__table thead th,
html[data-bs-theme="dark"] .VueTables__heading {
  background-color: #121924 !important;
  color: #c5d4e4 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-bs-theme="dark"] .table tbody td,
html[data-bs-theme="dark"] .VueTables__table tbody td {
  color: var(--is-text);
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-bs-theme="dark"] .VueTables__search-field input,
html[data-bs-theme="dark"] .VueTables__search__input,
html[data-bs-theme="dark"] .VueTables__limit-field select,
html[data-bs-theme="dark"] .VueTables__limit select {
  background-color: #121820;
  color: var(--is-text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

html[data-bs-theme="dark"] .VueTables__search label,
html[data-bs-theme="dark"] .VueTables__limit label,
html[data-bs-theme="dark"] .VueTables__count,
html[data-bs-theme="dark"] .text-muted {
  color: var(--is-muted) !important;
}

html[data-bs-theme="dark"] .VuePagination .page-link,
html[data-bs-theme="dark"] .pagination .page-link {
  background-color: #18202b;
  color: #c5d4e4;
  border-color: rgba(255, 255, 255, 0.15);
}

html[data-bs-theme="dark"] .VuePagination .page-item.active .page-link,
html[data-bs-theme="dark"] .pagination .page-item.active .page-link {
  background-color: var(--is-blue);
  border-color: var(--is-blue);
  color: #fff;
}

html[data-bs-theme="dark"] .VuePagination .page-item.disabled .page-link,
html[data-bs-theme="dark"] .pagination .page-item.disabled .page-link {
  background-color: #121820;
  color: #6b7785;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .v-select .vs__dropdown-toggle {
  background-color: #121820;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--is-text);
}

html[data-bs-theme="dark"] .v-select .vs__selected,
html[data-bs-theme="dark"] .v-select .vs__search,
html[data-bs-theme="dark"] .v-select .vs__search:focus {
  color: var(--is-text);
  background: transparent;
}

html[data-bs-theme="dark"] .v-select .vs__open-indicator,
html[data-bs-theme="dark"] .v-select .vs__clear {
  fill: rgba(232, 238, 245, 0.65);
}

html[data-bs-theme="dark"] .v-select .vs__dropdown-menu {
  background: #1a2330;
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--is-text);
}

html[data-bs-theme="dark"] .v-select .vs__dropdown-option {
  color: var(--is-text);
}

html[data-bs-theme="dark"] .v-select .vs__dropdown-option--highlight {
  background: #0a4f9c;
  color: #fff;
}

html[data-bs-theme="dark"] .vs--single .vs__selected {
  color: var(--is-text);
}

html[data-bs-theme="dark"] .badge.text-bg-light,
html[data-bs-theme="dark"] .badge.text-bg-light.border {
  background-color: #2a3544 !important;
  color: #d7e4f0 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

html[data-bs-theme="dark"] .alert-light,
html[data-bs-theme="dark"] .alert-info {
  background-color: #1c2533;
  color: var(--is-text);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-bs-theme="dark"] .is-footer {
  background: rgba(18, 24, 32, 0.94);
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .dropdown-menu {
  background-color: #1a2330;
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--is-text);
}

html[data-bs-theme="dark"] .dropdown-item {
  color: var(--is-text);
}

html[data-bs-theme="dark"] .dropdown-item:hover,
html[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: rgba(77, 184, 232, 0.16);
  color: #fff;
}

html[data-bs-theme="dark"] .vm--modal {
  background-color: #18202b !important;
  color: var(--is-text);
}

html[data-bs-theme="dark"] .vm--overlay {
  background: rgba(0, 0, 0, 0.65) !important;
}

html[data-bs-theme="dark"] .purchase-dashboard .pd-kpi {
  background: rgba(24, 32, 43, 0.96);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .purchase-dashboard .pd-kpi__value {
  color: #e8eef5;
}

html[data-bs-theme="dark"] .purchase-dashboard .pd-table th {
  background: #121924;
  color: var(--is-muted);
}

html[data-bs-theme="dark"] .list-group-item {
  background-color: #18202b;
  color: var(--is-text);
  border-color: rgba(255, 255, 255, 0.10);
}
