/* ── Reset & Custom Properties ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

* { user-select: none; cursor: default; }
input, textarea, [contenteditable="true"] { user-select: text; cursor: text; }
a, button, [role="button"], select, label[for] { cursor: pointer; }

:root {
  color-scheme: dark;
  --bg-base:      #0d1117;
  --bg-surface:   #161b22;
  --bg-surface-2: #1c2128;
  --bg-hover:     #21262d;
  --border:       #30363d;
  --border-muted: #21262d;

  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;

  --accent:       #6366f1;
  --accent-hover: #4f46e5;
  --accent-subtle:#1e1e3f;

  --success: #22c55e;
  --danger:  #ef4444;
  --warning: #f59e0b;
  --info:    #38bdf8;

  --sidebar-width: 64px;
  --topbar-height: 52px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.5);
}

html, body { height: 100%; background: var(--bg-base); color: var(--text-primary); font-family: var(--font); font-size: 14px; line-height: 1.5; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  background: #0d0e10 !important;
  border-right: 1px solid #1a1b1f !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 8px 0 !important;
  gap: 2px !important;
}

/* Logo — só o mark centralizado */
.sidebar-logo {
  padding: 10px 0 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  border-bottom: none !important;
  text-decoration: none !important;
  margin-bottom: 0 !important;
  gap: 0 !important;
}

.sidebar-logo .logo-mark {
  width: 30px !important; height: 30px !important;
  background: var(--accent) !important;
  border-radius: var(--radius-sm) !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  font-weight: 700 !important; font-size: 14px !important; color: #fff !important; flex-shrink: 0 !important;
}

/* Ocultar texto do logo */
.sidebar-logo .logo-text { display: none !important; }

/* Seções — sem padding lateral, só espaçamento vertical */
.sidebar-section {
  padding: 4px 0 !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
}

/* Labels de seção — ocultas */
.sidebar-label { display: none !important; }

/* Links da sidebar — ícone em cima, label embaixo */
.sidebar-link {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  width: 100% !important;
  min-height: 48px !important;
  padding: 6px 4px !important;
  border-radius: 8px !important;
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  transition: background .15s, color .15s !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: center !important;
}

.sidebar-link:hover { background: #1e2029 !important; color: var(--text-primary) !important; }
.sidebar-link.active { background: #1e2029 !important; color: var(--accent) !important; }

/* Dot dos workspaces/projetos — vira quadrado colorido estilo avatar */
.sidebar-link .dot {
  width: 24px !important; height: 24px !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
}

/* Esconder nome do workspace e do projeto (textos longos) */
.sidebar-ws-name { display: none !important; }

/* Divider — oculto (sidebar estreita não usa separadores visuais) */
.sidebar-divider {
  display: none !important;
}

/* Footer — avatar centralizado */
.sidebar-footer {
  margin-top: auto !important;
  padding: 8px 0 !important;
  border-top: 1px solid #1a1b1f !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}

.user-pill {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 4px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: background .15s !important;
  width: 48px !important;
  gap: 3px !important;
}

.user-pill:hover { background: #1e2029 !important; }

.avatar {
  width: 30px !important; height: 30px !important; border-radius: 50% !important;
  background: var(--accent) !important; display: flex !important; align-items: center !important;
  justify-content: center !important; font-weight: 600 !important; font-size: 13px !important;
  color: #fff !important; flex-shrink: 0 !important;
}

/* Ocultar info de texto do usuário */
.user-pill .user-info { display: none !important; }
.user-pill .user-name { display: none !important; }
.user-pill .user-role { display: none !important; }

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

.topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 8px; flex-shrink: 0;
}

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.page-content { flex: 1; overflow-y: auto; padding: 28px 28px; }

/* Editor de canvas inline — irmão de .page-content dentro de .main (flex-column) */
.canvas-panel-frame { flex: 1; min-height: 0; border: none; display: block; }
.canvas-panel-frame[hidden] { display: none !important; }

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%; max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.auth-card .auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}

.auth-card h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.auth-card .auth-subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }

.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-secondary); }
.auth-footer a { color: var(--accent); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font); font-size: 14px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea { resize: vertical; min-height: 80px; }

.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s; text-decoration: none; white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-surface-2);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-muted); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-full { width: 100%; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-icon {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color .15s, box-shadow .15s;
}

.card:hover { border-color: var(--text-muted); }

.card-link { text-decoration: none; display: block; }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 { font-size: 20px; font-weight: 600; user-select: none; cursor: default; }
.page-header p { color: var(--text-secondary); font-size: 13px; margin-top: 2px; user-select: none; cursor: default; }

/* ── Grid layouts ────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* ── Workspace cards ─────────────────────────────────────────────────────── */
.workspace-card { cursor: pointer; }
.workspace-card .ws-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; margin-bottom: 12px;
  background: var(--accent-subtle); color: var(--accent);
}

.workspace-card .ws-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.workspace-card .ws-meta { font-size: 12px; color: var(--text-secondary); }

/* ── Project cards ───────────────────────────────────────────────────────── */
.project-card .proj-color-bar {
  height: 3px; border-radius: 3px 3px 0 0;
  margin: -16px -16px 14px;
  background: var(--accent);
}

.project-card .proj-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.project-card .proj-desc { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Card wrapper + context menu ─────────────────────────────────────────── */
.card-wrapper { position: relative; }
.card-wrapper .card-link,
.card-wrapper .canvas-card { display: block; }

.card-menu {
  position: absolute; top: 8px; right: 8px;
  z-index: 20;
}

.card-menu-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.card-wrapper:hover .card-menu-btn { opacity: 1; }
.card-menu-btn:hover { background: var(--bg-hover); color: var(--text-primary); opacity: 1; }

.card-menu-dropdown {
  display: none;
  position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 160px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 4px;
  z-index: 100;
}
.card-menu-dropdown.open { display: block; }

.card-menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: none; background: transparent;
  color: var(--text-primary);
  font-size: 13px; text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s;
}
.card-menu-item:hover { background: var(--bg-hover); }
.card-menu-item svg { flex-shrink: 0; color: var(--text-secondary); }
.card-menu-item .item-arrow { margin-left: auto; color: var(--text-muted); }

.card-menu-item.danger { color: var(--danger); }
.card-menu-item.danger svg { color: var(--danger); }
.card-menu-item.danger:hover { background: rgba(239,68,68,.12); }

.card-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ── Items list (table/row view) ─────────────────────────────────────────── */
.items-list { width: 100%; }

.items-list-header {
  display: flex; align-items: center;
  padding: 0 16px;
  height: 34px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11.5px; font-weight: 500; letter-spacing: .3px;
  user-select: none;
  cursor: default;
}

.items-list-row {
  display: flex; align-items: center;
  padding: 0 16px;
  height: 46px;
  border-bottom: 1px solid var(--border-muted);
  cursor: pointer;
  color: var(--text-primary);
  transition: background .1s;
  position: relative;
}
.items-list-row:hover { background: var(--bg-hover); }

.col-name {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 13px;
  min-width: 0; overflow: hidden;
  user-select: none; cursor: default;
}
.col-name-icon {
  width: 24px; height: 24px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.col-name-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.col-loc {
  width: 180px;
  color: var(--text-secondary); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 12px;
  user-select: none; cursor: default;
}
.col-date {
  width: 130px;
  color: var(--text-secondary); font-size: 12px;
  user-select: none; cursor: default;
}
.col-creator {
  width: 52px;
  display: flex; justify-content: center;
  user-select: none; cursor: default;
}
.col-creator .av-sm {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  border: 2px solid var(--bg-surface);
}
.col-menu { width: 40px; display: flex; justify-content: flex-end; position: relative; }
.items-list-row .col-menu { align-self: stretch; align-items: center; }
.items-list-row .col-menu .card-menu { position: relative; top: auto; right: auto; }

/* reuse card-menu classes but adapt for rows */
.col-menu .card-menu-btn {
  opacity: 0;
  width: 28px; height: 28px;
}
.items-list-row:hover .card-menu-btn { opacity: 1; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 32px; margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; margin-bottom: 20px; }

/* ── Flash messages ──────────────────────────────────────────────────────── */
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; }
.flash-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.flash-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #86efac; }

/* ── Board ───────────────────────────────────────────────────────────────── */
.board-wrap {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column;
}

.board {
  display: flex;
  gap: 14px;
  padding: 20px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  align-items: flex-start;
}

.board::-webkit-scrollbar { height: 6px; }
.board::-webkit-scrollbar-track { background: transparent; }
.board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.column {
  width: 272px; flex-shrink: 0;
  display: flex; flex-direction: column;
  max-height: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.column-header {
  padding: 12px 14px 10px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border-muted);
  flex-shrink: 0;
}

.column-header .status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

.column-header .status-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1;
}

.column-header .task-count {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-hover); border-radius: 99px;
  padding: 1px 7px;
}

.task-list {
  padding: 10px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 7px;
}

.task-list::-webkit-scrollbar { width: 4px; }
.task-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Task card ───────────────────────────────────────────────────────────── */
.task-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.task-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.task-card .task-title {
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  margin-bottom: 8px; line-height: 1.4;
}

.task-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.priority-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}

.priority-none    { background: var(--text-muted); }
.priority-low     { background: #64748b; }
.priority-medium  { background: var(--info); }
.priority-high    { background: var(--warning); }
.priority-urgent  { background: var(--danger); }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 2px 7px; border-radius: 99px;
  background: var(--bg-hover); color: var(--text-secondary);
  border: 1px solid var(--border-muted);
  cursor: pointer; transition: background .15s;
  text-decoration: none;
}

.status-pill:hover { background: var(--border); }

/* ── Add task form ───────────────────────────────────────────────────────── */
.add-task-wrap { padding: 8px 10px; flex-shrink: 0; }

details.add-task summary {
  list-style: none; cursor: pointer;
  font-size: 12.5px; color: var(--text-muted);
  padding: 6px 4px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 6px;
  transition: color .15s, background .15s;
}

details.add-task summary::-webkit-details-marker { display: none; }
details.add-task summary:hover { color: var(--text-secondary); background: var(--bg-hover); }
details.add-task[open] summary { color: var(--accent); }

.add-task-form { margin-top: 8px; }
.add-task-form input[type="text"] { font-size: 13px; padding: 7px 10px; }
.add-task-form .form-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ── New item modal (CSS :target) ────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 100;
  align-items: center; justify-content: center;
}

.modal-backdrop:target { display: flex; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.modal h2 { font-size: 16px; font-weight: 600; margin-bottom: 20px; }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 20px; line-height: 1;
  transition: color .15s;
}

.modal-close:hover { color: var(--text-primary); }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── Badge / Tag ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
  padding: 2px 7px; border-radius: 99px;
}

.badge-default { background: var(--bg-hover); color: var(--text-secondary); }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 12px; }

.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator { opacity: 1; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbars (global) ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Canvas list ─────────────────────────────────────────────────────────── */
.canvas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.canvas-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
}
.canvas-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.canvas-card-preview {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.canvas-card-preview svg { display: block; width: 100%; }

.canvas-card-info {
  padding: 12px 14px;
}
.canvas-card-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.canvas-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Canvas editor ───────────────────────────────────────────────────────── */
.canvas-editor-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.tool-group-color { gap: 4px; }

.tool-separator {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

.tool-btn {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, color .1s, border-color .1s;
  flex-shrink: 0;
}
.tool-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.tool-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.tool-btn-danger:hover {
  background: rgba(239, 68, 68, .15);
  color: #ef4444;
}

.tool-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

#color-picker { display: none; }
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  display: block;
  transition: border-color .15s;
}
.color-swatch:hover { border-color: var(--accent); }

#width-range {
  width: 80px;
  accent-color: var(--accent);
}
#width-display {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 20px;
}

.canvas-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
}

#main-canvas,
#overlay-canvas {
  position: absolute;
  top: 0; left: 0;
  display: block;
}
#overlay-canvas {
  cursor: crosshair;
  z-index: 2;
}

#text-input-container {
  position: absolute;
  z-index: 10;
}
.canvas-text-input {
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--accent);
  color: inherit;
  outline: none;
  padding: 2px 4px;
  min-width: 120px;
  font-family: sans-serif;
}

/* Save status badge */
.save-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 8px;
}
.save-status.saved  { color: #4ade80; }
.save-status.unsaved { color: #f59e0b; }
.save-status.error  { color: #ef4444; }

/* dialog modal */
.modal-dialog {
  margin: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 28px;
  min-width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-dialog::backdrop { background: rgba(0,0,0,.6); }
.modal-close-btn {
  position: absolute;
  top: 12px; right: 16px;
  background: none; border: none;
}
.modal-close-btn button {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 16px;
}

.ws-select-list { display: flex; flex-direction: column; gap: 4px; }
.ws-select-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--text-primary); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background .12s;
}
.ws-select-item:hover { background: var(--bg-hover); }
.ws-select-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.page-title    { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }

.sidebar-icon {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  color: #8b8fa8 !important;
}
.sidebar-link.active .sidebar-icon { color: var(--accent); }
.sidebar-link:hover .sidebar-icon { color: var(--text-primary); }

/* ── Sidebar workspace item com menu hover ───────────────────────────────── */
.sidebar-ws-item {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 100%;
}
.sidebar-ws-item .sidebar-link {
  width: 100%;
  min-width: unset;
  overflow: hidden;
}
/* Menu de workspace — oculto na sidebar estreita; abre ao click via dropdown */
.sidebar-ws-menu-btn { display: none; }
.sidebar-ws-item .card-menu-dropdown { left: 64px; top: 0; min-width: 175px; }

/* ── Task card menu ─────────────────────────────────────────────────────── */
.task-card { position: relative; }
.task-card-menu {
  position: absolute;
  top: 6px; right: 6px;
  opacity: 0;
  transition: opacity .12s;
}
.task-card:hover .task-card-menu,
.task-card:has(.card-menu-dropdown.open) .task-card-menu { opacity: 1; }
.task-card-menu .card-menu-btn {
  width: 22px; height: 22px;
  font-size: 12px;
  padding: 0;
}

/* ── Canvas delete confirm modal ──────────────────────────────────────────── */
.canvas-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.canvas-confirm-modal {
  background: #1e2029;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 24px;
  min-width: 300px;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  color: #c9d1d9;
  font-family: inherit;
}
.canvas-confirm-message {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.canvas-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.canvas-confirm-btn {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.canvas-confirm-btn:hover { opacity: 0.85; }
.canvas-confirm-btn-cancel { background: #2a2d3a; color: #c9d1d9; }
.canvas-confirm-btn-delete { background: #c0392b; color: #fff; font-weight: 600; }

