body {
  background: #f4f6f8;
  color: #1f2933;
  font-size: 14px;
}

.btn {
  font-weight: 600;
  border-radius: 10px;
  transition: filter 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-primary,
.btn-primary:not(:disabled):not(.disabled) {
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
  border: 1px solid transparent;
  color: #ffffff;
  box-shadow: 0 6px 14px -8px rgba(184, 134, 11, 0.5);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-primary.show,
.btn-check:checked + .btn-primary {
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
  color: #ffffff;
  filter: brightness(1.05);
  box-shadow: 0 10px 18px -8px rgba(184, 134, 11, 0.65), 0 0 0 3px rgba(212, 160, 23, 0.18);
  border-color: transparent;
}

.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%);
  color: #ffffff;
  transform: translateY(1px);
}

.btn-primary:disabled,
.btn-primary.disabled {
  background: #e6d088;
  color: #ffffff;
  opacity: 0.75;
  box-shadow: none;
}

.btn-outline-primary,
.btn-outline-primary:not(:disabled):not(.disabled) {
  border: 1px solid #d4a017;
  color: #b8860b;
  background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:focus-visible {
  background: rgba(212, 160, 23, 0.1);
  color: #8b6914;
  border-color: #d4a017;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}

.btn-outline-primary:active,
.btn-outline-primary:not(:disabled):not(.disabled):active {
  background: rgba(212, 160, 23, 0.2);
  color: #8b6914;
  border-color: #b8860b;
}

.btn-outline-secondary,
.btn-outline-secondary:not(:disabled):not(.disabled) {
  border: 1px solid #e2e8f0;
  color: #475569;
  background: #ffffff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:focus-visible {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1f2933;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}

.btn-outline-secondary:active,
.btn-outline-secondary:not(:disabled):not(.disabled):active {
  background: #eef2f6;
  border-color: #cbd5e1;
  color: #1f2933;
}

.btn-light,
.btn-light:not(:disabled):not(.disabled) {
  background: #ffffff;
  border: 1px solid #e6ebf2;
  color: #475569;
}

.btn-light:hover,
.btn-light:focus,
.btn-light:focus-visible {
  background: #f8fafc;
  border-color: #d8e0e8;
  color: #1f2933;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #edf1f5;
}

.form-actions .btn {
  min-width: 120px;
  height: 40px;
  padding-left: 16px;
  padding-right: 16px;
}

.form-actions .btn-text {
  letter-spacing: 0.01em;
}

@media (max-width: 576px) {
  .form-actions {
    flex-direction: column-reverse;
  }
  .form-actions .btn {
    width: 100%;
  }
}

.app-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f6fa;
  min-height: 100vh;
}

.app-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e6ebf2;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), 0 4px 16px -12px rgba(15, 23, 42, 0.1);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-topbar-inner {
  padding: 10px 22px;
  gap: 18px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding-right: 18px;
  border-right: 1px solid #eef1f5;
  margin-right: 4px;
}

.topbar-brand:hover {
  color: inherit;
}

.topbar-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff8e1 0%, #fef3c7 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px -6px rgba(184, 134, 11, 0.45);
}

.topbar-brand-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.topbar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.topbar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

.topbar-brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.topbar-toggler {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 10px;
  color: #475569;
  font-size: 22px;
  line-height: 1;
}

.topbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.18);
}

.topbar-nav {
  align-items: center;
  gap: 2px;
}

.topbar-nav .nav-item {
  position: relative;
}

.topbar-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar-nav .nav-link i {
  font-size: 15px;
  color: #94a3b8;
  transition: color 0.15s ease;
}

.topbar-nav .nav-link:hover,
.topbar-nav .nav-link:focus,
.topbar-nav .show > .nav-link {
  color: #b8860b;
  background: rgba(212, 160, 23, 0.08);
}

.topbar-nav .nav-link:hover i,
.topbar-nav .show > .nav-link i {
  color: #b8860b;
}

.topbar-nav .dropdown-toggle::after {
  margin-left: 4px;
  opacity: 0.55;
}

.topbar-dropdown {
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.25), 0 4px 12px -6px rgba(15, 23, 42, 0.12);
  padding: 6px;
  min-width: 220px;
  margin-top: 8px !important;
}

.topbar-dropdown .dropdown-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  color: #344054;
  font-weight: 500;
}

.topbar-dropdown .dropdown-item i {
  color: #94a3b8;
  font-size: 15px;
  width: 16px;
  text-align: center;
}

.topbar-dropdown .dropdown-item:hover,
.topbar-dropdown .dropdown-item:focus {
  background: rgba(212, 160, 23, 0.08);
  color: #b8860b;
}

.topbar-dropdown .dropdown-item:hover i,
.topbar-dropdown .dropdown-item:focus i {
  color: #b8860b;
}

.topbar-dropdown .dropdown-item.text-danger:hover,
.topbar-dropdown .dropdown-item.text-danger:focus {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c !important;
}

.topbar-dropdown .dropdown-item.text-danger:hover i,
.topbar-dropdown .dropdown-item.text-danger:focus i {
  color: #b91c1c;
}

.topbar-dropdown .dropdown-divider {
  margin: 6px 4px;
  border-color: #eef1f5;
}

.topbar-nav-end {
  gap: 0;
}

.topbar-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px !important;
  border-radius: 999px;
  background: #f5f7fb;
  border: 1px solid #eaeef4;
}

.topbar-user-trigger:hover,
.topbar-user-trigger:focus,
.show > .topbar-user-trigger {
  background: rgba(212, 160, 23, 0.1) !important;
  border-color: rgba(212, 160, 23, 0.25);
}

.topbar-user-trigger.dropdown-toggle::after {
  display: none;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
  box-shadow: 0 4px 10px -6px rgba(184, 134, 11, 0.5);
  text-transform: uppercase;
  flex: 0 0 34px;
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.topbar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #1f2933;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-role {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topbar-user-caret {
  color: #94a3b8;
  font-size: 13px;
  margin-left: 2px;
}

.app-main {
  max-width: 1480px;
}

@media (max-width: 991px) {
  .topbar-brand {
    border-right: 0;
    padding-right: 0;
  }
  .topbar-nav {
    gap: 0;
    align-items: stretch;
    padding: 8px 0;
  }
  .topbar-nav .nav-link {
    border-radius: 0;
    padding: 10px 4px;
  }
  .topbar-user-trigger {
    background: transparent;
    border: 0;
    padding: 8px 4px !important;
  }
}

.login-body {
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1f2933;
  background:
    radial-gradient(ellipse at top left, rgba(232, 196, 96, 0.18), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(54, 113, 233, 0.12), transparent 55%),
    linear-gradient(135deg, #f4f6fb 0%, #eef2f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 30px 60px -25px rgba(15, 23, 42, 0.25), 0 8px 20px -10px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  min-height: 560px;
}

.login-hero {
  position: relative;
  color: #fff;
  padding: 48px 44px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(255, 255, 255, 0.12), transparent 55%),
    linear-gradient(150deg, #b8860b 0%, #d4a017 45%, #8b6914 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.login-hero::before,
.login-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.login-hero::before {
  width: 280px;
  height: 280px;
  top: -90px;
  right: -90px;
}

.login-hero::after {
  width: 200px;
  height: 200px;
  bottom: -70px;
  left: -60px;
}

.login-hero-inner {
  position: relative;
  z-index: 1;
}

.login-brand-mark {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.35);
}

.login-brand-mark img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.login-hero h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  line-height: 1.25;
}

.login-hero p {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 28px;
}

.login-hero-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.login-hero-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
}

.login-hero-points i {
  color: #fff8e1;
  font-size: 18px;
}

.login-panel {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
}

.login-panel-inner {
  width: 100%;
  max-width: 360px;
}

.login-logo-mobile {
  display: none;
  justify-content: center;
  margin-bottom: 18px;
}

.login-logo-mobile img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.login-panel h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: #111827;
}

.login-subtitle {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 26px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-field .form-label {
  font-size: 13px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 6px;
}

.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-affix > i {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
}

.input-affix .form-control {
  height: 46px;
  padding-left: 42px;
  padding-right: 14px;
  font-size: 14px;
  border-radius: 10px;
  border-color: #d8dee9;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.input-affix .form-control::placeholder {
  color: #a3acbb;
}

.input-affix .form-control:focus {
  background: #fff;
  border-color: #d4a017;
  box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.15);
}

.input-affix:has(.input-toggle) .form-control {
  padding-right: 44px;
}

.input-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.input-toggle:hover {
  color: #475569;
  background: #eef2f7;
}

.btn-login {
  height: 46px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-top: 4px;
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
  border: 0;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(184, 134, 11, 0.6);
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-login:hover,
.btn-login:focus {
  filter: brightness(1.04);
  box-shadow: 0 12px 22px -10px rgba(184, 134, 11, 0.7);
  color: #fff;
}

.btn-login:active {
  transform: translateY(1px);
}

.login-footer {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  margin-top: 28px;
}

@media (max-width: 820px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-hero {
    display: none;
  }

  .login-logo-mobile {
    display: flex;
  }

  .login-panel {
    padding: 36px 28px;
  }
}

.metric {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 16px;
}

.metric-label {
  color: #657282;
  font-size: 13px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.chart-panel {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  min-height: 460px;
  padding: 18px;
}

.chart-wide {
  grid-column: 1 / -1;
}

.chart-title {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-title h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 2px;
}

.chart-panel canvas {
  height: 380px !important;
  width: 100% !important;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px 22px;
  background: #ffffff;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #d4a017 0%, #b8860b 100%);
}

.page-header > div:first-child {
  padding-left: 14px;
}

.page-header h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

.eyebrow {
  color: #b8860b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d4a017;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn-text {
  line-height: 1;
}

.search-form {
  display: flex;
  gap: 8px;
  min-width: min(460px, 48vw);
  align-items: stretch;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-width: 220px;
}

.search-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 15px;
  pointer-events: none;
}

.search-form .search-input {
  width: 100%;
  height: 40px;
  padding-left: 38px;
  padding-right: 36px;
  border-radius: 10px;
  border-color: #e2e8f0;
  background: #ffffff;
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.search-form .search-input::placeholder {
  color: #a3acbb;
}

.search-form .search-input:focus {
  border-color: #d4a017;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
}

.search-form .search-input:focus + .search-input-clear,
.search-input-wrap:focus-within .search-input-icon {
  color: #b8860b;
}

.search-input-clear {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.search-input-clear:hover {
  background: #f1f4f8;
  color: #475569;
}

.search-submit-btn {
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-weight: 600;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.search-submit-btn:hover {
  background: rgba(212, 160, 23, 0.08);
  border-color: rgba(212, 160, 23, 0.35);
  color: #b8860b;
}

.create-btn {
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
  border: 0;
  color: #ffffff;
  font-weight: 700;
  padding: 0 18px;
  box-shadow: 0 8px 18px -10px rgba(184, 134, 11, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.create-btn:hover,
.create-btn:focus {
  color: #ffffff;
  filter: brightness(1.05);
  box-shadow: 0 12px 22px -10px rgba(184, 134, 11, 0.7);
}

.create-btn:active {
  transform: translateY(1px);
}

.data-panel,
.form-panel {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 16px -12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.table-shell,
.detail-list {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
}

.table-shell {
  overflow: auto;
  max-height: calc(100vh - 240px);
}

.table-shell .table {
  margin-bottom: 0;
}

.data-panel .table-shell {
  border: 0;
  border-radius: 0;
}

.data-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafbfd;
  color: #6b7280;
  border-bottom: 1px solid #e6ebf2;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.data-table tbody td {
  border-color: #f1f4f8;
  border-bottom: 1px solid #f1f4f8;
  vertical-align: middle;
  padding-top: 12px;
  padding-bottom: 12px;
  color: #1f2933;
}

.data-table tbody tr {
  transition: background-color 0.12s ease;
}

.data-table tbody tr:hover {
  background: #fbf7ed;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.cell-value {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-yes {
  background: #ecfdf3;
  color: #027a48;
  border-color: #abefc6;
}

.status-no {
  background: #fef3f2;
  color: #b42318;
  border-color: #fecdca;
}

.status-open {
  background: #eff8ff;
  color: #175cd3;
  border-color: #b2ddff;
}

.status-closed {
  background: #f2f4f7;
  color: #475467;
  border-color: #d0d5dd;
}

.action-col {
  width: 112px;
}

.row-actions {
  justify-content: flex-end;
  gap: 4px;
}

.row-actions form {
  display: inline-flex;
}

.row-actions .btn {
  border-color: transparent;
  background: transparent;
  color: #64748b;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.row-actions .btn:hover {
  background: rgba(212, 160, 23, 0.1);
  color: #b8860b;
}

.row-actions .btn.text-danger:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c !important;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
}

.sort-link {
  align-items: center;
  color: #6b7280;
  display: inline-flex;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 700;
}

.sort-link:hover {
  color: #b8860b;
}

.sort-link i {
  font-size: 14px;
  color: #b8860b;
}

.filter-row th {
  background: #ffffff;
  padding-bottom: 10px;
  padding-top: 10px;
  border-bottom: 1px solid #eef1f5;
}

.filter-row .form-control {
  min-width: 120px;
  border-color: #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
}

.filter-row .form-control:focus {
  background: #fff;
  border-color: #d4a017;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
}

.filter-actions {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.table-toolbar {
  margin-bottom: 14px;
  padding: 12px 14px;
}

.commission-type-filter {
  align-items: center;
  display: flex;
  gap: 12px;
}

.commission-total {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #fff8e1 0%, #fef3c7 100%);
  border: 1px solid #f0d896;
  border-radius: 10px;
  box-shadow: 0 4px 12px -8px rgba(184, 134, 11, 0.4);
}

.commission-total-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b6914;
}

.commission-total-value {
  font-size: 16px;
  font-weight: 700;
  color: #7a5a0e;
  letter-spacing: -0.01em;
}

.inactive-promo-row > * {
  background: #fee2e2 !important;
}

.inline-commission-form {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.inline-commission-form .form-control {
  width: 110px;
}

.inline-stock-form {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.inline-stock-form .form-control {
  width: 92px;
}

.detail-submit-field {
  align-self: end;
}

.history-tabs {
  margin-bottom: 16px;
}

.history-tabs .nav-link {
  color: #536171;
  font-weight: 700;
}

.history-tabs .nav-link.active {
  color: #0d6efd;
}

.history-tab-content {
  min-height: 280px;
}

.empty-state {
  color: #657282;
  padding: 56px 16px !important;
  text-align: center;
}

.pagination-wrap {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e6ebf2;
  border-radius: 12px;
}

.pagination-info {
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.pagination-controls,
.page-size-form {
  align-items: center;
  display: flex;
  gap: 12px;
}

.page-size-form .form-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.page-size-form .form-select {
  width: 82px;
  border-radius: 8px;
  border-color: #e2e8f0;
}

.pagination-wrap .pagination {
  margin: 0;
  gap: 2px;
}

.pagination-wrap .page-link {
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.pagination-wrap .page-link:hover {
  background: rgba(212, 160, 23, 0.1);
  color: #b8860b;
}

.pagination-wrap .page-item.active .page-link {
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 10px -6px rgba(184, 134, 11, 0.5);
}

.pagination-wrap .page-item.disabled .page-link {
  color: #cbd5e1;
  background: transparent;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f4;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-key {
  color: #657282;
  font-weight: 600;
}

.form-panel {
  padding: 20px;
}

.record-form {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px 20px;
}

.field {
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.form-label {
  color: #344054;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control {
  border-color: #cfd8e3;
  border-radius: 7px;
}

.form-select {
  border-color: #cfd8e3;
  border-radius: 7px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #3671e9;
  box-shadow: 0 0 0 0.2rem rgba(54, 113, 233, 0.12);
}

.switch-field {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 2.8em;
}

.switch-field .form-check-input {
  width: 2.4em;
  height: 1.25em;
  margin-left: -2.8em;
}

.switch-field .form-check-input:checked {
  background-color: #167444;
  border-color: #167444;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #edf1f5;
}

.narrow-form {
  max-width: 480px;
}

.invoice-panel {
  padding: 18px;
}

.invoice-header-panel {
  padding: 14px 18px;
}

.invoice-header-compact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.invoice-header-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.invoice-header-fields .form-label {
  font-size: 11px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
}

.invoice-header-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.invoice-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.invoice-add-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #eef1f5;
}

.invoice-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e6ebf2;
  color: #344054;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.invoice-add-btn:hover {
  transform: translateY(-1px);
  border-color: transparent;
  box-shadow: 0 10px 22px -10px rgba(15, 23, 42, 0.18);
}

.invoice-add-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex: 0 0 36px;
}

.invoice-add-btn--treatment .invoice-add-icon {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.invoice-add-btn--product .invoice-add-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.invoice-add-btn--promo .invoice-add-icon {
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
}

.invoice-add-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.invoice-add-label {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.invoice-add-sub {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invoice-add-plus {
  color: #cbd5e1;
  font-size: 16px;
  margin-left: 4px;
}

.invoice-add-btn:hover .invoice-add-plus {
  color: #b8860b;
}

@media (max-width: 768px) {
  .invoice-header-compact {
    grid-template-columns: 1fr;
  }
  .invoice-header-fields {
    grid-template-columns: 1fr 1fr;
  }
  .invoice-notes-grid {
    grid-template-columns: 1fr;
  }
  .invoice-add-btn {
    flex: 1 1 100%;
  }
}

.section-title {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.invoice-header-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.invoice-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.invoice-summary > div {
  background: #f8fafc;
  border: 1px solid #e3e9f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.invoice-summary span {
  color: #657282;
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.invoice-summary strong {
  display: block;
  font-size: 22px;
  margin-top: 2px;
}

.invoice-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 18px;
  align-items: start;
}

.invoice-payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.invoice-close-actions {
  justify-content: flex-end;
}

.invoice-tabs {
  border-bottom-color: #dbe2ea;
}

.invoice-tabs .nav-link {
  color: #536171;
  font-weight: 700;
}

.invoice-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf1f5;
}

.compact-detail-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
  border-bottom: 1px solid #edf1f5;
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.compact-detail-form .btn {
  min-height: 38px;
}

.invoice-detail-section {
  position: relative;
  background: #ffffff;
  border: 1px solid #e6ebf2;
  border-left-width: 3px;
  border-radius: 12px;
  padding: 14px 14px 4px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.invoice-detail-section--promo {
  border-left-color: #d4a017;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 60%);
}

.invoice-detail-section--treatment {
  border-left-color: #06b6d4;
  background: linear-gradient(180deg, #ecfeff 0%, #ffffff 60%);
}

.invoice-detail-section--product {
  border-left-color: #8b5cf6;
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 60%);
}

.invoice-detail-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px dashed #eef1f5;
}

.invoice-detail-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 17px;
  flex: 0 0 34px;
  box-shadow: 0 4px 10px -6px rgba(15, 23, 42, 0.35);
}

.invoice-detail-section--promo .invoice-detail-badge {
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
}

.invoice-detail-section--treatment .invoice-detail-badge {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.invoice-detail-section--product .invoice-detail-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.invoice-detail-heading-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.invoice-detail-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.005em;
}

.invoice-detail-meta {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.invoice-detail-section .table-shell {
  border: 0;
  background: transparent;
}

.invoice-detail-section thead th {
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid #eef1f5;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.invoice-finalize-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #edf1f5;
}

.invoice-finalize-divider {
  width: 1px;
  height: 28px;
  background: #e2e8f0;
  margin: 0 4px;
}

.invoice-btn-save {
  border: 1px solid #d4a017;
  color: #b8860b;
  background: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 16px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.invoice-btn-save:hover {
  background: rgba(212, 160, 23, 0.1);
  color: #8b6914;
}

.invoice-btn-close {
  border: 1px solid #e2e8f0;
  color: #475569;
  background: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 16px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.invoice-btn-close:hover {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.invoice-btn-print {
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
  border: 0;
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 18px;
  box-shadow: 0 8px 18px -10px rgba(184, 134, 11, 0.6);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.invoice-btn-print:hover {
  filter: brightness(1.04);
  color: #fff;
  box-shadow: 0 12px 22px -10px rgba(184, 134, 11, 0.7);
}

.invoice-btn-print:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .invoice-finalize-bar {
    flex-wrap: wrap;
  }
  .invoice-finalize-divider {
    display: none;
  }
  .invoice-btn-save,
  .invoice-btn-close,
  .invoice-btn-print {
    flex: 1 1 100%;
  }
}

.inline-table {
  max-height: none;
}

.inline-table table {
  min-width: 760px;
}

.empty-state.compact {
  padding: 24px 12px !important;
}

.take-promo-form {
  display: inline-grid;
  grid-template-columns: minmax(120px, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

.print-body {
  background: #fff;
  color: #111827;
}

.print-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

.print-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 18px;
}

.print-header {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}

.print-logo {
  max-width: 110px;
  height: auto;
}

.print-header address {
  margin: 0;
}

.print-header h1 {
  font-size: 22px;
  text-decoration: underline;
  margin: 0 0 8px;
}

.print-group td {
  border-bottom: 1px solid #111827;
  font-weight: 800;
  padding-top: 14px;
}

.print-spacer {
  width: 30%;
}

@media (max-width: 900px) {
  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions,
  .search-form {
    width: 100%;
  }

  .search-form {
    min-width: 0;
  }

  .search-form .form-control {
    min-width: 0;
  }

  .pagination-wrap,
  .pagination-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-wrap .pagination {
    flex-wrap: wrap;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .invoice-header-grid,
  .compact-detail-form,
  .invoice-workspace,
  .invoice-summary,
  .invoice-payment-grid,
  .modal-form-grid {
    grid-template-columns: 1fr;
  }

  .invoice-side {
    min-width: 0;
  }
}

@media print {
  .print-toolbar {
    display: none;
  }

  .print-page {
    max-width: none;
    padding: 0;
  }

  .table > :not(caption) > * > * {
    background-color: transparent !important;
  }
}
