:root {
  --brand: #60102f;
  --brand-dark: #41081f;
  --brand-soft: #f7eef1;
  --charcoal: #27272a;
  --charcoal-dark: #18181b;
  --page: #f4f3f3;
  --surface: #ffffff;
  --surface-soft: #f7f6f6;
  --line: #e3e0e1;
  --text: #252427;
  --muted: #747075;
  --success: #168a51;
  --success-soft: #eaf7f0;
  --danger: #b4233c;
  --danger-soft: #fff0f2;
  --warning: #8a6500;
  --warning-soft: #fff7dc;
  --shadow: 0 10px 28px rgba(32, 27, 29, 0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1.2);
  --motion-fast: 180ms;
  --motion: 360ms;
}

/* Yönetim raporu */
.report-shell {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.report-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.25rem 0 1rem;
  animation: rise-in 440ms var(--ease) both;
}

.report-heading h1 {
  margin: 0;
  color: var(--charcoal-dark);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 720;
  letter-spacing: -0.03em;
}

.report-heading > div > p:last-child {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.report-back,
.report-downloads a,
.report-filter button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--charcoal);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 550;
  text-decoration: none;
  transition: transform var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}

.report-back {
  gap: 0.4rem;
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.report-back:hover {
  border-color: var(--brand-dark);
  color: #fff;
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.report-filter {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) auto minmax(220px, auto);
  align-items: end;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(32, 27, 29, 0.05);
}

.report-filter label span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.report-filter input {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d5d1d3;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #fff;
}

.report-filter input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(96, 16, 47, 0.1);
}

.report-filter button {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.report-filter button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.report-downloads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.report-downloads a {
  position: relative;
  overflow: hidden;
  font-weight: 700;
}

.report-downloads a::after {
  content: "";
  position: absolute;
  inset: -45% auto -45% -36%;
  width: 28%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-18deg) translateX(-220%);
  transition: transform 420ms var(--ease);
}

.report-downloads a:hover::after,
.report-downloads a:focus-visible::after {
  transform: skewX(-18deg) translateX(620%);
}

.report-downloads a.is-excel {
  border-color: var(--success);
  color: #fff;
  background: var(--success);
}

.report-downloads a.is-pdf {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
}

.report-downloads a.is-excel:hover {
  border-color: #0f7040;
  color: #fff;
  background: #0f7040;
  box-shadow: 0 8px 20px rgba(22, 138, 81, 0.2);
  transform: translateY(-2px);
}

.report-downloads a.is-pdf:hover {
  border-color: #941b31;
  color: #fff;
  background: #941b31;
  box-shadow: 0 8px 20px rgba(180, 35, 60, 0.2);
  transform: translateY(-2px);
}

.report-downloads a:active {
  transform: translateY(0) scale(0.97);
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.report-cards article {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(32, 27, 29, 0.045);
  animation: rise-in 440ms var(--ease) both;
}

.report-cards article::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -36px;
  width: 92px;
  height: 92px;
  border: 16px solid var(--brand-soft);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.report-cards article.is-approved::after { border-color: var(--success-soft); }
.report-cards article.is-rejected::after { border-color: var(--danger-soft); }

.report-cards span,
.report-cards small {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.report-cards strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0.18rem 0;
  color: var(--brand);
  font-size: 1.85rem;
  font-weight: 720;
}

.report-cards .is-approved strong { color: var(--success); }
.report-cards .is-rejected strong { color: var(--danger); }

.report-panel {
  margin-top: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(32, 27, 29, 0.045);
}

.report-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.report-panel h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.report-panel > header span {
  color: var(--muted);
  font-size: 0.76rem;
}

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

.report-pending-grid article {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.report-pending-grid span,
.report-pending-grid small { display: block; color: var(--muted); font-size: 0.78rem; }
.report-pending-grid strong { display: block; margin: 0.18rem 0; font-size: 1.05rem; font-weight: 700; }

.report-table-wrap { overflow-x: auto; }

.report-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.report-table th,
.report-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.report-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.report-table tbody tr { transition: background var(--motion-fast) var(--ease); }
.report-table tbody tr:hover { background: #faf8f9; }
.report-table tbody tr:last-child td { border-bottom: 0; }

.report-badge {
  display: inline-flex;
  padding: 0.24rem 0.48rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.report-badge.is-approved { color: #0d693c; background: var(--success-soft); }
.report-badge.is-rejected { color: #962038; background: var(--danger-soft); }
.report-empty { padding: 1.4rem !important; color: var(--muted); text-align: center !important; }

@media (max-width: 900px) {
  .report-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .report-shell { padding: 1rem; }
  .report-heading { align-items: flex-start; flex-direction: row; margin: 0 0 0.85rem; }
  .report-heading > div { min-width: 0; flex: 1 1 auto; }
  .report-heading h1 { font-size: 1.32rem; white-space: nowrap; }
  .report-heading > div > p:last-child { max-width: 240px; font-size: 0.8rem; line-height: 1.4; }
  .report-back { min-height: 36px; flex: 0 0 auto; padding: 0.45rem 0.65rem; }
  .report-filter { grid-template-columns: 1fr; padding: 0.75rem; }
  .report-downloads { grid-template-columns: 1fr 1fr; }
  .report-cards { gap: 0.55rem; }
  .report-cards article { min-height: 105px; padding: 0.75rem; }
  .report-cards strong { font-size: 1.5rem; }
  .report-cards small { max-width: 100%; line-height: 1.25; overflow-wrap: anywhere; }
  .report-pending-grid { grid-template-columns: 1fr; }
  .report-panel { border-radius: var(--radius-lg); }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  font-size: 16px;
}

@media (min-width: 901px) {
  html {
    font-size: 90%;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: "Manrope", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  animation: page-fade-in 180ms ease-out both;
}

button,
input,
select {
  font: inherit;
}

button {
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  transition: border-color 160ms var(--ease), color 160ms var(--ease),
    background 160ms var(--ease), box-shadow 160ms var(--ease),
    transform 160ms var(--ease), opacity 160ms var(--ease);
}

button:not(:disabled):active {
  transform: translateY(0) scale(0.965);
}

.ui-ripple {
  position: absolute;
  z-index: 20;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.34);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 560ms ease-out forwards;
}

.action-reject .ui-ripple,
.refresh-button .ui-ripple,
.filter-toggle .ui-ripple,
.clear-filters .ui-ripple,
.apply-filters .ui-ripple {
  background: rgba(96, 16, 47, 0.15);
}

.ui-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.header-refresh-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: none;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header-refresh-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(22deg);
}

[hidden] {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), #4a0b23);
  box-shadow: 0 4px 18px rgba(65, 8, 31, 0.2);
  animation: slide-down 240ms var(--ease) both;
}

.app-navigation {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.42rem clamp(0.85rem, 2vw, 1.6rem);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.brand:hover,
.brand:focus {
  color: #fff;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
  animation: logo-spring 680ms 80ms var(--ease-spring) both;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 700;
}

.brand-copy small {
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-area form {
  margin: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(30, 35, 42, 0.55);
  font-size: 0.8rem;
  font-weight: 800;
}

.signed-in-user {
  max-width: 180px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.86rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  min-height: 34px;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgba(17, 20, 24, 0.16);
  font-size: 0.84rem;
  font-weight: 700;
}

.logout-button:hover {
  background: rgba(17, 20, 24, 0.3);
  transform: translateY(-1px);
}

.app-main {
  min-height: calc(100vh - 112px);
  padding: 0.85rem clamp(0.85rem, 2vw, 1.6rem) 2rem;
}

.app-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(1rem, 2vw, 2rem);
  border-top: 1px solid rgba(96, 16, 47, 0.12);
  color: var(--muted);
  background: #f3ecef;
  font-size: 0.78rem;
}

.app-footer > span {
  white-space: nowrap;
}

.app-footer .last-refresh-status {
  margin: 0;
  font-size: 0.67rem;
  font-weight: 550;
  text-align: center;
}

.approval-shell {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
}

.approval-shell.is-history-return {
  animation: history-return-in 340ms var(--ease) both;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  animation: rise-in 440ms 60ms var(--ease) both;
}

.workspace-heading > div:first-child {
  min-width: 0;
}

.workspace-kicker {
  margin: 0 0 0.2rem;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.workspace-heading h1 {
  margin: 0;
  color: var(--charcoal-dark);
  font-size: clamp(1.32rem, 2vw, 1.68rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.refresh-button,
.history-button,
.report-button,
.pagination-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: #3b434c;
  background: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.refresh-button:hover,
.history-button:hover,
.report-button:hover,
.pagination-button:hover:not(:disabled) {
  border-color: #adb5bf;
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.report-button {
  color: var(--brand);
}

.report-button:hover {
  color: var(--brand-dark);
}

.workspace-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.55rem;
}

.workspace-actions > * {
  white-space: nowrap;
}

.history-button {
  border-color: #cad0d7;
  color: #fff;
  background: var(--charcoal);
}

.history-button:hover:not(:disabled) {
  color: #fff;
  background: #343437;
}

.approval-overview {
  position: relative;
  overflow: hidden;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.7rem 0.9rem;
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, var(--charcoal-dark), #3a383a);
  box-shadow: var(--shadow);
  animation: hero-in 560ms 100ms var(--ease) both;
}

.approval-overview::before {
  content: "";
  position: absolute;
  top: -78px;
  right: -64px;
  width: 190px;
  height: 190px;
  border: 34px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  pointer-events: none;
}

.approval-overview::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -22%;
  width: 16%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  pointer-events: none;
  transform: translateX(-160%) skewX(-18deg);
  display: none;
}

.approval-overview > * {
  position: relative;
  z-index: 1;
}

.overview-copy {
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.overview-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.1rem;
}

.overview-icon .ui-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.overview-copy small,
.overview-copy strong {
  display: block;
}

.overview-copy small {
  margin-bottom: 0.2rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  font-weight: 400;
}

.overview-copy strong {
  font-size: 1.06rem;
  font-weight: 700;
}

.overview-metrics {
  display: flex;
  align-items: stretch;
}

.overview-metric {
  min-width: 118px;
  padding: 0.1rem 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}

.overview-metric strong,
.overview-metric span {
  display: block;
}

.overview-metric strong {
  font-size: 1.55rem;
  line-height: 1.05;
  font-weight: 700;
}

.overview-metric span {
  margin-top: 0.25rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  white-space: nowrap;
}

.overview-metric.is-selected strong {
  color: #e3b1c4;
}

.document-tabs {
  position: relative;
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 20px rgba(32, 27, 29, 0.05);
  scrollbar-width: none;
  animation: rise-in 460ms 150ms var(--ease) both;
}

.document-tabs::after {
  content: "";
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 0;
  width: 205px;
  height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--brand);
  pointer-events: none;
  transform: translateX(0);
  transition: transform 360ms var(--ease);
  will-change: transform;
}

.document-tabs.is-sale-active::after {
  transform: translateX(205px);
}

.document-tabs::-webkit-scrollbar {
  display: none;
}

.document-tab {
  position: relative;
  min-width: 205px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 0;
  color: #747c87;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.document-tab:hover:not(:disabled) {
  color: var(--charcoal);
  background: #faf9fb;
}

.document-tab.is-active {
  color: var(--brand);
}

.document-tab em {
  min-width: 27px;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  color: #606873;
  background: #eef1f4;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 850;
}

.document-tab.is-active em {
  color: #fff;
  background: var(--brand);
}

.filter-toggle-row {
  display: none;
  animation: rise-in 460ms 190ms var(--ease) both;
}

.filter-toggle {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--charcoal);
  background: #fff;
  box-shadow: 0 4px 14px rgba(32, 27, 29, 0.06);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
}

.filter-toggle:hover,
.filter-toggle[aria-expanded="true"] {
  border-color: rgba(96, 16, 47, 0.38);
  color: var(--brand);
  box-shadow: 0 7px 18px rgba(96, 16, 47, 0.1);
  transform: translateY(-1px);
}

.filter-toggle-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.filter-summary {
  margin-left: auto;
  min-width: 21px;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  color: var(--muted);
  background: #f0f1f5;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.filter-toggle.has-active-filters .filter-summary {
  color: #fff;
  background: var(--brand);
}

.filter-toggle.has-active-sort .filter-summary {
  color: #fff;
  background: var(--charcoal);
}

.filter-toggle-chevron {
  width: 7px;
  height: 7px;
  margin-left: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: #7a828c;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms var(--ease);
}

.filter-toggle[aria-expanded="true"] .filter-toggle-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.filter-group {
  display: contents;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(150px, 0.55fr) minmax(120px, 0.4fr) auto;
  align-items: end;
  gap: 0.6rem;
  padding: 0.65rem;
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 4px 14px rgba(32, 27, 29, 0.055);
  animation: rise-in 480ms 190ms var(--ease) both;
}

.filter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 0.45rem;
}

.filter-field {
  min-width: 0;
  transition: transform 260ms var(--ease);
}

.filter-field:focus-within {
  transform: translateY(-2px);
}

.filter-field span {
  display: block;
  margin-bottom: 0.3rem;
  color: #616a75;
  font-size: 0.7rem;
  font-weight: 850;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 38px;
  padding: 0.48rem 0.62rem;
  border: 1px solid #cfd5dc;
  border-radius: var(--radius-sm);
  outline: 0;
  color: #29313a;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  transition: border-color 220ms ease, box-shadow 300ms var(--ease),
    transform 260ms var(--ease), background 220ms ease;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(96, 16, 47, 0.11);
  transform: scale(1.003);
}

.clear-filters,
.apply-filters {
  min-height: 38px;
  padding: 0.48rem 0.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 800;
  transition: transform 180ms var(--ease), background-color 180ms ease,
    border-color 180ms ease, box-shadow 180ms ease;
}

.clear-filters {
  border-color: #cbd3dc;
  color: #566372;
  background: #fff;
}

.clear-filters:hover:not(:disabled) {
  border-color: #9eabb9;
  color: #344150;
  background: #edf1f5;
  transform: translateY(-1px);
}

.apply-filters {
  border-color: #3567a6;
  color: #fff;
  background: #3567a6;
  box-shadow: 0 5px 14px rgba(53, 103, 166, 0.17);
}

.apply-filters:hover:not(:disabled) {
  border-color: #2a568d;
  background: #2a568d;
  box-shadow: 0 7px 18px rgba(42, 86, 141, 0.23);
  transform: translateY(-1px);
}

.clear-filters:active:not(:disabled),
.apply-filters:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

.status-message {
  padding: 0.8rem 1rem;
  margin-top: 0.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 650;
  animation: rise-in 360ms var(--ease) both;
}

.last-refresh-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: right;
}

.last-refresh-status time {
  color: #4f565f;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.status-message.is-success {
  border-color: #a9d7bd;
  color: #125f38;
  background: var(--success-soft);
}

.status-message.is-warning {
  border-color: #e8d28c;
  color: var(--warning);
  background: var(--warning-soft);
}

.status-message.is-error {
  border-color: #e7b1ad;
  color: #8c2119;
  background: var(--danger-soft);
}

.action-bar {
  position: sticky;
  top: 70px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: 0.55rem 0.7rem;
  margin: 0.65rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 5px 18px rgba(32, 27, 29, 0.07);
  isolation: isolate;
  animation: rise-in 260ms 80ms var(--ease) both;
}

.select-all-control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.87rem;
  font-weight: 500;
}

.form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  cursor: pointer;
}

.form-check-input:checked {
  border-color: var(--brand);
  background-color: var(--brand);
  animation: selection-check-pop 260ms var(--ease-spring) both;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-button,
.confirmation-cancel,
.confirmation-submit,
.login-button {
  min-height: 38px;
  padding: 0.45rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 600;
  transition: transform 160ms var(--ease), opacity 160ms var(--ease),
    color 160ms var(--ease), background 160ms var(--ease),
    border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.action-button:not(:disabled):active,
.confirmation-cancel:active,
.confirmation-submit:active,
.login-button:active {
  transform: translateY(1px);
}

.action-button:disabled,
.refresh-button:disabled,
.header-refresh-button:disabled,
.history-button:disabled,
.clear-filters:disabled,
.apply-filters:disabled,
.pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.action-approve,
.confirmation-submit {
  color: #fff;
  background: var(--success);
}

.action-approve:hover:not(:disabled) {
  background: #107443;
  box-shadow: 0 8px 20px rgba(22, 138, 81, 0.22);
  transform: translateY(-1px);
}

.action-reject {
  border-color: #e5b3af;
  color: var(--danger);
  background: #fff;
}

.action-reject:hover:not(:disabled) {
  border-color: rgba(180, 35, 60, 0.48);
  background: var(--danger-soft);
  box-shadow: 0 8px 20px rgba(180, 35, 60, 0.14);
  transform: translateY(-1px);
}

.loading-state,
.empty-state {
  padding: 2.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: #fff;
  text-align: center;
  animation: rise-in 520ms 260ms var(--ease) both;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  display: inline-block;
  margin-right: 0.4rem;
  border: 2px solid #e5a4b6;
  border-top-color: var(--brand);
  border-radius: 50%;
  vertical-align: -0.25rem;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 1.35rem;
  font-weight: 900;
  animation: logo-spring 620ms 330ms var(--ease-spring) both;
}

.empty-state h2 {
  margin: 0;
  color: var(--charcoal-dark);
  font-size: 1.15rem;
  font-weight: 700;
}

.empty-state p {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
}

.document-card-list {
  display: grid;
  gap: 0.85rem;
}

.approval-document-card {
  overflow: hidden;
  border: 1px solid #d4d9df;
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
  content-visibility: auto;
  contain-intrinsic-size: auto 240px;
  animation: card-in 280ms var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 6) * 18ms);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease),
    transform 160ms var(--ease);
}

.approval-document-card.is-purchase,
.approval-document-card.is-sale {
  border-left-color: var(--brand);
}

.approval-document-card:hover {
  box-shadow: 0 12px 30px rgba(32, 27, 29, 0.11);
  transform: translateY(-1px);
}

.approval-document-card.is-selected {
  border-left-color: var(--charcoal);
  background: #f7f7f8;
  box-shadow: 0 8px 26px rgba(24, 24, 27, 0.14);
  animation: document-selected 360ms var(--ease) both;
  animation-delay: 0ms;
}

.approval-document-card.is-selected .form-check-input:checked {
  border-color: var(--charcoal);
  background-color: var(--charcoal);
}

.approval-document-card.is-selected .document-details-toggle {
  color: var(--charcoal-dark);
  background: #f2f2f3;
}

.document-card-top {
  display: grid;
  grid-template-columns: auto minmax(260px, 1.2fr) minmax(320px, 2fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
}

.document-card-selection {
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  padding-top: 0.25rem;
}

.document-card-identity {
  min-width: 0;
}

.document-card-identity h2 {
  margin: 0;
  color: var(--charcoal-dark);
  font-size: 1.17rem;
  font-weight: 650;
}

.document-number-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.document-number-label {
  color: var(--muted);
  font-size: 0.88em;
  font-weight: 650;
}

.document-number-value {
  color: var(--charcoal-dark);
  font-weight: 950;
}

.document-card-identity p {
  margin: 0.26rem 0 0;
  overflow: hidden;
  color: #303740;
  font-size: 0.9rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card-identity small {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.document-card-metrics {
  min-width: 0;
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.22rem;
  scroll-snap-type: x proximity;
  scrollbar-color: #c7cdd4 transparent;
  scrollbar-width: thin;
  touch-action: pan-x;
}

.document-metric {
  min-width: 118px;
  flex: 1 0 118px;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e6eb;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  scroll-snap-align: start;
}

.document-metric small,
.document-metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-metric.is-waiting-long {
  border-color: #ead39a;
  background: #fff9e9;
}

.document-metric.is-waiting-long strong {
  color: #7c5a00;
}

.document-metric.is-waiting-critical {
  border-color: #e6b6b1;
  background: var(--danger-soft);
}

.document-metric.is-waiting-critical strong {
  color: #8c2119;
}

.document-metric small {
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
}

.document-metric strong {
  color: #252b32;
  font-size: 0.82rem;
  font-weight: 900;
}

.document-details {
  border-top: 1px solid var(--line);
}

.document-details-toggle {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  color: var(--brand);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  list-style: none;
  user-select: none;
}

.document-details-toggle::-webkit-details-marker {
  display: none;
}

.document-details-toggle:hover {
  background: var(--brand-soft);
}

.document-details-chevron {
  width: 0.52rem;
  height: 0.52rem;
  flex: 0 0 0.52rem;
  display: inline-block;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 140ms ease;
}

.document-details[open] .document-details-chevron {
  transform: rotate(225deg);
}

.document-details.is-closing .document-details-chevron {
  transform: rotate(45deg);
}

.document-detail-content {
  padding: 0 0.85rem 0.85rem;
  background: #f7f9fb;
  transform-origin: top;
}

.document-detail-content.is-animating {
  overflow: hidden;
  transition: height 230ms cubic-bezier(.2, .8, .2, 1),
    opacity 190ms ease, transform 230ms cubic-bezier(.2, .8, .2, 1);
  will-change: height, opacity, transform;
}

.document-line-table-shell {
  overflow: auto;
  border: 1px solid #dde2e7;
  border-radius: var(--radius-md);
  background: #fff;
}

.document-line-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
  font-size: 0.79rem;
}

.document-line-table th {
  padding: 0.58rem 0.62rem;
  color: #fff;
  background: var(--charcoal-dark);
  font-size: 0.71rem;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.document-line-table th.numeric,
.document-line-table td.numeric {
  text-align: right;
}

.document-line-table td {
  padding: 0.62rem;
  border-bottom: 1px solid #e8ebef;
  color: #343b43;
  vertical-align: middle;
}

.document-line-table tr:last-child td {
  border-bottom: 0;
}

.document-line-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.document-line-cards {
  display: none;
}

.desktop-table-shell {
  overflow: auto;
  border: 1px solid #d4d9df;
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow);
}

.approval-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.83rem;
}

.approval-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.68rem 0.65rem;
  color: #fff;
  background: var(--charcoal-dark);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.approval-table th.numeric,
.approval-table td.numeric {
  text-align: right;
}

.approval-table td {
  padding: 0.65rem;
  border-bottom: 1px solid #e7eaee;
  color: #333a43;
  vertical-align: middle;
}

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

.approval-table tbody:nth-of-type(even) tr {
  background: #fbfcfd;
}

.approval-table tbody:hover tr {
  background: #faf7f8;
}

.approval-table tbody.is-selected tr {
  background: var(--brand-soft);
}

.approval-table tbody + tbody tr:first-child td {
  border-top: 2px solid #d5dae0;
}

.table-select-cell {
  width: 42px;
  text-align: center;
}

.table-document-number {
  color: var(--charcoal-dark);
  font-weight: 900;
  white-space: nowrap;
}

.table-secondary {
  display: block;
  margin-top: 0.18rem;
  color: #7a838e;
  font-size: 0.71rem;
  font-weight: 600;
}

.table-customer {
  min-width: 190px;
  max-width: 260px;
  font-weight: 700;
}

.table-stock {
  min-width: 220px;
  max-width: 380px;
}

.table-stock strong,
.table-stock span {
  display: block;
}

.table-stock strong {
  color: #252b32;
  font-weight: 750;
}

.table-stock span {
  margin-top: 0.18rem;
  color: #747d88;
  font-size: 0.72rem;
}

.table-date,
.table-code,
.table-line {
  white-space: nowrap;
}

.table-price {
  color: #12161a;
  font-weight: 900;
  white-space: nowrap;
}

.price-change {
  font-weight: 900;
  white-space: nowrap;
}

.price-change.is-favorable {
  color: var(--success);
}

.price-change.is-unfavorable {
  color: var(--danger);
}

.mobile-document-list {
  display: none;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.pagination-bar span {
  min-width: 64px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 16, 21, 0.62);
  opacity: 0;
  transition: opacity 180ms ease-out;
}

.history-backdrop.is-open {
  opacity: 1;
}

.history-dialog {
  width: min(100%, 1050px);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: #f5f7f9;
  box-shadow: 0 24px 75px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease-out, transform 220ms ease-out;
}

.history-backdrop.is-open .history-dialog {
  opacity: 1;
  transform: translateY(0);
}

.history-backdrop.is-closing {
  pointer-events: none;
  opacity: 0;
}

.history-backdrop.is-closing .history-dialog {
  opacity: 0;
  transform: translateY(4px);
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.history-heading p {
  margin: 0 0 0.18rem;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-heading h2 {
  margin: 0;
  color: var(--charcoal-dark);
  font-size: 1.35rem;
}

.history-heading button {
  width: 38px;
  height: 38px;
  border: 1px solid #d2d7dd;
  border-radius: 50%;
  color: #525b66;
  background: #fff;
  font-size: 1.35rem;
}

.history-heading button:hover {
  transform: rotate(6deg) scale(1.06);
}

.history-status,
.history-loading,
.history-empty {
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.history-status {
  border-color: #e7b1ad;
  color: #8c2119;
  background: var(--danger-soft);
}

.history-table-shell {
  overflow: auto;
  border: 1px solid #d7dce2;
  border-radius: var(--radius-md);
  background: #fff;
}

.history-table {
  width: 100%;
  min-width: 790px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.history-table th {
  padding: 0.65rem;
  color: #fff;
  background: var(--charcoal-dark);
  text-align: left;
  white-space: nowrap;
}

.history-table td {
  padding: 0.68rem;
  border-bottom: 1px solid #e7eaee;
  color: #343b43;
}

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

.history-operation {
  font-weight: 900;
}

.history-operation.is-approved {
  color: var(--success);
}

.history-operation.is-rejected {
  color: var(--danger);
}

.history-cards {
  display: none;
}

.confirmation-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 16, 21, 0.58);
  opacity: 0;
  transition: opacity 160ms ease;
}

.confirmation-backdrop.is-open {
  opacity: 1;
  animation: overlay-in 280ms ease both;
}

.confirmation-dialog {
  width: min(100%, 400px);
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms var(--ease);
}

.confirmation-backdrop.is-open .confirmation-dialog {
  transform: translateY(0) scale(1);
  animation: modal-in 400ms var(--ease) both;
}

.confirmation-backdrop.is-open .confirmation-icon {
  animation: logo-spring 520ms 80ms var(--ease-spring) both;
}

.confirmation-backdrop.is-open .confirmation-dialog h2 {
  animation: rise-in 340ms 120ms var(--ease) both;
}

.confirmation-backdrop.is-open .confirmation-dialog p {
  animation: rise-in 340ms 160ms var(--ease) both;
}

.confirmation-backdrop.is-open .confirmation-actions {
  animation: rise-in 340ms 200ms var(--ease) both;
}

.confirmation-backdrop.is-closing {
  pointer-events: none;
  animation: overlay-out 210ms ease-in both;
}

.confirmation-backdrop.is-closing .confirmation-dialog {
  animation: modal-out 210ms ease-in both;
}

.confirmation-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-size: 1.15rem;
  font-weight: 900;
}

.confirmation-dialog.is-reject .confirmation-icon {
  background: var(--danger);
}

.confirmation-dialog h2 {
  margin: 0;
  color: var(--charcoal-dark);
  font-size: 1.22rem;
  font-weight: 900;
}

.confirmation-dialog p {
  margin: 0.55rem 0 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.confirmation-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0 0.2rem;
}

.confirmation-summary > div {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  text-align: center;
}

.confirmation-summary strong,
.confirmation-summary span {
  display: block;
}

.confirmation-summary strong {
  color: var(--charcoal-dark);
  font-size: 1.35rem;
  font-weight: 750;
}

.confirmation-summary span {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.confirmation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.confirmation-cancel {
  color: #343b43;
  background: #eef1f4;
}

.confirmation-dialog.is-reject .confirmation-submit {
  background: var(--danger);
}

@media (hover: hover) and (pointer: fine) {
  .confirmation-cancel:hover {
    color: var(--charcoal-dark);
    background: #e2e6ea;
    box-shadow: 0 7px 18px rgba(32, 27, 29, 0.12);
    transform: translateY(-2px);
  }

  .confirmation-submit:hover {
    background: #107443;
    box-shadow: 0 8px 20px rgba(22, 138, 81, 0.23);
    transform: translateY(-2px);
  }

  .confirmation-dialog.is-reject .confirmation-submit:hover {
    background: #941b31;
    box-shadow: 0 8px 20px rgba(180, 35, 60, 0.22);
  }
}

.login-page {
  min-height: calc(100vh - 155px);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 14% 10%, rgba(96, 16, 47, 0.1), transparent 28%),
    linear-gradient(145deg, #f7f5f6, #efedef);
}

.login-card {
  position: relative;
  width: min(100%, 760px);
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  padding: 0;
  border: 1px solid rgba(227, 224, 225, 0.92);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(32, 27, 29, 0.1);
  animation: card-in 360ms var(--ease) both;
}

.login-card::before {
  content: none;
}

.login-heading {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  color: #fff;
  background: linear-gradient(145deg, #202024, #34252b 62%, #531029);
  text-align: left;
}

.login-heading::after {
  content: "";
  position: absolute;
  right: -64px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  border: 28px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  pointer-events: none;
}

.login-mark {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  display: block;
  margin: 0;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  object-fit: contain;
  animation: logo-spring 420ms 40ms var(--ease-spring) both;
}

.login-brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.1rem;
}

.login-security-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.66rem;
  font-weight: 650;
  white-space: nowrap;
}

.login-security-chip .ui-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.login-heading p {
  position: relative;
  z-index: 1;
  margin: 0 0 0.5rem;
  color: #f1b9cf;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: rise-in 300ms 80ms var(--ease) both;
}

.login-heading h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  animation: rise-in 320ms 100ms var(--ease) both;
}

.login-heading > span:last-child {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 300px;
  margin: 0.7rem 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.55;
  animation: rise-in 320ms 120ms var(--ease) both;
}

.login-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  background: #fff;
  animation: rise-in 340ms 100ms var(--ease) both;
}

.validation-summary {
  margin-bottom: 1rem;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
}

.validation-summary:empty,
.field-validation:empty {
  display: none;
}

.validation-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

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

.form-field label {
  display: block;
  margin-bottom: 0.38rem;
  color: #424a54;
  font-size: 0.84rem;
  font-weight: 600;
}

.form-field input {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cfd5dc;
  border-radius: var(--radius-md);
  outline: 0;
  color: var(--text);
  background: #fff;
}

.login-input-shell {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.75rem;
  border: 1px solid #cfd5dc;
  border-radius: var(--radius-md);
  color: #7a7479;
  background: #fff;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.login-input-shell:focus-within {
  border-color: var(--brand);
  background: #fffdfd;
  box-shadow: 0 0 0 3px rgba(96, 16, 47, 0.1);
}

.login-input-shell input {
  min-width: 0;
  min-height: 46px;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  background: transparent;
}

.login-input-shell .ui-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.form-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(96, 16, 47, 0.12);
}

.form-field input:focus-visible,
.filter-field input:focus-visible,
.filter-field select:focus-visible {
  outline: none;
}

.field-validation {
  display: block;
  margin-top: 0.3rem;
  color: var(--danger);
  font-size: 0.78rem;
}

.login-button {
  width: 100%;
  min-height: 46px;
  margin-top: 0.45rem;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-button .ui-icon {
  width: 1rem;
  height: 1rem;
  transition: transform 160ms var(--ease);
}

.login-button:hover .ui-icon {
  transform: translateX(3px);
}

.login-footnote {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.login-button:hover {
  background: var(--brand-dark);
  box-shadow: 0 8px 22px rgba(96, 16, 47, 0.2);
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(96, 16, 47, 0.24);
  outline-offset: 2px;
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes history-return-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes document-selected {
  0% { box-shadow: 0 8px 26px rgba(24, 24, 27, 0.14); }
  48% { box-shadow: 0 0 0 5px rgba(39, 39, 42, 0.14), 0 12px 30px rgba(24, 24, 27, 0.16); }
  100% { box-shadow: 0 8px 26px rgba(24, 24, 27, 0.14); }
}

@keyframes selection-check-pop {
  0% { transform: scale(0.72); }
  65% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes logo-spring {
  0% { opacity: 0; transform: scale(0.65) rotate(-7deg); }
  65% { opacity: 1; transform: scale(1.06) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes chip-pop {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

@keyframes orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(-8px, 10px, 0) rotate(6deg); }
}

@keyframes shimmer-move {
  from { transform: translateX(-160%) skewX(-18deg); }
  to { transform: translateX(760%) skewX(-18deg); }
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes overlay-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(24px) scale(0.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(14px) scale(0.98); }
}

@keyframes ripple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

@media (max-width: 1450px) {
  .document-card-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .document-card-identity p {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }

  .document-card-metrics {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 900px) {
  .app-navigation {
    min-height: 54px;
    gap: 0.5rem;
    padding-inline: 0.55rem;
  }

  .signed-in-user {
    display: none;
  }

  .brand {
    flex: 1 1 auto;
    gap: 0.5rem;
  }

  .brand-copy {
    overflow: hidden;
  }

  .brand-copy strong,
  .brand-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-copy strong {
    font-size: 0.78rem;
  }

  .brand-copy small {
    display: block;
    margin-top: 0.08rem;
    font-size: 0.6rem;
  }

  .user-area {
    flex: 0 0 auto;
    gap: 0.4rem;
  }

  .logout-button {
    padding-inline: 0.62rem;
  }

  .header-refresh-button {
    display: inline-grid;
  }

  .refresh-button {
    display: none;
  }

  .app-main {
    padding: 0 0 1rem;
  }

  .app-footer {
    min-height: 42px;
    display: flex;
    gap: 0.45rem;
    padding: 0.65rem 0.7rem;
    font-size: 0.68rem;
  }

  .app-footer > span:first-child {
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
    text-overflow: ellipsis;
  }

  .app-footer .last-refresh-status {
    flex: 0 0 auto;
    font-size: 0.61rem;
  }

  .workspace-heading {
    align-items: center;
    padding: 0.65rem 0.7rem 0;
  }

  .workspace-heading > div:first-child {
    flex: 1 1 auto;
  }

  .workspace-kicker {
    display: none;
  }

  .workspace-heading h1 {
    font-size: clamp(0.9rem, 4.25vw, 1.18rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
  }

  .approval-overview {
    min-height: 68px;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    margin: 0 0.7rem;
  }

  .overview-copy {
    min-width: 0;
  }

  .overview-icon {
    width: 36px;
    height: 36px;
  }

  .overview-copy strong {
    max-width: 165px;
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-metric {
    min-width: 88px;
    padding: 0.1rem 0.4rem;
  }

  .overview-metric:nth-child(2),
  .overview-metric:nth-child(3) {
    display: none;
  }

  .document-tab {
    min-width: 0;
    flex: 1 1 50%;
    min-height: 46px;
    padding: 0.45rem 0.55rem;
  }

  .document-tabs {
    margin: 0 0.7rem;
  }

  .document-tabs::after {
    width: 50%;
  }

  .document-tabs.is-sale-active::after {
    transform: translateX(100%);
  }

  .status-message,
  .filter-toggle-row,
  .filter-bar,
  .action-bar,
  .loading-state,
  .empty-state,
  .document-list,
  .pagination-bar {
    margin-right: 0.7rem;
    margin-left: 0.7rem;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    border-width: 0;
    background: transparent;
    opacity: 0;
    box-shadow: none;
    pointer-events: none;
    transform: translateY(-10px) scale(0.985);
    animation: none;
    transition: max-height 380ms var(--ease), padding 300ms var(--ease),
      margin 300ms var(--ease), border-color 220ms ease,
      opacity 240ms ease, transform 360ms var(--ease), box-shadow 300ms ease;
  }

  .filter-toggle-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 0.7rem;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .filter-toggle-row::before,
  .filter-toggle-row::after {
    content: none;
  }

  .filter-toggle {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
    box-shadow: none !important;
  }

  .filter-toggle:hover,
  .filter-toggle[aria-expanded="true"] {
    box-shadow: none !important;
  }

  .filter-bar.is-open {
    max-height: 360px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    margin-top: 0.45rem;
    border-width: 1px;
    border-color: var(--line);
    background: #fff;
    opacity: 1;
    box-shadow: 0 12px 28px rgba(32, 27, 29, 0.09);
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .filter-bar .filter-group {
    display: none;
  }

  .filter-bar.is-filter-open .filter-search-fields,
  .filter-bar.is-sort-open .filter-sort-fields {
    display: contents;
  }

  .filter-actions {
    grid-column: 1 / -1;
  }

  .action-bar {
    top: 61px;
  }

  .desktop-table-shell {
    display: none;
  }

  .document-card-top {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.72rem;
  }

  .document-card-metrics {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .document-detail-content {
    padding: 0 0.7rem 0.7rem;
  }

  .document-line-table-shell {
    display: none;
  }

  .document-line-cards {
    display: grid;
    gap: 0.55rem;
  }

  .history-table-shell {
    display: none;
  }

  .history-cards {
    display: grid;
    gap: 0.55rem;
  }

  .history-card {
    padding: 0.72rem;
    border: 1px solid #dde2e7;
    border-radius: var(--radius-md);
    background: #fff;
  }

  .history-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
  }

  .history-card p {
    margin: 0.38rem 0 0;
    color: #4e5863;
    font-size: 0.78rem;
    font-weight: 750;
  }

  .history-card small {
    display: block;
    margin-top: 0.3rem;
    color: #7a838e;
    font-size: 0.7rem;
  }

  .mobile-document-list {
    display: grid;
    gap: 0.7rem;
  }

  .mobile-document-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-left: 4px solid var(--charcoal);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 3px 12px rgba(20, 28, 38, 0.08);
  }

  .mobile-document-card.is-selected {
    border-left-color: var(--brand);
    background: #fcf8f9;
  }

  .mobile-card-main {
    padding: 0.72rem;
  }

  .mobile-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
  }

  .mobile-card-identity {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .mobile-card-identity h2 {
    margin: 0;
    color: #69727d;
    font-size: 1rem;
    font-weight: 900;
  }

  .mobile-card-identity p {
    max-width: 240px;
    margin: 0.3rem 0 0;
    overflow: hidden;
    color: #22282f;
    font-size: 0.9rem;
    font-weight: 850;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-card-date {
    color: #65707b;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .mobile-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 0.8rem;
  }

  .mobile-metric {
    min-width: 0;
    padding: 0.48rem 0.55rem;
    border: 1px solid #e5e9ee;
    border-radius: var(--radius-sm);
    background: #f5f7f9;
  }

  .mobile-metric small,
  .mobile-metric strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-metric small {
    margin-bottom: 0.2rem;
    color: #7a838e;
    font-size: 0.68rem;
    font-weight: 800;
  }

  .mobile-metric strong {
    color: #20262d;
    font-size: 0.82rem;
    font-weight: 900;
  }

  .mobile-lines {
    border-top: 1px solid var(--line);
  }

  .mobile-lines summary {
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--brand);
    font-size: 0.8rem;
    font-weight: 850;
    list-style: none;
  }

  .mobile-lines summary::-webkit-details-marker {
    display: none;
  }

  .mobile-lines summary::after {
    content: "⌄";
    margin-left: 0.35rem;
    font-size: 1rem;
  }

  .mobile-lines[open] summary::after {
    transform: rotate(180deg);
  }

  .mobile-line-list {
    display: grid;
    gap: 0.55rem;
    padding: 0 0.75rem 0.75rem;
  }

  .mobile-line-card {
    min-width: 0;
    max-width: 100%;
    padding: 0.7rem;
    border: 1px solid #e4e8ed;
    border-radius: var(--radius-md);
    background: #f8f9fb;
  }

  .mobile-line-card h3 {
    margin: 0;
    color: #252b32;
    font-size: 0.88rem;
    font-weight: 850;
    line-height: 1.3;
  }

  .mobile-line-code {
    display: block;
    margin-top: 0.25rem;
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 800;
  }

  .mobile-line-meta {
    margin: 0.3rem 0 0;
    color: #737c87;
    font-size: 0.7rem;
    font-weight: 650;
    line-height: 1.35;
  }

  .mobile-line-values {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-top: 0.65rem;
    scroll-snap-type: x proximity;
    scrollbar-color: #c7cdd4 transparent;
    scrollbar-width: thin;
    touch-action: pan-x;
  }

  .mobile-line-value {
    min-width: 108px;
    flex: 0 0 108px;
    padding-right: 0.45rem;
    border-right: 1px solid #d8dde3;
    scroll-snap-align: start;
  }

  .mobile-line-value:last-child {
    padding-right: 0;
    border-right: 0;
  }

  .mobile-line-value small,
  .mobile-line-value strong {
    display: block;
  }

  .mobile-line-value span {
    display: block;
    margin-top: 0.16rem;
    overflow: hidden;
    color: #737c87;
    font-size: 0.65rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-line-value.is-favorable strong,
  .mobile-line-value.is-favorable span {
    color: var(--success);
  }

  .mobile-line-value.is-unfavorable strong,
  .mobile-line-value.is-unfavorable span {
    color: var(--danger);
  }

  .mobile-line-value small {
    margin-bottom: 0.18rem;
    color: #737c87;
    font-size: 0.67rem;
    font-weight: 750;
  }

  .mobile-line-value strong {
    overflow: hidden;
    color: #252b32;
    font-size: 0.79rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

}

@media (max-width: 560px) {
  .app-navigation {
    padding: 0.4rem 0.65rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-copy strong {
    max-width: 170px;
    overflow: hidden;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-avatar {
    display: none;
  }

  .logout-button {
    min-height: 32px;
    padding: 0.3rem 0.65rem;
  }

  .workspace-heading {
    align-items: center;
    flex-direction: row;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
  }

  .workspace-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.3rem;
  }

  .history-button,
  .report-button {
    width: auto;
    min-height: 34px;
    padding: 0.3rem 0.4rem;
    font-size: clamp(0.68rem, 2.9vw, 0.72rem);
  }

  .overview-copy strong {
    max-width: min(42vw, 165px);
    font-size: 0.84rem;
  }

  .overview-metric {
    min-width: 88px;
  }

  .overview-metric strong {
    font-size: 1.4rem;
  }

  .document-tab {
    min-width: 0;
    font-size: 0.76rem;
  }

  .action-bar {
    top: 58px;
    align-items: stretch;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 7px 18px rgba(32, 27, 29, 0.11);
  }

  .select-all-control {
    font-size: 0.78rem;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    grid-column: auto;
  }

  .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .action-button {
    min-height: 36px;
    padding: 0.4rem 0.55rem;
    font-size: 0.76rem;
  }

  .document-card-metrics {
    margin-right: -0.72rem;
    padding-right: 0.72rem;
  }

  .document-metric:last-child {
    grid-column: auto;
  }

  .history-backdrop {
    padding: 0;
  }

  .history-dialog {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .login-page {
    min-height: calc(100vh - 58px);
    padding: 1rem;
  }

  .login-card {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 0;
    border-radius: 24px;
  }

  .login-heading {
    padding: 1.35rem;
  }

  .login-mark {
    width: 54px;
    height: 54px;
    margin-bottom: 0;
    border-radius: 15px;
  }

  .login-brand-row {
    margin-bottom: 1.3rem;
  }

  .login-form {
    padding: 1.35rem;
  }

  .approval-document-card,
  .approval-overview,
  .document-tabs,
  .filter-toggle-row {
    animation-duration: 220ms;
    animation-delay: 0ms;
  }
}

@media (max-width: 360px) {
  .report-shell {
    padding: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
