:root {
  --primary-color: #5d5cde;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --light-bg: #ffffff;
  --dark-bg: #181818;
  --light-text: #212529;
  --dark-text: #f8f9fa;
  --light-border: #dee2e6;
  --dark-border: #495057;
  --light-card: #f8f9fa;
  --dark-card: #343a40;
}

/* Apply light/dark mode based on user preference */
@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--dark-bg);
    color: var(--dark-text);
  }
  .card {
    background-color: var(--dark-card);
    border-color: var(--dark-border);
  }
  .table {
    color: var(--dark-text);
  }
  input,
  select,
  textarea,
  button {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border-color: var(--dark-border);
  }
  .nav-tabs .nav-link {
    color: var(--dark-text);
  }
  .nav-tabs .nav-link.active {
    background-color: var(--dark-card);
    color: var(--primary-color);
    border-color: var(--dark-border);
  }
  .tab-content {
    border-color: var(--dark-border);
  }
  .modal-content {
    background-color: var(--dark-card);
    color: var(--dark-text);
  }
}

@media (prefers-color-scheme: light) {
  body {
    background-color: var(--light-bg);
    color: var(--light-text);
  }
  .card {
    background-color: var(--light-card);
    border-color: var(--light-border);
  }
  .table {
    color: var(--light-text);
  }
  input,
  select,
  textarea,
  button {
    background-color: var(--light-bg);
    color: var(--light-text);
    border-color: var(--light-border);
  }
  .nav-tabs .nav-link {
    color: var(--light-text);
  }
  .nav-tabs .nav-link.active {
    background-color: var(--light-bg);
    color: var(--primary-color);
    border-color: var(--light-border);
  }
  .tab-content {
    border-color: var(--light-border);
  }
  .modal-content {
    background-color: var(--light-bg);
    color: var(--light-text);
  }
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
  max-width: 1200px;
}

.header {
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid;
  border-color: inherit;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  flex-basis: 0;
  flex-grow: 1;
  max-width: 100%;
}

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

@media (min-width: 768px) {
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-clip: border-box;
  border: 1px solid;
  border-radius: 0.25rem;
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  border-bottom: 1px solid;
  border-color: inherit;
  font-weight: 500;
}

.card-body {
  flex: this 1 1 auto;
  min-height: 1px;
  padding: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.form-control {
  display: block;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px);
  padding: -0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  background-clip: padding-box;
  border: 1px solid;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

textarea.form-control {
  height: auto;
}

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  cursor: pointer;
  border: 1px solid transparent;
}

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

.btn-primary:hover {
  opacity: 0.9;
}

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

.btn-success:hover {
  opacity: 0.9;
}

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

.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid;
  border-color: inherit;
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid;
  border-color: inherit;
}

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.nav-tabs {
  border-bottom: 1px solid;
  border-color: inherit;
}

.nav-tabs .nav-item {
  margin-bottom: -1px;
}

.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.nav-tabs .nav-link.active {
  border-color: inherit;
  border-bottom-color: transparent;
}

.tab-content {
  padding: 1rem;
  border: 1px solid;
  border-top: none;
  border-bottom-right-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.fade {
  transition: opacity 0.15s linear;
}

.fade:not(.show) {
  opacity: 0;
}

.fade.show {
  opacity: 1;
}

.badge {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

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

.badge-warning {
  color: #212529;
  background-color: var(--warning-color);
}

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

.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

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

.mb-3 {
  margin-bottom: 1rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.d-none {
  display: none;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal.show {
  display: block;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 10% auto;
  max-width: 500px;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid;
  border-radius: 0.3rem;
  outline: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid;
  border-top-left-radius: calc(0.3rem - 1px);
  border-top-right-radius: calc(0.3rem - 1px);
}

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

.close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  opacity: 0.5;
  background-color: transparent;
  border: 0;
  cursor: pointer;
}

#loader {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid;
  border-color: inherit;
}

.app-title {
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 10px;
  background-color: #e0e0e0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #555;
}

.user-email {
  margin-right: 15px;
  font-size: 14px;
}

.logout-btn {
  padding: 5px 10px;
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}

.logout-btn:hover {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .user-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-info {
    margin-top: 10px;
    width: 100%;
    justify-content: flex-end;
  }
}

.light-container {
  display: grid;
  /* flex-wrap: wrap; */
  gap: 10px;
  padding: 5px;
}
.light {
  width: 10px;
  height: 10px;
  border-radius: 5%;
  display: flow-root;
  align-items: center;
  justify-content: center;
  color: black;
  font-weight: bold;
}
.light.green {
  background-color: green;
}
.light.red {
  background-color: red;
}
.light-text {
  margin-left: 10px;
  display: ruby-text;
}
/* markup language */
.printer-output {
  width: 80mm;
  padding: 10px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  margin: 20px auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.column {
  display: flex;
  justify-content: space-between;
  margin: 5px 0;
}
img {
  display: block;
  margin: 0 auto;
}
.barcode {
  text-align: center;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 3px;
}
.min-max-filter {
  display: grid;
}

.min-max-filter label {
  width: 20px;
}

.btn-primary:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}
.action-grid-button {
  display: grid;
  justify-content: space-between;
  align-items: center;
  grid-gap: 10px;
}
