:root {
  --ois-accent: #17a2b8;
  --ois-accent-strong: #0d6f7e;
  --ois-danger: #dc3545;
  --ok: #28a745;
  --ois-muted: #6c757d;
}

body.login-page,
.login-page {
  background: url("/dist/img/equipment-login-bg.png") no-repeat center center fixed !important;
  background-size: cover !important;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.login-page::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(8, 15, 19, 0.28);
  content: "";
}

.login-box {
  position: relative;
  width: min(390px, calc(100vw - 2rem));
}

.login-glass {
  background: rgba(10, 24, 30, 0.88) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 8px !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38) !important;
}

.login-card-body {
  background: transparent !important;
  border-radius: 8px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #fff;
  font-size: 1.55rem;
  margin-bottom: 0.75rem;
}

.login-logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.login-box-msg {
  color: #fff;
  font-size: 1rem;
}

.login-page .form-control {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 0 !important;
  border-radius: 10px 0 0 10px !important;
  color: #fff !important;
}

.login-page .form-control::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.login-page .form-control:focus {
  background: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 0 8px #00c3ff !important;
}

.login-page .input-group-text {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 0 !important;
  color: #00c6ff;
}

.login-page .btn-primary {
  background: #138da0 !important;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.login-page .btn-primary:hover,
.login-page .btn-primary:focus {
  background: #0d6f7e !important;
}

@media (max-width: 640px) {
  body.login-page,
  .login-page {
    background-position: 42% center !important;
  }

  .login-page::before {
    background: rgba(8, 15, 19, 0.48);
  }
}

.form-message {
  min-height: 1.25rem;
  color: var(--ois-danger);
  font-weight: 700;
}

/* Bootstrap also defines .toast, so Toastr needs scoped overrides loaded last. */
#toast-container {
  z-index: 11000;
}

#toast-container > .toast {
  width: min(390px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  padding: 1rem 2.75rem 1rem 3.25rem;
  border: 0;
  border-left: 5px solid rgba(255, 255, 255, 0.72);
  border-radius: 0.35rem;
  background-color: #343a40;
  background-position: 1rem center;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.24);
  color: #fff;
  opacity: 0.98;
}

#toast-container > .toast-success {
  background-color: #218838;
}

#toast-container > .toast-error {
  background-color: #c82333;
}

#toast-container > .toast-info {
  background-color: #117a8b;
}

#toast-container > .toast-warning {
  background-color: #d97706;
}

#toast-container .toast-title {
  margin-bottom: 0.15rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

#toast-container .toast-message {
  min-height: 0;
  margin: 0;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.35;
}

#toast-container .toast-close-button {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  color: #fff;
  text-shadow: none;
  opacity: 0.9;
}

#toast-container .toast-progress {
  height: 3px;
  background: #fff;
  opacity: 0.55;
}

.brand-link .brand-image {
  object-fit: cover;
}

.main-sidebar .user-panel img {
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--ois-accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content-wrapper h1 {
  font-size: 1.8rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.metric {
  position: relative;
  min-height: 128px;
  padding: 1rem;
  border-radius: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, #007bff, #00c6ff);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.09);
  overflow: hidden;
}

.metric:nth-child(2n) {
  background: linear-gradient(135deg, #28a745, #5cd65c);
}

.metric:nth-child(3n) {
  background: linear-gradient(135deg, #6f42c1, #a66cff);
}

.metric:nth-child(4n) {
  background: linear-gradient(135deg, #dc3545, #ff6b6b);
}

.metric span {
  display: block;
  max-width: 75%;
  font-size: 1rem;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin-top: 0.4rem;
  font-size: 2.15rem;
  line-height: 1;
}

.metric::after {
  content: "\f0ae";
  position: absolute;
  right: 1rem;
  bottom: 0.6rem;
  color: rgba(255, 255, 255, 0.28);
  font-family: "Font Awesome 5 Free";
  font-size: 3.5rem;
  font-weight: 900;
}

.split {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  background: #fff;
  border-top: 3px solid var(--ois-accent);
  border-radius: 0.25rem;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
  padding: 1rem;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

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

label {
  display: grid;
  gap: 0.35rem;
  color: #495057;
  font-size: 0.9rem;
  font-weight: 700;
}

.check-field {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 600;
}

.check-field input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.18rem;
  flex: 0 0 auto;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid #dee2e6;
}

.table-wrap table {
  margin-bottom: 0;
  min-width: 760px;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.row-actions .btn,
td .btn {
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
}

.qr-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.68);
}

.qr-dialog {
  width: min(760px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 0.4rem;
  background: #fff;
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.3);
}

.qr-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #dee2e6;
}

.qr-dialog-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.qr-dialog-body {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
}

.qr-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 0.75rem;
  border: 1px solid #dee2e6;
}

.qr-details {
  margin: 0;
}

.qr-details > div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #edf0f2;
}

.qr-details dt,
.qr-details dd {
  margin: 0;
}

.qr-details dt {
  color: #6c757d;
}

.qr-assignment {
  align-items: start;
}

.badge {
  font-size: 0.78rem;
}

.muted {
  color: var(--ois-muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 992px) {
  .split,
  .fields-2 {
    grid-template-columns: 1fr;
  }

  .metric span {
    max-width: 100%;
  }

  #toast-container.toast-top-right {
    top: 0.75rem;
    right: 0;
    left: 0;
  }

  #toast-container.toast-top-right > .toast {
    margin-right: auto;
    margin-left: auto;
  }

  .qr-dialog-body {
    grid-template-columns: 1fr;
  }

  .qr-preview {
    width: min(280px, 100%);
    margin: 0 auto;
  }
}
