/* ==========================================================================
   Qfluxus — sistema visual baseado no protótipo de interface
   ========================================================================== */

:root {
    --bg: #fbfbfa;
    --surface: #ffffff;
    --surface-2: #f6f6f4;
    --surface-muted: #f8f8f6;
    --sidebar: #f7f7f5;
    --text: #1f2328;
    --text-2: #6b7280;
    --text-muted: #6b7280;
    --text-3: #9ca3af;
    --border: #e7e7e4;
    --border-strong: #dcdcd8;
    --accent: #087fc1;
    --primary: #087fc1;
    --accent-hover: #05679f;
    --primary-hover: #05679f;
    --accent-soft: #eaf6fc;
    --primary-soft: #eaf6fc;
    --danger: #b42318;
    --warning: #b7791f;
    --warning-soft: #fdf6e7;
    --success: #0f766e;
    --nav-active: #ececea;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, .07);
    --shadow: 0 16px 48px rgba(15, 23, 42, .16);
    --shadow-pop: 0 16px 48px rgba(15, 23, 42, .16);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --sb: 264px;
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
    --bg: #191919;
    --surface: #202020;
    --surface-2: #262625;
    --surface-muted: #232322;
    --sidebar: #1b1b1a;
    --text: #ededed;
    --text-2: #a1a1aa;
    --text-muted: #a1a1aa;
    --text-3: #71717a;
    --border: #303030;
    --border-strong: #3a3a3a;
    --accent: #3ab7e0;
    --primary: #3ab7e0;
    --accent-hover: #6ccbea;
    --primary-hover: #6ccbea;
    --accent-soft: #12303c;
    --primary-soft: #12303c;
    --danger: #f87171;
    --warning: #e0b252;
    --warning-soft: #322a18;
    --success: #4fd1c5;
    --nav-active: #2a2a29;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .25);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow: 0 20px 56px rgba(0, 0, 0, .55);
    --shadow-pop: 0 20px 56px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
[hidden], [x-cloak] { display: none !important; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
p { margin: 0 0 1em; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { margin: 0; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 600; }

.i {
    width: 16px; height: 16px; flex: 0 0 auto;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
.i-sm { width: 14px; height: 14px; }
.action-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon-btn {
    display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto;
    border: 1px solid transparent; border-radius: 6px; color: var(--text-2);
}
.icon-btn:hover { background: var(--nav-active); color: var(--text); }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; color: #fff; background: #1f2328; border-radius: 6px; }
.skip-link:focus { top: 1rem; }
.kbd {
    display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px;
    border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface);
    color: var(--text-3); font-size: 10.5px; font-weight: 500; line-height: 1.5;
}
.muted { color: var(--text-2); }
.dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--text-3); }
.dot--board { background: var(--accent); }
.eyebrow { color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

/* Avatares ----------------------------------------------------------------- */
.avatar {
    display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto;
    border-radius: 50%; color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .01em;
    text-transform: uppercase;
}
.avatar.is-empty { color: var(--text-3); background: var(--surface-2); }
.av-1 { background: #087fc1; }
.av-2 { background: #7c5cff; }
.av-3 { background: #c2410c; }
.av-4 { background: #0f766e; }
.av-5 { background: #be185d; }
.av-stack { display: flex; align-items: center; }
.av-stack .avatar { box-shadow: 0 0 0 2px var(--surface); margin-left: -6px; }
.av-stack .avatar:first-child { margin-left: 0; }

/* Shell -------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sb) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.app.collapsed { --sb: 56px; }
.app.collapsed .brand-name,
.app.collapsed .brand,
.app.collapsed .sb-label,
.app.collapsed .sb-section,
.app.collapsed .ws-meta,
.app.collapsed .ws-chevron,
.app.collapsed .nav-item span:not(.dot),
.app.collapsed .nav-item .count,
.app.collapsed .nav-item .kbd,
.app.collapsed .user-meta,
.app.collapsed .user-chevron,
.app.collapsed .nav-empty { display: none; }
.app.collapsed .sb-top { justify-content: center; }
.app.collapsed .nav-item { justify-content: center; padding: 0; }
.app.collapsed .ws-switch { padding: 7px; justify-content: center; }
.app.collapsed .sidebar-foot { justify-content: center; }
.app.collapsed .user { justify-content: center; padding: 6px 0; }

.sidebar {
    display: flex; flex-direction: column; min-width: 0;
    padding: 10px 8px 8px; overflow-y: auto;
    background: var(--sidebar); border-right: 1px solid var(--border);
}
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand img { width: 22px; height: 22px; object-fit: contain; }

.ws-menu { position: relative; margin-bottom: 6px; }
.ws-switch {
    display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px;
    text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.ws-switch:hover { border-color: var(--border-strong); }
.ws-avatar {
    display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto;
    border-radius: 6px; background: linear-gradient(145deg, #0b8ac7, #07588f);
    color: #fff; font-size: 11px; font-weight: 700;
}
.ws-avatar-sm { width: 22px; height: 22px; border-radius: 5px; font-size: 9.5px; }
.ws-meta { min-width: 0; display: grid; line-height: 1.25; }
.ws-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.ws-meta small { color: var(--text-3); font-size: 10.5px; }
.ws-chevron { margin-left: auto; color: var(--text-3); }
.ws-pop, .user-pop {
    position: absolute; z-index: 45; min-width: 220px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
}
.ws-pop { top: 46px; right: 0; left: 0; }
.ws-option { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; color: var(--text); font-size: 12.5px; }
.ws-option:hover, .ws-option.is-active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.ws-option-create { margin-top: 4px; color: var(--text-2); border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; padding-top: 9px; }
.pop-label { padding: 4px 6px 6px; color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.pop-empty { margin: 0; padding: 8px; color: var(--text-3); font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
    display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px;
    border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.nav-item:hover { background: var(--nav-active); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--nav-active); color: var(--text); font-weight: 600; }
.nav-item .count {
    display: inline-grid; place-items: center; margin-left: auto; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff;
    font-size: 10.5px; font-weight: 600;
}
.nav-item .kbd { margin-left: auto; }
.nav-kbd { opacity: .85; }
.nav-item-muted { color: var(--text-3); }
.nav-empty { padding: 3px 8px 6px; color: var(--text-3); font-size: 11.5px; }
.sb-section {
    padding: 16px 8px 6px; color: var(--text-3);
    font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.nav-boards .nav-item { overflow: hidden; }
.nav-boards .nav-item span:not(.dot) { overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot { position: relative; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.user { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px; border-radius: 6px; text-align: left; }
.user:hover { background: var(--nav-active); }
.user-meta { min-width: 0; display: grid; line-height: 1.3; }
.user-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.user-meta small { color: var(--text-3); font-size: 10.5px; }
.user-chevron { margin-left: auto; color: var(--text-3); }
.user-pop { right: 0; bottom: 46px; left: 0; min-width: 230px; }
.user-pop-email { margin: 0; padding: 6px 8px; overflow: hidden; color: var(--text-3); font-size: 11.5px; text-overflow: ellipsis; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 2px 8px; border-bottom: 1px solid var(--border); }
.theme-options button { padding: 5px 4px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-2); font-size: 11px; }
.theme-options button:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.user-pop-action { width: 100%; margin-top: 4px; padding: 7px 8px; border-radius: 6px; color: var(--danger); text-align: left; font-size: 12.5px; }
.user-pop-action:hover { background: var(--surface-2); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: 52px; flex: 0 0 52px; padding: 0 16px 0 20px;
    border-bottom: 1px solid var(--border); background: var(--bg);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); font-size: 13px; }
.crumbs a { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .sep { color: var(--text-3); }
.crumbs strong { overflow: hidden; color: var(--text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.search-trigger {
    display: flex; align-items: center; gap: 8px; width: 240px; height: 30px;
    padding: 0 8px 0 10px; margin-right: 6px;
    border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
    color: var(--text-3); font-size: 12.5px;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger span:not(.kbd) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger .kbd { margin-left: auto; }
.bell-wrap { position: relative; }
.bell-dot {
    position: absolute; top: 4px; right: 4px; width: 6px; height: 6px;
    border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg);
}
.top-avatar { width: 26px; height: 26px; margin-left: 4px; font-size: 9px; }
.mobile-only { display: none; }
.theme-icon { grid-area: 1 / 1; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
.theme-toggle { display: inline-grid; place-items: center; }

.content { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; padding: 18px 24px 48px; }
.container { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.board-page { width: 100%; max-width: none; }
.narrow-page { width: min(720px, calc(100% - 24px)); padding-block: 8px 28px; }

.sidebar-backdrop { display: none; }
.messages { display: grid; gap: 8px; margin-bottom: 14px; }
.message {
    padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); font-size: 12.5px;
}
.message-success { color: var(--success); border-color: color-mix(in srgb, var(--success) 34%, var(--border)); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }
.message-error, .message-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 34%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.message-warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 34%, var(--border)); background: var(--warning-soft); }
.message-info { color: var(--text-2); }

.confirm-dialog {
    width: min(420px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
}
.confirm-dialog::backdrop { background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); }
.confirm-dialog-card { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 20px; }
.confirm-icon {
    display: grid; place-items: center; width: 36px; height: 36px;
    color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    border-radius: 10px;
}
.confirm-copy h2 { margin: 1px 0 5px; font-size: 15px; font-weight: 650; }
.confirm-copy p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 7px; grid-column: 1 / -1; padding-top: 6px; }

/* Botões ------------------------------------------------------------------- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500;
    line-height: 1; white-space: nowrap; box-shadow: var(--shadow-card);
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.button-secondary { background: var(--surface); }
.button-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.button-ghost:hover { background: var(--nav-active); color: var(--text); }
.button-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.button-danger:hover { background: color-mix(in srgb, var(--danger) 11%, var(--surface)); color: var(--danger); }
.button-small { height: 27px; padding: 0 9px; font-size: 11.5px; }
.button-block { width: 100%; height: 40px; font-size: 13px; }
.button-icon { width: 32px; padding: 0; }
.button:disabled { cursor: not-allowed; opacity: .6; }
.menu-wrap { position: relative; }
.menu-pop { top: 38px; right: 0; left: auto; width: 220px; padding: 6px; }
.menu-pop .p-item { width: 100%; }
.menu-pop form { margin: 0; border-top: 1px solid var(--border); padding-top: 4px; margin-top: 4px; }
.p-item-danger { color: var(--danger); }
.p-item-danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.header-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.form-actions { justify-content: flex-end; padding-top: 4px; }

/* Formulários -------------------------------------------------------------- */
.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .filter-field label { font-size: 12px; font-weight: 600; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.label-row a { font-size: 12px; }
.field input, .field select, .field textarea,
.filter-field input, .filter-field select {
    width: 100%; min-height: 34px; padding: 7px 10px;
    color: var(--text); border: 1px solid var(--border-strong); border-radius: 6px;
    background: var(--surface); outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.filter-field input:focus, .filter-field select:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-errors, .errorlist { margin: 0; padding: 0; color: var(--danger); font-size: 11.5px; list-style: none; }
.help-text { color: var(--text-3); font-size: 11.5px; line-height: 1.5; }
.help-text ul { margin: 5px 0 0; padding-left: 18px; }
.form-alert {
    margin-bottom: 16px; padding: 9px 11px; color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--border));
    border-radius: var(--radius); background: color-mix(in srgb, var(--danger) 7%, var(--surface));
    font-size: 12.5px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline-form { display: inline; }
[type="checkbox"] { accent-color: var(--accent); }

/* Páginas e seções --------------------------------------------------------- */
.page-stack { display: grid; gap: 22px; padding-bottom: 26px; }
.page-section { display: grid; gap: 22px; padding-bottom: 26px; }
.page-header, .board-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px;
}
.page-header { align-items: flex-end; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin-top: 4px; }
.page-header p, .board-sub { color: var(--text-2); font-size: 12.5px; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-sub { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.board-sub .av-stack .avatar { width: 22px; height: 22px; font-size: 8.5px; }
.board-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.pill {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600;
}
.pill .dot { width: 6px; height: 6px; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-2); font-size: 12.5px; }
.back-link:hover { color: var(--text); text-decoration: none; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.section-heading h2 { margin-top: 4px; font-size: 15px; }
.boards-section { display: grid; gap: 10px; }
.panel {
    padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--surface); box-shadow: var(--shadow-card);
}
.form-panel { padding: 26px 28px; }
.auth-heading { margin-bottom: 22px; }
.auth-heading h1 { margin: 4px 0 6px; font-size: 22px; }
.auth-heading p { margin: 0; color: var(--text-2); font-size: 13px; }

/* Workspaces e quadros em grade ------------------------------------------- */
.workspace-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.workspace-card {
    display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px;
    color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--surface); box-shadow: var(--shadow-card);
    transition: border-color .12s, box-shadow .12s;
}
.workspace-card:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); box-shadow: 0 2px 6px rgba(15, 23, 42, .07); }
.workspace-icon, .workspace-hero-icon {
    display: grid; place-items: center; flex: 0 0 auto;
    color: #fff; background: linear-gradient(145deg, #0b8ac7, #07588f);
    font-weight: 700;
}
.workspace-icon { width: 34px; height: 34px; border-radius: 8px; font-size: 13px; }
.workspace-hero-icon { width: 46px; height: 46px; border-radius: 12px; font-size: 18px; }
.workspace-card-body { min-width: 0; display: grid; gap: 1px; }
.workspace-card-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.workspace-card-body small { color: var(--text-3); font-size: 11px; }
.workspace-arrow { margin-left: auto; color: var(--text-3); font-size: 15px; }
.workspace-hero { display: flex; align-items: center; gap: 14px; }
.membership-badge {
    display: inline-flex; margin-top: 6px; padding: 3px 8px;
    color: var(--accent); background: var(--accent-soft); border-radius: 999px;
    font-size: 10.5px; font-weight: 600;
}
.empty-state {
    display: grid; place-items: center; align-content: center; min-height: 280px; padding: 32px;
    text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-xl);
    background: var(--surface);
}
.empty-state h2 { margin: 14px 0 4px; }
.empty-state p { max-width: 460px; margin: 0 0 16px; color: var(--text-2); font-size: 12.5px; }
.empty-illustration { display: flex; align-items: flex-end; gap: 6px; height: 54px; padding: 9px; border-radius: 10px; background: var(--surface-2); }
.empty-illustration span { display: block; width: 16px; border-radius: 3px; background: var(--accent); opacity: .75; }
.empty-illustration span:nth-child(1) { height: 25px; }
.empty-illustration span:nth-child(2) { height: 36px; }
.empty-illustration span:nth-child(3) { height: 17px; }
.foundation-placeholder {
    display: grid; place-items: center; align-content: center; min-height: 230px; padding: 30px;
    text-align: center; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.foundation-placeholder > div { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.foundation-placeholder h2 { margin: 14px 0 4px; }
.foundation-placeholder p { max-width: 560px; margin: 0 0 14px; color: var(--text-2); font-size: 12.5px; }
.compact-placeholder { min-height: 200px; padding: 24px; }

/* Convites e membros ------------------------------------------------------- */
.invitation-list { display: grid; gap: 6px; }
.invitation-list > div {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    font-size: 12.5px;
}
.member-list { display: grid; gap: 6px; }
.member-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.member-row > div:first-child { display: grid; gap: 1px; }
.member-row strong { font-size: 12.5px; font-weight: 500; }
.member-row small { color: var(--text-3); font-size: 11px; }
.member-actions, .member-actions form { display: flex; align-items: center; gap: 6px; }
.member-actions select {
    min-height: 27px; padding: 4px 6px; color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); font-size: 11.5px;
}

/* Quadro ------------------------------------------------------------------- */
.toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}
.tabs { display: flex; align-items: center; gap: 2px; }
.tab {
    position: relative; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px;
    border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 500;
}
.tab:hover { background: var(--nav-active); color: var(--text); }
.tab.active { color: var(--text); font-weight: 600; background: var(--nav-active); }
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; height: 26px; padding: 0 9px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 500;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.chip.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.board-filters {
    display: grid; grid-template-columns: minmax(180px, 1.8fr) repeat(3, minmax(140px, 1fr)) auto;
    align-items: end; gap: 10px; margin-bottom: 14px; padding: 12px;
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.filter-field { display: grid; gap: 5px; }
.filter-field label { color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.filter-actions { display: flex; gap: 6px; }
.filter-notice { margin: -4px 0 14px; color: var(--warning); font-size: 11.5px; }

.kanban-grid { display: flex; align-items: stretch; gap: 12px; width: 100%; overflow: visible; padding-bottom: 8px; }
.kanban-column {
    position: relative; display: flex; flex-direction: column; gap: 8px; flex: 1 1 0; min-width: 0;
    min-height: 340px; padding: 8px; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2);
}
.column-header { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 4px 4px 2px; }
.column-header > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.column-header h2 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.column-color { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; }
.column-count { color: var(--text-3); font-size: 11.5px; font-weight: 500; }
.column-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; opacity: 0; transition: opacity .12s; }
.kanban-column:hover .column-actions, .kanban-column:focus-within .column-actions { opacity: 1; }
.column-actions .icon-action, .column-actions .icon-button {
    display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0;
    border: 1px solid transparent; border-radius: 5px; color: var(--text-3);
}
.column-actions .icon-action:hover, .column-actions .icon-button:hover { background: var(--nav-active); color: var(--text); }
.column-actions .icon-button.icon-delete:hover { color: var(--danger); }
.column-cards { display: flex; flex: 1 1 auto; flex-direction: column; align-content: start; gap: 8px; min-height: 8px; }
.kanban-card {
    display: grid; gap: 8px; padding: 10px 11px; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    box-shadow: var(--shadow-card); cursor: grab;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.kanban-card:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); box-shadow: 0 2px 6px rgba(15, 23, 42, .07); }
.kanban-card:active { cursor: grabbing; }
.kanban-card-title { display: -webkit-box; overflow: hidden; margin: 0; font-size: 13px; font-weight: 500; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.kanban-card-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text-3); font-size: 10.5px; line-height: 1.25; }
.card-created, .card-stale, .card-finished { display: inline-flex; align-items: center; gap: 3px; }
.card-stale { color: var(--warning); font-weight: 600; }
.card-stale.is-critical { color: var(--danger); }
.card-finished, .card-panel-finished { color: var(--success); font-weight: 600; }
.card-date-icon { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kanban-card-meta { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text-3); font-size: 11px; }
.kanban-card-meta .avatar { width: 20px; height: 20px; font-size: 8px; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.meta-item .i { width: 12px; height: 12px; }
.card-due-date, .meta-item.due {
    display: inline-flex; align-items: center; padding: 0 4px; border-radius: 4px;
    color: var(--text-2); font-size: 11px; font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.meta-item.due.is-soon, .card-due-date.is-soon { color: var(--warning); background: var(--warning-soft); }
.meta-item.due.is-late, .card-due-date.is-late { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.column-empty { margin: 0; padding: 9px 6px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-3); text-align: center; font-size: 11.5px; }
.column-add {
    display: flex; align-items: center; gap: 6px; width: 100%; min-height: 30px; padding: 0 6px;
    border-radius: 6px; color: var(--text-3); font-size: 12.5px; font-weight: 500; text-align: left;
}
.column-add:hover { background: var(--nav-active); color: var(--text-2); text-decoration: none; }
.kanban-ghost { opacity: .45; border: 1px dashed var(--accent); background: var(--accent-soft); box-shadow: none; }
.kanban-chosen { box-shadow: 0 12px 24px rgba(9, 39, 68, .16); }
.kanban-drag { opacity: .9; }
.kanban-column.is-drop-target { outline: 2px dashed color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: -4px; }
body.is-dragging-card { cursor: grabbing; }

/* Lista -------------------------------------------------------------------- */
.list { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.list table, .card-results-table { width: 100%; border-collapse: collapse; text-align: left; }
.list th, .card-results-table th {
    padding: 8px 12px; color: var(--text-3); border-bottom: 1px solid var(--border);
    font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
}
.list td, .card-results-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; vertical-align: middle; }
.list tr:last-child td, .card-results-table tbody tr:last-child td { border-bottom: 0; }
.list tr.group td { padding: 7px 12px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; }
.list tr.row:hover td, .card-results-table tbody tr:hover td { background: var(--surface-2); }
.list tr.row { cursor: pointer; }
.cell-title { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.cell-title .dot { width: 7px; height: 7px; }
.table-scroll { overflow-x: auto; }
.table-muted, .table-empty { color: var(--text-3); }
.table-empty { padding-block: 26px !important; text-align: center; }
.card-result-title { display: block; color: var(--text); font-weight: 500; }
.card-result-title:hover { color: var(--accent); }
.card-results-table small { display: block; max-width: 520px; margin-top: 3px; color: var(--text-3); font-size: 11px; }
.status-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cell-person { display: inline-flex; align-items: center; gap: 6px; }
.cell-person .avatar { width: 20px; height: 20px; font-size: 8px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); font-size: 12px; }
.filtered-card-results { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.filtered-results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.filtered-results-heading h2 { margin-top: 3px; font-size: 15px; }
.filtered-results-heading > span { color: var(--text-3); font-size: 11.5px; }

/* Painel lateral do card --------------------------------------------------- */
.card-panel { position: fixed; inset: 0; z-index: 50; }
.card-panel-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .32); }
.card-panel-content {
    position: absolute; inset: 0 0 0 auto; display: flex; flex-direction: column;
    width: 560px; max-width: 94vw; height: 100dvh; min-width: 360px;
    background: var(--surface); border-left: 1px solid var(--border); box-shadow: -24px 0 60px rgba(15, 23, 42, .18);
}
.card-panel-content, .card-panel-content * { min-width: 0; overflow-wrap: anywhere; }
.card-panel-resize-handle { position: absolute; top: 0; bottom: 0; left: -5px; z-index: 2; width: 10px; cursor: ew-resize; touch-action: none; }
.card-panel-resize-handle::after { position: absolute; top: 50%; left: 3px; width: 3px; height: 48px; border-radius: 3px; background: var(--border-strong); content: ""; }
.card-panel-header {
    display: flex; align-items: center; gap: 6px; height: 48px; flex: 0 0 48px;
    padding: 0 12px 0 16px; border-bottom: 1px solid var(--border);
}
.card-panel-header .spacer { flex: 1; }
.card-panel-head-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.status-select {
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
    color: var(--text); font-size: 12px; font-weight: 500;
}
.card-panel-body { flex: 1; overflow: auto; padding: 18px 24px 28px; }
.card-panel-body h2 { margin: 0 0 16px; font-size: 21px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
.card-panel-description { color: var(--text-2); font-size: 13px; line-height: 1.6; }
.card-panel-description p { margin: 0 0 .7em; }
.card-panel-muted { color: var(--text-3); font-style: italic; font-size: 12.5px; }
.props { display: grid; gap: 2px; margin: 0 0 20px; }
.prop { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 8px; min-height: 32px; }
.prop dt { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.prop dt .i { width: 14px; height: 14px; }
.prop dd { margin: 0; min-width: 0; }
.prop-value { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; max-width: 100%; padding: 2px 6px; margin-left: -6px; border-radius: 6px; color: var(--text); font-size: 12.5px; text-align: left; }
.prop-value .avatar { width: 20px; height: 20px; font-size: 8px; }
.section { margin-top: 22px; }
.section h3 {
    display: flex; align-items: center; gap: 7px; margin: 0 0 10px;
    color: var(--text-2); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.section h3 .count { color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.progress { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text-3); font-size: 11px; }
.progress .bar { flex: 1; height: 4px; overflow: hidden; border-radius: 2px; background: var(--surface-2); }
.progress .bar span { display: block; height: 100%; border-radius: 2px; background: var(--success); }
.subtask-form { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.subtask-form .field { flex: 1; }
.subtask-form input { min-height: 32px; }
.subtask-list { display: grid; gap: 0; margin-top: 12px; }
.subtask-item { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 12.5px; }
.subtask-item span { flex: 1; }
.subtask-item.is-completed span { color: var(--text-3); text-decoration: line-through; }
.subtask-toggle {
    display: grid; place-items: center; width: 20px; height: 20px; padding: 0;
    border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface);
    color: var(--success); font-size: 12px; line-height: 1;
}
.subtask-item .icon-button { opacity: 0; width: 24px; height: 24px; }
.subtask-item:hover .icon-button, .subtask-item:focus-within .icon-button { opacity: 1; }
.card-subtasks, .card-attachments, .card-comments { margin-top: 22px; }
.attachment-form { display: flex; align-items: flex-end; gap: 8px; }
.attachment-form .field { flex: 1; }
.attachment-form input[type="file"] { padding: 6px; font-size: 11.5px; }
.attachment-list { display: grid; gap: 6px; margin-top: 10px; }
.attachment-item {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px;
    padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px;
}
.attachment-item a { color: var(--text); font-weight: 500; }
.attachment-item small { grid-column: 1; color: var(--text-3); font-size: 10.5px; }
.attachment-item form { grid-row: 1 / span 2; grid-column: 2; }
.comment-form { display: grid; gap: 8px; }
.comment-form textarea { width: 100%; min-height: 70px; padding: 8px 10px; color: var(--text); border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); resize: vertical; }
.comment-form .button { justify-self: start; }
.comment-list { display: grid; gap: 0; margin-top: 12px; }
.comment-item { display: flex; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: 0; }
.comment-item > .avatar { width: 24px; height: 24px; font-size: 9px; }
.comment-item header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; margin-bottom: 2px; }
.comment-item header strong { font-size: 12.5px; font-weight: 600; }
.comment-item time { margin-right: auto; color: var(--text-3); font-size: 10.5px; }
.comment-item > div { min-width: 0; }
.comment-item p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.card-panel-actions {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
    flex: 0 0 auto; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface);
}
.card-panel-actions form { margin: 0; }

/* Notificações ------------------------------------------------------------- */
.notification-list { display: grid; gap: 8px; }
.notification-item {
    display: grid; grid-template-columns: 28px 1fr auto; gap: 2px 10px; align-items: center;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.notification-item > .avatar { grid-row: 1 / span 2; width: 26px; height: 26px; font-size: 9.5px; }
.notification-item p { margin: 0; font-size: 12.5px; font-weight: 500; }
.notification-item small { grid-column: 2; color: var(--text-3); font-size: 10.5px; }
.notification-item form { grid-row: 1 / span 2; grid-column: 3; }
.notification-unread { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 18%, var(--border)); }

/* Popover de notificações -------------------------------------------------- */
.popover {
    position: absolute; top: 38px; right: 0; z-index: 40; width: 340px; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
}
.notif-pop { width: 340px; }
.sidebar-toggle { color: var(--text-3); }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.pop-head strong { font-size: 12.5px; font-weight: 600; }
.pop-head form { margin: 0; }
.pop-head button { color: var(--accent); font-size: 11px; font-weight: 500; }
.notif { display: flex; gap: 9px; padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.notif:last-of-type { border-bottom: 0; }
.notif .avatar { width: 24px; height: 24px; font-size: 9px; }
.notif p { margin: 0; font-size: 12px; line-height: 1.45; }
.notif time { color: var(--text-3); font-size: 10.5px; }
.notif.unread { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.pop-foot { padding: 8px 12px; text-align: center; border-top: 1px solid var(--border); }
.pop-foot a { color: var(--accent); font-size: 11.5px; font-weight: 500; }

/* Paleta de comandos ------------------------------------------------------- */
.palette-layer { position: fixed; inset: 0; z-index: 60; }
.palette-layer .backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .28); }
.palette {
    position: relative; width: 560px; max-width: calc(100vw - 32px); margin: 12vh auto 0;
    overflow: hidden; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-pop);
}
.palette-input { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.palette-input .i { color: var(--text-3); }
.palette-input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 14px; }
.palette-input input::placeholder { color: var(--text-3); }
.palette-body { max-height: 340px; overflow: auto; padding: 6px; }
.p-group { padding: 8px 8px 4px; color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.p-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: 6px; color: var(--text); font-size: 12.5px; }
.p-item:hover, .p-item:focus { background: var(--surface-2); color: var(--text); text-decoration: none; }
.p-item .i { color: var(--text-3); }
.p-item small { margin-left: auto; color: var(--text-3); }
.palette-foot { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 10.5px; }
.palette-foot .kbd { margin-right: 4px; }

/* Autenticação ------------------------------------------------------------- */
.guest-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.guest-bar { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.guest-bar .brand { font-size: 14.5px; }
.guest-content { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.guest-messages { width: min(460px, calc(100% - 32px)); margin: 20px auto 0; }
.auth-shell {
    display: grid; place-items: center; flex: 1;
    min-height: calc(100vh - 52px); padding: 40px 24px;
    background:
        radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 26rem),
        radial-gradient(circle at 88% 88%, color-mix(in srgb, var(--warning) 7%, transparent), transparent 24rem);
}
html[data-theme="dark"] .auth-shell { background: var(--bg); }
.auth-card {
    width: min(100%, 420px); padding: 30px 32px;
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    background: var(--surface); box-shadow: var(--shadow);
}
.auth-card-centered { text-align: center; }
.auth-heading { margin-bottom: 22px; }
.auth-heading h1, .auth-card h1 { margin: 4px 0 6px; font-size: 24px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; }
.auth-heading p, .auth-card-centered p { margin: 0; color: var(--text-2); font-size: 12.5px; }
.auth-brand { display: grid; place-items: center; width: 100%; margin: 0 auto 22px; }
.auth-logo { width: min(190px, 70%); height: auto; object-fit: contain; }
.text-link-centered { display: block; text-align: center; font-size: 12px; }
.success-icon {
    display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 16px;
    border-radius: 50%; background: color-mix(in srgb, var(--success) 12%, var(--surface));
    color: var(--success); font-size: 20px; font-weight: 700;
}

/* Importação --------------------------------------------------------------- */
.import-schema { display: grid; gap: 14px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.import-schema h2 { margin: 3px 0 5px; font-size: 14px; }
.import-schema p { margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.55; }
.import-schema ul { display: grid; gap: 4px; margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: 11.5px; }
.import-code { display: block; overflow-x: auto; margin-top: 10px; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); white-space: nowrap; font-size: 11.5px; }
.import-downloads { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Responsivo --------------------------------------------------------------- */
@media (max-width: 1080px) {
    .search-trigger { width: 180px; }
    .content { padding: 16px 16px 40px; }
    .workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .board-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 264px;
        transform: translateX(-100%); transition: transform .18s ease;
    }
    .app.mobile-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
    .app.collapsed .sidebar { width: 264px; }
    .app.collapsed .brand,
    .app.collapsed .brand-name,
    .app.collapsed .ws-meta,
    .app.collapsed .ws-chevron,
    .app.collapsed .nav-item span,
    .app.collapsed .nav-item .count,
    .app.collapsed .nav-item .kbd,
    .app.collapsed .user-meta,
    .app.collapsed .user-chevron,
    .app.collapsed .sb-section,
    .app.collapsed .nav-empty { display: revert; }
    .app.collapsed .nav-item { justify-content: flex-start; padding: 0 8px; }
    .app.collapsed .ws-switch { padding: 7px 8px; justify-content: flex-start; }
    .app.collapsed .sb-top { justify-content: space-between; }
    .mobile-only { display: inline-grid !important; }
    .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 39;
        background: rgba(15, 23, 42, .28);
    }
    .board-actions .button-ghost span { display: none; }
    .workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .content { padding: 12px 10px 32px; }
    .topbar { padding: 0 8px 0 12px; }
    .search-trigger { width: 30px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
    .search-trigger span { display: none; }
    .search-trigger .kbd { display: none; }
    .top-avatar { display: none; }
    .board-head, .page-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .board-actions { width: 100%; justify-content: flex-start; }
    .board-filters { grid-template-columns: 1fr; }
    .filter-actions .button { flex: 1; }
    .toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
    .chips { overflow: hidden; }
    h1 { font-size: 20px; }
    .board-sub { flex-wrap: wrap; }
    .kanban-grid { gap: 5px; }
    .kanban-column { min-height: 300px; padding: 5px; border-radius: 8px; }
    .column-header { gap: 4px; padding: 2px; }
    .column-header h2 { font-size: 10.5px; }
    .column-color { width: 6px; height: 6px; }
    .column-count { font-size: 9.5px; }
    .column-actions { display: none; }
    .column-cards { gap: 5px; }
    .kanban-card { gap: 5px; padding: 7px; border-radius: 6px; }
    .kanban-card-title { font-size: 10.5px; line-height: 1.35; }
    .kanban-card-dates { gap: 5px; font-size: 9px; }
    .card-date-icon { width: 10px; height: 10px; }
    .kanban-card-meta { gap: 5px; font-size: 9px; }
    .kanban-card-meta .avatar { width: 16px; height: 16px; font-size: 7px; }
    .kanban-card-meta .meta-item:not(.due):not(.avatar) { display: none; }
    .card-due-date, .meta-item.due { font-size: 9px; padding: 0 3px; }
    .column-empty { padding: 8px 3px; font-size: 8.5px; }
    .column-add { justify-content: center; padding: 0 2px; font-size: 10px; }
    .card-panel-content { width: 100%; max-width: 100%; min-width: 0; }
    .card-panel-resize-handle { display: none; }
    .card-panel-body { padding: 16px 16px 24px; }
    .prop { grid-template-columns: 88px 1fr; }
    .attachment-form, .subtask-form { align-items: stretch; flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .workspace-grid { grid-template-columns: 1fr; }
    .member-row, .member-actions, .member-actions form { align-items: stretch; flex-direction: column; }
    .member-actions, .member-actions form, .member-actions select, .member-actions .button { width: 100%; }
    .notification-item { grid-template-columns: 26px 1fr; }
    .notification-item form { grid-row: auto; grid-column: 1 / -1; justify-self: start; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .import-downloads { align-items: stretch; flex-direction: column; }
    .palette-layer .palette { margin-top: 8vh; }
    .auth-card { padding: 24px 20px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
