:root {
  --page: #f5f5f7;
  --page-soft: #eef1f5;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-soft: #f7f8fa;
  --panel-sheen: rgba(255, 255, 255, 0.82);
  --text: #0f172a;
  --muted: #6b7280;
  --line: rgba(15, 23, 42, 0.07);
  --line-strong: rgba(15, 23, 42, 0.14);
  --brand: #ff6a00;
  --brand-strong: #18181b;
  --brand-soft: #fff1e7;
  --brand-2: #ff9a1f;
  --danger: #3f3f46;
  --danger-soft: #f0f1f3;
  --warn: #9a3412;
  --warn-soft: #fff7ed;
  --ok: #27272a;
  --ok-soft: #eeeeef;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --radius-control: 12px;
  --focus: 0 0 0 4px rgba(255, 106, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at -10% -10%, rgba(255, 106, 0, 0.07), transparent 60%),
    radial-gradient(1000px 500px at 110% 0%, rgba(15, 23, 42, 0.045), transparent 60%),
    linear-gradient(180deg, #fbfbfc 0%, var(--page) 52%, var(--page-soft) 100%);
}

body::before {
  content: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--brand-strong);
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 10px 28px rgba(15, 23, 42, 0.04);
  animation: headerIn 520ms ease both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.brand:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.09);
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.session-user {
  max-width: min(48vw, 520px);
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
  animation: contentIn 620ms ease 80ms both;
}

.auth-view {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.auth-panel,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.auth-panel::before,
.panel::before {
  content: none;
}

.auth-panel:hover,
.panel:hover {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.auth-panel {
  width: min(460px, 100%);
  padding: 28px;
  animation: panelIn 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(460px, 0.86fr) minmax(420px, 1.14fr);
  gap: 18px;
  align-items: start;
}

.workspace-approver {
  grid-template-columns: minmax(620px, 1fr) minmax(360px, 420px);
}

.panel {
  min-width: 0;
  padding: 22px;
  animation: panelIn 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.panel-primary {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 247, 249, 0.78)),
    linear-gradient(90deg, rgba(255, 106, 0, 0.055), transparent 48%);
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 6px;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  font-size: 24px;
}

.panel-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 650;
}

.stack {
  display: grid;
  gap: 14px;
}

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

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="email"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  outline: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus);
  transform: translateY(-1px);
}

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

.hint,
.status-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.status-note {
  margin-top: 4px;
  text-align: right;
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

.checkline input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  position: relative;
  overflow: hidden;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 10%, rgba(255, 255, 255, 0.36) 50%, transparent 88%);
  transform: translateX(-120%);
  transition: transform 520ms ease;
}

.button:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.button:hover::after {
  transform: translateX(120%);
}

.button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 14px 28px rgba(255, 106, 0, 0.22);
}

.button-primary:hover {
  background: linear-gradient(135deg, #ff7414, var(--brand-2));
  color: #fff;
  box-shadow: 0 18px 34px rgba(255, 106, 0, 0.28);
}

.button-ghost {
  background: transparent;
}

.button-danger {
  border-color: var(--line);
  background: var(--danger-soft);
  color: var(--danger);
}

.button-small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 var(--panel-sheen) inset;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.metric:hover {
  border-color: rgba(255, 106, 0, 0.18);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 36px;
  line-height: 1;
  animation: numberSettle 520ms ease both;
}

.metric-accent {
  border-color: rgba(255, 106, 0, 0.18);
  background:
    radial-gradient(220px 80px at 20% 0%, rgba(255, 106, 0, 0.16), transparent 70%),
    rgba(255, 255, 255, 0.88);
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 1px 0 var(--panel-sheen) inset;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(249, 250, 251, 0.88);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

tbody tr:hover {
  background: rgba(255, 255, 255, 0.7);
}

.muted {
  color: var(--muted);
  font-weight: 600;
}

.employee-id,
.cell-note {
  display: block;
  max-width: 280px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-cell {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.badge-ok {
  border-color: rgba(15, 23, 42, 0.12);
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-bad {
  border-color: rgba(15, 23, 42, 0.12);
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-warn {
  border-color: rgba(255, 106, 0, 0.2);
  background: var(--warn-soft);
  color: var(--warn);
}

.message,
.empty-state {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.message-ok {
  border-color: rgba(15, 23, 42, 0.12);
  background: var(--ok-soft);
  color: var(--ok);
}

.message-bad {
  border-color: rgba(15, 23, 42, 0.12);
  background: var(--danger-soft);
  color: var(--danger);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(243, 244, 246, 0.72);
}

.segmented button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.segmented button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.decision-panel {
  position: sticky;
  top: 86px;
}

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

.detail-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 1px 0 var(--panel-sheen) inset;
}

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

dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 800;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(247, 248, 250, 0.76);
  backdrop-filter: blur(8px);
}

.loader {
  display: grid;
  gap: 10px;
  place-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: loaderPulse 1200ms ease-in-out infinite;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(15, 23, 42, 0.08);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes headerIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes contentIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes numberSettle {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loaderPulse {
  50% {
    transform: translateY(-2px);
  }
}

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

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

@media (max-width: 1120px) {
  .workspace,
  .workspace-approver {
    grid-template-columns: 1fr;
  }

  .decision-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .session {
    width: 100%;
    justify-content: space-between;
  }

  .session-user {
    max-width: 100%;
  }

  .app-shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 16px;
  }

  .auth-panel,
  .panel {
    padding: 16px;
  }

  .panel-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .field-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .button-row .button {
    width: 100%;
  }

  .button {
    justify-content: center;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1 1 auto;
  }
}
