/* TaskFlow — interface sem dependências externas */
:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --text: #172033;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #16a34a;
    --sidebar: #111827;
    --sidebar-muted: #94a3b8;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body { margin: 0; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: white; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; color: white; font-size: 20px; font-weight: 800; padding: 0 8px 24px; }
.brand:hover { color: white; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; display: inline-grid; place-items: center; font-weight: 900; box-shadow: 0 8px 18px rgba(79,70,229,.35); }
.nav-list { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; color: var(--sidebar-muted); padding: 11px 12px; border-radius: 9px; font-weight: 650; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.09); }
.nav-project { margin-top: 2px; }
.nav-project-summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; color: var(--sidebar-muted); padding: 11px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; }
.nav-project-summary::-webkit-details-marker { display: none; }
.nav-project-summary::after { content: '›'; margin-left: auto; font-size: 15px; line-height: 1; transition: transform .15s; }
.nav-project-summary:hover { color: white; background: rgba(255,255,255,.09); }
.nav-project[open] > .nav-project-summary { color: white; }
.nav-project[open] > .nav-project-summary::after { transform: rotate(90deg); }
.nav-sub { display: grid; gap: 4px; padding: 2px 0 6px 24px; }
.nav-sub-item { padding: 7px 12px; font-size: 12px; font-weight: 500; border-radius: 8px; color: var(--sidebar-muted); }
.nav-sub-item:hover, .nav-sub-item.active { color: white; background: rgba(255,255,255,.09); }
.nav-sub-empty { color: var(--sidebar-muted); font-size: 11px; padding: 4px 12px; opacity: .6; }
.sidebar-user { margin-top: auto; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; }
.sidebar-user-info { min-width: 0; }
.sidebar-user-info strong, .sidebar-user-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info small { color: var(--sidebar-muted); margin-top: 2px; }

.main-area { min-width: 0; }
.topbar { min-height: 86px; padding: 18px 28px; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 30; }
.topbar h1 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.content { padding: 26px; max-width: 1480px; margin: 0 auto; }
.board-content { max-width: none; overflow: hidden; }
.mobile-menu { display: none !important; }

.button { border: 0; border-radius: 9px; padding: 10px 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-dark); color: white; }
.button.secondary { background: #eef2ff; color: #3730a3; border: 1px solid #dbe2ff; }
.button.secondary.active { background: #4338ca; color: white; border-color: #4338ca; }
.button.danger { background: #fee2e2; color: #991b1b; }
.button.small { padding: 6px 10px; font-size: 13px; }
.button.full { width: 100%; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 8px; display: inline-grid; place-items: center; background: rgba(255,255,255,.08); color: inherit; }
.icon-button:hover { background: rgba(255,255,255,.16); }
.icon-button.danger { color: var(--danger); background: #fff1f2; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 3px 16px rgba(15,23,42,.04); padding: 20px; }
.panel + .panel { margin-top: 18px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-header h2 { margin: 0; font-size: 17px; }
.form-panel { max-width: 900px; }
.table-panel { padding: 0; overflow: auto; }

.alert { border-radius: 10px; padding: 13px 16px; margin-bottom: 18px; border: 1px solid transparent; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.alert.success { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.alert.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert.danger { background: #fff1f2; color: #991b1b; border-color: #fecdd3; }

.stack-form { display: grid; gap: 15px; }
.stack-form.compact { gap: 10px; }
.stack-form label, .form-grid label { display: grid; gap: 6px; font-weight: 650; font-size: 14px; }
input, textarea, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 11px; color: var(--text); background: white; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
textarea { resize: vertical; }
input[type="color"] { width: 60px; height: 42px; padding: 3px; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.checkbox-row { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.align-end { align-self: end; min-height: 42px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.field-help { color: var(--muted); font-size: 13px; margin: 0; }
.inline-form { display: flex; gap: 8px; align-items: end; margin-top: 14px; }
.inline-form.vertical { display: grid; align-items: stretch; }
.inline-form input[type="color"] { flex: 0 0 48px; }
.inline-details { margin-top: 14px; }
.inline-details summary, .quick-task summary { cursor: pointer; color: var(--primary); font-weight: 700; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
legend { padding: 0 6px; font-weight: 750; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; }
.checkbox-group label { display: flex; align-items: center; gap: 7px; font-weight: 500; }

.avatar { --avatar-color: #4f46e5; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; background: var(--avatar-color); color: white; display: inline-grid; place-items: center; font-size: 13px; font-weight: 850; border: 2px solid rgba(255,255,255,.8); }
img.avatar { object-fit: cover; }
.avatar.small { width: 32px; height: 32px; font-size: 11px; }
.avatar.tiny { width: 26px; height: 26px; font-size: 9px; }
.avatar.more { background: #475569; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 750; }
.status-dot, .priority-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.status-dot.active { background: #22c55e; }
.status-dot.inactive { background: #94a3b8; }
.priority-low { background: #94a3b8; }
.priority-normal { background: #3b82f6; }
.priority-high { background: #f59e0b; }
.priority-urgent { background: #ef4444; }
.priority-bg-low { background: #f1f5f9; color: #475569; }
.priority-bg-normal { background: #dbeafe; color: #1d4ed8; }
.priority-bg-high { background: #fef3c7; color: #92400e; }
.priority-bg-urgent { background: #fee2e2; color: #991b1b; }
.text-danger { color: var(--danger) !important; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { background: white; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 18px; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 30px; margin-top: 8px; }
.stat-card.danger-accent { border-left-color: var(--danger); }
.stat-card.warning-accent { border-left-color: var(--warning); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); gap: 18px; }
.task-list-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--border); color: var(--text); }
.task-list-item:last-child { border-bottom: 0; }
.task-list-item strong, .task-list-item small { display: block; }
.task-list-item small { color: var(--muted); margin-top: 3px; }
.task-list-item time { color: var(--muted); font-size: 13px; }
.project-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.project-mini-card { padding: 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); position: relative; overflow: hidden; }
.project-mini-card strong, .project-mini-card small { display: block; }
.project-mini-card small { color: var(--muted); margin-top: 5px; }
.project-color { --project-color: #2563eb; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--project-color); }

.toolbar, .board-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar input { max-width: 420px; }
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.project-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; min-height: 175px; }
.project-card-stripe { width: 6px; flex: 0 0 6px; background: var(--project-color); }
.project-card-body { padding: 18px; flex: 1; }
.project-card-top { display: flex; justify-content: space-between; gap: 10px; }
.project-card h2 { font-size: 17px; margin: 0; }
.project-card h2 a { color: var(--text); }
.project-card p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.meta-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.project-summary { border-top: 5px solid var(--project-color); background: white; border-radius: var(--radius); padding: 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin-bottom: 18px; }
.project-summary span, .project-summary strong { display: block; }
.project-summary span { color: var(--muted); font-size: 12px; }
.project-summary strong { margin-top: 4px; }
.two-column-layout, .task-layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 18px; align-items: start; }
.board-list { display: grid; gap: 9px; }
.board-list-item { display: flex; justify-content: space-between; gap: 15px; padding: 14px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); }
.board-list-item strong, .board-list-item small { display: block; }
.board-list-item small { color: var(--muted); margin-top: 3px; }
.member-list, .activity-list, .attachment-list { display: grid; gap: 10px; }
.member-row, .activity-item, .attachment-row { display: flex; align-items: center; gap: 10px; }
.member-row > div, .activity-item > div, .attachment-row > div { min-width: 0; flex: 1; }
.member-row strong, .member-row small, .activity-item strong, .activity-item small, .attachment-row a, .attachment-row small { display: block; }
.member-row small, .activity-item small, .attachment-row small { color: var(--muted); margin-top: 2px; }
.label-list { display: flex; flex-wrap: wrap; gap: 7px; }
.label-chip { --label-color: #0ea5e9; background: color-mix(in srgb, var(--label-color) 16%, white); color: color-mix(in srgb, var(--label-color) 75%, black); border: 1px solid color-mix(in srgb, var(--label-color) 40%, white); padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 750; }

.board-toolbar { justify-content: space-between; }
.board-filters-toggle { position: relative; }
.board-filters-toggle > summary { list-style: none; }
.board-filters { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; position: absolute; left: 0; top: calc(100% + 8px); width: min(520px, calc(100vw - 32px)); background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 15px; z-index: 40; }
.board-filters input, .board-filters select { flex: 1 1 180px; min-width: 150px; }
.filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: white; font-size: 11px; font-weight: 800; margin-left: 4px; }
.manage-board { position: relative; }
.manage-board > summary { list-style: none; }
.popover-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 330px; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 15px; z-index: 40; }
.mention-input-wrap { position: relative; }
.mention-suggestions { position: absolute; left: 0; top: calc(100% + 4px); width: min(320px, 100%); max-height: 220px; overflow-y: auto; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 40; display: grid; gap: 2px; }
.mention-suggestion-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; background: none; color: var(--text); }
.mention-suggestion-item small { color: var(--muted); }
.mention-suggestion-item:hover, .mention-suggestion-item.active { background: var(--primary); color: white; }
.mention-suggestion-item:hover small, .mention-suggestion-item.active small { color: rgba(255,255,255,.8); }
.kanban-board { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding: 2px 2px 18px; min-height: calc(100vh - 190px); }
.kanban-column { flex: 0 0 310px; background: #eef2f7; border: 1px solid #dde4ed; border-radius: 12px; max-height: calc(100vh - 205px); display: flex; flex-direction: column; }
.kanban-column-header { --column-color: #64748b; padding: 13px 13px 10px; display: flex; justify-content: space-between; align-items: center; }
.kanban-column-header > div { display: flex; align-items: center; gap: 7px; }
.column-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--column-color); }
.column-count { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: white; color: var(--muted); text-align: center; font-size: 11px; }
.kanban-column-header small { color: var(--muted); }
.kanban-cards { padding: 2px 9px 10px; display: grid; gap: 9px; overflow-y: auto; min-height: 50px; }
.kanban-cards.drag-over { background: rgba(99,102,241,.09); border-radius: 8px; }
.task-card { background: white; border: 1px solid #dde3eb; border-radius: 9px; box-shadow: 0 2px 6px rgba(15,23,42,.05); cursor: grab; display: flex; flex-direction: column; }
.task-card.dragging { opacity: .45; transform: rotate(1deg); }
.task-card.overdue { border-left: 4px solid var(--danger); }
.task-card.filtered-out { display: none; }
.task-card-link { display: block; color: var(--text); padding: 11px; flex: 1 1 auto; min-width: 0; -webkit-user-drag: none; }
.task-card-link:hover { color: var(--text); }
.card-title-row { display: flex; align-items: start; gap: 6px; line-height: 1.35; }
.card-title-row .priority-dot { margin-top: 5px; flex: 0 0 9px; }
.task-card p { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 8px 0; }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.card-label-chip { display: inline-block; width: auto; height: auto; padding: 2px 8px; font-size: 11px; line-height: 1.6; white-space: nowrap; }
.task-card-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; margin-top: 10px; }
.task-card-meta > div { display: flex; gap: 8px; align-items: center; }
.due-date.late { color: var(--danger); font-weight: 750; }
.button.tiny { padding: 4px 9px; font-size: 11px; font-weight: 600; border-radius: 6px; }
.card-quick-action { border-top: 1px solid #eef1f6; padding: 6px 9px; }
.card-quick-action .button.secondary { background: transparent; border-color: transparent; color: var(--muted); }
.card-quick-action .button.secondary:hover { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.task-card-separator { background: transparent; border: 0; box-shadow: none; cursor: default; }
.task-card-separator .task-card-link { padding: 4px 11px; }
.task-card-separator hr.separator { margin: 6px 0; }
.task-card-shortcut { background: #f8fafc; }
.card-link-meta { color: var(--primary); }
.quick-task { padding: 0 10px 12px; }
.quick-task[open] { background: rgba(255,255,255,.65); padding-top: 10px; }
.quick-task summary { list-style: none; font-size: 13px; }
.add-column-card { padding: 14px; min-height: 58px; max-height: none; background: rgba(255,255,255,.62); }
.add-column-card summary { cursor: pointer; color: var(--primary); font-weight: 750; }

.assignee-editor { display: grid; gap: 7px; }
.assignee-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 8px; background: var(--surface-2); }
.assignee-option label { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.primary-choice { color: var(--muted); font-size: 12px !important; }
.rich-text { line-height: 1.7; white-space: normal; }
.rich-text :first-child { margin-top: 0; }
.description-field-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-weight: 700; }
.description-dirty-flag { color: var(--danger); font-size: 11px; font-weight: 700; margin-right: 6px; }
.description-preview { border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; background: var(--surface-2); min-height: 120px; }
.progress { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-bottom: 14px; }
.progress span { display: block; height: 100%; background: var(--success); }
.checklist-list { display: grid; gap: 8px; margin-bottom: 12px; }
.checklist-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px; border-radius: 8px; }
.checklist-row:hover { background: var(--surface-2); }
.checklist-row.done > span { text-decoration: line-through; color: var(--muted); }
.check-button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid #94a3b8; background: white; display: grid; place-items: center; color: white; }
.checklist-row.done .check-button { background: var(--success); border-color: var(--success); }
.comment-list { display: grid; gap: 14px; margin-top: 18px; }
.comment { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: start; }
.comment-body { background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }
.comment-body > div { display: flex; justify-content: space-between; gap: 10px; }
.comment-body small { color: var(--muted); }
.comment-body p { margin: 8px 0 0; line-height: 1.55; }
.comment-body .mention { color: var(--accent, #2563eb); background: rgba(37,99,235,.1); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.comment.comment-highlight { outline: 2px solid var(--accent, #2563eb); outline-offset: 4px; border-radius: 10px; }
.copy-link { background: none; border: none; cursor: pointer; font-size: .85em; }
.cover-preview { height: 90px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.cover-preview-img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; }
.cover-actions { display: grid; gap: 8px; margin-top: 10px; }
.attachment-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.attachment-actions { display: flex; gap: 6px; align-items: center; }
.card-custom-fields { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.custom-field-badge { background: var(--surface-2); }
.custom-field-list { display: grid; gap: 6px; margin: 8px 0; }
.custom-field-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.custom-field-value-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.custom-field-value-row form { display: flex; gap: 6px; align-items: center; }
.details-list { margin: 0; display: grid; gap: 10px; }
.details-list div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 9px; }
.details-list dt { color: var(--muted); }
.details-list dd { margin: 0; text-align: right; font-weight: 650; }
.attachment-row { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
/* Standard bound for every thumbnail in the app (attachments sidebar, description links, ...): never larger than 100x100. */
.attachment-thumb, .link-thumbnail { width: 100px; height: 100px; max-width: 100px; max-height: 100px; object-fit: cover; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.attachment-thumb { flex: 0 0 auto; }
.link-thumbnail { display: block; margin: 8px 0 0; }
.compact-list .activity-item { align-items: start; }
.danger-zone { border-color: #fecaca; }
.danger-zone h2 { color: #991b1b; font-size: 16px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell strong, .user-cell small { display: block; }
.user-cell small { color: var(--muted); }
.actions-cell { display: flex; justify-content: flex-end; gap: 7px; }

.table-responsive { overflow-x: auto; }
.table-list-panel { margin-bottom: 18px; }
.table-list-panel .panel-header h2 { display: flex; align-items: center; gap: 8px; }
.view-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.view-tab { padding: 9px 14px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.timeline-scroll { overflow-x: auto; padding-bottom: 8px; }
.timeline-axis { position: relative; height: 10px; margin-bottom: 6px; }
.timeline-today-line { position: absolute; top: 0; bottom: -2000px; width: 2px; background: var(--danger); z-index: 1; }
.timeline-group { display: flex; align-items: stretch; border-top: 1px solid var(--border); }
.timeline-group-label { flex: 0 0 160px; padding: 10px 12px; font-weight: 700; font-size: 13px; position: sticky; left: 0; background: white; z-index: 2; }
.timeline-group-rows { position: relative; min-height: 42px; padding: 6px 0; }
.timeline-bar { position: absolute; display: block; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; top: 6px; }
.timeline-bar.overdue { outline: 2px solid var(--danger); }
.timeline-unscheduled { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart-panel h2 { font-size: 15px; margin-bottom: 10px; }
.bar-chart { width: 100%; height: auto; color: var(--text); }
.bar-fill { fill: var(--primary); }
.bar-fill-alt { fill: #16a34a; }
.visually-hidden-table { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 860px) { .dashboard-grid { grid-template-columns: 1fr; } }

.map-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.map-panel { padding: 0; overflow: hidden; }
#board-map { height: 560px; width: 100%; }
.map-sidebar h2 { font-size: 14px; margin-bottom: 8px; }
@media (max-width: 860px) { .map-layout { grid-template-columns: 1fr; } }

.notification-bell { position: relative; }
.notification-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; background: var(--danger); color: white; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.notification-list { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.notification-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--border); }
.notification-item.unread { background: #eef2ff; border-radius: 8px; }
.notification-item p { margin: 3px 0; }
.empty-state { padding: 22px 10px; color: var(--muted); text-align: center; }
.empty-state.wide { grid-column: 1 / -1; background: white; border: 1px dashed #cbd5e1; border-radius: var(--radius); }
.pagination { display: flex; list-style: none; padding: 0; gap: 4px; margin-top: 18px; }
.page-link { display: block; padding: 7px 10px; background: white; border: 1px solid var(--border); border-radius: 7px; color: var(--text); }
.page-item.active .page-link { background: var(--primary); color: white; border-color: var(--primary); }
.page-item.disabled .page-link { opacity: .45; }

.guest-body { background: radial-gradient(circle at top left, #312e81, #111827 52%, #030712); min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.guest-panel { width: min(440px, 100%); background: white; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.32); padding: 30px; }
.guest-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 850; margin-bottom: 24px; }
.auth-header { text-align: center; margin-bottom: 22px; }
.auth-header h1 { margin: 0 0 7px; }
.auth-header p { color: var(--muted); margin: 0; line-height: 1.5; }
.auth-link { display: block; text-align: center; margin-top: 16px; font-weight: 650; }
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error-panel { text-align: center; }
.error-panel .brand-mark { width: 70px; height: 70px; margin: 0 auto 18px; }

@media (max-width: 1120px) {
    .cards-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .dashboard-grid, .two-column-layout, .task-layout { grid-template-columns: 1fr; }
    .side-column { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
    .side-column .panel + .panel { margin-top: 0; }
}

@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 15px 0 40px rgba(0,0,0,.25); }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu { display: inline-grid !important; }
    .topbar { padding: 14px 16px; min-height: 72px; }
    .topbar h1 { font-size: 19px; }
    .topbar p { display: none; }
    .topbar-actions .button { padding: 8px 10px; font-size: 12px; }
    .content { padding: 16px; }
    .cards-grid, .stats-grid, .form-grid, .project-summary, .side-column { grid-template-columns: 1fr; }
    .dashboard-grid { display: block; }
    .dashboard-grid .panel + .panel { margin-top: 18px; }
    .form-grid .span-2 { grid-column: auto; }
    .board-toolbar { align-items: stretch; flex-direction: column; }
    .board-filters { overflow-x: auto; }
    .board-filters input, .board-filters select { min-width: 180px; }
    .popover-panel { left: 0; right: auto; width: min(330px, calc(100vw - 32px)); }
    .kanban-column { flex-basis: 285px; }
    .data-table { min-width: 720px; }
    .inline-form { align-items: stretch; flex-direction: column; }
    .comment-body > div { display: block; }
}
.separator { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.column-settings { margin: 0 9px 9px; background: rgba(255,255,255,.7); border-radius: 8px; padding: 7px 9px; }
.column-settings summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; }
.column-settings[open] summary { margin-bottom: 9px; }
.column-delete-form { margin-top: 8px; }
.member-role-form select { width: 112px; padding: 5px 6px; font-size: 11px; }
.label-admin-item { display: inline-flex; align-items: center; }
.label-admin-item form { display: inline-flex; }
.label-remove { width: 20px; height: 20px; border: 0; border-radius: 50%; margin-left: -5px; background: #fee2e2; color: #991b1b; display: grid; place-items: center; font-weight: 800; }
.dependency-list { list-style: none; margin: 6px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dependency-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }

.calendar-nav { display: flex; gap: 6px; align-items: center; }
.calendar-panel { padding: 18px; }
.calendar-header { margin-bottom: 14px; }
.calendar-header h2 { margin: 0; font-size: 19px; text-transform: capitalize; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.calendar-grid + .calendar-grid { margin-top: 6px; }
.calendar-weekdays { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; text-align: center; }
.calendar-cell { min-height: 108px; border: 1px solid var(--border); border-radius: 9px; padding: 7px; background: white; display: flex; flex-direction: column; gap: 5px; }
.calendar-cell.muted { background: var(--surface-2); color: var(--muted); }
.calendar-cell.muted .calendar-day-number { color: var(--muted); }
.calendar-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.calendar-day-number { font-weight: 750; font-size: 13px; }
.calendar-day-tasks { display: grid; gap: 3px; overflow: hidden; }
.calendar-task { display: flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 6px; font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-task .priority-dot { margin-right: 0; flex: 0 0 7px; width: 7px; height: 7px; }
.calendar-more { font-size: 11px; color: var(--muted); padding: 0 5px; }
.calendar-task-board { --board-color: #64748b; background: color-mix(in srgb, var(--board-color) 18%, white); color: color-mix(in srgb, var(--board-color) 70%, black); border-left: 3px solid var(--board-color); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.calendar-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; }
.calendar-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dot-color); flex: 0 0 10px; }

@media (max-width: 760px) {
    .calendar-cell { min-height: 76px; }
    .calendar-task { font-size: 10px; }
}

.hidden { display: none !important; }

.board-title-wrap { display: inline-flex; align-items: center; gap: 8px; }
.star-button { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px; border-radius: 6px; }
.star-button:hover, .star-button:focus-visible { color: #d97706; }
.star-button.active { color: #d97706; }
.star-button:disabled { opacity: .5; cursor: wait; }

.board-title-edit { display: inline-flex; align-items: center; }
.board-title-text { cursor: text; border-radius: 6px; padding: 2px 6px; }
.board-title-text:hover, .board-title-text:focus-visible { background: rgba(255,255,255,.1); outline: 2px solid transparent; }
.board-title-form { display: inline-flex; align-items: center; gap: 4px; }
.board-title-form input { font-size: inherit; font-weight: inherit; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); min-width: 220px; }

.visibility-badge { text-transform: uppercase; letter-spacing: .03em; font-size: 11px; }

.public-board-banner { background: #fffbeb; border: 1px solid #fbbf24; color: #92400e; padding: 10px 14px; border-radius: 9px; margin-bottom: 16px; font-weight: 650; font-size: 14px; }
.public-board-page { max-width: 1200px; margin: 0 auto; padding: 20px; }
.public-board-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-weight: 800; }

.column-header-actions { display: flex; align-items: center; gap: 6px; }
.column-collapse-btn { width: 24px; height: 24px; font-size: 12px; }
.kanban-column.collapsed { min-width: 44px; max-width: 44px; }
.kanban-column.collapsed .kanban-cards,
.kanban-column.collapsed .quick-task,
.kanban-column.collapsed .column-settings,
.kanban-column.collapsed .kanban-column-header small { display: none; }
.kanban-column.collapsed .kanban-column-header { writing-mode: vertical-rl; }

.task-select { flex: 0 0 auto; display: flex; align-items: center; padding: 11px 0 11px 11px; }
.task-card { position: relative; }

.bulk-action-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; margin-bottom: 12px; }
.bulk-action-bar select { padding: 6px 8px; border-radius: 7px; border: 1px solid var(--border); }

.archived-columns-panel { margin-top: 18px; }
.archived-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.archived-list-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.archived-list-actions { display: flex; gap: 6px; }
