.app-header-title {
  font-size: 1.72rem;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

.section-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 1.25rem;
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.08);
}

.kpi-card {
  border-radius: 1.15rem;
  min-height: 132px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.kpi-card p,
.kpi-card h3 {
  margin: 0;
}

.dashboard-table-wrap {
  border: 1px solid var(--border-default);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.app-table tbody tr {
  transition: background-color 140ms ease;
}

.app-table tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.06);
}

.dark .app-table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.14);
}

.sidebar-link {
  border: 1px solid transparent;
}

.app-shell {
  background:
    radial-gradient(circle at top left, rgba(43, 174, 231, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(5, 68, 164, 0.03) 0%, rgba(255, 255, 255, 0) 22%);
}

.top-shell {
  background: linear-gradient(180deg, rgba(254, 254, 254, 0.96), rgba(247, 250, 255, 0.92));
  backdrop-filter: blur(10px);
}

.dark .top-shell {
  background: linear-gradient(180deg, rgba(18, 33, 63, 0.96), rgba(18, 33, 63, 0.92));
}

.theme-toggle {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid rgba(146, 181, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fefefe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(43, 174, 231, 0.5);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 28px rgba(5, 68, 164, 0.24);
}

.theme-toggle svg {
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  transition: opacity 180ms ease, transform 180ms ease;
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: scale(0.72) rotate(-18deg);
}

.theme-toggle .icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-toggle.is-light {
  background: rgba(254, 254, 254, 0.94);
  color: #0544a4;
}

.theme-toggle.is-light .icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-toggle.is-light .icon-moon {
  opacity: 0;
  transform: scale(0.72) rotate(18deg);
}

.theme-toggle.is-dark {
  background: rgba(10, 27, 59, 0.95);
  color: #fefefe;
}

.sidebar-brand {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(43, 174, 231, 0.12), rgba(5, 68, 164, 0.08));
}

.sidebar-brand::before {
  content: '';
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(43, 174, 231, 0.95), rgba(166, 209, 62, 0.78));
}

.sidebar-brand::after {
  content: '';
  position: absolute;
  right: -2.5rem;
  top: -2rem;
  width: 7rem;
  height: 7rem;
  border-radius: 999px;
  background: rgba(43, 174, 231, 0.08);
}

.sidebar-brand-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 10.75rem;
  height: auto;
}

.sidebar-brand-caption {
  position: relative;
  z-index: 1;
}

.login-shell {
  background:
    radial-gradient(circle at top left, rgba(43, 174, 231, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(166, 209, 62, 0.12), transparent 26%),
    linear-gradient(135deg, #f5f9ff 0%, #fefefe 52%, #eef5ff 100%);
}

.dark .login-shell {
  background:
    radial-gradient(circle at top left, rgba(43, 174, 231, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(166, 209, 62, 0.08), transparent 22%),
    linear-gradient(135deg, #07111f 0%, #0b1830 48%, #101f3b 100%);
}

.login-brand-panel {
  background: linear-gradient(160deg, #04327a 0%, #0544a4 58%, #0b4fbb 100%);
  position: relative;
  overflow: hidden;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  inset: -20% auto auto -15%;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: rgba(43, 174, 231, 0.14);
  filter: blur(8px);
}

.login-brand-panel::after {
  content: '';
  position: absolute;
  right: -4rem;
  bottom: -4rem;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: rgba(166, 209, 62, 0.12);
}

.login-brand-panel > * {
  position: relative;
  z-index: 1;
}

.dark .login-brand-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02)),
    linear-gradient(160deg, #032454 0%, #0544a4 56%, #0b5bcf 100%);
  box-shadow: 0 28px 70px rgba(2, 8, 23, 0.38);
}

.login-form-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 231, 255, 0.9);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(16px);
}

.dark .login-form-card {
  background: rgba(13, 24, 45, 0.94);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 28px 76px rgba(2, 8, 23, 0.45);
}

.login-title {
  color: #0f172a;
}

.dark .login-title {
  color: #f8fafc;
}

.login-subtitle {
  color: #64748b;
}

.dark .login-subtitle {
  color: #9fb0c9;
}

.login-label {
  color: #334155;
}

.dark .login-label {
  color: #dbe7ff;
}

.login-help-text {
  color: #94a3b8;
}

.dark .login-help-text {
  color: rgba(226, 232, 240, 0.62);
}

.password-toggle-button {
  flex: 0 0 auto;
  min-width: 5.25rem;
  min-height: 3rem;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border-color: rgba(203, 213, 225, 0.9);
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
}

.password-toggle-button:hover {
  border-color: rgba(43, 174, 231, 0.68);
  color: #0544a4;
  background: rgba(255, 255, 255, 0.98);
}

.dark .password-toggle-button {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.92);
  color: #dbe7ff;
}

.dark .password-toggle-button:hover {
  border-color: rgba(43, 174, 231, 0.62);
  color: #f8fafc;
  background: rgba(37, 52, 77, 0.98);
}

.login-submit-button {
  box-shadow: 0 14px 30px rgba(5, 68, 164, 0.22);
}

.dark .login-submit-button {
  background: linear-gradient(135deg, #0b5bcf 0%, #0544a4 100%);
  box-shadow: 0 18px 36px rgba(4, 23, 51, 0.38);
}

.login-credit {
  margin-top: 1.2rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.035em;
  color: rgba(100, 116, 139, 0.82);
  opacity: 0.74;
}

.dark .login-credit {
  border-top-color: rgba(148, 163, 184, 0.12);
  color: rgba(203, 213, 225, 0.72);
}

.dark #login-error {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
}

.dark .login-brand-slot[data-logo-slot='card'] .login-brand-image,
.dark .login-brand-slot[data-logo-slot='mobile'] .login-brand-image {
  filter: brightness(0) invert(1);
}

.login-brand-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.login-brand-fallback {
  display: none;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-brand-slot.is-fallback .login-brand-image {
  display: none;
}

.login-brand-slot.is-fallback .login-brand-fallback {
  display: inline-flex;
}

.app-modal-overlay {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.app-modal-shell {
  width: 100%;
  max-height: calc(100vh - 1.5rem);
  display: flex;
  flex-direction: column;
}

.app-modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.125rem;
}

.app-modal-results {
  max-height: min(18rem, 38vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#contract-scroll-box {
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #0f172a;
  box-shadow:
    inset 0 1px 10px rgba(15, 23, 42, 0.1),
    0 10px 20px rgba(15, 23, 42, 0.07);
}

#contract-scroll-box * {
  color: #111827;
}

#signature-canvas {
  touch-action: none;
}

@media (max-width: 1279px) {
  .app-header-title {
    font-size: 1.52rem;
  }
}

@media (max-width: 1023px) {
  .app-shell {
    background:
      radial-gradient(circle at top left, rgba(43, 174, 231, 0.08), transparent 28%),
      linear-gradient(180deg, rgba(5, 68, 164, 0.02) 0%, rgba(255, 255, 255, 0) 20%);
  }

  .section-shell {
    border-radius: 1.15rem;
  }

  #sidebar-content {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.9rem);
    z-index: 30;
  }
}

@media (max-width: 768px) {
  .app-modal-shell {
    max-height: calc(100vh - 1rem);
    border-radius: 1.1rem;
  }
}

@media (max-width: 767px) {
  .app-header-title {
    font-size: 1.34rem;
    line-height: 1.22;
  }

  .kpi-card {
    min-height: 118px;
  }
}

@media (max-width: 640px) {
  .password-toggle-button {
    min-width: 5rem;
    min-height: 2.9rem;
  }
}

@media (max-width: 520px) {
  .password-field-row {
    grid-template-columns: 1fr;
  }

  .password-toggle-button {
    width: 100%;
  }
}

@media (max-width: 479px) {
  .section-shell {
    border-radius: 1rem;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}
