/* static/css/dashboard.css — extracted from index.html (FrameFlow prototype) */
  /* Workflow canvas */
  .workflow-canvas {
    min-height: 0;
    position: relative;
    padding: 22px;
    overflow: visible;
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both 0.3s;
  }

  .workflow-canvas h2 {
    margin: 0 0 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .workflow-canvas h2 .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 12px var(--neon);
    animation: pulse 2s ease-in-out infinite;
  }

  #nodes-container,
  #nodes-container-full {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    position: relative;
    z-index: 2;
  }

  @media (max-width: 1100px) {
    #nodes-container,
    #nodes-container-full {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 720px) {
    #nodes-container,
    #nodes-container-full {
      grid-template-columns: 1fr;
    }
  }

  .node-stage {
    position: relative;
    width: 100%;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
    box-sizing: border-box;
  }

  .node-stage:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(74,222,128,0.45);
    box-shadow:
      0 20px 50px rgba(0,0,0,0.5),
      0 0 0 1px rgba(74,222,128,0.25),
      0 0 50px rgba(74,222,128,0.12);
  }

  .node-stage.active {
    border-color: rgba(74,222,128,0.55);
    box-shadow:
      0 0 0 1px rgba(74,222,128,0.4),
      0 0 60px rgba(74,222,128,0.18);
  }

  .node-stage .node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }

  .node-stage .node-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(74,222,128,0.18), rgba(74,222,128,0.05));
    border: 1px solid rgba(74,222,128,0.25);
    color: var(--neon-bright);
    display: grid;
    place-items: center;
    box-shadow: 0 0 16px rgba(74,222,128,0.12);
  }

  .node-stage .node-icon svg { width: 16px; height: 16px; }

  .node-stage .node-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
  }

  .node-stage .node-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
  }

  .node-stage .node-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(74,222,128,0.10);
    color: var(--neon-bright);
    border: 1px solid rgba(74,222,128,0.25);
  }

  .node-stage .node-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 8px var(--neon);
  }

  .node-stage .node-status.pending {
    background: rgba(245, 158, 11, 0.10);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.25);
  }
  .node-stage .node-status.pending::before { background: var(--warning); box-shadow: 0 0 8px var(--warning); }

  .node-stage .node-status.done {
    background: rgba(59, 130, 246, 0.10);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.25);
  }
  .node-stage .node-status.done::before { background: #60a5fa; box-shadow: 0 0 8px #60a5fa; }

  /* Connection SVG */
  .connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
  }

  .connections path {
    fill: none;
    stroke: rgba(74,222,128,0.45);
    stroke-width: 2.5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px rgba(74,222,128,0.35));
  }

  .connections .particle {
    fill: var(--neon-bright);
    filter: drop-shadow(0 0 6px var(--neon));
  }

  /* Dashboard analytics */
  .dashboard-analytics {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 2px;
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both 0.2s;
  }
  .analytics-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
  }
  .analytics-card {
    padding: 18px;
    border-radius: 14px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .analytics-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
  }
  .analytics-card header span:first-child {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
  }
  .analytics-total {
    font-size: 12px;
    font-weight: 700;
    color: var(--neon-bright);
    background: rgba(74,222,128,0.10);
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(74,222,128,0.20);
  }
  .analytics-total small { font-size: 11px; margin-left: 3px; opacity: 0.85; }
  .analytics-chart {
    flex: 1;
    min-height: 160px;
    position: relative;
  }
  .analytics-chart svg { width: 100%; height: 100%; display: block; }
  .trend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    padding: 0 2px;
    margin-top: -4px;
  }
  .platform-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 11px;
  }
  .platform-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); }
  .platform-legend i {
    width: 8px; height: 8px; border-radius: 2px;
  }
  .engagement-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .engagement-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
  }
  .engagement-item:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
  }
  .ei-icon {
    width: 28px; height: 28px; border-radius: 8px;
    display: grid; place-items: center;
    color: #fff;
    background: var(--ei-color);
    box-shadow: 0 0 14px color-mix(in srgb, var(--ei-color) 35%, transparent);
  }
  .ei-icon svg { width: 14px; height: 14px; }
  .ei-value { font-size: 20px; font-weight: 800; color: var(--text); }
  .ei-label { font-size: 11px; color: var(--text-muted); }
  .video-rank-list { display: flex; flex-direction: column; gap: 8px; }
  .video-rank-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
  }
  .video-rank-item:hover { border-color: var(--border-strong); }
  .video-rank-no {
    width: 20px; height: 20px; border-radius: 6px;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 800;
    background: rgba(74,222,128,0.12); color: var(--neon-bright);
  }
  .video-rank-item:nth-child(1) .video-rank-no { background: rgba(251,191,36,0.18); color: #fbbf24; }
  .video-rank-item:nth-child(2) .video-rank-no { background: rgba(148,163,184,0.18); color: #94a3b8; }
  .video-rank-item:nth-child(3) .video-rank-no { background: rgba(180,83,9,0.18); color: #d97706; }
  .video-rank-info { flex: 1; min-width: 0; }
  .video-rank-title { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .video-rank-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
  .video-rank-views { font-size: 12px; font-weight: 700; color: var(--neon-bright); }
  .platform-detail-card { gap: 14px; }
  .platform-table-wrap { overflow-x: auto; }
  .platform-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .platform-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .platform-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
  }
  .platform-table tr:last-child td { border-bottom: none; }
  .platform-table tr:hover td { background: var(--surface-2); }
  .platform-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
  .platform-dot { width: 8px; height: 8px; border-radius: 50%; }
  .rate-up { color: #f87171; }
  .rate-good { color: var(--neon-bright); }
  @media (max-width: 1200px) {
    .analytics-row { flex-direction: column; }
    .analytics-card { min-width: 0; width: 100%; }
    .engagement-grid { grid-template-columns: repeat(4, 1fr); }
  }
  @media (max-width: 860px) {
    .engagement-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* Project cards */
  .section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dim);
    margin: 8px 4px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .section-title a {
    font-size: 12px;
    color: var(--neon-bright);
    text-decoration: none;
    font-weight: 600;
  }

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

  /* Dashboard featured projects: three equal columns under KPIs */
  .featured-project-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    overflow-x: visible;
    padding-bottom: 0;
  }
  .featured-project-track .project-card {
    width: auto;
    flex: none;
    display: flex;
    flex-direction: column;
    scroll-snap-align: none;
    animation-delay: 0s;
  }
  .featured-project-track .project-card:nth-child(1) { animation-delay: 0.10s; }
  .featured-project-track .project-card:nth-child(2) { animation-delay: 0.18s; }
  .featured-project-track .project-card:nth-child(3) { animation-delay: 0.26s; }
  .featured-project-track .project-card .project-cover {
    height: 118px;
    border-bottom: none;
    border-radius: 0;
  }
  .featured-project-track .project-card .project-cover .cover-watermark { font-size: 76px; top: -10px; right: 12px; }
  .featured-project-track .project-card .project-cover .cover-tone { left: 14px; bottom: 12px; font-size: 10px; }
  .featured-project-track .project-card .project-cover .phase-pill { top: 12px; right: 12px; padding: 5px 10px; font-size: 11px; }
  .featured-project-track .project-card .project-body { padding: 16px; }
  .featured-project-track .project-card .project-body h3 { font-size: 15px; margin: 0 0 6px; }
  .featured-project-track .project-card .project-body .client { font-size: 12px; margin-bottom: 10px; }
  .featured-project-track .project-card .project-tags { margin-bottom: 12px; }
  .featured-project-track .project-card .tag-priority,
  .featured-project-track .project-card .tag-type { font-size: 11px; padding: 3px 9px; border-radius: 7px; }
  .featured-project-track .project-card .project-progress { margin-top: auto; }
  .featured-project-track .project-card .project-meta-row { display: flex; margin-top: 12px; }

  .project-card {
    padding: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .project-card:nth-child(1) { animation-delay: 0.42s; }
  .project-card:nth-child(2) { animation-delay: 0.50s; }
  .project-card:nth-child(3) { animation-delay: 0.58s; }

  .project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(74,222,128,0.35);
    box-shadow:
      0 20px 50px rgba(0,0,0,0.45),
      0 0 0 1px rgba(74,222,128,0.15),
      0 0 40px rgba(74,222,128,0.08);
  }

  .project-cover {
    height: 118px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background:
      radial-gradient(120% 80% at 50% 130%, color-mix(in srgb, var(--accent, #4ade80) 22%, transparent), transparent 55%),
      linear-gradient(180deg, #0b1310 0%, #0a0f0d 55%, #060807 100%);
  }
  .project-cover::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 58%;
    height: 1px;
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 16px var(--accent, rgba(74,222,128,0.45));
  }
  /* 浅色主题：项目封面改为清透浅色渐变，避免大块深色“压闷” */
  html[data-theme="light"] .project-cover {
    background:
      radial-gradient(120% 80% at 50% 130%, color-mix(in srgb, var(--accent, #16a34a) 10%, transparent), transparent 55%),
      linear-gradient(180deg, #ffffff 0%, #f6fbf8 55%, #eef7f1 100%);
  }
  html[data-theme="light"] .project-cover .cover-watermark { opacity: 0; }
  html[data-theme="light"] .project-cover::before {
    background: rgba(21,128,61,0.16);
    box-shadow: 0 0 14px rgba(21,128,61,0.25);
  }
  html[data-theme="light"] .project-cover::after { opacity: 0; }
  html[data-theme="light"] .project-cover .cover-tone { color: rgba(0,0,0,0.55); }
  html[data-theme="light"] .project-cover .cover-watermark { color: rgba(0,0,0,0.05); }

  .project-cover::after {
    opacity: 0.4;
    mix-blend-mode: overlay;
  }
  .project-cover .cover-watermark {
    position: absolute;
    right: 12px; top: -10px;
    font-size: 76px;
    font-weight: 900;
    line-height: 1;
    color: rgba(255,255,255,0.06);
    letter-spacing: -0.05em;
    z-index: 1;
    pointer-events: none;
    user-select: none;
  }
  .project-cover .cover-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.10) 50%, transparent 60%);
    animation: shine 6s ease-in-out infinite;
    z-index: 1;
  }
  .project-cover .cover-tone {
    position: absolute;
    left: 14px; bottom: 12px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    z-index: 2;
  }
  .project-cover .phase-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--neon-bright);
  }
  /* 浅色主题：阶段胶囊用白底绿字，避免深灰“污渍”感 */
  html[data-theme="light"] .project-cover .phase-pill {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(21,128,61,0.28);
    color: #15803d;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  }

  /* Priority + type tags on project cards */
  .project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
  }
  .tag-priority, .tag-type {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 7px;
    letter-spacing: 0.02em;
  }
  .tag-priority.pri-高 { color: #ff9b9b; background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.35); }
  .tag-priority.pri-中 { color: #ffd479; background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.35); }
  .tag-priority.pri-低 { color: #86efac; background: rgba(74,222,128,0.14); border: 1px solid rgba(74,222,128,0.35); }
  .tag-type { color: #bcd3ff; background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.3); }
  /* 浅色主题：标签用深色文字 + 浅底，清晰不褪色 */
  html[data-theme="light"] .tag-priority.pri-高 { color: #b91c1c; background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.32); }
  html[data-theme="light"] .tag-priority.pri-中 { color: #b45309; background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.35); }
  html[data-theme="light"] .tag-priority.pri-低 { color: #15803d; background: rgba(74,222,128,0.14); border-color: rgba(74,222,128,0.4); }
  html[data-theme="light"] .tag-type { color: #1d4ed8; background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.35); }

  /* Clients + Templates views */
  .clients-toolbar, .templates-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
    margin-bottom: 18px;
  }
  .clients-toolbar .search-box, .templates-toolbar .search-box {
    position: relative; flex: 1; min-width: 240px; max-width: 420px;
  }
  .clients-toolbar .search-box svg, .templates-toolbar .search-box svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
  }
  .clients-toolbar input, .templates-toolbar input {
    width: 100%; padding: 10px 12px 10px 36px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: 13px; outline: none;
  }
  .clients-toolbar input:focus, .templates-toolbar input:focus { border-color: var(--neon); }
  .clients-toolbar .filter-pills, .templates-toolbar .filter-pills {
    display: flex; flex-wrap: wrap; gap: 8px;
  }
  .client-grid, .template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }

  /* Client archive — CRM layout */
  .page-head-kicker {
    font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: var(--neon-bright);
    text-transform: uppercase; margin-bottom: 6px;
  }
  .page-head-actions { display: flex; gap: 10px; align-items: center; }

  .client-kpi-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0 18px;
  }
  .client-kpi-card {
    padding: 18px 16px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px;
  }
  .client-kpi-label { font-size: 12px; color: var(--text-muted); }
  .client-kpi-value { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }
  .client-kpi-hint { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

  .clients-layout {
    display: block;
  }
  .clients-controls {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 18px;
  }
  .clients-controls .filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
  .clients-controls .filter-pill { padding: 6px 12px; font-size: 12px; }
  .clients-controls .search-box { position: relative; width: 260px; }
  .clients-controls .search-box svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
  }
  .clients-controls .search-box input {
    width: 100%; padding: 9px 12px 9px 36px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text); font-size: 13px; outline: none;
  }
  .clients-controls .search-box input:focus { border-color: var(--neon); }
  .clients-controls-right { display: flex; align-items: center; gap: 10px; }
  .view-toggle {
    display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  }
  .view-toggle button {
    width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--text-muted);
    display: grid; place-items: center; cursor: pointer; transition: all .15s ease;
  }
  .view-toggle button svg { width: 16px; height: 16px; }
  .view-toggle button:hover { color: var(--text); background: var(--surface-hover); }
  .view-toggle button.active { background: var(--bg-elevated); color: var(--neon-bright); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
  html[data-theme="light"] .view-toggle button.active { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

  .client-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  }
  .client-card {
    padding: 0; overflow: hidden; cursor: pointer;
    transition: all .3s cubic-bezier(0.16,1,0.3,1);
    animation: scaleIn .45s cubic-bezier(0.16,1,0.3,1) both;
  }
  .client-card:hover {
    transform: translateY(-4px);
    border-color: rgba(74,222,128,0.35);
    box-shadow: 0 20px 50px rgba(0,0,0,0.45), 0 0 0 1px rgba(74,222,128,0.15), 0 0 40px rgba(74,222,128,0.08);
  }
  html[data-theme="light"] .client-card:hover {
    box-shadow: 0 12px 28px rgba(0,0,0,0.08), 0 0 0 1px rgba(21,128,61,0.14);
  }
  html[data-theme="light"] .client-card.active {
    box-shadow: 0 0 0 1px rgba(21,128,61,0.28), 0 8px 22px rgba(0,0,0,0.06);
  }
  html[data-theme="light"] .client-card-logo {
    box-shadow: 0 6px 16px rgba(0,0,0,0.10);
  }
  html[data-theme="light"] .node-stage:hover {
    box-shadow: 0 12px 28px rgba(0,0,0,0.08), 0 0 0 1px rgba(21,128,61,0.14);
  }
  html[data-theme="light"] .node-stage.active {
    box-shadow: 0 0 0 1px rgba(21,128,61,0.28), 0 8px 22px rgba(0,0,0,0.06);
  }
  .client-card.active {
    border-color: rgba(74,222,128,0.55);
    box-shadow: 0 0 0 1px rgba(74,222,128,0.25), 0 0 40px rgba(74,222,128,0.14);
  }
  .client-card-cover {
    height: 130px; position: relative; overflow: hidden;
    background:
      radial-gradient(120% 80% at 50% 130%, color-mix(in srgb, var(--accent, #4ade80) 22%, transparent), transparent 55%),
      linear-gradient(180deg, #0b1310 0%, #0a0f0d 55%, #060807 100%);
    border-bottom: 1px solid var(--border);
  }
  html[data-theme="light"] .client-card-cover {
    background:
      radial-gradient(120% 80% at 50% 130%, color-mix(in srgb, var(--accent, #16a34a) 12%, transparent), transparent 55%),
      linear-gradient(180deg, #ffffff 0%, #f4faf6 55%, #ebf5ee 100%);
  }
  html[data-theme="light"] .client-card-cover::after { opacity: 0; }
  html[data-theme="light"] .client-card-watermark { opacity: 0; }
  html[data-theme="light"] .client-card-type { background: rgba(0,0,0,0.35); }
  .client-card-cover::after {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 8px 8px; opacity: 0.4; mix-blend-mode: overlay;
  }
  .client-card-watermark {
    position: absolute; right: 14px; top: -2px; font-size: 82px; font-weight: 900;
    line-height: 1; color: rgba(255,255,255,0.07); letter-spacing: -0.05em; pointer-events: none;
  }
  .client-card-type {
    position: absolute; top: 10px; left: 10px;
    font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
    background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.12); color: var(--text);
    backdrop-filter: blur(4px);
  }
  .client-card-logo {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
    font-size: 18px; font-weight: 900; border: 1px solid; backdrop-filter: blur(4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
  .client-card-body { padding: 16px; }
  .client-card-body h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; line-height: 1.3; }
  .client-card-desc {
    margin: 0 0 12px; font-size: 12px; color: var(--text-muted); line-height: 1.5;
    min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .client-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .client-card-tag {
    font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
    background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.2); color: var(--neon-bright);
  }
  .client-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted);
  }
  .client-card-btn {
    width: 100%; margin-top: 12px; padding: 8px 0; border-radius: 8px; border: none;
    background: linear-gradient(135deg, rgba(74,222,128,0.18), rgba(74,222,128,0.05));
    border: 1px solid rgba(74,222,128,0.3); color: #86efac; font-size: 12px; font-weight: 700;
    cursor: pointer; transition: all .2s ease;
  }
  .client-card-btn:hover { background: rgba(74,222,128,0.28); }
  .client-card-empty {
    grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px;
  }

  .client-list {
    display: flex; flex-direction: column; gap: 10px;
  }
  .client-list-row {
    display: grid; grid-template-columns: 52px 1.6fr 1.2fr 0.9fr 0.8fr 0.7fr; align-items: center; gap: 14px;
    padding: 12px 16px; cursor: pointer; transition: all .2s ease; animation: slideIn .35s cubic-bezier(0.16,1,0.3,1) both;
  }
  .client-list-row:hover { background: var(--surface-hover); border-color: rgba(74,222,128,0.25); }
  .client-list-row.active { border-color: rgba(74,222,128,0.55); box-shadow: 0 0 0 1px rgba(74,222,128,0.25), 0 0 40px rgba(74,222,128,0.14); }
  .client-list-logo {
    width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    font-size: 12px; font-weight: 900; border: 1px solid;
  }
  .client-list-name { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
  .client-list-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
  .client-list-tags { display: flex; flex-wrap: wrap; gap: 5px; }
  .client-list-contact div:first-child { font-size: 13px; color: var(--text); }
  .client-list-contact div:last-child { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
  .client-list-projects, .client-list-contract, .client-list-status { font-size: 12px; color: var(--text-dim); text-align: right; }
  .client-list-contract { font-weight: 700; color: var(--text); }

  .clients-detail-wrap {
    padding: 0; min-height: 520px; overflow-y: auto;
    display: flex; flex-direction: column;
  }
  .client-detail-empty {
    flex: 1; display: grid; place-items: center; color: var(--text-muted); font-size: 13px; min-height: 420px;
  }
  .client-detail-head {
    display: flex; gap: 14px; padding: 18px 16px 14px; border-bottom: 1px solid var(--border);
  }
  .client-detail-avatar {
    width: 56px; height: 56px; border-radius: 14px; font-size: 22px; font-weight: 900;
    display: grid; place-items: center; flex-shrink: 0;
  }
  .client-detail-title { flex: 1; min-width: 0; }
  .client-detail-title h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
  .client-detail-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
  .client-detail-tags { display: flex; gap: 6px; margin-bottom: 6px; }
  .client-detail-level, .client-detail-type {
    font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  }
  .client-detail-level { background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.3); color: #bbf7d0; }
  .client-detail-type { background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.3); color: #bcd3ff; }
  .client-detail-edit { align-self: flex-start; padding: 7px 12px; font-size: 12px; }

  .client-detail-section { padding: 16px; border-bottom: 1px solid var(--border); }
  .client-detail-section h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--text); }
  .client-detail-section h3 small { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-left: 8px; }
  .client-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px;
  }
  .client-info-full { grid-column: 1 / -1; }
  .client-info-item { display: flex; flex-direction: column; gap: 5px; }
  .client-info-item span { font-size: 11px; color: var(--text-muted); }
  .client-info-item strong { font-size: 13px; color: var(--text); font-weight: 600; word-break: break-all; }
  .client-info-item a { color: var(--neon-bright); text-decoration: none; }

  .client-dept-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .client-dept-tag {
    font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 8px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
  }
  .client-dept-tag i { font-style: normal; color: var(--text-muted); margin-left: 4px; }
  .client-contact-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  }
  .client-contact-card > div:first-child { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
  .client-contact-card strong { font-size: 14px; color: var(--text); }
  .client-contact-card span { font-size: 12px; color: var(--text-muted); }
  .client-contact-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); }
  .client-empty-hint { color: var(--text-muted); font-size: 12px; padding: 6px 0; }

  .client-cooperation {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  }
  .client-cooperation > div {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 10px; text-align: center;
  }
  .client-cooperation b { display: block; font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
  .client-cooperation span { font-size: 11px; color: var(--text-muted); }

  .client-detail-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; margin-top: auto;
  }
  .client-detail-actions .btn-neon, .client-detail-actions .btn-ghost { justify-content: center; padding: 11px 12px; font-size: 13px; }

  .client-detail-sheet .client-detail-title h2 { font-size: 15px; line-height: 1.35; word-break: keep-all; white-space: normal; overflow-wrap: break-word; }

  .client-edit-sheet .client-form-grid { grid-template-columns: 1fr; }
  .client-edit-sheet .client-form-full { grid-column: 1 / -1; }
  .client-edit-sheet .client-contact-fields { grid-template-columns: 1fr 1fr; }
  .right-client-edit-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px;
  }
  .right-client-edit-actions .btn-neon, .right-client-edit-actions .btn-ghost { justify-content: center; padding: 11px 12px; font-size: 13px; }

  /* Unified detail sheet in right panel: one subtle surface, not stacked gray cards */
  .client-detail-sheet {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
    overflow: hidden;
  }
  html[data-theme="light"] .client-detail-sheet {
    background: rgba(255,255,255,0.55);
    border-color: rgba(0,0,0,0.06);
  }
  .client-detail-sheet .client-detail-head {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  html[data-theme="light"] .client-detail-sheet .client-detail-head { border-color: rgba(0,0,0,0.06); }
  .client-detail-sheet .client-detail-section {
    padding: 16px;
    border-bottom: none;
  }
  .client-detail-sheet .client-detail-section + .client-detail-section {
    border-top: 1px solid rgba(255,255,255,0.05);
  }
  html[data-theme="light"] .client-detail-sheet .client-detail-section + .client-detail-section { border-color: rgba(0,0,0,0.05); }
  .client-detail-sheet .client-detail-section h3 {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 14px;
  }
  .client-detail-sheet .client-detail-actions {
    padding: 16px;
    margin-top: 0;
    border-top: 1px solid rgba(255,255,255,0.05);
  }
  html[data-theme="light"] .client-detail-sheet .client-detail-actions { border-color: rgba(0,0,0,0.05); }

