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

:root {
  --primary: #004297;
  --primary-hover: #2b86ff;
  --primary-light: #EEF2FF;
  --primary-dark: #003070;
  --accent: #CBD4FF;
  --bg-gradient-start: #F1F3FF;
  --bg-gradient-end: #CBD4FF;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --white: #ffffff;
  --danger: #dc3545;
  --danger-bg: #fde8ea;
  --success: #198754;
  --success-bg: #e8f5ee;
  --border: #d1d5db;
  --input-focus-border: var(--primary);
  --input-focus-ring: 0 0 0 3px rgba(0, 66, 151, 0.18);
  --input-focus-ring-invalid: 0 0 0 3px rgba(220, 53, 69, 0.16);
  --shadow: 0 4px 24px rgba(0, 66, 151, 0.12);
  --radius: 10px;
  --sidebar-width: 270px;
  --sidebar-collapsed: 85px;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}


.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.925rem;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #b8dfc9;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f5c2c7;
}

.alert-fade-out {
  opacity: 0;
}


.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10150;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: 400px;
  width: auto;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 25px;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 500;
  width: max-content;
  max-width: 400px;
  animation: toastIn 0.35s ease;
  transition: opacity 0.5s ease-in-out;
  box-shadow: 0 0 10px 2px rgba(128, 128, 128, 0.7);
}

.toast-success {
  background-color: #28a745;
  color: #ffffff;
  border: 1px solid #28a745;
}

.toast-error {
  background-color: #dc3545;
  color: #ffffff;
  border: 1px solid #dc3545;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  line-height: 1;
}

.toast-success .toast-icon {
  font-size: 22px;
  font-weight: 700;
}

.toast-message {
  flex: 1;
  color: #ffffff;
  line-height: 1.4;
}

.toast.toast-out {
  opacity: 0;
  animation: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
    align-items: stretch;
  }

  .toast {
    width: auto;
    max-width: 100%;
  }
}


body.dialog-open {
  overflow: hidden;
}

.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app-dialog.is-open {
  display: flex;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  animation: dialogFadeIn 0.2s ease;
  cursor: default;
}

.app-dialog-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: dialogSlideIn 0.25s ease;
  overflow: hidden;
}

.app-dialog-header {
  padding: 20px 24px 0;
}

.app-dialog-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-dialog-title-warning {
  color: #dc2626;
}

.app-dialog-title-icon {
  flex-shrink: 0;
}

.app-dialog-body {
  padding: 12px 24px 20px;
}

.app-dialog-message {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}


.btn-danger {
  position: relative;
  overflow: hidden;
  background: #a71d2a;
  color: #fff;
  border: 1px solid #a71d2a;
  border-radius: 3px;
  font-weight: 700;
}

.btn-danger::after {
  content: "";
  position: absolute;
  top: -50px;
  left: -75px;
  z-index: 1;
  width: 50px;
  height: 155px;
  background: #fff;
  opacity: 0.2;
  transform: rotate(35deg);
  transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
}

.btn-danger:hover:not(:disabled),
.btn-danger:focus:not(:disabled),
.btn-danger:focus-visible:not(:disabled) {
  color: #fff !important;
  background: #db213c;
  border-color: #db213c;
  outline: none;
  box-shadow: none;
}

.btn-danger:hover:not(:disabled)::after,
.btn-danger:focus:not(:disabled)::after,
.btn-danger:focus-visible:not(:disabled)::after {
  left: 120%;
}

.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


.app-dialog-logout .app-dialog-box {
  max-width: 380px;
  text-align: center;
  padding: 28px 28px 24px;
}

.app-dialog-logout .app-dialog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fee2e2;
  color: #a71d2a;
}

.app-dialog-logout .app-dialog-icon svg {
  display: block;
}

.app-dialog-logout .app-dialog-body {
  padding: 0 0 24px;
}

.app-dialog-logout .app-dialog-message {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
}

.app-dialog-logout .app-dialog-actions {
  justify-content: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  border-top: none;
}

.app-dialog-logout .app-dialog-actions .btn {
  min-width: 120px;
  padding: 10px 20px;
}

@keyframes dialogFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialogSlideIn {
  from {
    transform: translateY(-16px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}


.change-password-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.change-password-modal.is-open {
  display: flex;
}

.change-password-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  animation: dialogFadeIn 0.2s ease;
  cursor: default;
}

.change-password-modal-box {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: dialogSlideIn 0.25s ease;
  overflow: hidden;
}

.change-password-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
}

.change-password-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 4px;
}

.change-password-modal-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.change-password-modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.change-password-modal-close:hover {
  color: var(--text);
}

.change-password-modal-body {
  padding: 16px 24px 8px;
}

.change-password-modal-body .form-group:last-child {
  margin-bottom: 0;
}

.change-password-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 24px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}


.app-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app-modal.is-open {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  animation: dialogFadeIn 0.2s ease;
  cursor: default;
}

.app-modal-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: dialogSlideIn 0.25s ease;
  overflow: hidden;
}

.app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
}

.app-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.app-modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.app-modal-close:hover {
  color: var(--text);
}

.app-modal-body {
  padding: 16px 24px 24px;
}

.app-modal-body .form-group:last-child {
  margin-bottom: 0;
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 24px 20px;

  border-top: 1px solid var(--border);
}


.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-box,
.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .modal-box {
  width: min(100%, var(--modal-max-width, 100%));
  max-width: min(100%, var(--modal-max-width, 640px));
  max-height: calc(100dvh - 40px);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-header,
.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-actions,
.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .modal-header,
.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .modal-actions,
.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .make-items-modal-footer {
  flex-shrink: 0;
}

.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-body,
.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .modal-body,
.app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .make-items-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-modal .app-modal-title,
.app-modal .modal-title {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-dialog-box,
.change-password-modal-box {
  width: min(100%, 420px);
  max-width: 100%;
  max-height: calc(100dvh - 40px);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.app-dialog-header,
.app-dialog-actions,
.change-password-modal-box .app-modal-header,
.change-password-modal-box .app-modal-actions {
  flex-shrink: 0;
}

.app-dialog-body,
.change-password-modal-box .app-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal),
  .app-dialog {
    padding: 12px;
    align-items: flex-start;
  }

  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-box,
  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .modal-box,
  .app-dialog-box,
  .change-password-modal-box {
    max-height: calc(100dvh - 24px);
    max-height: calc(100vh - 24px);
  }

  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-header,
  .app-dialog-header {
    padding: 16px 16px 0;
  }

  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-body,
  .app-dialog-body {
    padding: 14px 16px 20px;
  }

  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-actions,
  .app-dialog-actions {
    padding: 14px 16px 16px;
    flex-wrap: wrap;
  }

  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-actions .btn,
  .app-dialog-actions .btn {
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal),
  .app-dialog {
    padding: 8px;
  }

  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-box,
  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .modal-box,
  .app-dialog-box,
  .change-password-modal-box {
    max-height: calc(100dvh - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 10px;
  }

  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-actions {
    justify-content: stretch;
  }

  .app-modal:not(.stock-history-modal):not(.pump-ready-history-modal) .app-modal-actions .btn {
    flex: 1 1 auto;
  }

  .app-dialog-actions {
    flex-direction: column-reverse;
  }

  .app-dialog-actions .btn {
    width: 100%;
  }
}


.app-modal:not(.pump-ready-history-modal):not(.stock-history-modal) .app-modal-box,
.app-modal:not(.pump-ready-history-modal):not(.stock-history-modal) .modal-box,
.app-dialog-box,
.change-password-modal-box {
  font-size: 1rem;
}

.app-modal:not(.pump-ready-history-modal):not(.stock-history-modal) .app-modal-box :where(
  p, span, label, td, th, li, a, button, input, select, textarea,
  h1, h2, h3, h4, h5, h6, small, strong, b, em, i, div, table
),
.app-modal:not(.pump-ready-history-modal):not(.stock-history-modal) .modal-box :where(
  p, span, label, td, th, li, a, button, input, select, textarea,
  h1, h2, h3, h4, h5, h6, small, strong, b, em, i, div, table
),
.app-dialog-box :where(
  p, span, label, td, th, li, a, button, input, select, textarea,
  h1, h2, h3, h4, h5, h6, small, strong, b, em, i, div
),
.change-password-modal-box :where(
  p, span, label, td, th, li, a, button, input, select, textarea,
  h1, h2, h3, h4, h5, h6, small, strong, b, em, i, div
) {
  font-size: 1rem !important;
}

.app-modal:not(.pump-ready-history-modal):not(.stock-history-modal) .app-modal-title,
.app-dialog-title,
.change-password-modal-title,
.app-dialog-message {
  font-size: 1rem !important;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap .form-control {
  padding-right: 42px;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px;
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: 0.775rem;
  margin-top: 4px;
}


.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;

  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input.form-control,
select.form-control {
  height: 42px;
  min-height: 42px;
}

textarea.form-control {
  height: auto;
  min-height: 96px;
  padding: 11px 14px;
}

.form-control:focus,
.form-control:focus-visible {
  outline: none;

  border-color: #000000;
}

.form-control.is-invalid:focus,
.form-control.is-invalid:focus-visible {
  border-color: var(--danger);
  box-shadow: var(--input-focus-ring-invalid);
}

.form-control:disabled:focus,
.form-control:disabled:focus-visible,
.form-control[readonly]:focus,
.form-control[readonly]:focus-visible,
.form-control-readonly:focus,
.form-control-readonly:focus-visible,
.sale-readonly-input:focus,
.sale-readonly-input:focus-visible,
.purchase-readonly-input:focus,
.purchase-readonly-input:focus-visible {
  border-color: var(--border);
  box-shadow: none;
}

.form-control:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
}

.date-picker-field {
  position: relative;
  display: block;
  width: 100%;
}

.date-picker-display-input {
  width: 100%;
  padding-right: 42px;
  caret-color: transparent;
  cursor: pointer;
  background-color: #fff;
  pointer-events: auto;
  user-select: none;
  position: relative;
  z-index: 1;
}

.date-picker-display-input:disabled {
  background: #f3f4f6;
}

.date-picker-display-input:focus,
.date-picker-display-input:focus-visible,
.date-picker-field.is-picker-open .date-picker-display-input,
.date-picker-display-input.is-picker-open {
  border-color: #000000;
  box-shadow: none;
  outline: none;
}

.date-picker-field.is-picker-open .date-picker-trigger {
  color: #111827;
}

.date-picker-native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  appearance: none;
  -webkit-appearance: none;
}

.date-picker-native-input::-webkit-calendar-picker-indicator,
.date-picker-native-input::-webkit-inner-spin-button,
.date-picker-native-input::-webkit-clear-button,
.date-picker-native-input::-moz-calendar-picker-indicator {
  display: none;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.date-picker-trigger {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  cursor: pointer;
  pointer-events: auto;
}

.date-picker-trigger:hover {
  color: #111827;
  background: #f3f4f6;
}

.date-picker-trigger:focus,
.date-picker-trigger:focus-visible {
  outline: none;
  color: #111827;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.date-picker-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: transparent;
}

.date-picker-field .form-control-sm + .date-picker-trigger {
  width: 28px;
  height: 28px;
  right: 4px;
}

.date-picker-field .form-control-sm.date-picker-display-input {
  padding-right: 36px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

.form-text {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border: none;
  border-radius: 3px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: color 1s cubic-bezier(0.19, 1, 0.22, 1),
    background 1s cubic-bezier(0.19, 1, 0.22, 1),
    border-color 1s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn:hover,
a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active,
a.btn:visited {
  text-decoration: none;
}

.btn:active {
  transform: none;
}

.btn > * {
  position: relative;
  z-index: 2;
}


.btn-primary {
  background: #004297;
  color: #fff;
  border: 1px solid #004297;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: -50px;
  left: -75px;
  z-index: 1;
  width: 50px;
  height: 155px;
  background: #fff;
  opacity: 0.2;
  transform: rotate(35deg);
  transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus:not(:disabled),
.btn-primary:focus-visible:not(:disabled) {
  color: #fff !important;
  background: #2b86ff;
  border-color: #2b86ff;
  outline: none;
  box-shadow: none;
  text-decoration: none;
}

.btn-primary:hover:not(:disabled)::after,
.btn-primary:focus:not(:disabled)::after,
.btn-primary:focus-visible:not(:disabled)::after {
  left: 120%;
}

.btn-primary:disabled:not(.is-submitting):not(.loading) {
  background: #949494;
  border-color: #949494;
  color: #fff;
  cursor: not-allowed;
  opacity: 1;
}

.btn-primary:disabled:not(.is-submitting):not(.loading)::after {
  display: none;
}


.btn-light,
.btn.white-btn {
  background: #fff;
  color: #004297;
  border: 1px solid #004297;
}

.btn-light::after,
.btn.white-btn::after {
  content: "";
  position: absolute;
  top: -50px;
  left: -75px;
  z-index: 1;
  width: 50px;
  height: 155px;
  background: #004297;
  opacity: 0.2;
  transform: rotate(35deg);
  transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
}

.btn-light:hover:not(:disabled),
.btn-light:focus:not(:disabled),
.btn-light:focus-visible:not(:disabled),
.btn.white-btn:hover:not(:disabled),
.btn.white-btn:focus:not(:disabled),
.btn.white-btn:focus-visible:not(:disabled) {
  color: #2b86ff !important;
  border-color: #2b86ff !important;
  background: #fff;
  outline: none;
  box-shadow: inset 0 0 12px rgba(43, 134, 255, 0.25);
  text-decoration: none;
}

.btn-light:hover:not(:disabled)::after,
.btn-light:focus:not(:disabled)::after,
.btn-light:focus-visible:not(:disabled)::after,
.btn.white-btn:hover:not(:disabled)::after,
.btn.white-btn:focus:not(:disabled)::after,
.btn.white-btn:focus-visible:not(:disabled)::after {
  left: 120%;
  opacity: 0.2;
}

.btn-light:disabled,
.btn.white-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-light:disabled::after,
.btn.white-btn:disabled::after {
  display: none;
}


.btn.is-submitting,
.btn.loading {
  font-size: 0 !important;
  line-height: 0 !important;
  background: #949494 !important;
  border-color: #949494 !important;
  color: #fff !important;
  cursor: wait;
  box-shadow: none !important;
  pointer-events: none;
}

.btn.is-submitting::before,
.btn.loading::before {
  content: "Loading...";
  display: block !important;
  font-size: 0.95rem !important;
  font-weight: 500;
  line-height: 1.4 !important;
  padding-left: 10px;
  color: #fff;
  position: relative;
  z-index: 2;
}

.btn.is-submitting::after,
.btn.loading::after {
  display: none !important;
}

.btn.is-submitting:focus,
.btn.loading:focus,
.btn.is-submitting:focus-visible,
.btn.loading:focus-visible {
  background: #949494 !important;
  border-color: #949494 !important;
  outline: none;
  box-shadow: none;
}

.btn.is-submitting .btn-text,
.btn.is-submitting .btn-loader,
.btn.loading .btn-text,
.btn.loading .btn-loader {
  display: none !important;
}

.btn-block {
  width: 100%;
}


.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(var(--bg-gradient-start), var(--bg-gradient-end));

  transition: margin-left 0.4s ease;
}

body:has(.sidebar.collapsed) .main-content {
  margin-left: var(--sidebar-collapsed);
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 30px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 66, 151, 0.08);
  gap: 16px;
}

.header-left {
  flex: 1;
  min-width: 0;
}

.header-welcome {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.welcome-label {
  font-weight: 600;
  color: var(--text);
}

.welcome-separator {
  color: #cbd5e1;
  font-weight: 300;
  user-select: none;
}

.welcome-meta {
  color: var(--text-muted);
}

.welcome-office {
  color: var(--primary);
  font-weight: 500;
}

.page-label {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}


.header-activity-notifications {
  position: relative;
  z-index: 302;
}

.header-activity-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(0, 66, 151, 0.12);
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.header-activity-toggle:hover,
.header-activity-notifications.is-open .header-activity-toggle {
  background: var(--primary-light);
  border-color: rgba(0, 66, 151, 0.22);
}


.header-activity-notifications.is-count-only .header-activity-toggle {
  cursor: pointer;
}

.header-activity-icon {
  display: inline-flex;
  line-height: 0;
}

.header-activity-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.header-activity-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 480px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.header-activity-panel[hidden] {
  display: none !important;
}

.header-activity-panel-head,
.header-activity-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-activity-panel-foot {
  border-bottom: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  justify-content: center;
}

.header-activity-panel-head strong {
  font-size: 0.875rem;
  color: var(--text);
}

.header-activity-mark-all {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.header-activity-mark-all:hover {
  text-decoration: underline;
}

.header-activity-mark-all:disabled {
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}

.header-activity-list {
  overflow-y: auto;
  max-height: 360px;
}

.header-activity-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.header-activity-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  background: #fff;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: default;
}

.header-activity-item.is-unread {
  background: rgba(0, 66, 151, 0.04);
}

.header-activity-item-office {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.header-activity-item-message {
  display: block;
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.4;
}

.header-activity-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.71875rem;
  color: var(--text-muted);
}

.header-activity-item-action {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.header-activity-item-action.is-update {
  color: #0369a1;
}

.header-activity-item-action.is-delete {
  color: #b91c1c;
}

.header-activity-view-all {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.header-activity-view-all:hover {
  text-decoration: underline;
}

.branch-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 600;
}


.user-dropdown {
  position: relative;
  z-index: 301;
}

.user-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.user-dropdown-toggle:hover,
.user-dropdown.open .user-dropdown-toggle {
  background: transparent;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #dc3545;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.user-info {
  text-align: left;
  min-width: 0;
}

.user-name {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
}

.user-role {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
}

.user-dropdown-chevron-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.user-dropdown-toggle:hover .user-dropdown-chevron-wrap,
.user-dropdown.open .user-dropdown-chevron-wrap {
  background: var(--primary-light);
}

.user-dropdown-chevron {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.2s ease, margin 0.2s ease;
}

.user-dropdown.open .user-dropdown-chevron {
  transform: rotate(-135deg);
  margin-top: 3px;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.14);
  list-style: none;
  padding: 8px;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 400;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  isolation: isolate;
}

.user-dropdown-menu > li {
  background: #ffffff;
}

.user-dropdown.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  background: #ffffff;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-dropdown-item:hover {
  background: var(--primary-light);
  text-decoration: none;
  color: var(--primary);
}

.user-dropdown-logout:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.user-dropdown-logout:hover .dropdown-item-icon-logout {
  background: #f5c2c7;
  color: var(--danger);
}

.dropdown-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-item-icon svg {
  display: block;
}

.dropdown-item-icon-profile {
  background: var(--primary-light);
  color: var(--primary);
}

.dropdown-item-icon-logout {
  background: var(--danger-bg);
  color: var(--danger);
}

.dropdown-item-label {
  flex: 1;
  line-height: 1.3;
}

.page-content {
  padding: 24px 30px 40px;
}


.dashboard-welcome {
  max-width: 900px;
}

.welcome-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.welcome-card h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.welcome-card p {
  color: var(--text-muted);
  margin-bottom: 6px;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-label {
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.info-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
}

.status-active {
  color: var(--success);
}

.dashboard-alert-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border-left: 4px solid var(--warning, #e6a817);
}

.dashboard-alert-warning {
  background: #fffbf0;
}

.dashboard-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dashboard-alert-header h4 {
  margin: 0;
  color: #b45309;
  font-size: 1.05rem;
}

.dashboard-alert-badge {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.dashboard-alert-desc {
  color: var(--text-muted);
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.dashboard-low-stock-table-wrap {
  overflow-x: auto;
}

.dashboard-low-stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dashboard-low-stock-table th,
.dashboard-low-stock-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f0e6c8;
}

.dashboard-low-stock-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.dashboard-low-stock-table .text-right {
  text-align: right;
}

.dashboard-low-stock-table .stock-critical {
  color: #dc2626;
  font-weight: 600;
}

.dashboard-alert-footer {
  margin: 14px 0 0;
  font-size: 0.875rem;
}

.dashboard-alert-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.dashboard-alert-footer a:hover {
  text-decoration: underline;
}

.info-card-warning .info-value.status-warning {
  color: #dc2626;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }

  body:has(.sidebar.collapsed) .main-content {
    margin-left: 0;
  }

  .top-header {
    padding: 16px 20px;
    padding-left: 70px;
  }

  .page-content {
    padding: 16px 20px 30px;
  }
}
