:root {
  --ink: #111827;
  --muted: #657181;
  --line: #d7e0ea;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --page: #edf3f9;
  --nav: #101418;
  --nav-soft: #202933;
  --blue: #0875c9;
  --blue-deep: #064f92;
  --blue-ink: #073b6d;
  --orange: #f57920;
  --orange-soft: #fff2e8;
  --green: #168458;
  --red: #c53d3d;
  --amber: #b56a12;
  --shadow: 0 18px 48px rgba(15, 36, 68, 0.11);
  --shadow-soft: 0 8px 22px rgba(15, 36, 68, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(8, 117, 201, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(245, 121, 32, 0.08), transparent 38%),
    var(--page);
  color: var(--ink);
  font-family: Aptos, "Avenir Next", "Trebuchet MS", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(8, 117, 201, 0.16), transparent 24%),
    linear-gradient(145deg, #101419 0%, #171c22 58%, #0e1115 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 14px 0 34px rgba(15, 23, 42, 0.08);
}

.sidebar .brand-mark {
  padding: 8px 8px 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: grid;
  justify-items: start;
  gap: 3px;
}

.brand-eye {
  width: 70px;
  height: 38px;
  filter: drop-shadow(0 10px 18px rgba(8, 117, 201, 0.25));
}

.brand-word {
  font-weight: 900;
  font-size: 29px;
  line-height: 1;
  color: currentColor;
}

.brand-tagline {
  color: #7a828e;
  font-size: 12px;
  font-weight: 800;
}

.sidebar .brand-tagline {
  color: #bfc7d2;
}

.user-chip {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 16px 8px 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(8, 117, 201, 0.24);
}

.user-chip strong {
  display: block;
  font-size: 14px;
}

.user-chip span {
  color: #c9d2de;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
  padding: 6px 0;
}

.nav button,
.quick-actions button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 0 12px;
  color: #d8dee8;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav button:hover,
.quick-actions button:hover {
  background: var(--nav-soft);
  transform: translateX(2px);
}

.nav button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #ff9347);
  box-shadow: 0 10px 22px rgba(245, 121, 32, 0.26);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
}

.quick-actions {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

.quick-title {
  margin: 0 0 8px;
  color: #aab4c2;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.version {
  color: #87909e;
  font-size: 12px;
  padding: 14px 8px 0;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 76px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.mobile-menu {
  display: none !important;
}

.page-title h1 {
  margin: 0;
  font-size: 24px;
}

.page-title p {
  margin: 3px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.content {
  padding: 24px 28px 42px;
  position: relative;
}

.content::before {
  content: "";
  position: fixed;
  inset: 76px 0 auto 272px;
  height: 170px;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(8, 117, 201, 0.12), transparent 55%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), transparent);
  z-index: -1;
}

.workspace-banner {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(8, 117, 201, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(8, 117, 201, 0.11), rgba(255, 255, 255, 0.88) 46%),
    linear-gradient(315deg, rgba(245, 121, 32, 0.14), transparent 48%),
    #fff;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.workspace-banner h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.workspace-banner-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  flex-wrap: wrap;
}

.eyebrow {
  color: var(--blue-ink);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.empty-state {
  min-height: 156px;
  border: 1px dashed #b7c5d8;
  border-radius: var(--radius);
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(8, 117, 201, 0.06), transparent 42%),
    linear-gradient(315deg, rgba(245, 121, 32, 0.08), transparent 48%),
    #fbfdff;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-state span {
  max-width: 520px;
}

.empty-state.compact {
  min-height: 92px;
  padding: 16px;
}

.empty-state .btn {
  margin-top: 6px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.card:hover {
  border-color: #c6d5e6;
  box-shadow: 0 22px 54px rgba(15, 36, 68, 0.14);
}

.card-header {
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.92), rgba(255, 255, 255, 0.92));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.card-header h2,
.card-header h3 {
  margin: 0;
  font-size: 16px;
}

.card-body {
  padding: 16px;
}

.stat {
  padding: 18px;
  position: relative;
  isolation: isolate;
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto 16px 14px auto;
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  opacity: 0.32;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 850;
  color: #0b1728;
}

.stat-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.mini-stat {
  border-left: 3px solid var(--blue);
  padding: 6px 0 6px 10px;
}

.mini-stat p {
  margin: 0;
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right,
.segmented {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  min-width: min(440px, 100%);
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  background: #fff;
  min-width: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(8, 117, 201, 0.6);
  box-shadow: 0 0 0 4px rgba(8, 117, 201, 0.1);
  outline: none;
}

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

#otp-code {
  max-width: 220px;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 6px;
  text-align: center;
}

.btn {
  height: 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #e8eef6;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn.primary {
  background: linear-gradient(135deg, var(--orange), #ff9448);
  color: #fff;
  box-shadow: 0 10px 24px rgba(245, 121, 32, 0.2);
}

.btn.blue {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  box-shadow: 0 10px 24px rgba(8, 117, 201, 0.18);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.btn.danger {
  background: var(--red);
  color: #fff;
}

.btn.small {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.segmented .btn {
  background: #fff;
  border: 1px solid var(--line);
}

.segmented .btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

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

td.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 260px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: #4d5968;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f3f7fb;
}

tr:hover td {
  background: #fbfdff;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 12px;
}

.strong {
  font-weight: 800;
}

.badge {
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1c2938;
  background: #e9eef6;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.badge.green {
  color: #0f5f41;
  background: #dff5eb;
}

.badge.red {
  color: #8d2323;
  background: #fee4e2;
}

.badge.blue {
  color: #064f92;
  background: #e3f0ff;
}

.badge.orange {
  color: #914d0d;
  background: #fff0dc;
}

.badge.gray {
  color: #475467;
  background: #eef2f7;
}

.status-line {
  display: grid;
  gap: 8px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline-row time {
  color: var(--muted);
  font-size: 12px;
}

.timeline-dot {
  padding-left: 16px;
  border-left: 3px solid var(--blue);
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 6px 16px rgba(15, 36, 68, 0.05);
}

.list-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  flex-wrap: wrap;
}

.list-item h3 {
  margin: 0;
  font-size: 15px;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.list-item p {
  margin: 5px 0 0;
  color: var(--muted);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  overflow: visible;
}

.lane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f9fbfe, #f3f7fc);
}

.lane h3 {
  margin: 0;
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}

.lane .list {
  padding: 10px;
}

.lane .badge {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #3c4654;
  font-size: 13px;
  font-weight: 750;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 24, 40, 0.64);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.dialog {
  width: min(860px, 100%);
  max-height: min(90vh, 880px);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.dialog header,
.dialog footer {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog header {
  border-bottom: 1px solid var(--line);
}

.dialog header h2 {
  margin: 0;
  font-size: 18px;
}

.dialog main {
  padding: 16px;
}

.dialog footer {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  background: #fff;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.72) 45%, rgba(8, 117, 201, 0.18)),
    linear-gradient(135deg, rgba(8, 117, 201, 0.16), transparent 42%),
    repeating-linear-gradient(135deg, rgba(8, 117, 201, 0.05) 0 1px, transparent 1px 18px),
    linear-gradient(145deg, #f9fbff 0%, #e5eff8 100%);
  display: flex;
  align-items: center;
  padding: 56px;
}

.login-visual::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -12%;
  width: 70%;
  aspect-ratio: 1.25;
  background:
    linear-gradient(130deg, transparent 0 18%, rgba(16, 22, 30, 0.94) 18% 52%, transparent 52%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 8px, transparent 8px 28px);
  transform: skewX(-18deg);
}

.login-copy {
  position: relative;
  max-width: 620px;
}

.login-copy h1 {
  margin: 30px 0 10px;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 0.95;
}

.login-copy p {
  color: var(--muted);
  font-size: 18px;
  max-width: 540px;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    linear-gradient(165deg, rgba(8, 117, 201, 0.18), transparent 34%),
    linear-gradient(35deg, rgba(245, 121, 32, 0.15), transparent 40%),
    #101419;
}

.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 254, 0.98));
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.26);
}

.login-card h2 {
  margin: 16px 0 6px;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.login-card .field {
  margin-bottom: 12px;
}

.entry-links {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.entry-links .btn {
  flex: 1 1 0;
  min-width: 0;
}

.entry-links .btn.active {
  background: var(--blue-deep);
  color: #fff;
  border-color: var(--blue-deep);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin: 18px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f3f6fb;
}

.auth-tabs button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--blue-deep);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12);
}

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

.login-form-grid .full {
  grid-column: 1 / -1;
}

.demo-accounts {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.qr {
  width: 164px;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
}

.qr span {
  background: #fff;
}

.qr span.on {
  background: #111827;
}

.passport-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  align-items: center;
}

.media-drop {
  border: 1px dashed #9aa9bb;
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 14px;
}

.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.thumb {
  width: 68px;
  height: 52px;
  border-radius: 6px;
  background: #e6edf6;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  min-width: 260px;
  border-radius: var(--radius);
  padding: 12px 14px;
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .stats-grid,
  .three-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 88vw);
    z-index: 30;
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex !important;
  }

  .topbar {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .content {
    padding: 18px 16px 34px;
  }

  .content::before {
    inset: 76px 0 auto 0;
  }

  .workspace-banner {
    display: grid;
    padding: 14px;
  }

  .workspace-banner-side {
    justify-content: flex-start;
    text-align: left;
  }

  .page-title {
    min-width: 0;
  }

  .page-title h1,
  .page-title p {
    overflow-wrap: anywhere;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: stretch;
  }

  .topbar-actions .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .stats-grid,
  .three-col,
  .two-col,
  .form-grid,
  .passport-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
    padding: 32px 24px;
  }

  .login-panel {
    min-height: auto;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right,
  .search,
  .toolbar .btn {
    width: 100%;
  }

  .login-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dialog-backdrop {
    align-items: start;
    padding: 12px;
    overflow-y: auto;
  }

  .dialog {
    max-height: calc(100vh - 24px);
  }

  .dialog footer {
    flex-wrap: wrap;
  }

  .dialog footer .btn {
    width: 100%;
    min-width: 0;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .btn,
  .dialog footer {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  .card {
    box-shadow: none;
    break-inside: avoid;
  }
}
