:root {
  color-scheme: light;
  --bg: #eef5f5;
  --panel: #ffffff;
  --ink: #10202b;
  --muted: #667085;
  --line: #d9e4e8;
  --brand: #087a7a;
  --brand-dark: #05545b;
  --cyan: #00d6cc;
  --neon-green: #22c55e;
  --neon-mint: #34d399;
  --neon-lime: #a3e635;
  --pink: #ff4f7b;
  --amber: #ff9f1c;
  --soft: #e9fbf8;
  --danger: #b42318;
  --radius: 8px;
  font-family: "Pretendard", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 15% 8%, rgba(34, 197, 94, 0.16), transparent 28%),
    radial-gradient(circle at 90% 18%, rgba(0, 214, 204, 0.12), transparent 24%),
    linear-gradient(145deg, #edf5f5, #f7fafb 56%, #edf6f1);
  color: var(--ink);
  margin: 0;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(4, 86, 92, 0.92), rgba(16, 32, 43, 0.72)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80") center/cover;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: 0 24px 90px rgba(4, 40, 43, 0.34), 0 0 42px rgba(34, 197, 94, 0.18);
  max-width: 450px;
  padding: 34px;
  width: 100%;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 8px;
}

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

h1 {
  font-size: 34px;
  margin-bottom: 10px;
}

.intro,
.section-head p,
.category-head p,
.coming-soon p {
  color: var(--muted);
  line-height: 1.6;
}

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

label {
  color: #344054;
  display: grid;
  font-size: 14px;
  font-weight: 800;
  gap: 8px;
}

input,
select {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 46px;
  padding: 0 14px;
}

input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 214, 204, 0.13);
  outline: 0;
}

.login-form button,
.secondary-button {
  background: linear-gradient(90deg, #064e3b, var(--neon-mint), var(--cyan));
  background-size: 190% 100%;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 14px 30px rgba(0, 168, 168, 0.22);
  color: white;
  font-weight: 900;
  min-height: 46px;
  padding: 0 18px;
  transition:
    background-position 620ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

.login-form button:hover,
.secondary-button:hover {
  background-position: 100% 50%;
  box-shadow: 0 18px 38px rgba(0, 168, 168, 0.26), 0 0 24px rgba(34, 197, 94, 0.24);
  transform: translateY(-1px);
}

.login-form button:active,
.secondary-button:active,
.mini-button:active,
.ghost-button:active,
.icon-action:active,
.icon-button:active,
.nav-item:active,
.subnav-item:active,
.category-head:active,
.document-card:active {
  transform: translateY(1px) scale(0.992);
}

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

.login-version {
  align-items: center;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 999px;
  display: inline-flex;
  justify-self: start;
  padding: 6px 10px;
}

.login-version strong {
  color: var(--brand-dark);
  margin-left: 5px;
}

.dashboard-view {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dashboard-view:has(.sidebar.collapsed) {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(34, 197, 94, 0.13), transparent 24%),
    linear-gradient(160deg, #06191c, #0d2023 54%, #081417);
  color: white;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 18px 14px;
  position: relative;
}

.sidebar::after {
  animation: scanLine 5.5s linear infinite;
  background: linear-gradient(180deg, transparent, rgba(0, 214, 204, 0.56), transparent);
  content: "";
  height: 180px;
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;
}

.brand {
  align-items: center;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 40px;
  gap: 10px;
  margin: 0 0 18px;
  min-height: 48px;
}

.brand-mark {
  align-items: center;
  animation: keyColorShift 7s ease infinite;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-mint), var(--cyan));
  background-size: 180% 180%;
  border-radius: var(--radius);
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.42);
  display: inline-flex;
  flex: 0 0 38px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand small {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 999px;
  color: #c7ffe2;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  margin-top: 5px;
  padding: 3px 8px;
}

.sidebar.collapsed .brand-copy,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .subnav-item span,
.sidebar.collapsed .logout-button {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

.sidebar.collapsed .brand-copy {
  display: none;
}

.sidebar.collapsed .brand {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 10px;
  min-height: 92px;
}

.sidebar.collapsed .sidebar-toggle {
  position: static;
}

.sidebar-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 214, 204, 0.22);
  border-radius: var(--radius);
  color: #ffffff;
  display: inline-grid;
  height: 40px;
  justify-content: center;
  place-items: center;
  transition:
    border-color 460ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1),
    background 520ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 40px;
}

.sidebar-toggle svg {
  height: 20px;
  width: 20px;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 14px 28px rgba(0, 25, 25, 0.22), 0 0 18px rgba(0, 214, 204, 0.16);
  transform: translateY(-1px);
}

.nav-menu {
  display: grid;
  gap: 10px;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.nav-divider {
  align-items: center;
  display: grid;
  height: 22px;
  padding: 4px 0;
  width: 100%;
}

.nav-divider::before {
  background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.55), rgba(0, 214, 204, 0.38), transparent);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.18);
  content: "";
  display: block;
  height: 1px;
  width: 100%;
}

.nav-item,
.logout-button,
.subnav-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #d6dddd;
  display: flex;
  gap: 10px;
  min-height: 44px;
  min-width: 0;
  padding: 0 12px;
  justify-self: stretch;
  text-align: left;
  transition:
    background 520ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 520ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 560ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  width: 100%;
}

.nav-item[data-page="clients"],
.nav-item[data-page="settlement"] {
  background: rgba(255, 255, 255, 0.015);
}

.nav-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: inline-flex;
  flex: 0 0 24px;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.nav-item.active,
.nav-item:hover,
.subnav-item.active,
.subnav-item:hover {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.16), rgba(0, 214, 204, 0.08));
  border-color: rgba(52, 211, 153, 0.28);
  box-shadow: inset 3px 0 0 var(--neon-mint), 0 0 26px rgba(34, 197, 94, 0.13);
  color: #ffffff;
  transform: translateY(-1px);
}

.client-subnav {
  display: grid;
  gap: 6px;
  margin: 0 0 2px;
  max-height: 260px;
  opacity: 1;
  padding: 2px 0 2px 34px;
  transform: translateY(0);
  transition:
    max-height 560ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 420ms ease,
    padding 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.client-subnav.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-bottom: 0;
  padding-top: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.sidebar.collapsed .client-subnav {
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.subnav-item {
  min-height: 34px;
  padding-left: 12px;
}

.logout-button {
  justify-content: center;
  margin-top: auto;
}

.workspace {
  min-width: 0;
  padding: 22px 28px;
}

.topbar,
.section-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.topbar {
  margin-bottom: 18px;
}

h2 {
  font-size: 28px;
  margin-bottom: 0;
}

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

.version-pill {
  align-items: center;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.12), rgba(0, 214, 204, 0.1));
  border: 1px solid rgba(52, 211, 153, 0.26);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.12);
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.icon-action,
.icon-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(0, 168, 168, 0.25);
  border-radius: var(--radius);
  color: var(--brand-dark);
  display: inline-flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  transition:
    border-color 460ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 42px;
}

.icon-action:hover,
.icon-button:hover {
  border-color: rgba(52, 211, 153, 0.42);
  box-shadow: 0 0 22px rgba(0, 214, 204, 0.2), 0 12px 24px rgba(7, 38, 42, 0.08);
  transform: translateY(-1px);
}

.user-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(7, 38, 42, 0.08);
  color: var(--brand-dark);
  font-weight: 900;
  padding: 10px 16px;
}

.page-section,
.sales-library {
  display: grid;
  gap: 12px;
  grid-auto-flow: dense;
}

.page-section {
  animation: pageSlideIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.section-head,
.category-head,
.static-head,
.coming-soon {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(232, 255, 252, 0.86)),
    #ffffff;
  border: 1px solid rgba(0, 168, 168, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(7, 38, 42, 0.08);
  padding: 16px 18px;
}

.section-head {
  overflow: hidden;
  position: relative;
}

.section-head::before {
  animation: keyColorShift 8s ease infinite;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-mint), var(--cyan), var(--neon-lime));
  background-size: 220% 100%;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.section-head h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.resource-category {
  display: grid;
  gap: 8px;
}

.category-head {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 76px;
  text-align: left;
  transition:
    border-color 520ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 560ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    background 620ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
}

.category-head:hover {
  border-color: rgba(52, 211, 153, 0.36);
  box-shadow: 0 18px 42px rgba(7, 38, 42, 0.11), 0 0 26px rgba(34, 197, 94, 0.12);
  transform: translateY(-1px);
}

.category-head h4,
.static-head h4 {
  font-size: 19px;
  margin: 3px 0 0;
}

.category-head p {
  line-height: 1.35;
  margin: 4px 0 0;
}

.category-count {
  color: var(--brand-dark);
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 900;
}

.category-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.category-body {
  display: grid;
  gap: 10px;
  max-height: 1400px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition:
    max-height 720ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 520ms ease,
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
}

.category-body.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

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

.document-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(7, 38, 42, 0.08);
  display: grid;
  grid-template-columns: minmax(150px, 0.56fr) minmax(0, 1fr);
  min-height: 220px;
  overflow: hidden;
  transform-origin: top center;
  transition:
    border-color 520ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 620ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    grid-template-columns 760ms cubic-bezier(0.22, 1, 0.36, 1),
    min-height 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.document-card:hover {
  border-color: rgba(0, 168, 168, 0.34);
  box-shadow: 0 18px 42px rgba(7, 38, 42, 0.12), 0 0 24px rgba(0, 214, 204, 0.12);
  transform: translateY(-2px);
}

.document-card.expanded {
  animation: cardExpand 820ms cubic-bezier(0.22, 1, 0.36, 1) both;
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 0.72fr);
  min-height: 320px;
  box-shadow: 0 22px 56px rgba(7, 38, 42, 0.16), 0 0 36px rgba(34, 197, 94, 0.16);
}

.document-preview {
  background:
    linear-gradient(135deg, rgba(0, 168, 168, 0.1), rgba(54, 124, 255, 0.08)),
    #eef2f6;
  border-right: 1px solid var(--line);
  display: grid;
  height: 220px;
  min-height: 220px;
  place-items: center;
  transition:
    height 780ms cubic-bezier(0.22, 1, 0.36, 1),
    min-height 780ms cubic-bezier(0.22, 1, 0.36, 1),
    background 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.document-preview img {
  display: block;
  height: 196px;
  max-height: 196px;
  max-width: 100%;
  object-fit: contain;
  padding: 12px;
  width: auto;
  transition:
    height 780ms cubic-bezier(0.22, 1, 0.36, 1),
    max-height 780ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 780ms cubic-bezier(0.22, 1, 0.36, 1);
}

.document-card.expanded .document-preview {
  height: 320px;
  min-height: 320px;
}

.document-card.expanded .document-preview img {
  height: 296px;
  max-height: 296px;
  transform: scale(1.01);
}

.document-meta {
  align-content: start;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
}

.document-meta h5 {
  font-size: 16px;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.document-meta p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
}

.document-meta small {
  color: #475467;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag,
.status {
  align-self: start;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-self: start;
  padding: 5px 9px;
}

.tag {
  background: linear-gradient(90deg, #e6fbf8, #fff4df);
  color: var(--brand-dark);
}

.mini-button,
.ghost-button {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f4faf9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #344054;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  text-decoration: none;
  transition:
    background 520ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 520ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 560ms cubic-bezier(0.22, 1, 0.36, 1),
    color 420ms ease,
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mini-button:hover,
.ghost-button:hover {
  background: linear-gradient(180deg, #ffffff, #eafff7);
  border-color: rgba(34, 197, 94, 0.38);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.16);
  color: var(--brand-dark);
  transform: translateY(-1px);
}

.mini-button.danger {
  color: var(--danger);
}

.empty-category,
.empty-client {
  align-items: center;
  background: #ffffff;
  border: 1px dashed #b8c3cf;
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  font-weight: 800;
  min-height: 88px;
  padding: 18px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 50;
}

.modal-panel {
  background: var(--panel);
  border: 1px solid rgba(0, 168, 168, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 24px 90px rgba(15, 23, 42, 0.28), 0 0 36px rgba(0, 214, 204, 0.14);
  display: grid;
  gap: 16px;
  max-height: min(780px, calc(100vh - 48px));
  max-width: 620px;
  overflow: auto;
  padding: 24px;
  width: min(100%, 620px);
}

.modal-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.modal-note {
  background: #fffaeb;
  border: 1px solid #fedf89;
  border-radius: var(--radius);
  color: #7a4b00;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  padding: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.trash-log-list {
  display: grid;
  gap: 10px;
}

.trash-log-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 6px;
  padding: 14px;
}

.trash-log-card span,
.trash-log-card small {
  color: var(--muted);
}

.toast {
  background: linear-gradient(90deg, #081c1f, #0d3033);
  border-radius: var(--radius);
  bottom: 22px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25), 0 0 26px rgba(0, 214, 204, 0.18);
  color: #ffffff;
  font-weight: 900;
  left: 50%;
  padding: 13px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 60;
}

.text-dashboard {
  display: grid;
  gap: 18px;
}

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

.ai-doc-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 253, 253, 0.94));
  border: 1px solid rgba(0, 168, 168, 0.18);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(7, 38, 42, 0.1);
  color: var(--ink);
  display: grid;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  position: relative;
  text-align: left;
  transition:
    border-color 520ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 560ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1),
    background 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-doc-button.active,
.ai-doc-button:hover {
  border-color: rgba(0, 168, 168, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 214, 204, 0.11), 0 16px 40px rgba(7, 38, 42, 0.12);
  transform: translateY(-1px);
}

.ai-doc-button.active::before {
  animation: neonPulse 3.2s ease-in-out infinite;
  background: linear-gradient(180deg, var(--cyan), var(--amber), var(--pink));
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 4px;
}

.ai-doc-button span,
.ai-doc-button small {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ai-doc-viewer {
  background: var(--panel);
  border: 1px solid rgba(0, 168, 168, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(7, 38, 42, 0.1);
  min-width: 0;
  overflow: hidden;
}

.ai-doc-toolbar {
  align-items: center;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(232, 255, 252, 0.86));
  border-bottom: 1px solid rgba(0, 168, 168, 0.18);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.ai-doc-toolbar h4 {
  font-size: 20px;
  margin: 3px 0 0;
}

.ai-doc-toolbar input {
  max-width: 320px;
  width: 100%;
}

.ai-doc-content {
  color: #344054;
  font-size: 14px;
  line-height: 1.75;
  max-height: none;
  overflow: visible;
  padding: 22px;
}

.ai-summary-section {
  margin-bottom: 22px;
}

.ai-table-wrap {
  border: 1px solid rgba(0, 168, 168, 0.2);
  border-radius: var(--radius);
  margin: 14px 0;
  overflow-x: auto;
}

.ai-summary-table,
.ai-doc-content table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.ai-summary-table th,
.ai-summary-table td,
.ai-doc-content table th,
.ai-doc-content table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
}

.ai-summary-table th,
.ai-doc-content table th {
  background: linear-gradient(180deg, #e6fbf8, #dff0ee);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  position: static;
}

.ai-summary-table td,
.ai-doc-content table td {
  background: #ffffff;
  color: #344054;
}

.ai-summary-table tr:nth-child(even) td,
.ai-doc-content table tr:nth-child(even) td {
  background: #f8fafc;
}

.ai-doc-content mark {
  background: #fde68a;
  border-radius: 4px;
  padding: 0 2px;
}

.inbound-table-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 168, 168, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 16px 46px rgba(7, 38, 42, 0.1);
  overflow: hidden;
}

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

.inbound-table {
  border-collapse: collapse;
  min-width: 1320px;
  width: 100%;
}

.inbound-table th,
.inbound-table td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.inbound-table th {
  background: linear-gradient(180deg, #e6fbf8, #dff7ef);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.inbound-table td {
  background: #ffffff;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.inbound-table tbody tr {
  position: relative;
  transition: background 460ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 460ms cubic-bezier(0.22, 1, 0.36, 1), opacity 460ms ease;
}

.inbound-table tbody tr:hover td {
  background: #f1fffa;
  box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.55);
}

.inbound-table tbody tr.is-today-lead td {
  animation: freshLeadPulse 2.8s ease-in-out infinite;
  background: linear-gradient(90deg, rgba(236, 253, 243, 0.98), rgba(240, 253, 250, 0.94));
  border-bottom-color: rgba(34, 197, 94, 0.28);
}

.inbound-table tbody tr.is-today-lead td:first-child {
  box-shadow: inset 4px 0 0 var(--neon-mint);
}

.inbound-table tbody tr.is-contacted-lead td {
  background: linear-gradient(90deg, rgba(255, 241, 242, 0.98), rgba(255, 247, 237, 0.72));
  border-bottom-color: rgba(244, 63, 94, 0.2);
}

.inbound-table tbody tr.is-contacted-lead td:first-child {
  box-shadow: inset 4px 0 0 rgba(244, 63, 94, 0.72);
}

.inbound-table tbody tr.is-contacted-lead:hover td {
  background: linear-gradient(90deg, rgba(255, 228, 230, 0.98), rgba(255, 237, 213, 0.82));
}

.inbound-table a {
  color: var(--brand-dark);
  font-weight: 900;
  text-decoration: none;
}

.fresh-badge {
  background: linear-gradient(90deg, var(--neon-green), var(--cyan));
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.28);
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  margin-top: 6px;
  padding: 4px 8px;
  white-space: nowrap;
}

.contact-check {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f4faf9);
  border: 1px solid rgba(0, 168, 168, 0.24);
  border-radius: var(--radius);
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  min-height: 30px;
  padding: 0 10px;
  transition: background 520ms cubic-bezier(0.22, 1, 0.36, 1), border-color 520ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 560ms cubic-bezier(0.22, 1, 0.36, 1), transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-check:hover {
  border-color: rgba(34, 197, 94, 0.42);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.18);
  transform: translateY(-1px);
}

.contact-check.checked {
  background: linear-gradient(90deg, #be123c, #fb7185);
  border-color: rgba(244, 63, 94, 0.48);
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.18);
  color: #ffffff;
}

.contact-meta {
  color: #475467;
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  margin-top: 6px;
  white-space: nowrap;
}

.contact-meta.muted {
  color: #98a2b3;
}

.client-owner-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-tab {
  background: #ffffff;
  border: 1px solid rgba(0, 168, 168, 0.22);
  border-radius: 999px;
  color: #344054;
  font-weight: 900;
  min-height: 40px;
  padding: 0 16px;
}

.owner-tab.active,
.owner-tab:hover {
  background: linear-gradient(90deg, rgba(0, 214, 204, 0.16), rgba(255, 159, 28, 0.1));
  border-color: rgba(0, 168, 168, 0.45);
  box-shadow: 0 0 20px rgba(0, 214, 204, 0.14);
  color: var(--brand-dark);
}

.metric-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-row article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(7, 38, 42, 0.1);
  padding: 18px;
}

.metric-row span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.metric-row strong {
  font-size: 30px;
}

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

.client-lane {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 168, 168, 0.18);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(7, 38, 42, 0.08);
  padding: 16px;
}

.lane-head,
.status-column-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.lane-head {
  margin-bottom: 14px;
}

.lane-head span {
  font-size: 20px;
  font-weight: 900;
}

.lane-head strong,
.status-column-head strong {
  color: var(--brand-dark);
}

.client-status-grid {
  display: grid;
  gap: 12px;
}

.status-column {
  display: grid;
  gap: 10px;
}

.status-column-head {
  color: #475467;
  font-size: 13px;
  font-weight: 900;
}

.status-card-list {
  display: grid;
  gap: 10px;
}

.client-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 14px;
}

.client-card h4 {
  margin: 0;
}

.client-card p,
.client-card small {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.status.active {
  background: #ecfdf3;
  color: #027a48;
}

.status.pending {
  background: #fffaeb;
  color: #b54708;
}

.status.risk {
  background: #fef3f2;
  color: var(--danger);
}

.coming-soon {
  min-height: 260px;
}

.coming-soon h3 {
  font-size: 28px;
}

@keyframes neonPulse {
  0% {
    box-shadow: 0 0 0 rgba(0, 214, 204, 0), 0 0 14px rgba(0, 214, 204, 0.2);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(0, 214, 204, 0.09), 0 0 28px rgba(0, 214, 204, 0.42);
  }
  100% {
    box-shadow: 0 0 0 rgba(0, 214, 204, 0), 0 0 14px rgba(0, 214, 204, 0.2);
  }
}

@keyframes keyColorShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes scanLine {
  0% {
    transform: translateY(-120%);
  }
  100% {
    transform: translateY(120%);
  }
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardExpand {
  from {
    opacity: 0.86;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes freshLeadPulse {
  0% {
    box-shadow: inset 0 0 0 rgba(34, 197, 94, 0), 0 0 0 rgba(34, 197, 94, 0);
  }
  50% {
    box-shadow: inset 0 0 22px rgba(34, 197, 94, 0.1), 0 0 24px rgba(34, 197, 94, 0.18);
  }
  100% {
    box-shadow: inset 0 0 0 rgba(34, 197, 94, 0), 0 0 0 rgba(34, 197, 94, 0);
  }
}

@media (max-width: 1180px) {
  .document-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1181px) {
  .sales-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head,
  .resource-category.has-materials {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .dashboard-view,
  .dashboard-view:has(.sidebar.collapsed) {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 12px;
  }

  .nav-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-subnav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-left: 0;
  }

  .document-grid,
  .client-board,
  .ai-doc-list,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .document-card,
  .document-card.expanded {
    grid-template-columns: 1fr;
  }

  .document-preview {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .login-panel,
  .workspace {
    padding: 20px;
  }

  .topbar,
  .section-head,
  .category-head,
  .ai-doc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .category-head {
    min-height: auto;
  }

  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }
}

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