/* static/css/client-editor.css — extracted from index.html (FrameFlow prototype) */
  /* Client editor overlay */
  .client-editor-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(2,6,10,0.75); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 40px;
    opacity: 0; transition: opacity .25s ease;
  }
  .client-editor-overlay.show { opacity: 1; }
  .client-editor {
    width: 100%; max-width: 900px; max-height: calc(100vh - 80px);
    border-radius: 16px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 40px 100px rgba(0,0,0,0.55);
  }
  .client-editor-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
  }
  .client-editor-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--text); }
  .client-editor-head p { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); }
  .client-editor-close {
    width: 34px; height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
    color: var(--text-dim); display: grid; place-items: center; cursor: pointer; transition: all .2s ease; flex-shrink: 0;
  }
  .client-editor-close:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); transform: rotate(90deg); }
  .client-editor-close svg { width: 16px; height: 16px; }
  .client-editor-body {
    flex: 1; overflow-y: auto; padding: 18px 20px;
    display: flex; flex-direction: column; gap: 16px;
  }
  .client-editor-foot {
    display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border);
  }

  /* Editor sections: clean accordion, one expanded at a time */
  .client-editor-section {
    border: none; border-radius: 14px; overflow: hidden;
    background: transparent;
    transition: background .2s ease;
  }
  .client-editor-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; cursor: pointer; background: rgba(255,255,255,0.03);
    border-radius: 14px; border: 1px solid rgba(255,255,255,0.06);
    transition: background .2s ease, border-color .2s ease;
  }
  html[data-theme="light"] .client-editor-section-head { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.06); }
  .client-editor-section-head:hover { background: rgba(255,255,255,0.055); border-color: rgba(255,255,255,0.10); }
  html[data-theme="light"] .client-editor-section-head:hover { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.10); }
  .client-editor-section:not(.collapsed) .client-editor-section-head {
    background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12);
  }
  html[data-theme="light"] .client-editor-section:not(.collapsed) .client-editor-section-head { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.10); }
  .client-editor-section-head .section-title {
    display: flex; align-items: center; gap: 10px;
  }
  .client-editor-section-head .section-number {
    width: 24px; height: 24px; border-radius: 7px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--text-dim);
    flex-shrink: 0;
  }
  html[data-theme="light"] .client-editor-section-head .section-number { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.10); }
  .client-editor-section:not(.collapsed) .client-editor-section-head .section-number {
    background: var(--neon); border-color: var(--neon); color: #0b1a0f;
  }
  .client-editor-section-head h3 { margin: 0; font-size: 13px; font-weight: 800; color: var(--text); letter-spacing: 0.04em; }
  .client-editor-section-head p { margin: 5px 0 0; font-size: 12px; color: var(--text-muted); }
  .client-editor-section-head .chevron-wrap {
    width: 26px; height: 26px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    display: grid; place-items: center; flex-shrink: 0;
    transition: background .2s ease, transform .2s ease;
  }
  html[data-theme="light"] .client-editor-section-head .chevron-wrap { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.08); }
  .client-editor-section-head .chevron { width: 16px; height: 16px; color: var(--text-muted); transition: transform .25s cubic-bezier(0.16,1,0.3,1); }
  .client-editor-section.collapsed .chevron { transform: rotate(-90deg); }
  .client-editor-section-body {
    padding: 18px 4px 4px;
    animation: ceBodyIn .25s cubic-bezier(0.16,1,0.3,1);
  }
  @keyframes ceBodyIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .client-editor-section.collapsed .client-editor-section-body { display: none; }
  .client-editor-section + .client-editor-section { margin-top: 14px; }

  /* Unified editor sheet inside right panel */
  .client-edit-sheet {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
    padding: 18px 16px;
  }
  html[data-theme="light"] .client-edit-sheet {
    background: rgba(255,255,255,0.55);
    border-color: rgba(0,0,0,0.06);
  }

  .client-logo-upload {
    display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
    padding: 16px; background: rgba(255,255,255,0.04); border: none; border-radius: 14px;
  }
  html[data-theme="light"] .client-logo-upload { background: rgba(0,0,0,0.04); }
  .client-logo-box {
    width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center;
    font-size: 14px; font-weight: 800; border: 1px solid;
  }
  .client-logo-title { font-size: 13px; font-weight: 700; color: var(--text); }
  .client-logo-hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
  .client-upload-logo-btn { margin-left: auto; }

  .client-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  }
  .client-form-full { grid-column: 1 / -1; }
  .client-form-item { display: flex; flex-direction: column; gap: 6px; }
  .client-form-item label { font-size: 11px; font-weight: 700; color: var(--text-muted); }
  .client-form-item input, .client-form-item select {
    height: 40px; padding: 0 13px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
    color: var(--text); font-size: 13px; outline: none; transition: border-color .15s ease, background .15s ease;
  }
  html[data-theme="light"] .client-form-item input, html[data-theme="light"] .client-form-item select { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
  .client-form-item input:focus, .client-form-item select:focus { border-color: var(--neon); background: rgba(255,255,255,0.06); }
  html[data-theme="light"] .client-form-item input:focus, html[data-theme="light"] .client-form-item select:focus { background: rgba(0,0,0,0.05); }

  .client-depts-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
  }
  .client-depts-header span { font-size: 11px; color: var(--text-muted); font-weight: 700; }
  .client-depts-list { display: flex; flex-direction: column; gap: 10px; }
  .client-dept-row {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 14px;
    transition: border-color .2s ease, background .2s ease;
  }
  html[data-theme="light"] .client-dept-row { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.05); }
  .client-dept-row:hover { border-color: rgba(255,255,255,0.10); }
  html[data-theme="light"] .client-dept-row:hover { border-color: rgba(0,0,0,0.10); }
  .client-dept-main {
    display: flex; align-items: center; gap: 10px;
  }
  .client-dept-handle { color: var(--text-muted); display: grid; place-items: center; flex-shrink: 0; }
  .client-dept-handle svg { width: 16px; height: 16px; }
  .client-dept-name {
    flex: 1; min-width: 0;
    background: transparent; border: 1px solid transparent; color: var(--text); font-size: 14px; font-weight: 700; padding: 7px 9px; border-radius: 8px;
  }
  .client-dept-name:hover, .client-dept-name:focus { background: rgba(255,255,255,0.04); border-color: var(--border); outline: none; }
  .client-dept-actions {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  }
  .client-dept-actions button {
    width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted); display: grid; place-items: center; cursor: pointer; transition: all .2s ease; padding: 0;
  }
  html[data-theme="light"] .client-dept-actions button { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.08); }
  .client-dept-actions button:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.14); color: var(--text); }
  html[data-theme="light"] .client-dept-actions button:hover { background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.12); }
  .client-dept-actions .client-dept-add-contact { font-size: 18px; font-weight: 500; line-height: 1; }
  .client-dept-actions .client-dept-del:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.35); color: #fca5a5; }
  .client-dept-actions .client-dept-toggle svg { width: 14px; height: 14px; transition: transform .2s ease; }
  .client-dept-row:has(.client-contacts-list.show) .client-dept-toggle svg { transform: rotate(90deg); }
  .client-dept-meta { padding-left: 26px; font-size: 12px; color: var(--text-muted); margin-top: -4px; }
  .client-dept-count { color: var(--text-dim); font-weight: 600; }
  .client-add-dept { padding: 7px 12px; font-size: 12px; }
  .client-add-dept span { font-size: 14px; }

  .client-contacts-list {
    display: none; flex-direction: column; gap: 8px;
  }
  .client-contacts-list.show { display: flex; }
  .client-empty-contacts {
    padding: 16px; text-align: center; font-size: 12px; color: var(--text-muted);
    background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.08); border-radius: 10px;
  }
  html[data-theme="light"] .client-empty-contacts { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
  .client-contact-row {
    display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(255,255,255,0.03); border-radius: 10px;
  }
  .client-contact-fields {
    flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  }
  .client-contact-fields input {
    height: 34px; padding: 0 10px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07);
    color: var(--text); font-size: 12px; outline: none; transition: border-color .15s ease, background .15s ease;
  }
  html[data-theme="light"] .client-contact-fields input { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.08); }
  .client-contact-fields input:focus { border-color: var(--neon); background: rgba(255,255,255,0.07); }
  html[data-theme="light"] .client-contact-fields input:focus { background: rgba(0,0,0,0.06); }
  .client-contact-del {
    width: 28px; height: 28px; border-radius: 8px; background: transparent; border: 1px solid rgba(255,255,255,0.10);
    color: var(--text-muted); display: grid; place-items: center; cursor: pointer; transition: all .2s ease; flex-shrink: 0;
  }
  .client-contact-del:hover { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.35); color: #fca5a5; }

  /* Template cards */
  .template-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;
  }
  .template-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);
  }
  .template-cover {
    height: 120px; 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);
  }
  .template-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;
  }
  .template-watermark {
    position: absolute; right: 12px; top: -6px; font-size: 64px; font-weight: 900;
    line-height: 1; color: rgba(255,255,255,0.06); letter-spacing: -0.05em; pointer-events: none;
  }
  .template-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);
  }
  .template-body { padding: 16px; }
  .template-body h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
  .template-body p { margin: 0 0 12px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
  .template-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .template-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);
  }
  .template-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);
  }
  .template-use-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;
  }
  .template-use-btn:hover { background: rgba(74,222,128,0.28); }

  /* Back link */
  .back-link {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .back-link:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }

