/**
 * Tema POS Moda Express — modo oscuro, sin kit YashAdmin/Bootstrap.
 * Tokens alineados con app/views/template/README.md
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #452b90;
  --secondary: #f8b940;
  --secondary-dark: #f6a70f;
  --primary-hover: #321f69;
  --primary-dark: #0d081a;
  --rgba-primary-1: rgba(69, 43, 144, 0.1);
  --rgba-primary-2: rgba(69, 43, 144, 0.2);
  --rgba-primary-3: rgba(69, 43, 144, 0.3);
  --rgba-primary-4: rgba(69, 43, 144, 0.4);
  --rgba-primary-5: rgba(69, 43, 144, 0.5);
  --rgba-primary-6: rgba(69, 43, 144, 0.6);
  --rgba-primary-7: rgba(69, 43, 144, 0.7);
  --rgba-primary-8: rgba(69, 43, 144, 0.8);
  --rgba-primary-9: rgba(69, 43, 144, 0.9);
  --font-family-base: "Poppins", sans-serif;
  --font-family-title: "Poppins", sans-serif;
  --dz-sidebar-width: 15rem;
  --dz-header-height: 4.375rem;
  --dz-head-title-size: 1.25rem;
  --dz-sidebar-pos: absolute;
  --dz-header-pos: relative;
  --dz-side-nav-padding: 0.85rem 1.5rem;
  --dz-side-nav-size: 0.875rem;
  --dz-side-sub_nav-size: 0.85rem;
  --dz-side-menu-direction: column;
}

[data-theme-version="dark"] {
  --body-bg: #151c2c;
  --light: #151c2c;
  --bs-tertiary-bg: #151c2c;
  --card: #182237;
  --nav-headbg: #182237;
  --sidebar-bg: #182237;
  --headerbg: #182237;
  --border: rgba(255, 255, 255, 0.1);
  --bs-border-color: rgba(255, 255, 255, 0.1);
  --text-dark: #fff;
  --text-gray: #b3b3b3;
  --text: #828690;
}

[data-sidebar-position="fixed"] {
  --dz-sidebar-pos: fixed;
}

[data-header-position="fixed"] {
  --dz-header-pos: fixed;
}

html {
  font-size: 14px;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-gray);
  background-color: var(--body-bg);
  min-height: 100vh;
}

[data-theme-version="dark"] h1,
[data-theme-version="dark"] h2,
[data-theme-version="dark"] h3,
[data-theme-version="dark"] h4,
[data-theme-version="dark"] h5,
[data-theme-version="dark"] h6,
[data-theme-version="dark"] .h1,
[data-theme-version="dark"] .h2,
[data-theme-version="dark"] .h3,
[data-theme-version="dark"] .h4,
[data-theme-version="dark"] .h5,
[data-theme-version="dark"] .h6 {
  color: var(--text-dark);
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover);
}

.text-muted {
  color: var(--text) !important;
}

.text-danger {
  color: #ff5e5e !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-success {
  color: #3a9b94 !important;
}

.text-white {
  color: #fff !important;
}

.text-center {
  text-align: center !important;
}

.text-end {
  text-align: right !important;
}

.fw-bold {
  font-weight: 700 !important;
}

.fw-semibold {
  font-weight: 600 !important;
}

.fs-5 {
  font-size: 1.25rem !important;
}

.fs-6 {
  font-size: 1rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}
.mb-1 {
  margin-bottom: 0.25rem !important;
}
.mb-2 {
  margin-bottom: 0.5rem !important;
}
.mb-3 {
  margin-bottom: 1rem !important;
}
.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}
.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.p-2 {
  padding: 0.5rem !important;
}
.p-3 {
  padding: 1rem !important;
}

.rounded {
  border-radius: 0.375rem !important;
}

.float-end {
  float: right !important;
}

.w-100 {
  width: 100% !important;
}

.h-100 {
  height: 100% !important;
}

.position-relative {
  position: relative !important;
}

.position-absolute {
  position: absolute !important;
}

.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.25) !important;
}

.top-0 {
  top: 0;
}

.start-0 {
  left: 0;
}

.end-0 {
  right: 0;
}

.overflow-auto {
  overflow: auto !important;
}

.min-vh-100 {
  min-height: 100vh !important;
}

.d-flex {
  display: flex !important;
}

.d-grid {
  display: grid !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.navbar-collapse.justify-content-between {
  width: 100%;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}

.align-items-center {
  align-items: center !important;
}

.align-items-end {
  align-items: flex-end !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

/* Grid tipo Bootstrap */
.container-fluid {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

.row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

.row.g-3 {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.row.g-4 {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 1.5rem;
}

.row.g-2 {
  --bs-gutter-x: 0.5rem;
  --bs-gutter-y: 0.5rem;
}

.col-12 {
  flex: 0 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .col-md-1 {
    flex: 0 0 auto;
    width: 8.333333%;
  }
  .col-md-2 {
    flex: 0 0 auto;
    width: 16.666667%;
  }
  .col-md-3 {
    flex: 0 0 auto;
    width: 25%;
  }
  .col-md-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }
  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }
}

@media (min-width: 1200px) {
  .col-xl-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }
}

/* Shell layout */
#main-wrapper {
  opacity: 0;
  transition: opacity 0.25s ease-in;
  position: relative;
}

#main-wrapper.show {
  opacity: 1;
}

#preloader {
  background-color: var(--body-bg);
  padding: 0;
  margin: 0;
  height: 100%;
  position: fixed;
  z-index: 99999;
  width: 100%;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preloader.pos-preloader--hidden {
  display: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.pos-preloader-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: pos-spin 0.7s linear infinite;
}

@keyframes pos-spin {
  to {
    transform: rotate(360deg);
  }
}

.nav-header {
  height: var(--dz-header-height);
  width: var(--dz-sidebar-width);
  display: inline-block;
  text-align: left;
  position: absolute;
  top: 0;
  background-color: var(--nav-headbg);
  transition: all 0.2s ease;
  z-index: 7;
}

[data-sidebar-position="fixed"][data-layout="vertical"] .nav-header,
[data-header-position="fixed"] .nav-header {
  position: fixed;
}

.nav-header .brand-logo {
  display: flex;
  height: 100%;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.header {
  height: var(--dz-header-height);
  position: var(--dz-header-pos);
  padding: 0;
  background: var(--headerbg);
  z-index: 3;
  top: 0;
  width: 100%;
  padding-left: var(--dz-sidebar-width);
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}

.header-content {
  height: 100%;
}

.navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  height: 100%;
}

.navbar-expand .navbar-collapse {
  display: flex !important;
  flex-basis: auto;
  flex-grow: 1;
  align-items: center;
}

.collapse:not(.show):not(.navbar-collapse) {
  display: none;
}

.header-left .dashboard_bar {
  font-size: var(--dz-head-title-size);
  font-weight: 600;
  color: var(--text-dark);
}

.deznav {
  width: var(--dz-sidebar-width);
  padding-bottom: 0;
  height: calc(100% - var(--dz-header-height));
  position: var(--dz-sidebar-pos);
  left: 0;
  top: var(--dz-header-height);
  padding-top: 0;
  z-index: 6;
  background-color: var(--sidebar-bg);
  transition: box-shadow 0.2s ease;
  box-shadow: 0 0.9375rem 1.875rem rgba(0, 0, 0, 0.08);
}

.deznav-scroll {
  position: relative;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

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

.deznav .metismenu {
  display: flex;
  flex-direction: var(--dz-side-menu-direction);
  padding-top: 0.9375rem;
}

.deznav .metismenu > li > a {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--dz-side-nav-padding);
  font-size: var(--dz-side-nav-size);
  color: var(--text-gray);
}

.deznav .metismenu > li > a .menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
}

.deznav .metismenu > li > a .menu-icon .material-icons {
  font-size: 1.375rem;
  line-height: 1;
  color: #8088a1;
}

.deznav .metismenu > li.mm-active > a {
  color: var(--secondary);
}

.deznav .metismenu > li.mm-active > a .menu-icon .material-icons {
  color: var(--secondary);
}

.deznav .metismenu > li > a.deznav-logout .menu-icon .material-icons {
  color: #ff5e5e;
}

.deznav .metismenu > li > a.deznav-logout:hover .menu-icon .material-icons,
.deznav .metismenu > li > a.deznav-logout:hover {
  color: #ff8a8a;
}

.deznav .metismenu .menu-title {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 20px;
  color: var(--text-gray);
  letter-spacing: 0.06em;
}

.content-body {
  margin-left: var(--dz-sidebar-width);
  z-index: 0;
  transition: margin 0.2s ease;
  min-height: calc(100vh - var(--dz-header-height));
}

[data-header-position="fixed"] .content-body {
  padding-top: var(--dz-header-height);
}

/* Tarjetas dashboard / kit */
.icon-box {
  height: 2.5rem;
  width: 2.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 2.375rem;
  border-radius: 0.625rem;
}

.depostit-card {
  overflow: hidden;
}

.same-card .card-body {
  background: transparent;
}

/* Botones */
.btn {
  display: inline-block;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.btn-sm {
  padding: 0.25rem 0.65rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-secondary {
  color: #222;
  background-color: #adb5bd;
  border-color: #adb5bd;
}

.btn-success {
  color: #fff;
  background-color: #3a9b94;
  border-color: #3a9b94;
}

.btn-danger {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-warning {
  color: #000;
  background-color: #ffc107;
  border-color: #ffc107;
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}

.btn-outline-primary:hover {
  color: #fff;
  background: var(--primary);
}

.btn-outline-secondary {
  color: var(--text-gray);
  border-color: var(--border);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--rgba-primary-1);
  color: var(--text-dark);
}

/* Cards */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.card-header {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0.75rem 0.75rem 0 0;
  font-weight: 600;
  color: var(--text-dark);
}

.card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}

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

.card-title {
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.border-0 {
  border: 0 !important;
}

.border-primary {
  border-color: var(--primary) !important;
}

.border-success {
  border-color: #3a9b94 !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.bg-secondary {
  background-color: var(--secondary) !important;
}

.bg-success {
  background-color: #3a9b94 !important;
}

.bg-light {
  background-color: var(--rgba-primary-1) !important;
}

.bg-warning {
  background-color: rgba(255, 159, 0, 0.25) !important;
}

.text-white .bg-primary,
.card-header.bg-primary,
.card-header.bg-success {
  border-bottom-color: transparent;
}

.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  border-radius: 0.35rem;
}

.fs-6.badge {
  font-size: 1rem !important;
}

.bg-primary.badge {
  background: var(--primary);
  color: #fff;
}

/* Formularios */
.form-label {
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-gray);
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-dark);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  appearance: none;
}

.form-control:focus,
.form-select:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--rgba-primary-3);
}

.form-control-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

.form-check {
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5em;
}

.form-check-input {
  float: left;
  margin-left: -1.5em;
  margin-top: 0.2em;
}

.form-check-label {
  color: var(--text-gray);
}

select.form-select,
select.default-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b3b3b3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.25rem;
}

.input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}

.input-group-lg > .form-control {
  padding: 0.65rem 1rem;
  font-size: 1rem;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-dark);
  background-color: var(--rgba-primary-2);
  border: 1px solid var(--border);
}

.input-group .form-control {
  border-radius: 0;
}

.input-group > :first-child {
  border-radius: 0.5rem 0 0 0.5rem !important;
}

.input-group > :last-child {
  border-radius: 0 0.5rem 0.5rem 0 !important;
}

/* Tablas */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
  color: var(--text-dark);
}

.table th,
.table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.table thead th {
  color: var(--text-gray);
  font-weight: 600;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Alertas */
.alert {
  position: relative;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
}

.alert-dismissible {
  padding-right: 3rem;
}

.alert-success {
  background: rgba(58, 155, 148, 0.15);
  border-color: rgba(58, 155, 148, 0.4);
  color: #bbe6e3;
}

.alert-danger {
  background: rgba(255, 94, 94, 0.15);
  border-color: rgba(255, 94, 94, 0.35);
  color: #ffdede;
}

.alert-warning {
  background: rgba(255, 159, 0, 0.12);
  border-color: rgba(255, 159, 0, 0.35);
  color: #ffe8c2;
}

.alert-info {
  background: rgba(88, 186, 215, 0.12);
  border-color: rgba(88, 186, 215, 0.35);
  color: #c8eef7;
}

.alert-secondary {
  background: var(--rgba-primary-2);
  border-color: var(--border);
  color: var(--text-dark);
}

.fade {
  transition: opacity 0.15s linear;
}

.btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent
    url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e")
    center/1rem auto no-repeat;
  opacity: 0.7;
}

.btn-close:hover {
  opacity: 1;
}

/* Modales */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.show {
  display: block;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  outline: 0;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.55);
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  color: var(--text-dark);
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

.modal-sm .modal-dialog {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 576px) {
  .modal-dialog:not(.modal-sm) {
    max-width: 500px;
    margin: 1.75rem auto;
  }
}

body.modal-open {
  overflow: hidden;
}

/* List group */
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  max-height: 240px;
  overflow-y: auto;
}

.list-group-item {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
}

.list-group-item:last-child {
  border-bottom: 0;
}

.list-group-item-action {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.list-group-item-action:hover {
  background: var(--rgba-primary-1);
}

/* Vista estrecha: mismo shell con sidebar siempre visible (sin minimizar/ocultar). */
@media (max-width: 767px) {
  .header-left .dashboard_bar {
    font-size: 1rem;
  }
}
