:root {
    --bg: #eef4ff;
    --bg-soft: #f8fbff;
    --sidebar: #0f2f6d;
    --sidebar-2: #17489f;
    --panel: #ffffff;
    --text: #10233f;
    --muted: #5a6c88;
    --line: #dce7f8;
    --blue: #1d5bd8;
    --red: #cf2436;
    --shadow: 0 12px 28px rgba(16, 35, 63, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top right, rgba(29, 91, 216, 0.15), transparent 30%), var(--bg);
}

body.migration-active {
    overflow: hidden;
}

.dev-banner {
    background: var(--red);
    color: #fff;
    text-align: center;
    padding: 0.45rem 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.82rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.dev-banner-sep {
    opacity: 0.7;
}

.migration-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(9, 23, 46, 0.58);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 80;
    background: rgba(16, 35, 63, 0.95);
    color: #f4f8ff;
    border: 1px solid rgba(185, 208, 245, 0.35);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(16, 35, 63, 0.3);
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 52rem;
    margin: 0 auto;
}

.cookie-banner p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.35;
}

.cookie-banner-actions {
    display: inline-flex;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.cookie-banner-actions button {
    min-width: 56px;
    padding: 0.42rem 0.7rem;
}

@media (max-width: 720px) {
    .cookie-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.migration-dialog {
    width: min(100%, 32rem);
    background: linear-gradient(160deg, #cf2436, #aa1323);
    color: #ffffff;
    border-radius: 22px;
    box-shadow: 0 26px 60px rgba(16, 35, 63, 0.34);
    padding: 1.5rem 1.4rem;
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 1rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.migration-spinner {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 0.32rem solid rgba(255, 255, 255, 0.22);
    border-top-color: #ffffff;
    animation: migration-spin 0.9s linear infinite;
}

.migration-copy {
    display: grid;
    gap: 0.35rem;
}

.migration-label,
.migration-status {
    margin: 0;
}

.migration-label {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.migration-status {
    font-size: 0.98rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
}

@keyframes migration-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .dev-banner {
        font-size: 0.72rem;
        gap: 0.4rem;
    }

    .dev-banner-sep {
        display: none;
    }

    .migration-dialog {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}
.app-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 270px 1fr;
    align-items: start;
    gap: 1rem;
    padding: 0 1rem 1rem;
}

body[data-sidebar="right"] .app-shell {
    grid-template-columns: 1fr 270px;
}

body[data-sidebar="right"] .sidebar {
    order: 2;
}

body.sidebar-collapsed .app-shell {
    grid-template-columns: 84px 1fr;
}

body[data-sidebar="right"].sidebar-collapsed .app-shell {
    grid-template-columns: 1fr 84px;
}

.sidebar {
    background: linear-gradient(175deg, var(--sidebar), var(--sidebar-2));
    color: #fff;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    scrollbar-gutter: stable;
    border-radius: 20px;
    box-shadow: 0 18px 34px rgba(18, 46, 95, 0.22);
}

.brand-mark {
    text-decoration: none;
    color: inherit;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 0.6rem;
    align-items: center;
}

.brand-mark-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, #fff, #d7e5ff);
    color: var(--blue);
    font-weight: 800;
}

.brand-mark-icon svg,
.menu-icon svg,
.topbar-home-logo svg,
.topbar-icon-button > svg {
    width: 16px;
    height: 16px;
}

.brand-text {
    font-size: 0.92rem;
    font-weight: 700;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .menu-label {
    display: none;
}

.menu {
    display: grid;
    gap: 0.4rem;
}

.menu a {
    color: #e9f0ff;
    text-decoration: none;
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
}

.menu a:hover {
    background: rgba(255, 255, 255, 0.16);
}

.menu-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.2);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-utility-links {
    display: grid;
    gap: 0.4rem;
    margin-top: auto;
}

.sidebar-utility-link {
    color: #e9f0ff;
    text-decoration: none;
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
}

.sidebar-utility-link:hover {
    background: rgba(255, 255, 255, 0.16);
}

.sidebar-controls {
    display: flex;
    gap: 0.5rem;
}

.shell-icon-button {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    font-size: 1rem;
}

.shell-icon-button::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 0.55rem);
    top: 50%;
    transform: translateY(-50%) translateX(-0.2rem);
    background: rgba(16, 35, 63, 0.96);
    color: #fff;
    padding: 0.38rem 0.52rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    transition-delay: 0.5s;
    box-shadow: var(--shadow);
    z-index: 20;
}

.shell-icon-button:hover::after,
.shell-icon-button:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.content-area {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

body.guest-mode .app-shell,
body.guest-mode[data-sidebar="right"] .app-shell,
body.guest-mode.sidebar-collapsed .app-shell,
body.guest-mode[data-sidebar="right"].sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
}

body.guest-mode .sidebar {
    display: none;
}

.topbar {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    padding: 0.9rem 1.2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topbar-home {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    line-height: 1.15;
}

.topbar-home-copy {
    display: grid;
    gap: 0.12rem;
}

.topbar-home-logo {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--blue);
    background: linear-gradient(140deg, #e7efff, #f8fbff);
    border: 1px solid #d6e3f7;
}

.topbar-home-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.topbar-home-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topbar-mid {
    padding-left: 0.5rem;
}

.topbar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-nav-app {
    gap: 0.35rem;
}

.account-menu {
    position: relative;
}

.account-dropdown {
    min-width: 160px;
    right: 0;
}

.account-dropdown a,
.account-dropdown button {
    width: 100%;
    text-align: left;
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
    padding: 0.6rem 0.7rem;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 600;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
    background: #f5f8ff;
}

.topbar-icon-button {
    width: 40px;
    height: 40px;
    display: inline-block;
    position: relative;
    padding: 0;
    font-size: 1rem;
    line-height: 0;
    overflow: hidden;
    border-radius: 10px;
    min-width: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.topbar-icon-button:hover,
.topbar-icon-button:focus-visible {
    background: transparent;
    border-color: transparent;
}

.topbar-account-avatar {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    border: 0;
}

.topbar-account-avatar .avatar-svg {
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    display: block;
    border-radius: inherit;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
}

/* ── Version text trigger ──────────────────────────────────────────────────── */
.version-trigger {
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    padding: 0 2px;
    transition: background 0.15s ease;
}
.version-trigger:hover {
    background: rgba(29, 91, 216, 0.1);
}

/* ── Admin console trigger modal ────────────────────────────────────────────── */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(9, 23, 46, 0.65);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: 1rem;
}
.admin-modal-card {
    background: #1a2d45;
    border: 1px solid #2a3d59;
    border-radius: 18px;
    padding: 1.8rem 2rem 1.6rem;
    width: min(100%, 21rem);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}
.admin-modal-title {
    margin: 0 0 1.1rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #e8f0fc;
    text-align: center;
}
.admin-modal-input {
    display: block;
    width: 100%;
    padding: 0.58rem 0.72rem;
    background: #0d1b2e;
    border: 1px solid #2a3d59;
    border-radius: 9px;
    color: #e8f0fc;
    font: inherit;
    font-size: 0.93rem;
    margin-bottom: 0.65rem;
}
.admin-modal-input:focus {
    outline: 2px solid #3b82f6;
    border-color: transparent;
}
.admin-modal-btn {
    display: block;
    width: 100%;
    padding: 0.62rem;
    background: linear-gradient(130deg, #cf2436, #9e1120);
    color: #fff;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.admin-modal-btn:hover { opacity: 0.9; }
.admin-modal-err {
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    min-height: 1rem;
    margin: 0.5rem 0 0;
}

.page-shell {
    padding: 1rem 1.2rem 1.8rem;
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}

.page-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.74rem;
    color: var(--blue);
    font-weight: 700;
}

h1, h2, h3 {
    margin: 0.5rem 0;
}

.lead, p {
    color: var(--muted);
    line-height: 1.5;
}

.tile-grid,
.stats-grid,
.page-grid,
.auth-layout,
.hero,
.hero-app,
.detail-list,
.activity-grid,
.admin-grid,
.project-grid,
.account-grid,
.company-grid,
.landing-grid,
.landing-graphic-grid {
    display: grid;
    gap: 0.9rem;
}

.tile-grid,
.page-grid,
.project-grid,
.admin-grid,
.company-grid,
.account-grid,
.landing-grid,
.landing-graphic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero,
.hero-app,
.auth-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-card,
.stat-card,
.hero-copy,
.hero-panel,
.auth-card,
.auth-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.hero-ui-chips {
    margin-top: 0.95rem;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.hero-ui-chip {
    border: 1px solid #c8dbfb;
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    font-size: 0.77rem;
    font-weight: 700;
    color: #2856a2;
    background: #f6f9ff;
}

.landing-graphic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-graphic-card {
    background: linear-gradient(165deg, #ffffff, #f4f8ff);
}

.landing-mock-shell {
    margin-top: 0.8rem;
    border-radius: 14px;
    border: 1px solid #d8e5fb;
    background: #ffffff;
    overflow: hidden;
}

.landing-mock-header {
    padding: 0.52rem 0.65rem;
    border-bottom: 1px solid #edf4ff;
    display: flex;
    gap: 0.35rem;
}

.landing-mock-header span {
    width: 0.56rem;
    height: 0.56rem;
    border-radius: 999px;
    background: #cdddf8;
}

.landing-mock-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 0.8rem;
}

.landing-mock-col {
    display: grid;
    gap: 0.55rem;
}

.landing-mock-block,
.landing-mock-pill {
    border-radius: 10px;
    background: #e8f1ff;
}

.landing-mock-block {
    height: 2.4rem;
}

.landing-mock-block.short {
    height: 1.5rem;
}

.landing-mock-block.tall {
    height: 4.45rem;
}

.landing-mock-pill {
    height: 1.05rem;
    border-radius: 999px;
}

.landing-table-preview {
    margin-top: 0.8rem;
    border-radius: 12px;
    border: 1px solid #d8e5fb;
    background: #fff;
    overflow: hidden;
}

.landing-table-row {
    display: grid;
    grid-template-columns: 0.8fr 1.4fr 1fr 1fr;
    gap: 0.55rem;
    padding: 0.58rem 0.72rem;
    border-top: 1px solid #edf3ff;
    font-size: 0.82rem;
    color: #4d6282;
}

.landing-table-row.header {
    border-top: 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    color: #5d7192;
    background: #f5f9ff;
}

.roadmap-bubbles {
    display: grid;
    gap: 0.85rem;
    overflow: hidden;
}

.bubble-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.bubble {
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    border: 1px solid #d3e2fc;
    background: radial-gradient(circle at 20% 20%, #ffffff, #e8f1ff 72%);
    color: #2b4f8f;
    font-weight: 700;
}

.bubble.size-lg {
    font-size: 0.94rem;
    padding: 0.62rem 1rem;
}

.bubble.size-md {
    font-size: 0.85rem;
}

.bubble.size-sm,
.bubble.size-xs {
    font-size: 0.78rem;
}

.signup-steps-overview {
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.signup-steps-overview li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #4c6183;
}

.signup-steps-overview li span {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: #dbe9ff;
    color: #1d4fa9;
    font-size: 0.75rem;
    font-weight: 700;
}

.signup-phase {
    display: grid;
    gap: 0.5rem;
}

.signup-phase h2 {
    margin-top: 0;
    font-size: 1.05rem;
}

.wizard-actions {
    margin-top: 0.65rem;
    display: flex;
    gap: 0.55rem;
    justify-content: flex-end;
}

.avatar-preview {
    margin-top: 0.45rem;
    display: grid;
    place-items: center;
}

.avatar-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.avatar-scene-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}

.avatar-choice-card {
    border: 1px solid #ccddfb;
    background: #f6f9ff;
    border-radius: 12px;
    padding: 0.28rem;
    display: grid;
    place-items: center;
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.avatar-choice-card:hover {
    border-color: #93b7f5;
    transform: translateY(-1px);
}

.avatar-choice-card[aria-pressed="true"] {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(29, 91, 216, 0.18);
    background: #eef4ff;
}

.avatar-choice-card .avatar-svg {
    width: 100%;
    max-width: 90px;
    aspect-ratio: 1 / 1;
    border-radius: 9px;
    display: block;
}

.avatar-preview-canvas {
    width: min(100%, 240px);
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    border: 1px solid #c8dbfb;
    background: #f4f8ff;
    padding: 0.4rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.avatar-preview-canvas .avatar-svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 10px;
}

.accent-card {
    background: linear-gradient(160deg, var(--blue), #2d70e2);
    color: #fff;
}

.accent-card p,
.accent-card .stat-label {
    color: #dce8ff;
}

form {
    display: grid;
    gap: 0.5rem;
}

label {
    margin-top: 0.2rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.62rem 0.72rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    font: inherit;
}

button,
.button-primary,
.button-secondary,
.ghost-button,
.danger-button {
    border: 0;
    padding: 0.62rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
}

button,
.button-primary {
    color: #fff;
    background: linear-gradient(130deg, var(--blue), #0d4ab7);
}

.button-secondary,
.ghost-button {
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
}

.danger-card {
    border-color: #f1c4cb;
    background: #fff7f8;
}

.danger-button {
    background: linear-gradient(130deg, var(--red), #9f1b29);
    color: #fff;
}

.text-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}

.form-message {
    min-height: 1.4rem;
    margin: 0.6rem 0 0;
    font-weight: 600;
}

.form-message[data-state="success"] {
    color: #0e7143;
}

.form-message[data-state="error"] {
    color: #b8202f;
}

input[data-field-state="error"],
select[data-field-state="error"] {
    border-color: #c8222f;
    outline: 2px solid #f5c2c7;
    outline-offset: 0;
}

.project-page-header,
.project-workbench {
    width: 100%;
}

.project-page-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-page-add-button {
    flex: 0 0 auto;
}

.btn-create-project {
    flex: 0 0 auto;
    padding: 0.55rem 1.25rem;
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.3;
}

.btn-create-project:hover {
    background: #1045b5;
}

.board-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.board-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.plus-menu {
    position: relative;
}

.plus-icon-button {
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
}

.inline-plus-menu .plus-icon-button {
    min-width: 1.5rem;
    min-height: 1.5rem;
    font-size: 0.9rem;
    border-radius: 6px;
}

.plus-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 180px;
    display: grid;
    gap: 0.2rem;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    z-index: 30;
    animation: menu-in 120ms ease-out;
}

.plus-dropdown[hidden] {
    display: none !important;
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plus-dropdown button,
.columns-dropdown label {
    width: 100%;
    text-align: left;
    border-radius: 9px;
}

.plus-dropdown button {
    border: 0;
    color: var(--text);
    background: transparent;
    padding: 0.6rem 0.7rem;
}

.plus-dropdown button:hover,
.columns-dropdown label:hover {
    background: #f5f8ff;
}

.columns-dropdown {
    min-width: 210px;
}

.columns-dropdown label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    color: var(--text);
}

.columns-dropdown input {
    width: auto;
    margin: 0;
}

.board-toolbar-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.board-toolbar-context {
    display: grid;
    gap: 0.35rem;
    min-width: 260px;
}

.board-toolbar-context label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5d7192;
}

.project-editor {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    background: linear-gradient(180deg, #fbfdff, #f2f7ff);
    margin-bottom: 1rem;
}

body.drawer-open {
    overflow: hidden;
}

.project-editor-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 32, 58, 0.35);
    z-index: 35;
}

.project-editor-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(540px, 100vw);
    height: 100dvh;
    border-radius: 0;
    border-left: 1px solid #d6e3f7;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    background: #f8fbff;
    z-index: 40;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 0.7rem;
    overflow: auto;
    padding: 0.85rem;
    box-shadow: -16px 0 36px rgba(12, 31, 58, 0.2);
}

.project-editor-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 0.8rem;
}

.project-editor-tabs {
    display: flex;
    gap: 0.45rem;
    border-bottom: 1px solid #d6e3f7;
    padding-bottom: 0.45rem;
}

.project-editor-tab {
    border: 1px solid #d4e1f3;
    background: #f6f9ff;
    color: #35527c;
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.project-editor-tab.active {
    background: #2f5ba8;
    border-color: #2f5ba8;
    color: #fff;
}

.project-editor-panel {
    display: grid;
    gap: 0.6rem;
}

.entity-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.entity-form-span {
    grid-column: 1 / -1;
}

.entity-form-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    margin-top: 0.9rem;
}

.project-board {
    display: grid;
    gap: 1rem;
}

.project-table-shell {
    border: 1px solid #d9e2f2;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(16, 35, 63, 0.08);
}

.project-table-header {
    padding: 0.7rem 0.85rem 0.62rem;
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: start;
    background: #ffffff;
}

.project-table-header h2 {
    margin-top: 0.1rem;
    font-size: 1rem;
}

.project-table-header p {
    margin: 0.1rem 0 0;
}

.project-table-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: center;
    margin-left: auto;
}

.project-header-button {
    padding: 0.2rem 0.4rem;
    font-size: 0.68rem;
    border-radius: 6px;
}

.project-note-bubble {
    margin: 0 0.85rem 0.55rem;
    padding: 0.5rem 0.62rem;
    border: 1px solid #dbe6f5;
    border-radius: 10px;
    background: #f9fbff;
    display: grid;
    gap: 0.35rem;
}

.project-note-dates {
    margin: 0;
    font-size: 0.78rem;
    color: #4f6280;
}

.project-note-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.project-note-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #536785;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.project-note-select {
    min-width: 120px;
    width: auto;
    height: 30px;
    padding: 0.2rem 0.45rem;
    border-radius: 7px;
    border: 1px solid #d1dff3;
    background: #fff;
    font-size: 0.8rem;
    color: #2e486b;
}

.project-note-customize {
    padding: 0.3rem 0.52rem;
    border-radius: 7px;
    font-size: 0.75rem;
}

.project-note-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.76rem;
    font-weight: 800;
}

.meta-chip,
.status-badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: capitalize;
}

.meta-chip {
    border: 1px solid var(--line);
    background: #fff;
}

.status-badge {
    background: #e7eefc;
    color: var(--blue);
}

.status-pill {
    border: 1px solid #c9d9f5;
    background: #edf3ff;
    color: var(--blue);
}

.project-table-wrap {
    overflow-x: auto;
    border-top: 1px solid #e3eaf6;
}

.project-data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
    table-layout: fixed;
}

.project-data-table th,
.project-data-table td {
    padding: 0.15rem 0.5rem;
    border-top: 1px solid #ecf1f9;
    vertical-align: middle;
    height: 36px;
}

.project-summary-row {
    background: linear-gradient(180deg, #fbfdff, #f6faff);
}

.project-data-table th {
    text-align: left;
    color: #5e6f89;
    background: #f7f9fc;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    position: sticky;
    top: 0;
    z-index: 1;
    border-top: 0;
    overflow: visible;
    user-select: none;
}

.project-data-table tbody tr:hover {
    background: #f6f9ff;
}

.project-data-table tbody tr[data-row-status="blocked"] {
    box-shadow: inset 3px 0 0 #cc3947;
}

.project-data-table tbody tr[data-row-status="in_progress"] {
    box-shadow: inset 3px 0 0 #0f7f5a;
}

.project-data-table tbody tr[data-row-status="done"] {
    box-shadow: inset 3px 0 0 #2d63d9;
}

.column-item {
    width: 400px;
    min-width: 400px;
}

.actions-col {
    width: 104px;
    text-align: right;
}

.drag-col {
    width: 40px;
    color: var(--muted);
    text-align: center;
    cursor: default;
    font-size: 0.82rem;
    user-select: none;
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: grab;
    color: #5f7597;
}

.drag-handle:hover {
    background: #eaf1ff;
    color: #2f4f7f;
}

.milestone-row {
    background: #f8fbff;
    color: inherit;
}

.task-row {
    background: #fff;
}

.subtask-row {
    background: #fcfdff;
}

.row-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-left: calc(var(--depth, 0) * 1.1rem);
    min-height: 32px;
}

.row-toggle {
    border: 0;
    background: #edf2fb;
    color: #34547f;
    padding: 0;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
}

.row-toggle-passive {
    opacity: 0.55;
}

.row-spacer {
    display: inline-block;
    width: 1rem;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.2rem;
    margin-left: auto;
}

.row-edit-button {
    padding: 0.16rem 0.32rem;
    font-size: 0.66rem;
    border-radius: 6px;
}

.row-actions .inline-plus-menu {
    margin-left: 0;
}

.project-comments-panel {
    border-top: 1px solid #dbe6f5;
    padding-top: 0.65rem;
    display: grid;
    gap: 0.45rem;
}

.project-comments-panel h4 {
    margin: 0;
    font-size: 0.9rem;
}

.project-comments-actions {
    display: flex;
    justify-content: flex-end;
}

.project-comment-history {
    display: grid;
    gap: 0.4rem;
    max-height: 240px;
    overflow: auto;
    padding-right: 0.2rem;
}

.comment-item {
    border: 1px solid #dbe6f5;
    background: #ffffff;
    border-radius: 9px;
    padding: 0.42rem 0.5rem;
    box-shadow: 0 2px 7px rgba(16, 35, 63, 0.06);
}

.comment-item p {
    margin: 0;
    color: #374f73;
    font-size: 0.84rem;
}

.comment-item small {
    color: #6f819f;
    font-size: 0.72rem;
}

.comment-item-title {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5c6f8d;
}

.comment-item-change {
    border-color: #cfdcf0;
    background: #f6f9ff;
}

.comment-change-list {
    margin: 0.2rem 0 0.35rem;
    padding-left: 1rem;
    display: grid;
    gap: 0.2rem;
}

.comment-change-list li {
    color: #4f6485;
    font-size: 0.78rem;
}

.muted-cell {
    color: var(--muted);
    font-size: 0.9rem;
}

.cell-input {
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    border: 1px solid #dbe6f5;
    background: #ffffff;
    font-size: 0.84rem;
}

.cell-input:focus {
    border-color: #9db8eb;
    outline: none;
    background: #fff;
}

.cell-input-text {
    font-weight: 600;
    color: var(--text);
}

.cell-input-select,
.cell-input-date,
.cell-input-estimate,
.cell-input-unit {
    color: var(--muted);
}

.board-pill {
    border-radius: 999px;
    font-weight: 700;
    text-transform: capitalize;
    border: 1px solid transparent;
    padding-left: 0.6rem;
}

.status-not-started {
    background: #eff3fb;
    color: #4e6281;
    border-color: #dae4f3;
}

.status-progress {
    background: #def6ec;
    color: #0c744e;
    border-color: #b9e8d4;
}

.status-blocked {
    background: #ffe8eb;
    color: #a62135;
    border-color: #f5c2cb;
}

.status-done {
    background: #e3edff;
    color: #244fae;
    border-color: #bfd2ff;
}

.priority-low {
    background: #eef2fb;
    color: #4d6388;
    border-color: #d5e0f5;
}

.priority-medium {
    background: #e9f3ff;
    color: #1c5dbf;
    border-color: #c4dcff;
}

.priority-high {
    background: #fff1dd;
    color: #9e5e11;
    border-color: #f3d3a7;
}

.priority-urgent {
    background: #ffe8eb;
    color: #a22236;
    border-color: #f6c5cc;
}

.type-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.52rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.type-chip.project {
    background: #e8f0ff;
    color: #2858ba;
    border-color: #c8d9ff;
}

.type-chip.milestone {
    background: #e6f7f0;
    color: #157d57;
    border-color: #bfe9d8;
}

.type-chip.task {
    background: #fff4df;
    color: #91590f;
    border-color: #f0d5ab;
}

.type-chip.subtask {
    background: #f3efff;
    color: #594596;
    border-color: #ddd4fb;
}

.type-chip.meeting {
    background: #eaf8ff;
    color: #1b6688;
    border-color: #c9e8f7;
}

.estimate-editor {
    display: grid;
    grid-template-columns: minmax(70px, 92px) minmax(72px, 1fr);
    gap: 0.4rem;
}

.row-action {
    white-space: nowrap;
}

.board-table-foot {
    display: flex;
    justify-content: flex-start;
    padding: 0.35rem 0.5rem 0.5rem;
    border-top: 1px solid #e3eaf6;
    background: #ffffff;
}

.placeholder-note {
    margin: 0;
    color: #c32434;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.placeholder-page {
    min-height: 220px;
    display: grid;
    align-content: start;
    gap: 0.35rem;
}

.empty-group-row td {
    color: var(--muted);
    font-style: italic;
}

.add-row {
    background: #f0f6ff;
    border-top: 2px dashed #c5d9f5;
    cursor: pointer;
}

.add-row:hover {
    background: #e2eeff;
}

.add-row td {
    padding: 0.35rem 0.5rem;
    height: auto;
    min-height: 28px;
}

.add-row .row-title {
    color: #6b7fa0;
    font-size: 0.85rem;
    font-weight: 500;
}

.inline-check {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.84rem;
}

#entity-meeting-attendees {
    min-height: 110px;
}

#entity-meeting-location-custom {
    margin-top: 0.35rem;
}

#entity-meeting-attendees-custom {
    margin-top: 0.45rem;
}

.empty-board {
    padding: 1rem;
}

/* Column resize handle — sits on the right edge of each <th> */
.col-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    background: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent 2px,
        #c6d6ef 2px,
        #c6d6ef 3px,
        transparent 3px,
        transparent 4px
    );
    z-index: 2;
}

.col-resize-handle:hover {
    background: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent 1px,
        #7ea3de 1px,
        #7ea3de 2px,
        transparent 2px,
        transparent 3px
    );
}

.contacts-book-shell {
    display: grid;
    gap: 0.9rem;
}

.contacts-tabs {
    display: flex;
    gap: 0.6rem;
}

.contacts-tab {
    border: 1px solid #d0ddf2;
    background: #f7faff;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.contacts-tab.active {
    background: #1a56db;
    border-color: #1a56db;
    color: #fff;
}

.contacts-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.contact-card {
    border: 1px solid #dbe6f5;
    background: #fff;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    display: grid;
    gap: 0.25rem;
}

.contact-card h3 {
    margin: 0;
    font-size: 0.95rem;
}

.contact-card p {
    margin: 0;
    color: #546883;
    font-size: 0.83rem;
}

.contact-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.35rem;
}

/* Prevent text selection while dragging a column edge */
body.col-resizing,
body.col-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.project-table-shell[draggable="true"] {
    cursor: grab;
}

.feature-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.45rem;
}

.cta-row {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.mini-label {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

pre {
    margin: 0;
    border-radius: 10px;
    padding: 0.9rem;
    border: 1px solid var(--line);
    background: #f9fbff;
    white-space: pre-wrap;
}

.activity-table-wrap {
    overflow: auto;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.activity-table th,
.activity-table td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.5rem;
    vertical-align: top;
}

.site-footer {
    padding: 0.8rem 1.2rem;
    color: var(--muted);
    text-align: right;
}

@media (max-width: 1120px) {
    .tile-grid,
    .page-grid,
    .project-grid,
    .admin-grid,
    .company-grid,
    .account-grid,
    .landing-grid,
    .landing-graphic-grid,
    .stats-grid,
    .hero,
    .hero-app,
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .entity-form-grid {
        grid-template-columns: 1fr;
    }

    .board-toolbar-actions {
        width: 100%;
    }
}

@media (max-width: 840px) {
    .app-shell,
    body[data-sidebar="right"] .app-shell,
    body.sidebar-collapsed .app-shell,
    body[data-sidebar="right"].sidebar-collapsed .app-shell {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }

    .sidebar {
        position: static;
        min-height: 0;
        height: auto;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        scrollbar-gutter: auto;
    }

    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .menu-label {
        display: inline;
    }

    .shell-icon-button::after {
        left: 50%;
        top: calc(100% + 0.45rem);
        transform: translateX(-50%) translateY(-0.2rem);
    }

    .shell-icon-button:hover::after,
    .shell-icon-button:focus-visible::after {
        transform: translateX(-50%) translateY(0);
    }

    .board-toolbar,
    .project-table-header,
    .project-editor-header,
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .project-table-header-meta,
    .row-actions,
    .entity-form-actions {
        justify-content: start;
    }

    .topbar-end {
        margin-left: 0;
    }

    .project-editor-drawer {
        width: 100vw;
    }
}
