:root {
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f0f1f4; --border: #e4e6eb;
  --text: #1c1d22; --text-dim: #6b6f76;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: #eef0ff;
  --green: #16a34a; --green-soft: #dcfce7;
  --amber: #d97706; --amber-soft: #fef3c7;
  --red: #dc2626; --red-soft: #fee2e2;
  --gray-soft: #eef0f2;
  --brand: #0b5c9c; --brand-2: #063f6e; --brand-hover: #0a5289; --brand-light: #1372b8;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171b; --surface: #1e1f25; --surface-2: #26272e; --border: #33343c;
    --text: #e8e9ed; --text-dim: #9a9ea7;
    --accent: #7c74ff; --accent-hover: #8f88ff; --accent-soft: #2a2b52;
    --green: #4ade80; --green-soft: #14331f;
    --amber: #fbbf24; --amber-soft: #3a2c0a;
    --red: #f87171; --red-soft: #3a1414;
    --gray-soft: #2b2c33;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); height: 100vh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ---------- Auth screen (modern split layout) ---------- */
.auth-screen {
  height: 100vh; display: flex; align-items: center; justify-content: center; padding: 22px;
  background: radial-gradient(1100px 640px at 15% -10%, var(--accent-soft), var(--bg));
}
.auth-shell {
  display: flex; width: min(940px, 96vw); min-height: 552px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg);
}

/* Left brand hero */
.auth-hero {
  flex: 1.05; position: relative; padding: 44px 42px; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(155deg, var(--brand-light) 0%, var(--brand) 46%, var(--brand-2) 100%);
}
.auth-hero::before { content: ""; position: absolute; width: 360px; height: 360px; right: -130px; top: -130px;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%); }
.auth-hero::after { content: ""; position: absolute; width: 280px; height: 280px; left: -110px; bottom: -100px;
  background: radial-gradient(circle, rgba(255,255,255,.10), transparent 70%); }
.auth-hero-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-hero-badge { width: 54px; height: 54px; border-radius: 15px; background: #fff; display: flex;
  align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.auth-hero-badge img { width: 38px; height: 38px; object-fit: contain; }
.auth-hero-name { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.auth-hero-mid { position: relative; z-index: 1; }
.auth-hero-mid h2 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.6px; margin-bottom: 14px; }
.auth-hero-mid p { font-size: 15px; line-height: 1.55; color: rgba(255,255,255,.85); max-width: 330px; margin-bottom: 26px; }
.auth-features { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.auth-features li { position: relative; padding-left: 30px; font-size: 14px; color: rgba(255,255,255,.94); }
.auth-features li::before { content: "✓"; position: absolute; left: 0; top: -1px; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; }
.auth-hero-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,.72); }

/* Right form panel */
.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 44px 42px; }
.auth-form { width: 100%; max-width: 340px; }
.auth-logo-mobile { display: none; height: 52px; width: auto; margin: 0 auto 20px; }
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 5px; }
.auth-sub { font-size: 14px; color: var(--text-dim); margin-bottom: 22px; }
.auth-hint { font-size: 13px; text-align: center; margin-bottom: 16px; background: var(--accent-soft);
  color: var(--accent); padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.auth-tabs button.hidden { display: none; }
.auth-tabs button { flex: 1; border: none; background: none; padding: 9px; border-radius: 7px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text-dim); transition: color .15s; }
.auth-tabs button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.auth-error { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 8px;
  font-size: 13px; margin-bottom: 14px; }
.auth-form .field input:focus { border-color: var(--brand); }
.auth-form .auth-submit { background: var(--brand); margin-top: 6px; padding: 12px; font-size: 15px; border-radius: 9px; }
.auth-form .auth-submit:hover { background: var(--brand-hover); }

@media (max-width: 820px) {
  .auth-hero { display: none; }
  .auth-shell { width: min(420px, 96vw); min-height: auto; }
  .auth-logo-mobile { display: block; }
  .auth-title, .auth-sub { text-align: center; }
}

/* ---------- App shell ---------- */
.app { display: flex; height: 100vh; }
.sidebar { width: 264px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 16px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.brand .brand-icon { height: 30px; width: auto; object-fit: contain; }
.brand h1 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.sidebar-section { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim);
  font-weight: 600; padding: 6px 10px; display: flex; justify-content: space-between; align-items: center;
}
.add-btn {
  border: none; background: none; color: var(--text-dim); cursor: pointer; font-size: 18px; line-height: 1;
  width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
}
.add-btn:hover { background: var(--surface-2); color: var(--accent); }
.project-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  font-size: 14px; margin-bottom: 1px;
}
.project-item:hover { background: var(--surface-2); }
.project-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.project-item.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.project-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.project-item .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item .pcount { font-size: 11px; color: var(--text-dim); background: var(--surface-2); padding: 1px 7px; border-radius: 10px; }
.project-item.active .pcount { background: var(--surface); }
.shared-badge { font-size: 10px; color: var(--text-dim); }

/* admin link */
.admin-link {
  margin: 0 12px 4px; padding: 9px 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; text-align: left;
}
.admin-link:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* user footer */
.user-box { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-box .uinfo { flex: 1; min-width: 0; }
.user-box .uname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .uemail { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { border: none; background: none; color: var(--text-dim); cursor: pointer; font-size: 12px; padding: 4px 6px; border-radius: 6px; }
.logout-btn:hover { background: var(--surface-2); color: var(--red); }

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { padding: 16px 28px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: 16px; }
.topbar .title-wrap { flex: 1; min-width: 0; }
.topbar h2 { font-size: 20px; font-weight: 700; letter-spacing: -.4px; display: flex; align-items: center; gap: 10px; }
.topbar .desc { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.avatars { display: flex; align-items: center; }
.avatars .avatar { width: 28px; height: 28px; font-size: 11px; border: 2px solid var(--surface); margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }
.share-btn {
  padding: 7px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px;
}
.share-btn:hover { background: var(--border); }
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress-bar { width: 120px; height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #a855f7); transition: width .3s; }
.progress-pct { font-size: 12px; color: var(--text-dim); font-weight: 600; min-width: 34px; }

.toolbar { padding: 12px 28px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); background: var(--surface); }
.view-toggle { display: flex; background: var(--surface-2); border-radius: 8px; padding: 3px; }
.view-toggle button { border: none; background: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-dim); font-weight: 500; }
.view-toggle button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search { flex: 1; max-width: 260px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 13px; }
.search:focus { outline: none; border-color: var(--accent); }
.spacer { flex: 1; }
.sync-dot { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
.sync-dot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.content { flex: 1; overflow: auto; padding: 22px 28px; }

/* Board */
.board { display: flex; gap: 18px; align-items: flex-start; min-height: 100%; }
.column { background: var(--surface-2); border-radius: 12px; width: 300px; flex-shrink: 0; padding: 6px; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; font-size: 13px; font-weight: 700; }
.column-head .cdot { width: 9px; height: 9px; border-radius: 50%; }
.column-head .ccount { color: var(--text-dim); font-weight: 500; }
.column-body { padding: 4px; min-height: 40px; display: flex; flex-direction: column; gap: 8px; }
.column-body.drag-over { background: var(--accent-soft); border-radius: 8px; }
.card { background: var(--surface); border-radius: 10px; padding: 12px 13px; box-shadow: var(--shadow); cursor: grab; border: 1px solid var(--border); position: relative; overflow: hidden; }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .4; }
.card .card-title { font-size: 14px; font-weight: 500; line-height: 1.35; margin-bottom: 8px; padding-right: 18px; overflow-wrap: anywhere; word-break: break-word; }
.card .card-title.done { text-decoration: line-through; color: var(--text-dim); }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.chip-high { background: var(--red-soft); color: var(--red); }
.chip-med { background: var(--amber-soft); color: var(--amber); }
.chip-low { background: var(--gray-soft); color: var(--text-dim); }
.chip-due { background: var(--surface-2); color: var(--text-dim); }
.chip-due.overdue { background: var(--red-soft); color: var(--red); }
.card-del { position: absolute; top: 8px; right: 8px; border: none; background: none; color: var(--text-dim); cursor: pointer; font-size: 15px; line-height: 1; opacity: 0; padding: 2px; border-radius: 4px; }
.card:hover .card-del { opacity: 1; }
.card-del:hover { color: var(--red); background: var(--red-soft); }
.add-card { border: none; background: none; color: var(--text-dim); cursor: pointer; padding: 9px 12px; font-size: 13px; border-radius: 8px; text-align: left; width: 100%; font-weight: 500; }
.add-card:hover { background: var(--surface); color: var(--accent); }

/* List */
.list-table { width: 100%; background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.list-row { display: grid; grid-template-columns: 28px 1fr 130px 110px 110px 40px; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 14px; }
.list-row:last-child { border-bottom: none; }
.list-row.head { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); font-weight: 600; background: var(--surface-2); }
.list-row:not(.head):hover { background: var(--surface-2); }
.list-title { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.list-title.done { text-decoration: line-through; color: var(--text-dim); }
.check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check.done { background: var(--green); border-color: var(--green); color: #fff; }
.status-select, .prio-select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }

/* Sheets */
.sheets-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.sheets-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sheet-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; box-shadow: var(--shadow); position: relative; }
.sheet-card:hover { border-color: var(--accent); }
.sheet-card .sname { font-size: 15px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; padding-right: 16px; }
.sheet-card .smeta { font-size: 12px; color: var(--text-dim); }
.sheet-card .del-sheet { position: absolute; top: 10px; right: 10px; opacity: 0; border: none; background: none; color: var(--text-dim); cursor: pointer; font-size: 16px; }
.sheet-card:hover .del-sheet { opacity: 1; }
.sheet-card .del-sheet:hover { color: var(--red); }

.sheet-editor-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sheet-name-input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 15px; font-weight: 600; min-width: 200px; }
.sheet-name-input:focus { outline: none; border-color: var(--accent); }
.sheet-dirty { font-size: 12px; color: var(--amber); font-weight: 600; }
.sheet-grid-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; max-height: calc(100vh - 250px); background: var(--surface); }
table.sheet-grid { border-collapse: collapse; font-size: 13px; }
table.sheet-grid td, table.sheet-grid th { border: 1px solid var(--border); }
table.sheet-grid th { background: var(--surface-2); color: var(--text-dim); font-size: 11px; font-weight: 600; padding: 6px 8px; position: sticky; top: 0; z-index: 2; text-align: center; min-width: 120px; }
table.sheet-grid td.rownum { background: var(--surface-2); color: var(--text-dim); text-align: center; font-size: 11px; min-width: 40px; position: sticky; left: 0; z-index: 1; }
table.sheet-grid td[contenteditable] { padding: 6px 8px; outline: none; min-width: 120px; max-width: 320px; }
table.sheet-grid td[contenteditable]:focus { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }

/* Files (PDFs & documents) */
.files-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.files-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.file-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; box-shadow: var(--shadow); position: relative; display: flex; align-items: center; gap: 12px; }
.file-card:hover { border-color: var(--accent); }
.file-ico { font-size: 26px; flex-shrink: 0; }
.file-card .finfo { min-width: 0; flex: 1; }
.file-card .fname { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .fmeta { font-size: 12px; color: var(--text-dim); }
.file-card .del-file { position: absolute; top: 8px; right: 8px; opacity: 0; border: none; background: none; color: var(--text-dim); cursor: pointer; font-size: 15px; }
.file-card:hover .del-file { opacity: 1; }
.file-card .del-file:hover { color: var(--red); }

.file-viewer { background: var(--surface); border-radius: 14px; width: 92vw; max-width: 980px; height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.file-viewer-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fv-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-viewer-body { flex: 1; background: var(--surface-2); overflow: auto; display: flex; align-items: center; justify-content: center; }
.file-viewer-body iframe { width: 100%; height: 100%; border: none; }
.file-viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fv-loading { color: var(--text-dim); font-size: 14px; }

/* Task image attachments */
.task-images { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.task-thumb { position: relative; width: 74px; height: 74px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); cursor: zoom-in; background: var(--surface-2); }
.task-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.task-thumb .thumb-del { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; opacity: 0; }
.task-thumb:hover .thumb-del { opacity: 1; }
.img-add-btn { padding: 7px 12px; font-size: 13px; }
.img-empty { font-size: 12px; color: var(--text-dim); }
.card-imgcount { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-dim); background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }
.card-thumb-strip { display: flex; gap: 4px; margin-top: 8px; }
.card-thumb-strip img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
#lightboxOverlay { z-index: 130; cursor: zoom-out; }
.lightbox-img { max-width: 90vw; max-height: 90vh; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* Empty */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-dim); text-align: center; gap: 14px; }
.empty .emoji { font-size: 46px; }
.empty h3 { font-size: 17px; color: var(--text); }
.empty p { font-size: 14px; max-width: 320px; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
.overlay.show { display: flex; }
/* Edit-user dialog opens on top of the Admin panel, so it must stack above it */
#editUserOverlay { z-index: 120; }
.modal { background: var(--surface); border-radius: 14px; padding: 24px; width: 440px; max-width: 92vw; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal.modal-wide { width: 560px; }
.modal h3 { font-size: 17px; margin-bottom: 18px; }

/* Admin panel */
.admin-user-row { display: grid; grid-template-columns: 30px 1fr auto auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row-actions { display: flex; gap: 2px; }
.admin-user-row .minfo { min-width: 0; }
.admin-user-row .mname { font-size: 14px; font-weight: 500; }
.admin-user-row .memail { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-row select.role-mini { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 12px; font-weight: 600; }
.perm-toggle { font-size: 11px; display: flex; align-items: center; gap: 5px; color: var(--text-dim); white-space: nowrap; }
.admin-create { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.admin-create-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.perm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; margin-top: 4px; cursor: pointer; }
.perm-check input { width: auto; }
.badge-admin { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.badge-you { font-size: 11px; color: var(--text-dim); }
.del-user { border: none; background: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 5px; }
.del-user:hover { color: var(--red); background: var(--red-soft); }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 60px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.color-picker { display: flex; gap: 8px; }
.color-opt { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.color-opt.selected { border-color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.btn-primary { padding: 9px 16px; background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-primary.full { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.btn-ghost { padding: 9px 16px; background: var(--surface-2); color: var(--text); border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-ghost:hover { background: var(--border); }

/* Members list in share modal */
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: none; }
.member-row .minfo { flex: 1; min-width: 0; }
.member-row .mname { font-size: 14px; font-weight: 500; }
.member-row .memail { font-size: 12px; color: var(--text-dim); }
.role-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-dim); }
.role-tag.owner { background: var(--accent-soft); color: var(--accent); }
.remove-member { border: none; background: none; color: var(--text-dim); cursor: pointer; font-size: 13px; }
.remove-member:hover { color: var(--red); }
.invite-row { display: flex; gap: 8px; margin-bottom: 18px; }
.invite-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 14px; }
.invite-row input:focus { outline: none; border-color: var(--accent); }
.invite-suggest { margin-bottom: 8px; max-height: 210px; overflow-y: auto; }
.suggest-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.suggest-row:hover { background: var(--surface-2); }
.suggest-row .minfo { flex: 1; min-width: 0; }
.suggest-row .mname { font-size: 14px; font-weight: 500; }
.suggest-row .memail { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-add { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.suggest-empty { font-size: 13px; color: var(--text-dim); padding: 8px 4px; }
.members-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); font-weight: 600; margin: 14px 0 6px; }

/* Import */
.import-btn { padding: 8px 13px; }
.import-intro { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin-bottom: 14px; }
.import-intro b { color: var(--text); }
.import-intro a { color: var(--accent); cursor: pointer; font-weight: 600; }
.import-drop { display: block; border: 2px dashed var(--border); border-radius: 10px; padding: 22px; text-align: center; cursor: pointer; margin-bottom: 14px; }
.import-drop:hover { border-color: var(--accent); background: var(--surface-2); }
.import-drop-inner { color: var(--text-dim); font-size: 14px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.import-fname { font-size: 12px; color: var(--accent); font-weight: 700; }
.import-map { margin-bottom: 14px; }
.import-map-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.map-field label { display: block; font-size: 11px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.map-field select { width: 100%; padding: 8px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); font-size: 13px; }
.map-field select:focus { outline: none; border-color: var(--accent); }
.import-count { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.import-warn { background: var(--amber-soft); color: var(--amber); padding: 8px 10px; border-radius: 8px; font-size: 12px; margin-bottom: 10px; }
.import-empty { color: var(--text-dim); font-size: 13px; padding: 8px 0; }
.import-table-wrap { max-height: 230px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.import-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.import-table th { text-align: left; padding: 8px 10px; background: var(--surface-2); color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; position: sticky; top: 0; }
.import-table td { padding: 8px 10px; border-top: 1px solid var(--border); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }
