/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg-sidebar:   #f7f7f8;
  --bg-main:      #ffffff;
  --bg-input:     #f4f4f5;
  --bg-hover:     #efefef;
  --bg-active:    #e4e4e6;
  --text-primary: #1a1a1a;
  --text-sec:     #555570;
  --text-muted:   #90909a;
  --border:       #dddde0;
  --accent:       #10a37f;
  --accent-h:     #0d8c6e;
  --red:          #d93025;
  --sidebar-w:    260px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  overflow: hidden;
  font-size: 15px;
}

/* ── Login screen ──────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 380px;
  max-width: 94vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.login-title  { font-size: 22px; font-weight: 700; margin: 8px 0 4px; }
.login-sub    { color: var(--text-sec); font-size: 13px; text-align: center; margin-bottom: 24px; }
.field-label  { align-self: flex-start; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field-input  {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--accent); }
.login-btn {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}
.login-btn:hover:not(:disabled) { background: var(--accent-h); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error {
  width: 100%;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 8px;
  text-align: center;
}
.login-footer { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 20px; }
.hidden { display: none !important; }

/* ── App hidden state ──────────────────────────────────────── */
.app-hidden { display: none !important; }
#app { display: contents; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-top    { padding: 12px; border-bottom: 1px solid var(--border); }
.new-chat-btn {
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.new-chat-btn:hover { background: var(--bg-hover); }
.sidebar-list   { flex: 1; overflow-y: auto; padding: 8px; }
.list-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.conv-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, color 0.12s;
}
.conv-item:hover  { background: var(--bg-hover);  color: var(--text-primary); }
.conv-item.active { background: var(--bg-active); color: var(--text-primary); }
.sidebar-bottom {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.clear-btn {
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.clear-btn:hover { background: var(--bg-hover); color: var(--red); border-color: var(--red); }

/* ── Main ──────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-left     { display: flex; align-items: center; gap: 10px; }
.status-dot      { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.status-dot.on   { background: var(--accent); }
.header-title    { font-size: 16px; font-weight: 600; }
.lock-strip      { display: flex; align-items: center; gap: 8px; }
.user-display    { font-size: 13px; color: var(--text-sec); }
.model-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  appearance: none;
}
.model-select:focus { border-color: var(--accent); }
.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-sec);
  cursor: pointer;
  padding: 5px 9px;
  font-size: 13px;
  line-height: 1;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Chat body ─────────────────────────────────────────────── */
.chat-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Welcome ───────────────────────────────────────────────── */
.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 14px;
}
.welcome-bee { font-size: 52px; }
.welcome-h   { font-size: 26px; font-weight: 700; }
.welcome-sub { color: var(--text-sec); max-width: 440px; line-height: 1.6; }

/* ── Messages ──────────────────────────────────────────────── */
.msgs-wrap  { flex: 1; overflow-y: auto; padding: 24px 0 8px; }
.msgs-inner { max-width: 780px; margin: 0 auto; padding: 0 20px; }
.msg        { display: flex; gap: 12px; margin-bottom: 22px; }
.msg.user   { flex-direction: row-reverse; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}
.avatar.user      { background: #5b5bd6; color: #fff; }
.avatar.assistant { background: var(--accent); color: #fff; font-size: 16px; }
.msg-content       { max-width: 82%; line-height: 1.65; }
.msg.user .msg-content {
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
}
.msg.assistant .msg-content { padding: 2px 0; }

/* Markdown in assistant bubbles */
.msg-content p            { margin-bottom: 10px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content code         { background: #ededf0; padding: 1px 5px; border-radius: 3px; font-family: 'Courier New', monospace; font-size: 13px; }
.msg-content pre          { background: #ededf0; padding: 14px; border-radius: 8px; overflow-x: auto; margin: 10px 0; }
.msg-content pre code     { background: transparent; padding: 0; }
.msg-content ul,
.msg-content ol           { padding-left: 22px; margin-bottom: 10px; }
.msg-content li           { margin-bottom: 3px; }
.msg-content h1, .msg-content h2, .msg-content h3 { margin: 14px 0 6px; }
.msg-content a            { color: var(--accent); }
.sources-block            { margin-top: 10px; font-size: 13px; color: var(--text-sec); }
.sources-block ol         { padding-left: 18px; margin-top: 4px; }

/* Typing dots */
.dots { display: flex; gap: 5px; padding: 6px 0; align-items: center; }
.dot  { width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%; animation: bounce 1.2s infinite; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.35; }
  30%            { transform: translateY(-4px); opacity: 1; }
}

/* ── Input area ────────────────────────────────────────────── */
.input-area   { padding: 14px 20px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.input-wrap   { max-width: 780px; margin: 0 auto; position: relative; }
.msg-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 12px 52px 12px 16px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.55;
  transition: border-color 0.15s;
}
.msg-input:focus         { border-color: var(--accent); }
.msg-input::placeholder  { color: var(--text-muted); }
.send-btn {
  position: absolute;
  right: 10px; bottom: 9px;
  background: var(--accent);
  border: none;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}
.send-btn:hover          { background: var(--accent-h); }
.send-btn:disabled       { background: var(--border); cursor: not-allowed; opacity: 0.5; }
.input-footer            { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.copy-btn:hover  { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--accent); color: var(--accent); }
.disclaimer-bar {
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  padding: 6px 20px;
  font-size: 11px;
  color: #78716c;
  text-align: center;
  line-height: 1.5;
  flex-shrink: 0;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar             { width: 6px; }
::-webkit-scrollbar-track       { background: transparent; }
::-webkit-scrollbar-thumb       { background: #c0c0c4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8b0; }

/* ── Hamburger ─────────────────────────────────────────────── */
.hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-sec);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 18px;
  line-height: 1;
  transition: all 0.15s;
  flex-shrink: 0;
}
.hamburger:hover { border-color: var(--accent); color: var(--accent); }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hamburger { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open               { transform: translateX(0); }
  .sidebar-backdrop.visible   { display: block; }
  .header                     { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
  .header-left                { flex: 1; }
  .lock-strip                 { flex: 0 0 100%; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .model-select               { max-width: 115px; font-size: 11px; padding: 5px 6px; }
  .msgs-inner                 { padding: 0 12px; }
  .input-area                 { padding: 10px 12px 14px; }
  .welcome                    { padding: 30px 16px; }
  .msg-content                { max-width: 90%; }
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
}
.modal-card {
  background: #fff;
  border-radius: 14px;
  width: 460px; max-width: 94vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-title { font-weight: 700; font-size: 16px; }
.modal-x {
  background: none; border: none; font-size: 17px; cursor: pointer;
  color: var(--text-muted); padding: 2px 7px; border-radius: 6px;
  line-height: 1;
}
.modal-x:hover { background: var(--bg-hover); }
.modal-body {
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
}

/* ── Profile card ───────────────────────────────────────────── */
.profile-info    { text-align: center; padding-bottom: 8px; }
.profile-name    { font-size: 17px; font-weight: 700; }
.profile-email   { font-size: 13px; margin-top: 2px; }
.profile-orgs    { font-size: 13px; }
.profile-org-row { padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.text-muted      { color: var(--text-muted); }

/* ── Reusable form components ───────────────────────────────── */
.form-row   { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.03em; }
.form-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.15s; color: var(--text-primary);
}
.form-input:focus { border-color: var(--accent); }
.form-error {
  color: var(--red); font-size: 13px;
  padding: 7px 10px; background: #fef2f2; border-radius: 6px; display: none;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 8px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm {
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px;
  font-size: 12px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.btn-sm:hover { background: var(--bg-active); }
.btn-danger {
  background: none; border: 1px solid var(--red);
  color: var(--red); border-radius: 6px; padding: 5px 10px;
  font-size: 12px; cursor: pointer; white-space: nowrap;
}
.btn-danger:hover { background: #fef2f2; }

/* ── Role badge ─────────────────────────────────────────────── */
.role-badge {
  display: inline-block; background: var(--bg-active);
  border-radius: 4px; padding: 2px 7px;
  font-size: 11px; color: var(--text-sec);
  margin: 1px 2px; white-space: nowrap;
}

/* ── Users view ─────────────────────────────────────────────── */
.users-view {
  flex: 1; overflow-y: auto; padding: 22px 28px;
  display: flex; flex-direction: column; gap: 16px;
}
.users-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.users-title  { font-size: 17px; font-weight: 700; flex: 1; }
.users-content { display: flex; flex-direction: column; gap: 14px; }
.users-table  { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th {
  text-align: left; padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
}
.users-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.users-table tr:hover td { background: var(--bg-hover); }

/* ── Inline form card ───────────────────────────────────────── */
.inline-form {
  background: var(--bg-sidebar); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  margin-bottom: 4px;
}
.inline-form-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

/* ── Flash notification ─────────────────────────────────────── */
.flash-msg {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff; padding: 9px 20px;
  border-radius: 20px; font-size: 13px; z-index: 500;
  transition: opacity 0.5s; pointer-events: none;
}

/* ── Knowledge / document management ───────────────────────── */
.knowledge-table { table-layout: fixed; }
.knowledge-table th:nth-child(1) { width: auto; }   /* Name — takes remaining space */
.knowledge-table th:nth-child(2) { width: 70px; }   /* Type */
.knowledge-table th:nth-child(3) { width: 60px; }   /* Items */
.knowledge-table th:nth-child(4) { width: 100px; }  /* Synced */
.knowledge-table th:nth-child(5) { width: 38%; }    /* Access Roles */
.folder-files-table { margin-bottom: 2px; }
.doc-name-cell { word-break: break-word; }
.doc-date-cell { font-size: 11px; white-space: nowrap; color: var(--text-muted); }
.doc-roles-cell { padding: 8px 12px; }
.doc-roles-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.doc-role-add { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.doc-role-select { padding: 2px 5px; font-size: 11px; height: 24px; }
.doc-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.doc-link:hover { text-decoration: underline; }
.role-badge--rm { cursor: pointer; }
.role-badge--rm:hover { background: #fee2e2; color: var(--red); }
.role-badge--mixed { background: #fef3c7; color: #92400e; font-style: italic; }
.scope-badge {
  display: inline-block; border-radius: 4px; padding: 2px 7px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.scope-region { background: #e0f2fe; color: #0369a1; }
.scope-org    { background: #dcfce7; color: #166534; }
.scope-site   { background: #fef9c3; color: #854d0e; }

/* ── Folder tree ─────────────────────────────────────────── */
.folder-node {
  margin-bottom: 2px;
}
.folder-node > .folder-content {
  border-left: 2px solid var(--border);
  margin-left: 10px;
  padding-left: 4px;
  margin-top: 2px;
}
.folder-summary {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600; user-select: none;
  list-style: none; color: var(--text-sec);
}
.folder-summary::-webkit-details-marker { display: none; }
.folder-summary:hover { background: var(--bg-hover); }
.folder-node[open] > .folder-summary { color: var(--text-primary); }
.folder-chevron {
  display: inline-block; font-style: normal; font-size: 14px;
  transition: transform 0.15s; line-height: 1; color: var(--text-muted);
}
.folder-node[open] > .folder-summary .folder-chevron { transform: rotate(90deg); }
.folder-name { flex: 1; }
.folder-doc-count {
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  background: var(--bg-input); border-radius: 10px; padding: 1px 7px;
}

/* ── Sync bar ─────────────────────────────────────────────── */
.sync-bar {
  padding: 12px 0 16px; border-bottom: 2px solid var(--border); margin-bottom: 20px;
}
.sync-bar-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.sync-status-badge {
  display: inline-block; border-radius: 4px; padding: 2px 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
}
.sync-running  { background: #fef9c3; color: #854d0e; }
.sync-success  { background: #dcfce7; color: #166534; }
.sync-error    { background: #fee2e2; color: var(--red); }

.sync-history-details { margin-top: 4px; }
.sync-history-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; user-select: none; list-style: none;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 0;
}
.sync-history-toggle::-webkit-details-marker { display: none; }
.sync-history-toggle::before {
  content: '›'; font-size: 14px; display: inline-block;
  transition: transform 0.15s; color: var(--text-muted);
}
.sync-history-details[open] > .sync-history-toggle::before { transform: rotate(90deg); }
.sync-history-count {
  background: var(--bg-input); border-radius: 10px;
  padding: 1px 7px; font-weight: 400;
}
.sync-history-list { margin-top: 6px; }
.sync-history-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  font-size: 12px; border: 1px solid var(--border); margin-bottom: 3px;
}
.sync-history-row:hover { background: var(--bg-hover); }
.sync-history-date { color: var(--text-sec); min-width: 140px; }
.sync-history-summary { color: var(--text-sec); font-family: monospace; font-size: 11px; }
.sync-history-by { color: var(--text-muted); font-size: 11px; margin-left: auto; }

/* ── System prompt modal ─────────────────────────────────── */
.prompt-modal-box {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 28px 32px;
  width: min(860px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.prompt-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.prompt-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.prompt-modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}
.prompt-textarea {
  width: 100%;
  min-height: 420px;
  padding: 16px 18px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-main);
  color: var(--text-primary);
  resize: vertical;
  box-sizing: border-box;
  white-space: pre-wrap;
}
.prompt-textarea:focus { outline: none; border-color: var(--accent); }
.prompt-textarea--ro {
  background: var(--bg-hover);
  color: var(--text-sec);
  cursor: default;
}

/* ── Sync detail modal ───────────────────────────────────── */
.sync-detail-modal { max-width: 640px; width: 96vw; }
.sync-meta-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.sync-meta-table th {
  text-align: left; padding: 4px 10px 4px 0; width: 100px;
  color: var(--text-sec); font-weight: 500;
}
.sync-meta-table td { padding: 4px 0; }
.sync-items-table { margin-top: 6px; font-size: 13px; table-layout: auto; }
.sync-items-table th:nth-child(1) { width: 110px; }
.sync-items-table th:nth-child(2) { width: auto; }
.sync-items-table td, .sync-items-table th { padding: 5px 8px; }

/* ── SharePoint-style flat browser ──────────────────────── */
.sp-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  padding: 8px 0 10px; font-size: 13px; color: var(--text-sec);
}
.sp-bc-item { white-space: nowrap; }
.sp-bc-link {
  color: var(--accent); cursor: pointer; border-radius: 4px; padding: 1px 3px;
}
.sp-bc-link:hover { background: var(--bg-hover); text-decoration: underline; }
.sp-bc-current { color: var(--text-primary); font-weight: 500; padding: 1px 3px; }
.sp-bc-sep { color: var(--text-muted); }

.sp-flat-table { margin-top: 0; }
.sp-flat-table tbody tr { cursor: default; }

.sp-folder-row { cursor: pointer; }
.sp-folder-row:hover td { background: var(--bg-hover); }
.sp-folder-row td { color: var(--text-primary); }

.sp-item-icon {
  display: inline-block; margin-right: 6px; font-size: 15px;
  vertical-align: middle; line-height: 1;
}
.sp-folder-name { vertical-align: middle; font-weight: 500; color: #2563eb; }
.sp-folder-count {
  margin-left: 8px; font-size: 11px; color: var(--text-muted);
  font-weight: 400; vertical-align: middle;
}
.sp-section-title {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 8px;
}
