:root {
  color-scheme: light;
  --blue-50: #f2f7ff;
  --blue-100: #e4efff;
  --blue-200: #c9dfff;
  --blue-300: #8fc2ff;
  --blue-400: #5ca2ff;
  --blue-500: #2f7bff;
  --blue-600: #2563eb;
  --blue-700: #1753c7;
  --blue-900: #102e68;
  --neutral-950: #0c1324;
  --neutral-900: #101828;
  --neutral-800: #1d2939;
  --neutral-700: #344054;
  --neutral-600: #475467;
  --neutral-500: #667085;
  --neutral-400: #98a2b3;
  --neutral-300: #d0d5dd;
  --neutral-200: #e4e7ec;
  --neutral-100: #f2f4f7;
  --neutral-50: #f8fafc;
  --white: #ffffff;
  --success: #12b76a;
  --warning: #f79009;
  --error: #f04438;
  --violet: #7a5af8;
  --cyan: #13b8d5;
  --border-subtle: #e9ecf2;
  --border-divider: #d8dee8;
  --border-control: #c9d3df;
  --border-focus: #2f7bff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(31, 77, 138, 0.04);
  --shadow-md: 0 12px 36px rgba(31, 77, 138, 0.1);
  --shadow-lg: 0 24px 64px rgba(24, 61, 118, 0.16);
  --sidebar: 240px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font: Inter, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: #f7faff;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--neutral-900);
  background:
    radial-gradient(circle at 82% 0, rgba(174, 222, 255, 0.24), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0, #f6f9fe 36rem, #f8fafc 100%);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.auth-locked {
  height: 100vh;
  overflow: hidden;
}

body.overlay-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(47, 123, 255, 0.25);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(140%);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px) saturate(150%);
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(6px);
  pointer-events: none;
}

.ambient-one {
  top: -14rem;
  right: -8rem;
  width: 36rem;
  height: 36rem;
  background: rgba(91, 183, 255, 0.19);
}

.ambient-two {
  bottom: -16rem;
  left: 22%;
  width: 32rem;
  height: 32rem;
  background: rgba(91, 111, 255, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand-copy strong {
  color: var(--neutral-900);
  font-size: 15px;
  font-weight: 720;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.brand-copy small {
  color: var(--neutral-500);
  font-size: 10px;
  line-height: 15px;
  letter-spacing: 0.02em;
}

.brand-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(145deg, #6bbcff, #2e74ff 58%, #2252c9);
  box-shadow: 0 8px 18px rgba(47, 123, 255, 0.25);
}

.brand-mark > span {
  position: absolute;
  width: 7px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(-30deg);
}

.brand-mark > span:nth-child(1) {
  top: 8px;
  left: 7px;
}

.brand-mark > span:nth-child(2) {
  top: 5px;
  left: 15px;
  height: 24px;
  background: rgba(255, 255, 255, 0.74);
}

.brand-mark > span:nth-child(3) {
  top: 13px;
  left: 23px;
  height: 14px;
  background: rgba(255, 255, 255, 0.48);
}

/* Authentication */
.login-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  place-items: center;
  padding: 48px clamp(24px, 6vw, 96px);
  background:
    linear-gradient(115deg, rgba(250, 252, 255, 0.94) 0%, rgba(244, 249, 255, 0.88) 56%, rgba(235, 245, 255, 0.92) 100%);
}

.login-screen::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(88, 139, 210, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 139, 210, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  mask-image: linear-gradient(90deg, #000, transparent 72%);
}

.login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1200px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(380px, 470px);
  align-items: center;
  gap: clamp(52px, 6.5vw, 96px);
}

.brand-on-login {
  margin-bottom: clamp(72px, 12vh, 132px);
}

.brand-on-login .brand-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 12px;
}

.brand-on-login .brand-mark > span:nth-child(1) {
  top: 10px;
  left: 8px;
}

.brand-on-login .brand-mark > span:nth-child(2) {
  top: 7px;
  left: 17px;
}

.brand-on-login .brand-mark > span:nth-child(3) {
  top: 14px;
  left: 26px;
}

.brand-on-login .brand-copy strong {
  font-size: 18px;
  line-height: 23px;
}

.brand-on-login .brand-copy small {
  font-size: 11px;
}

.login-eyebrow {
  display: inline-flex;
  min-height: 30px;
  padding: 0 11px;
  align-items: center;
  gap: 7px;
  color: var(--blue-600);
  border: 1px solid rgba(47, 123, 255, 0.12);
  border-radius: 999px;
  background: rgba(47, 123, 255, 0.06);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.login-eyebrow svg {
  width: 14px;
  height: 14px;
}

.login-intro h1 {
  margin: 22px 0 18px;
  color: var(--neutral-950);
  font-size: clamp(40px, 4.3vw, 62px);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: -0.055em;
}

.login-intro h1 span {
  color: transparent;
  background: linear-gradient(90deg, var(--blue-600), #52b6e8);
  background-clip: text;
  -webkit-background-clip: text;
}

.login-intro > p {
  max-width: 570px;
  margin: 0;
  color: var(--neutral-500);
  font-size: 16px;
  line-height: 1.9;
}

.login-trust {
  display: flex;
  margin-top: 34px;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 550;
}

.login-trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.login-trust svg {
  width: 16px;
  height: 16px;
  color: var(--blue-500);
}

.login-trust i,
.connection-pill i,
.table-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.1);
}

.login-card {
  display: grid;
  gap: 19px;
  padding: 34px;
  border-radius: var(--radius-xl);
}

.login-card-head {
  display: flex;
  margin-bottom: 6px;
  align-items: center;
  gap: 14px;
}

.login-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  color: var(--blue-600);
  border: 1px solid var(--blue-100);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--blue-50), #fff);
  box-shadow: var(--shadow-sm);
}

.login-card-icon svg {
  width: 22px;
  height: 22px;
}

.login-card .eyebrow {
  margin-bottom: 3px;
}

.login-card h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card-head > div > span {
  display: block;
  margin-top: 5px;
  color: var(--neutral-500);
  font-size: 12px;
}

.sso-login-button {
  display: grid;
  width: 100%;
  min-height: 62px;
  padding: 10px 14px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--neutral-900);
  border: 1px solid rgba(47, 123, 255, 0.2);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.08), rgba(82, 182, 232, 0.05));
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sso-login-button:hover {
  border-color: rgba(47, 123, 255, 0.46);
  box-shadow: 0 8px 24px rgba(47, 123, 255, 0.1);
  transform: translateY(-1px);
}

.sso-login-button > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.sso-login-button strong { font-size: 14px; }
.sso-login-button small { color: var(--neutral-500); font-size: 11px; }
.sso-login-button b { color: var(--blue-600); font-size: 18px; font-weight: 500; }

.dingtalk-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  border-radius: 11px;
  background: linear-gradient(145deg, #3296fa, #1677ff);
  box-shadow: 0 5px 12px rgba(22, 119, 255, 0.23);
  font-size: 17px;
  font-weight: 800;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--neutral-400);
  font-size: 10px;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  background: var(--border-divider);
  content: "";
}

.login-submit {
  width: 100%;
  min-height: 46px !important;
  margin-top: 3px;
  justify-content: space-between !important;
  padding: 0 18px !important;
}

.login-submit > span {
  font-size: 18px;
  font-weight: 400;
}

.login-error {
  min-height: 20px;
  margin: -6px 0 -12px;
  color: var(--error);
  font-size: 12px;
  line-height: 20px;
}

.login-help {
  margin: 0;
  color: var(--neutral-400);
  font-size: 11px;
  text-align: center;
}

/* App shell and navigation */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  width: var(--sidebar);
  height: 100vh;
  padding: 22px 16px 16px;
  flex-direction: column;
  background: rgba(250, 252, 255, 0.84);
  border-right: 1px solid var(--border-divider);
  backdrop-filter: blur(24px) saturate(150%);
}

.sidebar > .brand {
  padding: 0 8px;
}

.sidebar-close,
.mobile-menu {
  display: none;
}

.nav-list {
  display: flex;
  margin-top: 26px;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  margin: 16px 12px 5px;
  color: #9aa5b6;
  font-size: 10px;
  font-weight: 650;
  line-height: 16px;
  letter-spacing: 0.11em;
}

.nav-label:first-child {
  margin-top: 0;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  align-items: center;
  gap: 11px;
  color: var(--neutral-600);
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 520;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: var(--blue-600);
  background: rgba(47, 123, 255, 0.06);
}

.nav-item.active {
  color: var(--blue-600);
  background: linear-gradient(90deg, rgba(47, 123, 255, 0.13), rgba(47, 123, 255, 0.045));
  font-weight: 650;
}

.nav-item.active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -4px;
  width: 3px;
  border-radius: 3px;
  background: var(--blue-500);
  content: "";
}

.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: #7c8ba1;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}

.nav-item.active .nav-icon {
  color: var(--blue-500);
}

.sidebar-note {
  position: relative;
  min-height: 105px;
  padding: 14px 12px 12px 48px;
  overflow: hidden;
  border-color: rgba(61, 132, 245, 0.12);
  border-radius: 13px;
}

.sidebar-note::after {
  position: absolute;
  right: -22px;
  bottom: -26px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(47, 123, 255, 0.06);
  content: "";
}

.sidebar-note-icon {
  position: absolute;
  top: 14px;
  left: 12px;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--blue-500);
  border-radius: 8px;
  background: var(--blue-50);
}

.sidebar-note-icon svg {
  width: 14px;
  height: 14px;
}

.sidebar-note > span:not(.sidebar-note-icon),
.sidebar-note strong,
.sidebar-note small {
  display: block;
}

.sidebar-note > span:not(.sidebar-note-icon) {
  color: var(--neutral-500);
  font-size: 10px;
}

.sidebar-note strong {
  margin-top: 2px;
  color: var(--neutral-800);
  font-size: 13px;
}

.sidebar-note small {
  margin: 8px 0 0 -36px;
  color: var(--neutral-400);
  font-size: 9px;
  line-height: 1.55;
}

/* Main workspace */
.workspace {
  min-width: 0;
  padding: 26px clamp(22px, 3vw, 42px) 42px;
}

.topbar,
.toolbar,
.bulk-bar,
.drawer-header,
.drawer-footer,
.topbar-actions,
.filter-row,
.row-actions,
.page-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar,
.toolbar,
.bulk-bar,
.drawer-header,
.drawer-footer {
  justify-content: space-between;
}

.topbar {
  max-width: 1680px;
  margin: 0 auto 22px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

h1,
h2 {
  margin: 0;
  color: var(--neutral-900);
  line-height: 1.2;
}

h1 {
  font-size: 28px;
  font-weight: 740;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.page-subtitle {
  margin: 5px 0 0;
  color: var(--neutral-500);
  font-size: 12px;
}

.connection-pill {
  display: inline-flex;
  max-width: 230px;
  min-height: 32px;
  padding: 0 11px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--neutral-500);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-pill i {
  background: var(--neutral-400);
  box-shadow: none;
}

.connection-pill.online {
  color: #07864b;
  border-color: rgba(18, 183, 106, 0.18);
  background: rgba(236, 253, 245, 0.84);
}

.connection-pill.online i {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.08);
}

.connection-pill.error {
  color: #c83229;
  border-color: rgba(240, 68, 56, 0.18);
  background: rgba(254, 243, 242, 0.88);
}

.connection-pill.error i {
  background: var(--error);
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.text-button,
.mobile-menu,
.sidebar-close {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 650;
  transition:
    transform 140ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  display: inline-flex;
  min-height: 38px;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.primary-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.primary-button:hover {
  background: linear-gradient(135deg, #397ff8, var(--blue-700));
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.26);
  transform: translateY(-1px);
}

.ghost-button,
.icon-button {
  color: var(--neutral-600);
  border-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.ghost-button {
  padding: 0 13px;
}

.ghost-button:hover,
.icon-button:hover {
  color: var(--blue-600);
  border-color: var(--blue-200);
  background: var(--blue-50);
}

.danger-button {
  padding: 0 13px;
  color: var(--white);
  background: var(--error);
  box-shadow: 0 8px 18px rgba(240, 68, 56, 0.16);
}

.danger-button:hover {
  background: #d92d20;
}

.icon-button,
.mobile-menu,
.sidebar-close {
  display: grid;
  width: 36px;
  padding: 0;
  place-items: center;
}

.icon-button svg,
.mobile-menu svg,
.sidebar-close svg {
  width: 17px;
  height: 17px;
}

.page-heading .mobile-menu,
.sidebar .sidebar-close {
  display: none;
}

.text-button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--blue-600);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}

.text-button:hover {
  background: var(--blue-50);
}

.danger-text {
  color: var(--error);
}

.danger-text:hover {
  background: #fef3f2;
}

input,
select,
textarea {
  width: 100%;
  color: var(--neutral-800);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.025);
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input,
select {
  min-height: 40px;
  padding: 0 11px;
}

select {
  appearance: auto;
}

textarea {
  min-height: 108px;
  padding: 10px 11px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--neutral-400);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aab5c4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.1);
}

.toolbar {
  max-width: 1680px;
  margin: 0 auto 14px;
  padding: 11px 12px;
  border-color: rgba(225, 232, 242, 0.88);
  border-radius: var(--radius-md);
}

.search-box {
  display: flex;
  width: min(520px, 100%);
  min-height: 40px;
  padding: 0 10px;
  align-items: center;
  gap: 8px;
  color: var(--neutral-400);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
}

.search-box svg {
  width: 17px;
  height: 17px;
}

.search-box input {
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-box input:focus {
  box-shadow: none;
}

.search-box kbd {
  padding: 2px 6px;
  color: var(--neutral-400);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: var(--neutral-50);
  font: 10px var(--font);
  white-space: nowrap;
}

.filter-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 600;
}

.filter-label svg {
  width: 15px;
  height: 15px;
}

.filter-row select,
.filter-row input[type="date"] {
  width: auto;
  min-width: 130px;
  border-color: var(--border-subtle);
  font-size: 12px;
}

.date-range-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--neutral-500);
  font-size: 11px;
  white-space: nowrap;
}

.date-range-filter[hidden] {
  display: none;
}

.date-range-filter span {
  font-weight: 600;
}

.date-range-filter i {
  color: var(--neutral-400);
  font-style: normal;
}

.date-range-filter input[type="date"] {
  min-width: 132px;
}

.summary-strip {
  display: grid;
  max-width: 1680px;
  margin: 0 auto 14px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.summary-card {
  position: relative;
  width: 100%;
  min-height: 116px;
  padding: 15px 16px;
  overflow: hidden;
  color: inherit;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.summary-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--blue-400);
  content: "";
}

.summary-card:nth-child(2)::before {
  background: var(--cyan);
}

.summary-card:nth-child(3)::before {
  background: var(--success);
}

.summary-card:nth-child(4)::before {
  background: var(--warning);
}

.summary-card::after {
  position: absolute;
  right: -18px;
  bottom: -34px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(47, 123, 255, 0.035);
  content: "";
}

.summary-card:hover {
  border-color: var(--blue-200);
  box-shadow: 0 10px 24px rgba(31, 77, 138, 0.08);
  transform: translateY(-1px);
}

.summary-card.active {
  border-color: var(--blue-400);
  background: linear-gradient(145deg, var(--blue-50), rgba(255, 255, 255, 0.94));
  box-shadow: 0 0 0 1px rgba(47, 123, 255, 0.12), var(--shadow-sm);
}

.summary-card > span,
.summary-card > small {
  display: block;
  color: var(--neutral-500);
  font-size: 11px;
}

.summary-card > span {
  font-weight: 600;
}

.summary-card strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--neutral-900);
  font-size: 26px;
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.summary-card > small {
  color: var(--neutral-400);
  font-size: 10px;
}

/* Data table */
.table-panel {
  max-width: 1680px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
}

.table-titlebar {
  display: flex;
  min-height: 67px;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 252, 255, 0.9));
}

.table-titlebar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-titlebar > div > span:last-child,
.table-titlebar strong,
.table-titlebar small {
  display: block;
}

.table-title-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: var(--blue-600);
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  background: var(--blue-50);
}

.table-title-icon svg {
  width: 17px;
  height: 17px;
}

.table-titlebar strong {
  color: var(--neutral-800);
  font-size: 13px;
  font-weight: 680;
}

.table-titlebar small {
  margin-top: 2px;
  color: var(--neutral-400);
  font-size: 10px;
}

.table-live {
  display: inline-flex;
  min-height: 27px;
  padding: 0 9px;
  align-items: center;
  gap: 7px;
  color: var(--neutral-500);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 600;
}

.table-live i {
  width: 6px;
  height: 6px;
}

.bulk-bar {
  padding: 9px 14px;
  color: #9a6405;
  border-bottom: 1px solid #f9e0aa;
  background: #fffaeb;
  font-size: 12px;
  font-weight: 700;
}

.bulk-bar .danger-button {
  min-height: 30px;
  font-size: 11px;
}

.table-scroll {
  overflow: auto;
}

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

th,
td {
  height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: var(--neutral-500);
  background: #f8faff;
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.025em;
}

td {
  color: var(--neutral-600);
  font-size: 12px;
}

.table-panel td.cell-name {
  max-width: 300px;
  overflow: hidden;
  color: var(--neutral-800);
  font-weight: 620;
  text-overflow: ellipsis;
}

tbody tr {
  transition: background 130ms ease;
}

tbody tr:hover {
  background: rgba(242, 247, 255, 0.72);
}

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

.checkbox-cell {
  width: 42px;
  padding-right: 6px;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border-radius: 5px;
  accent-color: var(--blue-600);
  box-shadow: none;
}

.row-actions {
  gap: 1px;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  padding: 0 8px;
  align-items: center;
  color: var(--neutral-600);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--neutral-50);
  font-size: 10px;
  font-weight: 650;
}

.badge.success {
  color: #07864b;
  border-color: #b7ebce;
  background: #ecfdf3;
}

.badge.warn {
  color: #a15c07;
  border-color: #fedf89;
  background: #fffaeb;
}

.badge.danger {
  color: #c83229;
  border-color: #fecdca;
  background: #fef3f2;
}

.lead-level {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--neutral-600);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--neutral-50);
  font-size: 11px;
  font-weight: 750;
}

.lead-level.level-a {
  color: #067647;
  border-color: #abefc6;
  background: #ecfdf3;
}

.lead-level.level-b {
  color: var(--blue-700);
  border-color: var(--blue-200);
  background: var(--blue-50);
}

.lead-level.level-c {
  color: #b54708;
  border-color: #fedf89;
  background: #fffaeb;
}

.lead-level.level-d {
  color: var(--neutral-500);
  border-color: var(--neutral-200);
  background: var(--neutral-100);
}

.empty-state {
  display: grid;
  min-height: 280px;
  padding: 44px 16px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  color: var(--neutral-500);
}

.empty-state > strong {
  color: var(--neutral-700);
  font-size: 14px;
}

.empty-state > span:last-child {
  font-size: 11px;
}

.empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 5px;
  place-items: center;
  color: var(--blue-500);
  border-radius: 14px;
  background: var(--blue-50);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

.pagination-bar {
  display: flex;
  min-height: 58px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--neutral-500);
  border-top: 1px solid var(--border-subtle);
  background: #fbfdff;
  font-size: 11px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pagination-actions select {
  width: auto;
  min-width: 84px;
  min-height: 34px;
  border-color: var(--border-subtle);
  font-size: 11px;
}

.pagination-actions .ghost-button {
  min-height: 34px;
  font-size: 11px;
}

/* Detail panel */
.detail-backdrop,
.drawer-backdrop,
.confirm-overlay,
.secret-overlay,
.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(3px);
}

.detail-backdrop {
  z-index: 49;
}

.detail-panel {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  width: min(900px, calc(100vw - 24px));
  height: 100vh;
  overflow: auto;
  padding: 24px;
  border-left: 1px solid rgba(216, 222, 232, 0.8);
  background:
    radial-gradient(circle at 100% 0, rgba(189, 228, 255, 0.18), transparent 22rem),
    rgba(252, 253, 255, 0.98);
  box-shadow: -18px 0 60px rgba(24, 61, 118, 0.18);
}

.detail-header {
  display: flex;
  margin: -24px -24px 20px;
  padding: 22px 24px 18px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
}

.detail-header h2 {
  color: var(--neutral-900);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.detail-item {
  display: grid;
  min-height: 74px;
  padding: 12px;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

.detail-item span {
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 600;
}

.detail-item strong {
  color: var(--neutral-800);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.related-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.related-head {
  display: flex;
  margin-bottom: 11px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.related-head h2 {
  font-size: 15px;
}

.mini-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.mini-table {
  width: 100%;
  min-width: max-content;
  font-size: 11px;
}

.mini-table th,
.mini-table td {
  height: 43px;
}

.mini-table .cell-id {
  width: 62px;
}

.mini-table .cell-date {
  min-width: 148px;
}

.mini-table .cell-action {
  width: 70px;
  min-width: 70px;
}

.mini-table .cell-long-text {
  min-width: 260px;
  max-width: 360px;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.empty-related {
  display: grid;
  min-height: 86px;
  place-items: center;
  color: var(--neutral-400);
  border: 1px dashed var(--border-control);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.72);
  font-size: 11px;
}

.followup-list {
  display: grid;
  max-height: 500px;
  gap: 10px;
  overflow: auto;
  padding: 2px 4px 2px 0;
}

.followup-card {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
}

.followup-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.followup-card-head strong,
.followup-card-head span {
  display: block;
}

.followup-card-head strong {
  color: var(--neutral-800);
  font-size: 13px;
  font-weight: 680;
}

.followup-card-head span {
  margin-top: 3px;
  color: var(--neutral-400);
  font-size: 10px;
}

.followup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.followup-meta span {
  display: inline-flex;
  min-height: 25px;
  padding: 0 8px;
  align-items: center;
  gap: 5px;
  color: var(--neutral-600);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--neutral-50);
  font-size: 10px;
  font-weight: 550;
}

.followup-meta em {
  color: var(--neutral-400);
  font-style: normal;
  font-weight: 650;
}

.followup-text {
  display: grid;
  gap: 5px;
}

.followup-text span {
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 650;
}

.followup-text p {
  max-height: 100px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  color: var(--neutral-600);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--neutral-50);
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Drawer and modal */
.drawer-backdrop {
  z-index: 59;
}

.drawer {
  position: fixed;
  z-index: 60;
  top: 0;
  right: 0;
  width: min(560px, 100vw);
  height: 100vh;
  padding: 24px;
  border-left: 1px solid rgba(216, 222, 232, 0.8);
  background:
    radial-gradient(circle at 100% 0, rgba(189, 228, 255, 0.16), transparent 20rem),
    rgba(252, 253, 255, 0.98);
  box-shadow: -18px 0 60px rgba(24, 61, 118, 0.18);
  transform: translateX(105%);
  transition: transform 220ms ease;
}

.drawer.open {
  transform: translateX(0);
}

.drawer form {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.drawer-header {
  margin: -24px -24px 0;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.72);
}

.form-grid {
  display: grid;
  gap: 15px;
  overflow: auto;
  padding: 21px 3px;
}

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

.field label,
.field > span {
  color: var(--neutral-600);
  font-size: 11px;
  font-weight: 650;
}

.drawer-footer {
  margin: 0 -24px -24px;
  padding: 15px 24px;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
}

.confirm-overlay {
  z-index: 80;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(15, 23, 42, 0.36);
}

.secret-overlay {
  z-index: 90;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
}

.secret-box {
  display: grid;
  width: min(590px, 100%);
  gap: 12px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-lg);
}

.secret-box h2 {
  margin: 0;
  color: var(--neutral-900);
  font-size: 20px;
}

.secret-box > p:not(.eyebrow) {
  margin: 0;
  color: var(--neutral-500);
  font-size: 13px;
}

.secret-value-row {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.secret-value-row input {
  min-width: 0;
  flex: 1;
  color: var(--neutral-800);
  background: var(--neutral-50);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.secret-copy-status {
  color: var(--neutral-500);
  font-size: 11px;
}

.confirm-box {
  display: grid;
  width: min(410px, 100%);
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.confirm-box p {
  margin: 0;
  color: var(--neutral-800);
  font-size: 14px;
  line-height: 1.65;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.mobile-backdrop {
  z-index: 69;
}

@media (max-width: 1100px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    gap: 48px;
  }

  .brand-on-login {
    margin-bottom: 72px;
  }

  .summary-card {
    min-height: 108px;
  }

  .filter-label {
    display: none;
  }
}

@media (max-width: 900px) {
  .login-layout {
    width: min(500px, 100%);
    grid-template-columns: 1fr;
  }

  .login-intro > :not(.brand-on-login) {
    display: none;
  }

  .brand-on-login {
    margin: 0 0 24px;
    justify-content: center;
  }

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

  .sidebar {
    position: fixed;
    z-index: 70;
    left: 0;
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

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

  .sidebar .sidebar-close {
    display: grid;
    margin-left: auto;
    color: var(--neutral-500);
    border-color: var(--border-subtle);
    background: rgba(255, 255, 255, 0.76);
  }

  .page-heading .mobile-menu {
    display: grid;
    flex: 0 0 36px;
    color: var(--neutral-600);
    border-color: var(--border-subtle);
    background: rgba(255, 255, 255, 0.78);
  }

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

@media (max-width: 680px) {
  .login-screen {
    padding: 24px 16px;
  }

  .login-card {
    padding: 25px 21px;
    border-radius: 18px;
  }

  .workspace {
    padding: 18px 12px 28px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    margin-bottom: 16px;
  }

  h1 {
    font-size: 24px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr repeat(3, 36px);
    justify-content: stretch;
  }

  .connection-pill {
    max-width: none;
  }

  .topbar-actions .primary-button {
    grid-column: 1 / -1;
  }

  .toolbar {
    padding: 10px;
  }

  .search-box {
    width: 100%;
  }

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

  .filter-row select,
  .filter-row input[type="date"] {
    width: 100%;
    min-width: 0;
  }

  .date-range-filter {
    grid-column: 1 / -1;
  }

  .date-range-filter input[type="date"] {
    min-width: 0;
  }

  .summary-strip {
    gap: 9px;
  }

  .summary-card {
    min-height: 102px;
    padding: 13px;
  }

  .summary-card strong {
    font-size: 23px;
  }

  .table-titlebar {
    padding: 11px 12px;
  }

  .table-live {
    display: none;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-actions {
    width: 100%;
  }

  .pagination-actions select {
    flex: 1;
  }

  .detail-panel {
    width: 100vw;
    padding: 18px 14px;
  }

  .detail-header {
    margin: -18px -14px 16px;
    padding: 18px 14px 15px;
    align-items: stretch;
    flex-direction: column;
  }

  .detail-header .topbar-actions {
    display: flex;
    justify-content: flex-start;
  }

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

  .drawer {
    padding: 20px 16px;
  }

  .drawer-header {
    margin: -20px -16px 0;
    padding: 19px 16px 16px;
  }

  .drawer-footer {
    margin: 0 -16px -20px;
    padding: 14px 16px;
  }
}

@media (max-width: 420px) {
  .login-card-head {
    align-items: flex-start;
  }

  .login-card-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 94px;
  }

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

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