:root {
    color-scheme: dark;
    --bg: #111213;
    --bg-elevated: #171819;
    --surface: #1d1e20;
    --surface-2: #252628;
    --surface-3: #2b2c2e;
    --border: #34363a;
    --border-soft: #292b2f;
    --text: #f5f7fb;
    --muted: #94979f;
    --muted-2: #6f737b;
    --blue: #4d8ff7;
    --blue-strong: #2877ef;
    --blue-soft: #1d2a3d;
    --accent: var(--blue);
    --accent-soft: #79adff;
    --green: #24c790;
    --green-soft: #173a30;
    --yellow: #f3b61f;
    --yellow-soft: #3d3116;
    --red: #ef5757;
    --red-soft: #442426;
    --radius: 12px;
    --shadow: 0 18px 45px rgb(0 0 0 / 32%);
    --sidebar-width: 240px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
}

img,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    color: #79adff;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 3px;
    font-size: clamp(24px, 3vw, 31px);
    line-height: 1.2;
    letter-spacing: -.025em;
}

h2 {
    margin-bottom: 0;
    font-size: 16px;
}

h3 {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

p {
    color: var(--muted);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 26px 0;
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.muted {
    color: var(--muted);
}

.text-success {
    color: var(--green) !important;
}

.span-full,
.span-2 {
    grid-column: 1 / -1;
}

.mobile-only {
    display: none;
}

.button,
.icon-button {
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 9px;
    font-weight: 650;
    transition: .18s ease;
}

.button:hover,
.icon-button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

.button-primary {
    color: white;
    background: var(--blue);
    box-shadow: 0 7px 20px rgb(77 143 247 / 18%);
}

.button-primary:hover {
    color: white;
    background: #5c9bff;
}

.button-secondary {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface-2);
}

.button-secondary:hover {
    color: white;
    border-color: #4a4d53;
    background: #2d2f32;
}

.button-small {
    min-height: 31px;
    padding: 0 10px;
    font-size: 12px;
}

.button-full {
    width: 100%;
}

.icon-button {
    width: 40px;
    padding: 0;
    color: var(--text);
    border-color: var(--border);
    background: var(--surface-2);
}

.auth-page {
    background:
        radial-gradient(circle at 35% 50%, rgb(38 72 118 / 35%), transparent 26%),
        linear-gradient(rgb(255 255 255 / 1%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 1%) 1px, transparent 1px),
        #191a1c;
    background-size: auto, 42px 42px, 42px 42px, auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.auth-topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 28px 38px;
    color: #d5d8de;
    font-size: 11px;
    font-weight: 700;
}

.auth-topbar span:last-child {
    font-weight: 400;
}

.auth-main {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 30px 20px;
}

.auth-card {
    width: min(100%, 420px);
    padding: 42px 44px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgb(39 40 42 / 96%);
    box-shadow: var(--shadow);
    text-align: center;
}

.auth-logo {
    margin-bottom: 12px;
    font-size: 31px;
    font-weight: 800;
    letter-spacing: -.05em;
}

.auth-logo span {
    color: var(--blue);
}

.locked-icon {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 17px;
    border: 1px solid #785817;
    border-radius: 50%;
    color: var(--yellow);
    background: var(--yellow-soft);
    font-size: 26px;
    font-weight: 800;
}

.locked-actions {
    margin-top: 17px;
}

.auth-card h1 {
    margin-bottom: 7px;
    font-size: 26px;
}

.auth-card > p {
    margin-bottom: 28px;
}

.auth-footer {
    padding: 22px;
    color: var(--muted-2);
    font-size: 11px;
    text-align: center;
}

.form-stack {
    display: grid;
    gap: 16px;
}

label > span:first-child,
.toolbar label > span:first-child {
    display: block;
    margin-bottom: 6px;
    color: #dfe2e7;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.label-row {
    align-items: center;
    display: flex !important;
    justify-content: space-between;
}

.label-row a {
    font-size: 11px;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #202123;
    padding: 11px 13px;
    transition: .15s ease;
}

input,
select {
    min-height: 42px;
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #73767d;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgb(77 143 247 / 13%);
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 46px;
}

.password-field button {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 34px;
    height: 32px;
    padding: 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.check-row {
    align-items: center;
    display: flex;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.check-row input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--blue);
}

.check-row span {
    margin: 0 !important;
}

.security-note {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid #4b3b17;
    border-radius: 9px;
    color: var(--yellow);
    background: rgb(61 49 22 / 65%);
    font-size: 11px;
    text-align: left;
}

.security-note span {
    color: #d9c58a;
}

.password-rules {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 12px;
    text-align: left;
}

.code-input {
    font-size: 26px;
    letter-spacing: .3em;
    text-align: center;
}

.back-link {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    margin-top: 20px;
    font-size: 12px;
}

.flash {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 9px;
    font-size: 13px;
}

.flash-error {
    color: #ffb5b5;
    border-color: #6f3034;
    background: var(--red-soft);
}

.flash-success {
    color: #9aeacb;
    border-color: #235d49;
    background: var(--green-soft);
}

.workspace-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 32% 25%, rgb(32 59 98 / 19%), transparent 27%),
        var(--bg);
}

.workspace-page.sidebar-lock {
    overflow: hidden;
}

.sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 26px 20px 18px;
    border-right: 1px solid var(--border);
    background: #191a1b;
}

.sidebar-brand {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 8px 32px;
}

.sidebar-brand > a {
    color: white;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.06em;
}

.sidebar-brand > a span {
    margin-left: 6px;
    padding: 3px 5px;
    border-radius: 4px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 8px;
    letter-spacing: 0;
    vertical-align: middle;
}

.sidebar-close,
.mobile-menu {
    display: none;
}

.sidebar-nav,
.sidebar-secondary {
    display: grid;
    gap: 5px;
}

.sidebar-nav a,
.sidebar-secondary a {
    align-items: center;
    display: flex;
    gap: 12px;
    min-height: 43px;
    padding: 0 12px;
    border-radius: 8px;
    color: #a8abb2;
    font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-secondary a:hover,
.sidebar-nav a.is-active,
.sidebar-secondary a.is-active {
    color: var(--blue);
    background: var(--blue-soft);
}

.sidebar-secondary {
    margin-top: auto;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-soft);
}

.sidebar-user {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user-info {
    align-items: center;
    display: flex;
    gap: 9px;
    min-width: 0;
    color: var(--text);
}

.sidebar-user-info > span:last-child {
    min-width: 0;
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
    overflow: hidden;
    max-width: 120px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user strong {
    font-size: 12px;
}

.sidebar-user small {
    color: var(--muted);
    font-size: 9px;
}

.sidebar-user .icon-button {
    width: 34px;
    min-height: 34px;
}

.workspace-main {
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 38px clamp(24px, 4vw, 56px) 70px;
}

.page-header {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 25px;
}

.page-header p {
    margin: 5px 0 0;
}

.page-header-compact {
    margin-bottom: 16px;
}

.page-actions,
.badge-row,
.card-heading-row {
    align-items: center;
    display: flex;
    gap: 9px;
}

.page-actions,
.badge-row {
    flex-wrap: wrap;
}

.card-heading-row {
    justify-content: space-between;
}

.card-heading-row > span:first-child {
    min-width: 0;
}

.card-heading-row strong,
.card-heading-row small {
    display: block;
}

.card-heading-row small {
    color: var(--muted);
}

.breadcrumb {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.metric-card,
.panel,
.client-card,
.project-card,
.table-card,
.chat-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.metric-card {
    min-height: 126px;
    padding: 22px;
}

.metric-card > span,
.metric-card > small {
    display: block;
    color: var(--muted);
}

.metric-card > strong {
    display: block;
    margin: 8px 0 3px;
    font-size: 30px;
    line-height: 1.1;
}

.metric-card > small {
    font-size: 11px;
}

.panel {
    min-width: 0;
    padding: 20px;
}

.panel-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.panel-heading a,
.panel-heading > span {
    color: var(--blue);
    font-size: 11px;
}

.dashboard-grid,
.detail-grid,
.posts-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.detail-grid-sidebar {
    grid-template-columns: minmax(0, 2fr) minmax(280px, .85fr);
}

.content-stack,
.list-stack,
.deadline-list,
.comment-list {
    display: grid;
    gap: 10px;
}

.task-row,
.deadline-row,
.post-compact,
.activity-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 53px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-2);
}

.task-row:hover,
.deadline-row:hover {
    color: var(--text);
    border-color: var(--border);
}

.task-row strong,
.task-row small,
.deadline-row strong,
.deadline-row small,
.post-compact strong,
.post-compact small {
    display: block;
}

.task-row small,
.deadline-row small,
.post-compact small {
    color: var(--muted);
    font-size: 10px;
}

.post-compact {
    justify-content: flex-start;
}

.post-compact .badge {
    margin-left: auto;
}

.deadline-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(140px, 1fr) auto;
}

progress {
    width: 100%;
    height: 6px;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    appearance: none;
}

progress::-webkit-progress-bar {
    background: #333539;
}

progress::-webkit-progress-value {
    border-radius: 20px;
    background: var(--blue);
}

progress::-moz-progress-bar {
    border-radius: 20px;
    background: var(--blue);
}

.deadline-value {
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.deadline-value small {
    color: var(--muted);
}

.empty-state {
    padding: 30px 18px;
    color: var(--muted);
    text-align: center;
}

.empty-state.centered {
    align-self: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 750;
    line-height: 1.25;
    white-space: nowrap;
}

.badge-blue,
.badge-in_progress,
.badge-review {
    color: #75abff;
    background: var(--blue-soft);
}

.badge-active,
.badge-completed,
.badge-approved,
.badge-low {
    color: var(--green);
    background: var(--green-soft);
}

.badge-pending,
.badge-medium,
.badge-waiting_client {
    color: var(--yellow);
    background: var(--yellow-soft);
}

.badge-suspended,
.badge-high,
.badge-critical,
.badge-blocked {
    color: var(--red);
    background: var(--red-soft);
}

.avatar {
    flex: 0 0 auto;
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #4b4e54;
    border-radius: 50%;
    color: white;
    background: linear-gradient(145deg, #405679, #25282d);
    font-size: 10px;
    font-weight: 750;
}

.avatar-sm {
    width: 25px;
    height: 25px;
    font-size: 8px;
}

.avatar-lg {
    width: 58px;
    height: 58px;
    font-size: 16px;
}

.avatar-blue {
    color: white;
    border-color: #4479cc;
    background: var(--blue);
}

.avatar-stack {
    display: flex;
}

.avatar-stack .avatar + .avatar {
    margin-left: -7px;
}

.toolbar,
.filters-row {
    align-items: end;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar {
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--bg-elevated);
}

.toolbar label {
    flex: 1 1 170px;
    min-width: min(180px, 100%);
}

.toolbar-search {
    flex: 2 1 240px !important;
}

.filters-row {
    align-items: center;
}

.filter-pill,
.tabs > span,
.tabs > a,
.tabs label span {
    padding: 8px 13px;
    border-radius: 7px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 600;
}

.filter-pill.is-active,
.tabs > .is-active,
.tabs label:has(input:checked) span {
    color: white;
    background: var(--blue);
}

.search-box {
    position: relative;
    align-items: center;
    display: flex;
    flex: 1;
}

.search-box svg {
    position: absolute;
    left: 12px;
    color: var(--muted);
}

.search-box input {
    padding-left: 39px;
}

.filters-row .search-box {
    margin-left: auto;
    max-width: 440px;
}

.table-card {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    background: var(--bg-elevated);
    font-size: 10px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

td {
    color: #b9bbc1;
    font-size: 12px;
}

tbody tr:hover {
    background: rgb(255 255 255 / 2%);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.person-cell,
.file-name {
    align-items: center;
    display: flex;
    gap: 9px;
    color: var(--text);
}

.client-grid,
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.client-grid > *,
.project-grid > *,
.form-grid > *,
.dashboard-grid > *,
.detail-grid > *,
.posts-layout > * {
    min-width: 0;
}

.client-card,
.project-card {
    padding: 18px;
    color: var(--text);
    transition: .18s ease;
}

.client-card:hover,
.project-card:hover {
    color: var(--text);
    border-color: #4b4e55;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgb(0 0 0 / 18%);
}

.client-card-heading {
    align-items: center;
    display: flex;
    gap: 11px;
    margin-bottom: 20px;
}

.client-card-heading strong,
.client-card-heading small {
    display: block;
}

.card-stats,
.detail-list,
.project-summary dl {
    margin: 0;
}

.card-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

dt {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

dd {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.project-card {
    display: grid;
    gap: 14px;
}

.project-card .card-heading-row strong {
    font-size: 16px;
}

.progress-label {
    align-items: center;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 10px;
}

.progress-label strong {
    color: var(--blue);
}

.project-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    font-size: 11px;
}

.project-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-meta small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}

.next-milestone {
    padding: 9px 10px;
    border-radius: 7px;
    color: #c8cad0;
    background: #18191a;
    font-size: 10px;
}

.detail-list {
    display: grid;
    gap: 16px;
}

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

.internal-note {
    border-color: #5e4320;
    background: #2d281f;
}

.project-summary dl {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.tabs {
    align-items: center;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.tabs > span,
.tabs > a,
.tabs label span {
    flex: 0 0 auto;
    scroll-snap-align: start;
    background: transparent;
}

.tabs > .is-active,
.tabs label:has(input:checked) span {
    border-bottom: 2px solid var(--blue);
    border-radius: 0;
    color: var(--blue);
    background: transparent;
}

.tabs .count {
    margin-left: 5px;
    padding: 2px 5px;
    border-radius: 4px;
    color: white;
    background: var(--blue);
    font-size: 9px;
}

.stage-track {
    display: flex;
    gap: 0;
    overflow-x: auto;
    margin-bottom: 17px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.stage {
    position: relative;
    flex: 1 0 120px;
    align-items: center;
    display: flex;
    gap: 7px;
    color: var(--muted);
    font-size: 10px;
    scroll-snap-align: start;
}

.stage:not(:last-child)::after {
    content: "";
    flex: 1;
    height: 2px;
    margin: 0 7px;
    background: var(--border);
}

.stage > span {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: 8px;
}

.stage-approved,
.stage-in_progress {
    color: var(--text);
}

.stage-approved > span {
    color: white;
    border-color: var(--green);
    background: var(--green);
}

.stage-in_progress > span {
    border-color: var(--blue);
    background: var(--blue);
}

.project-selector {
    align-items: center;
    display: flex;
    gap: 9px;
    width: min(100%, 300px);
    margin-bottom: 17px;
}

.kanban-board {
    display: grid;
    grid-auto-columns: minmax(245px, 1fr);
    grid-auto-flow: column;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.kanban-column {
    min-height: 310px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #18191a;
    scroll-snap-align: start;
}

.kanban-column-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 11px;
    padding: 0 3px;
}

.kanban-column-heading h2 {
    font-size: 13px;
}

.kanban-column-heading > span {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    border-radius: 5px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: 10px;
}

.kanban-dropzone {
    display: grid;
    align-content: start;
    gap: 9px;
    min-height: 250px;
}

.kanban-dropzone.is-over {
    outline: 2px dashed var(--blue);
    outline-offset: 4px;
}

.kanban-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: 0 6px 16px rgb(0 0 0 / 12%);
}

.kanban-card[draggable="true"] {
    cursor: grab;
}

.kanban-card.is-dragging {
    opacity: .45;
}

.kanban-card > a {
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.kanban-card small {
    color: var(--muted);
    font-size: 9px;
}

.kanban-card-footer {
    align-items: center;
    display: flex;
    gap: 7px;
}

.task-detail > h1 {
    margin-bottom: 9px;
}

.task-detail > h3 {
    margin-top: 28px;
}

.checklist {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checklist li {
    align-items: center;
    display: flex;
    gap: 9px;
}

.checklist li > span {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.checklist li.is-complete {
    color: var(--muted);
    text-decoration: line-through;
}

.checklist li.is-complete > span {
    color: white;
    border-color: var(--blue);
    background: var(--blue);
    text-decoration: none;
}

.comment {
    display: flex;
    gap: 10px;
}

.comment strong,
.comment small {
    display: block;
}

.comment small {
    color: var(--muted);
    font-weight: 400;
}

.comment p {
    margin: 5px 0 0;
    color: #c2c4ca;
}

.inline-compose {
    align-items: end;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
    margin-top: 18px;
}

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

.form-wide {
    max-width: 850px;
    margin: 0 auto;
}

.form-actions,
.modal-actions {
    align-items: center;
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    margin-top: 20px;
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

legend {
    margin-bottom: 8px;
    color: #dfe2e7;
    font-size: 12px;
    font-weight: 600;
}

.priority-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.priority-options label {
    position: relative;
}

.priority-options input,
.compose-tabs input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.priority-options label > span {
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 37px;
    border: 1px solid transparent;
    cursor: pointer;
}

.priority-options label:has(input:checked) > span {
    border-color: currentColor;
}

.ticket-hero {
    margin-bottom: 18px;
}

.ticket-hero h1 {
    font-size: 23px;
}

.ticket-hero p {
    margin-bottom: 0;
}

.message-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.message-card > strong,
.message-card > small {
    display: block;
}

.message-card > small {
    margin-top: 3px;
    color: var(--muted);
}

.message-card p {
    margin: 13px 0 0;
    color: #c3c6cc;
    overflow-wrap: anywhere;
}

.message-client {
    border-color: #39445a;
}

.message-internal {
    border-color: #72511b;
    background: #382d1b;
}

.ticket-compose textarea {
    border-top-left-radius: 0;
}

.compose-tabs {
    margin-bottom: 0;
    padding-bottom: 0;
    border: 0;
}

.compose-tabs label {
    position: relative;
}

.chat-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: calc(100vh - 76px);
    min-height: 560px;
    overflow: hidden;
}

.chat-channels {
    overflow-y: auto;
    padding: 17px;
    border-right: 1px solid var(--border);
    background: #18191a;
}

.chat-channels h2 {
    margin: 22px 7px 8px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.chat-channels > a {
    display: block;
    padding: 8px 9px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
}

.chat-channels > a.is-active,
.chat-channels > a:hover {
    color: white;
    background: var(--blue-soft);
}

.chat-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.chat-header {
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
}

.chat-header h1 {
    font-size: 16px;
}

.chat-header p {
    margin: 0;
    font-size: 10px;
}

.chat-messages {
    overflow-y: auto;
    padding: 22px;
}

.chat-message {
    display: flex;
    gap: 11px;
    margin-bottom: 18px;
}

.chat-message strong,
.chat-message small {
    display: block;
}

.chat-message small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 400;
}

.chat-message p {
    margin: 5px 0 0;
    color: #c4c6cc;
    overflow-wrap: anywhere;
}

.chat-compose {
    align-items: end;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin: 0 20px 20px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}

.chat-compose textarea {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.posts-layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr);
}

.post-author,
.profile-heading,
.session-row {
    align-items: center;
    display: flex;
    gap: 10px;
}

.post-author strong,
.post-author small,
.profile-heading strong,
.profile-heading small,
.session-row strong,
.session-row small {
    display: block;
}

.post-author small,
.profile-heading small,
.session-row small {
    color: var(--muted);
}

.post-author .badge {
    margin-left: auto;
}

.post-card h2 {
    margin-top: 18px;
    font-size: 17px;
}

.post-card > p {
    margin-bottom: 0;
    color: #c4c6cb;
}

.notification {
    align-items: flex-start;
    display: flex;
    gap: 9px;
    padding: 9px;
    border-radius: 7px;
    color: var(--text);
}

.notification:hover {
    color: var(--text);
    background: var(--surface-2);
}

.notification > span {
    width: 6px;
    height: 6px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--muted-2);
}

.notification.is-unread > span {
    background: var(--blue);
}

.notification strong,
.notification small {
    display: block;
}

.notification strong {
    font-size: 11px;
}

.notification small {
    color: var(--muted);
    font-size: 9px;
}

.profile-heading {
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.profile-heading a {
    display: block;
    font-size: 11px;
}

.session-row {
    padding: 13px 0;
    border-bottom: 1px solid var(--border-soft);
}

.session-row > span:last-child {
    margin-left: auto;
    font-size: 11px;
}

.session-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.modal {
    width: min(94vw, 620px);
    max-height: 90vh;
    padding: 0;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.modal::backdrop {
    background: rgb(0 0 0 / 72%);
    backdrop-filter: blur(3px);
}

.modal-card {
    padding: 24px;
}

.modal-heading {
    align-items: flex-start;
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-heading p {
    margin: 5px 0 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 150px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.security-copy {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.error-state {
    width: min(100%, 560px);
    margin: 10vh auto 0;
    padding: 45px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.error-code {
    display: block;
    color: var(--blue);
    font-size: 48px;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

@media (max-width: 820px) {
    :root {
        --sidebar-width: 270px;
    }

    .mobile-menu {
        position: fixed;
        z-index: 25;
        top: 16px;
        left: 16px;
        align-items: center;
        display: inline-flex;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 9px;
        color: white;
        background: var(--surface-2);
    }

    .sidebar {
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: var(--shadow);
    }

    .sidebar-close {
        align-items: center;
        display: inline-flex;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        color: var(--muted);
        background: transparent;
    }

    .sidebar-scrim {
        position: fixed;
        z-index: 29;
        inset: 0;
        display: none;
        background: rgb(0 0 0 / 62%);
    }

    .sidebar-scrim.is-open {
        display: block;
    }

    .workspace-main {
        width: 100%;
        margin-left: 0;
        padding: 82px 18px 60px;
    }

    .dashboard-grid,
    .detail-grid,
    .detail-grid-sidebar,
    .posts-layout {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .filters-row {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .toolbar label,
    .filters-row .search-box {
        flex: 1 1 220px;
        max-width: none;
        margin-left: 0;
    }

    .project-summary dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chat-shell {
        grid-template-columns: 180px 1fr;
        height: 72vh;
    }
}

@media (max-width: 600px) {
    .auth-topbar {
        align-items: flex-start;
        gap: 10px;
        padding: 20px;
        flex-direction: column;
    }

    .auth-card {
        padding: 30px 22px;
        border-radius: 15px;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header > .button {
        width: 100%;
    }

    .metric-grid,
    .client-grid,
    .project-grid,
    .form-grid,
    .detail-list-grid,
    .card-stats,
    .project-summary dl {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 105px;
    }

    .deadline-row {
        grid-template-columns: 1fr auto;
    }

    .deadline-row progress {
        grid-column: 1 / -1;
        grid-row: 2;
    }

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

    .inline-compose,
    .chat-compose {
        grid-template-columns: 1fr;
    }

    .chat-shell {
        display: block;
        height: auto;
        min-height: 0;
    }

    .chat-channels {
        max-height: 220px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .chat-main {
        min-height: 550px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.header-actions,
.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions form,
.header-actions form,
.panel-heading form,
.checklist form {
    margin: 0;
}

.button-danger {
    color: #fff;
    background: #b4233b;
    border-color: #d13b55;
}

.button-danger:hover {
    background: #cf2948;
}

.modal-card-wide {
    width: 100%;
}

.modal:has(.modal-card-wide) {
    width: min(94vw, 920px);
}

.permission-list,
.audit-list {
    display: grid;
    gap: 8px;
    max-height: 58vh;
    overflow: auto;
    padding-right: 6px;
}

.permission-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .02);
}

.permission-row span,
.permission-row small {
    display: block;
}

.permission-row small {
    color: var(--muted);
    margin-top: 3px;
}

.stage-editor {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
}

.settings-permissions {
    margin-top: 22px;
}

.role-permission-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.role-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.role-summary-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
}

.role-permission-card {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
}

.permission-checkboxes {
    display: grid;
    gap: 8px;
    max-height: 460px;
    overflow: auto;
    padding-right: 4px;
}

.permission-checkboxes .check-row {
    align-items: start;
}

.permission-checkboxes small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-top: 14px;
}

.inline-form > input,
.inline-form > select {
    flex: 1 1 150px;
    min-width: 0;
}

.inline-form > input[type="color"] {
    flex: 0 0 54px;
    min-width: 54px;
    padding: 5px;
}

.stack-form {
    display: grid;
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.stack-form label,
.stack-form label span {
    display: grid;
    gap: 7px;
}

.check-toggle {
    width: 23px;
    height: 23px;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

img.avatar {
    display: block;
    object-fit: cover;
}

.notification-preferences {
    display: grid;
    gap: 6px;
}

.preference-heading,
.preference-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 90px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.preference-heading {
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
}

.preference-heading strong:not(:first-child),
.preference-row input {
    justify-self: center;
}

.record-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: rgba(255,255,255,.018); }
.record-card p { margin: 10px 0; }
.kanban-color { width: 9px; height: 9px; display: inline-block; border-radius: 50%; margin-right: 8px; background: var(--kanban-color); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.folder-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.folder-card.is-active { border-color: var(--accent); background: rgba(123,92,255,.08); }
.folder-card > a { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.folder-card > a small { grid-column: 2; }
.timeline-list { display: grid; gap: 10px; }
.timeline-list > div { display: grid; gap: 3px; border-left: 2px solid var(--border); padding-left: 10px; }
.chat-message blockquote { margin: 0 0 8px; padding: 8px 10px; border-left: 2px solid var(--accent); background: rgba(255,255,255,.025); border-radius: 6px; display: grid; }
.button-link { border: 0; padding: 0; background: transparent; color: var(--accent-soft); cursor: pointer; font: inherit; }
.chat-compose details { min-width: 160px; }
.chat-compose > small { grid-column: 1 / -1; color: var(--muted); }

@media (max-width: 600px) {
    .header-actions,
    .header-actions .button,
    .header-actions form,
    .header-actions form .button {
        width: 100%;
    }

    .permission-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1000px) {
    .role-permission-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive system — v1.2 */

.auth-page,
.workspace-page,
.workspace-main {
    min-height: 100dvh;
}

.sidebar {
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.table-card .panel-heading {
    padding: 16px 18px 0;
}

.task-row > span:first-child,
.deadline-row > span:first-child,
.activity-row > span:first-child,
.session-row > span:first-child,
.post-compact > span:first-child {
    min-width: 0;
}

.task-row strong,
.deadline-row strong,
.activity-row strong,
.session-row strong,
.post-compact strong,
.file-name,
dd {
    overflow-wrap: anywhere;
}

input[type="file"] {
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 820px) {
    .mobile-menu {
        top: max(16px, env(safe-area-inset-top));
        left: max(16px, env(safe-area-inset-left));
        box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
    }

    .sidebar {
        width: min(var(--sidebar-width), calc(100vw - 34px));
        padding-top: max(26px, env(safe-area-inset-top));
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }

    .workspace-main {
        padding:
            calc(78px + env(safe-area-inset-top))
            max(18px, env(safe-area-inset-right))
            calc(60px + env(safe-area-inset-bottom))
            max(18px, env(safe-area-inset-left));
    }

    .toolbar > .button,
    .filters-row > .button {
        flex: 1 1 150px;
    }

    .chat-shell {
        height: calc(100dvh - 126px);
        min-height: 520px;
    }

    .modal {
        max-height: min(92dvh, 820px);
    }
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .span-2,
    .span-full {
        grid-column: auto;
    }

    .table-card {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .table-card .panel-heading {
        padding: 14px 0 10px;
    }

    .table-scroll:has(.responsive-table) {
        overflow: visible;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .responsive-table tbody {
        display: grid;
        gap: 12px;
    }

    .responsive-table tbody tr {
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        box-shadow: 0 8px 22px rgb(0 0 0 / 10%);
    }

    .responsive-table tbody tr[hidden] {
        display: none;
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        min-height: 46px;
        padding: 10px 13px;
        border-bottom: 1px solid var(--border-soft);
        white-space: normal;
        text-align: right;
    }

    .responsive-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 9px;
        font-weight: 750;
        letter-spacing: .04em;
        text-align: left;
        text-transform: uppercase;
    }

    .responsive-table td > * {
        min-width: 0;
        justify-self: end;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
    }

    .responsive-table td.table-actions {
        display: flex;
        justify-content: flex-end;
        padding-top: 12px;
        flex-wrap: wrap;
    }

    .responsive-table td.table-actions::before {
        flex: 1 0 100%;
    }

    .responsive-table td.table-actions form {
        flex: 1 1 auto;
    }

    .responsive-table td.table-actions .button {
        width: 100%;
    }

    .responsive-table .person-cell,
    .responsive-table .file-name {
        justify-self: end;
        text-align: left;
    }

    .responsive-table td.responsive-table-empty {
        display: block;
        padding: 24px 16px;
        color: var(--muted);
        text-align: center;
    }

    .responsive-table td.responsive-table-empty::before {
        content: none;
    }

    .modal-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin: 20px -20px -20px;
        padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: rgb(29 30 32 / 96%);
        backdrop-filter: blur(10px);
    }
}

@media (max-width: 600px) {
    body {
        font-size: 13px;
    }

    h1 {
        font-size: clamp(23px, 8vw, 28px);
    }

    .auth-page {
        grid-template-rows: auto 1fr auto;
    }

    .auth-main {
        padding: 20px 14px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .auth-footer {
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

    .workspace-main {
        padding-right: 14px;
        padding-left: 14px;
    }

    .page-header {
        gap: 14px;
        margin-bottom: 20px;
    }

    .header-actions,
    .page-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .header-actions > *,
    .page-actions > *,
    .header-actions form,
    .page-actions form,
    .header-actions .button,
    .page-actions .button {
        width: 100%;
        min-width: 0;
    }

    .header-actions > :only-child,
    .page-actions > :only-child {
        grid-column: 1 / -1;
    }

    .toolbar,
    .filters-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 11px;
    }

    .toolbar label,
    .toolbar-search,
    .filters-row .search-box,
    .toolbar > .button,
    .filters-row > .button {
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0;
    }

    .panel,
    .metric-card {
        padding: 16px;
    }

    .panel-heading {
        align-items: flex-start;
    }

    .task-row,
    .deadline-row,
    .post-compact,
    .activity-row,
    .session-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .task-row > .badge,
    .deadline-row > .badge,
    .post-compact > .badge {
        margin-left: auto;
    }

    .metric-card > strong {
        font-size: 27px;
    }

    .project-selector {
        width: 100%;
    }

    .stage-track {
        margin-right: -14px;
        margin-left: -14px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        padding-right: 14px;
        padding-left: 14px;
    }

    .kanban-board {
        grid-auto-columns: minmax(260px, calc(100vw - 42px));
        margin-right: -14px;
        margin-left: -14px;
        padding-right: 14px;
        padding-left: 14px;
    }

    .kanban-column {
        min-height: 260px;
    }

    .chat-shell {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        height: calc(100dvh - 180px);
        min-height: 540px;
        border-radius: 10px;
    }

    .chat-channels {
        display: flex;
        gap: 7px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 11px;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    .chat-channels form,
    .chat-channels h2 {
        display: none;
    }

    .chat-channels > a {
        flex: 0 0 auto;
        max-width: 210px;
        overflow: hidden;
        padding: 8px 11px;
        border: 1px solid var(--border-soft);
        text-overflow: ellipsis;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .chat-main {
        min-height: 0;
    }

    .chat-header {
        padding: 13px 14px;
    }

    .chat-messages {
        padding: 16px 13px;
    }

    .chat-message {
        gap: 8px;
    }

    .chat-compose {
        margin: 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
    }

    .chat-compose details,
    .chat-compose .button {
        width: 100%;
        min-width: 0;
    }

    .folder-grid {
        grid-template-columns: 1fr;
    }

    .preference-heading,
    .preference-row {
        grid-template-columns: minmax(0, 1fr) 64px 64px;
        gap: 7px;
        padding-right: 6px;
        padding-left: 6px;
    }

    .preference-heading {
        font-size: 9px;
    }

    .modal {
        width: 100vw;
        max-width: none;
        max-height: calc(96dvh - env(safe-area-inset-top));
        margin: auto 0 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 18px 18px 0 0;
    }

    .modal:has(.modal-card-wide) {
        width: 100vw;
    }

    .modal-card {
        padding: 20px;
    }

    .modal-heading {
        gap: 10px;
        margin-bottom: 17px;
    }

    .error-state {
        margin-top: 6vh;
        padding: 30px 20px;
    }
}

@media (max-width: 420px) {
    .auth-topbar span:last-child {
        display: none;
    }

    .header-actions,
    .page-actions {
        grid-template-columns: 1fr;
    }

    .responsive-table td {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 8px;
    }

    .preference-heading,
    .preference-row {
        grid-template-columns: minmax(0, 1fr) 52px 52px;
    }

    .modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .modal-actions .button {
        width: 100%;
    }
}

@media (hover: none), (pointer: coarse) {
    .button,
    .icon-button,
    .sidebar-nav a,
    .sidebar-secondary a {
        min-height: 44px;
    }

    .button:hover,
    .icon-button:hover,
    .client-card:hover,
    .project-card:hover {
        transform: none;
    }

    .kanban-card[draggable="true"] {
        cursor: pointer;
    }
}

/* Dashboard — v1.2.1 */

.dashboard-page {
    display: grid;
    gap: 20px;
}

.dashboard-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 190px;
    overflow: hidden;
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid #334868;
    border-radius: 18px;
    background:
        radial-gradient(circle at 88% 12%, rgb(87 154 255 / 27%), transparent 30%),
        linear-gradient(125deg, #202e44 0%, #1d232d 47%, #1b1d21 100%);
    box-shadow: 0 20px 50px rgb(0 0 0 / 20%);
}

.dashboard-hero::after {
    position: absolute;
    z-index: -1;
    right: -80px;
    bottom: -165px;
    width: 340px;
    height: 340px;
    border: 1px solid rgb(116 174 255 / 12%);
    border-radius: 50%;
    box-shadow:
        0 0 0 42px rgb(116 174 255 / 3%),
        0 0 0 88px rgb(116 174 255 / 2%);
    content: "";
}

.dashboard-hero-copy {
    max-width: 670px;
}

.dashboard-kicker {
    display: block;
    margin-bottom: 7px;
    color: #77adff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
    line-height: 1.3;
    text-transform: uppercase;
}

.dashboard-hero h1 {
    margin-bottom: 8px;
    font-size: clamp(30px, 4.2vw, 47px);
    letter-spacing: -.045em;
}

.dashboard-hero p {
    max-width: 590px;
    margin-bottom: 14px;
    color: #c1c7d1;
    font-size: 14px;
}

.dashboard-date {
    color: #828a97;
    font-size: 11px;
    font-weight: 650;
}

.dashboard-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-left: 28px;
    flex-wrap: wrap;
}

.dashboard-hero-actions .button {
    min-height: 44px;
}

.dashboard-notification-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgb(255 255 255 / 13%);
    border-radius: 10px;
    color: white;
    background: rgb(255 255 255 / 6%);
    transition: .18s ease;
}

.dashboard-notification-button:hover {
    color: white;
    border-color: rgb(121 173 255 / 58%);
    background: rgb(77 143 247 / 18%);
    transform: translateY(-1px);
}

.dashboard-filter-panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--bg-elevated);
}

.dashboard-filter-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 13px 17px;
    cursor: pointer;
    list-style: none;
}

.dashboard-filter-panel > summary::-webkit-details-marker {
    display: none;
}

.dashboard-filter-title,
.dashboard-filter-state {
    display: flex;
    align-items: center;
    gap: 11px;
}

.dashboard-filter-title > svg {
    flex: 0 0 auto;
    color: var(--blue);
}

.dashboard-filter-title strong,
.dashboard-filter-title small {
    display: block;
}

.dashboard-filter-title strong {
    color: var(--text);
    font-size: 12px;
}

.dashboard-filter-title small,
.dashboard-filter-state {
    color: var(--muted);
    font-size: 10px;
}

.dashboard-filter-count,
.dashboard-context-label {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid #3a5782;
    border-radius: 999px;
    color: #8db9ff;
    background: rgb(77 143 247 / 11%);
    font-size: 9px;
    font-weight: 750;
}

.dashboard-filter-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #c5c9d0;
    font-size: 18px;
    transition: transform .2s ease;
}

.dashboard-filter-panel[open] .dashboard-filter-chevron {
    transform: rotate(180deg);
}

.dashboard-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 13px;
    padding: 17px;
    border-top: 1px solid var(--border-soft);
    background: rgb(255 255 255 / 1%);
}

.dashboard-filter-form label {
    min-width: 0;
}

.dashboard-filter-form label > span:first-child {
    font-size: 10px;
}

.dashboard-filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
    grid-column: 1 / -1;
}

.dashboard-section-intro,
.dashboard-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-section-intro {
    align-items: flex-end;
    margin-bottom: 13px;
}

.dashboard-section-intro h2,
.dashboard-panel-heading h2 {
    font-size: 17px;
    letter-spacing: -.015em;
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.dashboard-metric-card {
    position: relative;
    min-width: 0;
    min-height: 154px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgb(255 255 255 / 2%), transparent 58%),
        var(--surface);
}

.dashboard-metric-card::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 72px;
    height: 72px;
    border-radius: 0 0 0 72px;
    background: rgb(77 143 247 / 4%);
    content: "";
}

.dashboard-metric-icon {
    position: absolute;
    z-index: 1;
    top: 17px;
    right: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #385273;
    border-radius: 10px;
    color: #72a9fc;
    background: rgb(77 143 247 / 10%);
}

.dashboard-metric-label {
    display: block;
    max-width: calc(100% - 47px);
    color: #b6bac2;
    font-size: 11px;
    font-weight: 650;
}

.dashboard-metric-card > strong {
    display: block;
    margin: 20px 0 4px;
    color: white;
    font-size: clamp(27px, 3vw, 34px);
    line-height: 1;
    letter-spacing: -.04em;
}

.dashboard-metric-card > strong > small {
    display: inline;
    margin-left: 2px;
    color: #aeb3bb;
    font-size: 15px;
}

.dashboard-metric-card > small {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.dashboard-metric-projects .dashboard-metric-icon {
    color: #45d8a3;
    border-color: #285f50;
    background: rgb(36 199 144 / 10%);
}

.dashboard-metric-tickets .dashboard-metric-icon {
    color: #f0bd40;
    border-color: #665225;
    background: rgb(243 182 31 / 10%);
}

.dashboard-metric-hours .dashboard-metric-icon {
    color: #bd94ff;
    border-color: #574278;
    background: rgb(157 104 255 / 10%);
}

.dashboard-focus-grid,
.dashboard-support-grid {
    display: grid;
    gap: 16px;
}

.dashboard-focus-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
}

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

.dashboard-focus-grid > *,
.dashboard-support-grid > * {
    min-width: 0;
}

.dashboard-page .panel {
    padding: 22px;
    border-radius: 14px;
}

.dashboard-panel-heading {
    margin-bottom: 17px;
}

.dashboard-panel-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.dashboard-count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #c8ccd3;
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 800;
}

.dashboard-count-alert {
    color: #ff8a8a;
    border-color: #68363b;
    background: rgb(239 87 87 / 9%);
}

.dashboard-section-link {
    flex: 0 0 auto;
    margin-top: 18px;
    font-size: 11px;
    font-weight: 700;
}

.dashboard-attention-list,
.dashboard-deadline-list,
.dashboard-task-list,
.dashboard-post-list {
    display: grid;
    gap: 8px;
}

.dashboard-attention-row,
.dashboard-task-row,
.dashboard-post-row {
    display: grid;
    align-items: center;
    gap: 11px;
    min-width: 0;
    min-height: 61px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text);
    background: var(--surface-2);
}

.dashboard-attention-row {
    grid-template-columns: 8px minmax(0, 1fr) auto;
}

.dashboard-attention-row:hover,
.dashboard-task-row:hover {
    color: var(--text);
    border-color: #45484e;
    background: #292b2e;
}

.dashboard-attention-marker {
    width: 7px;
    height: 34px;
    border-radius: 99px;
    background: var(--red);
}

.dashboard-attention-row.attention-approval .dashboard-attention-marker,
.dashboard-attention-row.attention-client_pending .dashboard-attention-marker {
    background: var(--yellow);
}

.dashboard-attention-row.attention-scope_change .dashboard-attention-marker {
    background: #9d7aff;
}

.dashboard-row-copy {
    min-width: 0;
}

.dashboard-row-copy strong,
.dashboard-row-copy small {
    display: block;
    overflow-wrap: anywhere;
}

.dashboard-row-copy strong {
    color: #f0f2f6;
    font-size: 12px;
}

.dashboard-row-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.dashboard-row-meta {
    display: grid;
    justify-items: end;
    gap: 5px;
}

.dashboard-row-meta small {
    color: var(--muted);
    font-size: 9px;
}

.dashboard-row-meta .badge-waiting_approval,
.dashboard-row-meta .badge-open {
    color: var(--yellow);
    background: var(--yellow-soft);
}

.dashboard-clear-state,
.dashboard-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 120px;
    border: 1px dashed var(--border);
    border-radius: 11px;
    color: var(--muted);
    background: rgb(255 255 255 / 1%);
    text-align: center;
}

.dashboard-clear-state {
    justify-content: flex-start;
    min-height: 88px;
    padding: 17px;
    color: #83dec0;
    border-color: #315e51;
    background: rgb(36 199 144 / 5%);
    text-align: left;
}

.dashboard-clear-state > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgb(36 199 144 / 12%);
}

.dashboard-clear-state strong,
.dashboard-clear-state small {
    display: block;
}

.dashboard-clear-state strong {
    color: #c8f3e4;
    font-size: 12px;
}

.dashboard-clear-state small {
    margin-top: 2px;
    color: #75a899;
    font-size: 10px;
}

.dashboard-empty-state {
    flex-direction: column;
    padding: 24px;
    font-size: 11px;
}

.dashboard-empty-state svg {
    color: #68717e;
}

.dashboard-deadline-row {
    display: grid;
    gap: 11px;
    padding: 12px 0;
    color: var(--text);
    border-bottom: 1px solid var(--border-soft);
}

.dashboard-deadline-row:first-child {
    padding-top: 2px;
}

.dashboard-deadline-row:last-child {
    padding-bottom: 2px;
    border-bottom: 0;
}

.dashboard-deadline-row:hover {
    color: var(--text);
}

.dashboard-deadline-topline,
.dashboard-progress-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-deadline-topline > span:first-child {
    min-width: 0;
}

.dashboard-deadline-topline strong,
.dashboard-deadline-topline small {
    display: block;
    overflow-wrap: anywhere;
}

.dashboard-deadline-topline strong {
    font-size: 12px;
}

.dashboard-deadline-topline small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.dashboard-deadline-date {
    flex: 0 0 auto;
    color: #aeb4bd;
    font-size: 9px;
    font-weight: 700;
}

.dashboard-progress-line progress {
    min-width: 0;
}

.dashboard-progress-line small {
    flex: 0 0 30px;
    color: #77adff;
    font-size: 9px;
    font-weight: 750;
    text-align: right;
}

.dashboard-task-row {
    grid-template-columns: 18px minmax(0, 1fr) auto;
}

.dashboard-task-check {
    width: 17px;
    height: 17px;
    border: 1px solid #555a63;
    border-radius: 5px;
    background: #202225;
}

.dashboard-post-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.dashboard-post-row .avatar {
    width: 32px;
    height: 32px;
}

@media (max-width: 1180px) {
    .dashboard-filter-form {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .dashboard-focus-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    }
}

@media (max-width: 980px) {
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
        margin: 24px 0 0;
    }

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

    .dashboard-focus-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-support-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dashboard-page {
        gap: 16px;
    }

    .dashboard-hero {
        min-height: 0;
        padding: 24px 18px;
        border-radius: 14px;
    }

    .dashboard-hero h1 {
        font-size: 32px;
    }

    .dashboard-hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
        margin-top: 22px;
    }

    .dashboard-hero-actions .button {
        width: 100%;
        min-width: 0;
        padding: 0 12px;
    }

    .dashboard-notification-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .dashboard-filter-panel > summary {
        align-items: flex-start;
        min-height: 62px;
        padding: 13px;
    }

    .dashboard-filter-title small,
    .dashboard-filter-state > span:not(.dashboard-filter-count):not(.dashboard-filter-chevron) {
        display: none;
    }

    .dashboard-filter-form {
        grid-template-columns: 1fr;
        padding: 13px;
    }

    .dashboard-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-filter-actions > :only-child {
        grid-column: 1 / -1;
    }

    .dashboard-filter-actions .button {
        width: 100%;
    }

    .dashboard-section-intro {
        align-items: flex-start;
    }

    .dashboard-metric-card {
        min-height: 137px;
        padding: 17px;
    }

    .dashboard-page .panel {
        padding: 17px;
    }

    .dashboard-panel-heading {
        gap: 10px;
    }

    .dashboard-panel-heading p {
        max-width: 270px;
    }

    .dashboard-attention-row {
        grid-template-columns: 7px minmax(0, 1fr);
    }

    .dashboard-attention-row .dashboard-row-meta {
        grid-column: 2;
        grid-template-columns: auto 1fr;
        align-items: center;
        justify-items: start;
    }

    .dashboard-task-row {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .dashboard-task-row > .badge {
        grid-column: 2;
    }

    .dashboard-post-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .dashboard-post-row > .badge {
        grid-column: 2;
    }
}

@media (max-width: 430px) {
    .dashboard-hero-actions,
    .dashboard-filter-actions,
    .dashboard-metric-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-metric-card {
        min-height: 126px;
    }

    .dashboard-metric-card > strong {
        margin-top: 15px;
    }

    .dashboard-notification-button,
    .dashboard-filter-actions > :only-child {
        grid-column: auto;
    }

    .dashboard-panel-heading p {
        display: none;
    }
}

/* Dashboard alinhado às telas de referência — v1.2.3 */

.dashboard-page-reference {
    gap: 16px;
}

.dashboard-page-reference .dashboard-page-header {
    align-items: center;
    margin-bottom: 2px;
}

.dashboard-page-reference .dashboard-page-header h1 {
    font-size: clamp(26px, 3vw, 32px);
}

.dashboard-page-reference .dashboard-page-header p {
    margin: 5px 0 0;
}

.dashboard-page-reference .dashboard-header-actions {
    flex-wrap: nowrap;
}

.dashboard-page-reference .dashboard-filter-panel {
    margin-bottom: 2px;
    background: var(--surface);
}

.dashboard-page-reference .dashboard-filter-panel > summary {
    min-height: 60px;
}

.dashboard-page-reference .dashboard-metric-card {
    min-height: 150px;
    border-color: #383a3e;
    background: var(--surface-2);
}

.dashboard-page-reference .dashboard-metric-card::after {
    opacity: .6;
}

.dashboard-page-reference .dashboard-metric-card > strong {
    margin-top: 22px;
}

.dashboard-page-reference .panel {
    border-color: #383a3e;
    background: var(--surface-2);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-main-grid > * {
    min-width: 0;
}

.dashboard-page-reference .dashboard-panel-heading {
    margin-bottom: 13px;
}

.dashboard-page-reference .dashboard-panel-heading h2 {
    font-size: 17px;
}

.dashboard-page-reference .dashboard-section-link {
    margin-top: 3px;
}

.dashboard-page-reference .dashboard-task-list,
.dashboard-page-reference .dashboard-post-list {
    gap: 0;
}

.dashboard-page-reference .dashboard-task-row,
.dashboard-page-reference .dashboard-post-row {
    min-height: 68px;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid #36383b;
    border-radius: 0;
    background: transparent;
}

.dashboard-page-reference .dashboard-task-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.dashboard-page-reference .dashboard-task-row:last-child,
.dashboard-page-reference .dashboard-post-row:last-child {
    border-bottom: 0;
}

.dashboard-page-reference .dashboard-task-row:hover {
    padding-right: 10px;
    padding-left: 10px;
    border-color: #3d4044;
    border-radius: 9px;
    background: rgb(255 255 255 / 2.5%);
}

.dashboard-page-reference .dashboard-post-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.dashboard-page-reference .dashboard-empty-state {
    min-height: 132px;
    border-color: #414348;
    background: rgb(0 0 0 / 7%);
}

.dashboard-page-reference .dashboard-attention-panel {
    border-color: #5f3a3e;
}

.dashboard-page-reference .dashboard-deadline-list {
    gap: 11px;
}

.dashboard-page-reference .dashboard-deadline-row {
    gap: 13px;
    padding: 15px;
    border: 1px solid #383a3e;
    border-radius: 11px;
    background: rgb(0 0 0 / 7%);
}

.dashboard-page-reference .dashboard-deadline-row:first-child,
.dashboard-page-reference .dashboard-deadline-row:last-child {
    padding: 15px;
    border: 1px solid #383a3e;
}

.dashboard-page-reference .dashboard-deadline-row:hover {
    border-color: #4a4d52;
    background: rgb(255 255 255 / 2%);
}

@media (max-width: 980px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dashboard-page-reference .dashboard-page-header {
        align-items: stretch;
    }

    .dashboard-page-reference .dashboard-header-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .dashboard-page-reference .dashboard-header-actions .button {
        width: 100%;
    }

    .dashboard-page-reference .dashboard-metric-card {
        min-height: 132px;
    }

    .dashboard-page-reference .dashboard-task-row,
    .dashboard-page-reference .dashboard-post-row {
        align-items: flex-start;
    }
}

@media (max-width: 430px) {
    .dashboard-page-reference .dashboard-task-row,
    .dashboard-page-reference .dashboard-post-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .dashboard-page-reference .dashboard-post-row .avatar {
        display: none;
    }
}

/* Workspace responsive and live chat — v1.3.0 */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
canvas {
    max-width: 100%;
}

svg {
    flex: 0 0 auto;
}

input,
select,
textarea,
button {
    min-width: 0;
    max-width: 100%;
}

.workspace-main {
    overflow-x: clip;
}

.workspace-main > *,
.page-header > *,
.header-actions > *,
.page-actions > *,
.toolbar > *,
.filters-row > *,
.inline-form > *,
.inline-compose > *,
.chat-main > * {
    min-width: 0;
}

.panel,
.table-card,
.client-card,
.project-card,
.metric-card,
.modal-card {
    max-width: 100%;
}

.page-header > div:first-child,
.chat-header > div:first-child {
    min-width: 0;
}

.page-header h1,
.page-header p,
.chat-header h1,
.chat-header p,
.panel-heading h2,
.card-heading-row strong,
.card-heading-row small {
    overflow-wrap: anywhere;
}

.inline-form,
.project-selector {
    align-items: center;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form > input,
.inline-form > select,
.project-selector > select {
    flex: 1 1 220px;
}

.sidebar-nav a,
.sidebar-secondary a {
    min-width: 0;
}

.sidebar-nav a > span:not(.nav-unread-badge),
.sidebar-secondary a > span:not(.nav-unread-badge) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-unread-badge,
.channel-unread-badge {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    color: #fff;
    background: var(--blue);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.nav-unread-badge {
    margin-left: auto;
}

.nav-unread-badge[hidden],
.channel-unread-badge[hidden] {
    display: none;
}

.chat-shell {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    height: clamp(540px, calc(100dvh - 170px), 780px);
    min-height: 0;
}

.chat-channels {
    min-width: 0;
}

.chat-channels > a {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    min-width: 0;
}

.chat-channel-label {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.chat-channel-label > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presence-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border: 1px solid #6a6d74;
    border-radius: 50%;
    background: #3f4248;
}

.presence-dot.is-online {
    border-color: #40d88a;
    background: #28c779;
    box-shadow: 0 0 0 3px rgb(40 199 121 / 12%);
}

.chat-header {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.chat-header-tools,
.chat-presence-list,
.chat-message-actions {
    align-items: center;
    display: flex;
}

.chat-header-tools {
    gap: 9px;
    flex: 0 0 auto;
}

.chat-presence-list {
    min-width: 34px;
    padding-left: 8px;
}

.chat-presence-avatar {
    position: relative;
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: -8px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    color: #b9bdc7;
    background: #34373e;
    font-size: 8px;
    font-weight: 800;
}

.chat-presence-avatar::after {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 7px;
    height: 7px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: #555861;
    content: "";
}

.chat-presence-avatar.is-online::after {
    background: #28c779;
}

.chat-sound-toggle {
    position: relative;
}

.chat-sound-toggle.is-muted {
    color: var(--muted);
    opacity: .72;
}

.chat-sound-toggle.is-muted::after {
    position: absolute;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
    transform: rotate(-45deg);
}

.chat-messages {
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.chat-message {
    align-items: flex-start;
    min-width: 0;
}

.chat-message.is-own {
    flex-direction: row-reverse;
}

.chat-message-content {
    width: fit-content;
    max-width: min(78%, 720px);
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 4px 13px 13px;
    background: var(--surface-2);
}

.chat-message.is-own .chat-message-content {
    border-color: rgb(47 123 255 / 35%);
    border-radius: 13px 4px 13px 13px;
    background: var(--blue-soft);
}

.chat-message.is-own .chat-message-content > strong,
.chat-message.is-own .chat-message-content > p {
    text-align: right;
}

.chat-message-content p {
    max-width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message-content .button {
    max-width: 100%;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-actions {
    gap: 10px;
    justify-content: space-between;
    margin-top: 6px;
}

.message-delivery {
    color: #8fb6ff !important;
}

.chat-compose {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
}

.chat-compose textarea {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 54px;
    max-height: 180px;
    resize: vertical;
}

.chat-compose input[type="file"] {
    width: 100%;
}

.chat-compose details {
    max-width: 240px;
}

.chat-compose-status {
    min-width: 100px;
    color: var(--muted);
    font-size: 10px;
    text-align: right;
}

.chat-live-toasts {
    position: fixed;
    z-index: 80;
    top: 18px;
    right: 18px;
    display: grid;
    gap: 9px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}

.chat-live-toast {
    display: grid;
    gap: 3px;
    padding: 13px 15px;
    border: 1px solid #3f68aa;
    border-radius: 11px;
    color: var(--text);
    background: rgb(27 34 49 / 96%);
    box-shadow: 0 18px 50px rgb(0 0 0 / 35%);
    pointer-events: auto;
    text-decoration: none;
    animation: chat-toast-in .2s ease-out;
}

.chat-live-toast:hover {
    border-color: var(--blue);
    background: rgb(31 43 65 / 98%);
}

.chat-live-toast strong {
    font-size: 12px;
}

.chat-live-toast span {
    overflow: hidden;
    color: #b9c2d4;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes chat-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1180px) {
    .detail-grid-sidebar,
    .posts-layout {
        grid-template-columns: 1fr;
    }

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

    .chat-shell {
        grid-template-columns: minmax(210px, 235px) minmax(0, 1fr);
    }
}

@media (max-width: 980px) {
    .client-grid,
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-grid,
    .card-stats,
    .project-summary dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chat-header-tools .button {
        display: none;
    }

    .chat-compose {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .chat-compose input[type="file"],
    .chat-compose-status {
        grid-column: 1 / -1;
    }

    .chat-compose-status {
        text-align: left;
    }
}

@media (max-width: 760px) {
    .workspace-main {
        padding-right: max(14px, env(safe-area-inset-right));
        padding-left: max(14px, env(safe-area-inset-left));
    }

    .dashboard-grid,
    .detail-grid,
    .detail-grid-sidebar,
    .posts-layout,
    .form-grid,
    .detail-list-grid {
        grid-template-columns: 1fr;
    }

    .span-2,
    .span-full {
        grid-column: auto;
    }

    .page-actions,
    .header-actions {
        max-width: 100%;
    }

    .toolbar,
    .filters-row {
        width: 100%;
    }

    .chat-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        height: min(760px, calc(100dvh - 120px));
        min-height: 560px;
    }

    .chat-channels {
        display: flex;
        gap: 8px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        scroll-snap-type: x proximity;
    }

    .chat-channels form,
    .chat-channels h2 {
        display: none;
    }

    .chat-channels > a {
        flex: 0 0 auto;
        width: auto;
        max-width: min(230px, 72vw);
        border: 1px solid var(--border-soft);
        scroll-snap-align: start;
    }

    .chat-main {
        min-height: 0;
    }

    .chat-header {
        padding: 12px 14px;
    }

    .chat-presence-list {
        display: none;
    }

    .chat-messages {
        padding: 15px 12px;
    }

    .chat-compose {
        margin: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
    }
}

@media (max-width: 600px) {
    .workspace-main {
        padding-top: calc(72px + env(safe-area-inset-top));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
        padding-left: max(12px, env(safe-area-inset-left));
    }

    .page-header {
        gap: 12px;
    }

    .page-header h1 {
        font-size: clamp(23px, 8vw, 28px);
    }

    .header-actions,
    .page-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header-actions .button,
    .page-actions .button,
    .header-actions button,
    .page-actions button {
        min-height: 44px;
    }

    .metric-grid,
    .dashboard-metric-grid,
    .client-grid,
    .project-grid,
    .card-stats,
    .project-summary dl {
        grid-template-columns: 1fr;
    }

    .panel,
    .metric-card,
    .client-card,
    .project-card {
        padding: 15px;
    }

    .task-row,
    .deadline-row,
    .post-compact,
    .activity-row,
    .session-row {
        width: 100%;
    }

    .inline-form,
    .project-selector {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form > *,
    .project-selector > * {
        width: 100%;
        flex-basis: auto;
    }

    .responsive-table td {
        grid-template-columns: minmax(86px, 31%) minmax(0, 1fr);
    }

    .modal-card {
        overflow-x: hidden;
    }

    .chat-shell {
        height: min(760px, calc(100dvh - 96px));
        min-height: 590px;
    }

    .chat-header h1 {
        max-width: 58vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-message-content {
        max-width: calc(100% - 42px);
    }

    .chat-message .avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .chat-compose {
        grid-template-columns: 1fr;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .chat-compose textarea,
    .chat-compose input[type="file"],
    .chat-compose details,
    .chat-compose-status,
    .chat-compose .button {
        grid-column: auto;
        width: 100%;
        max-width: none;
    }

    .chat-compose-status {
        min-height: 14px;
    }
}

@media (max-width: 430px) {
    .header-actions,
    .page-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-form,
    .dashboard-filter-actions {
        grid-template-columns: 1fr;
    }

    .responsive-table td {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        text-align: left;
    }

    .responsive-table td > *,
    .responsive-table .person-cell,
    .responsive-table .file-name {
        width: 100%;
        justify-self: stretch;
    }

    .responsive-table td.table-actions form {
        width: 100%;
    }

    .preference-heading,
    .preference-row {
        grid-template-columns: minmax(0, 1fr) 48px 48px;
        font-size: 10px;
    }

    .chat-shell {
        margin-right: -12px;
        margin-left: -12px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .chat-header {
        align-items: flex-start;
    }

    .chat-header h1 {
        max-width: 64vw;
    }

    .chat-header p {
        max-width: 68vw;
    }

    .chat-live-toasts {
        top: max(10px, env(safe-area-inset-top));
        right: 10px;
        width: calc(100vw - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-messages {
        scroll-behavior: auto;
    }

    .chat-live-toast {
        animation: none;
    }
}

/* ========================================================================== 
   Chat workspace — organização, presença e formatação (v1.3.1)
   ========================================================================== */

.chat-page-heading {
    margin-bottom: 16px;
}

.chat-shell {
    display: grid;
    grid-template-columns: minmax(280px, 310px) minmax(0, 1fr);
    height: clamp(620px, calc(100dvh - 176px), 860px);
    min-height: 620px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #17191c;
    box-shadow: 0 18px 55px rgb(0 0 0 / 18%);
}

.chat-channels {
    display: flex;
    min-width: 0;
    max-height: none;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-right: 1px solid var(--border);
    background: #16181a;
}

.chat-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
    padding: 15px 16px 10px;
}

.chat-sidebar-heading strong,
.chat-sidebar-heading small {
    display: block;
}

.chat-sidebar-heading strong {
    font-size: 14px;
}

.chat-sidebar-heading small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
}

.chat-search {
    flex: 0 0 auto;
    margin: 0 12px 10px;
    background: #1e2023;
}

.chat-search input {
    min-width: 0;
}

.chat-channel-nav {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 8px 14px;
    scrollbar-width: thin;
}

.chat-channel-section + .chat-channel-section {
    margin-top: 13px;
}

.chat-channel-section h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 8px 6px;
    color: #777c86;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.chat-channel-section h2 small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    color: #8e939d;
    background: #202226;
    font-size: 8px;
    letter-spacing: 0;
}

.chat-channel-item {
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #b7bbc4;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.chat-channel-item + .chat-channel-item {
    margin-top: 2px;
}

.chat-channel-item:hover {
    color: #fff;
    border-color: #2f3339;
    background: #202328;
}

.chat-channel-item.is-active {
    color: #fff;
    border-color: rgb(77 143 247 / 30%);
    background: linear-gradient(135deg, rgb(77 143 247 / 19%), rgb(77 143 247 / 9%));
}

.chat-channel-item.has-unread:not(.is-active) {
    background: rgb(255 255 255 / 2.5%);
}

.chat-channel-avatar,
.chat-active-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid #373b43;
    border-radius: 11px;
    color: #d9dce3;
    background: linear-gradient(145deg, #30343b, #25282d);
    font-weight: 800;
}

.chat-channel-avatar {
    width: 39px;
    height: 39px;
    font-size: 10px;
}

.chat-channel-avatar.is-channel {
    color: #8db8ff;
    background: #202a3a;
}

.chat-channel-avatar .presence-dot,
.chat-active-avatar .presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border: 2px solid #16181a;
}

.chat-channel-copy,
.chat-channel-topline,
.chat-channel-bottomline {
    min-width: 0;
}

.chat-channel-copy {
    display: grid;
    gap: 2px;
}

.chat-channel-topline,
.chat-channel-bottomline {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-channel-topline strong {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-channel-topline time {
    margin-left: auto;
    color: #747984;
    font-size: 8px;
    white-space: nowrap;
}

.chat-channel-bottomline > span:first-child {
    min-width: 0;
    overflow: hidden;
    color: #7f848e;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-channel-item.has-unread .chat-channel-bottomline > span:first-child,
.chat-channel-item.has-unread .chat-channel-topline strong {
    color: #e7eaf0;
}

.chat-channel-bottomline .channel-unread-badge {
    min-width: 18px;
    height: 18px;
    margin-left: auto;
    padding: 0 5px;
    font-size: 8px;
}

.chat-official-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border-radius: 50%;
    color: #fff;
    background: var(--blue);
    font-size: 8px;
    font-weight: 900;
}

.chat-main {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #1b1d20;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: rgb(29 31 34 / 96%);
}

.chat-active-channel {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 11px;
}

.chat-active-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #9bc0ff;
    background: #222b39;
    font-size: 11px;
}

.chat-active-avatar .presence-dot {
    border-color: #1d1f22;
}

.chat-active-channel > div {
    min-width: 0;
}

.chat-active-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 7px;
}

.chat-active-title h1 {
    max-width: min(52vw, 520px);
    margin: 0;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-active-channel p {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 2px 0 0;
    color: #858a94;
    font-size: 9px;
}

.chat-direct-status .presence-dot {
    width: 7px;
    height: 7px;
    border-width: 0;
}

.chat-direct-status.is-online {
    color: #6cdfa7;
}

.chat-official-label {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 6px;
    border: 1px solid rgb(77 143 247 / 28%);
    border-radius: 999px;
    color: #91bbff;
    background: rgb(77 143 247 / 10%);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.chat-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.chat-presence-list {
    display: flex;
    align-items: center;
    min-width: 0;
    padding-left: 8px;
}

.chat-presence-avatar,
.chat-presence-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    margin-left: -8px;
    border: 2px solid #1d1f22;
    border-radius: 50%;
    color: #b9bdc7;
    background: #34373e;
    font-size: 8px;
    font-weight: 800;
}

.chat-presence-avatar {
    position: relative;
}

.chat-presence-more {
    color: #9aa0aa;
    background: #25282d;
}

.chat-search-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 18px;
    border-bottom: 1px solid var(--border-soft);
    color: #aeb3bd;
    background: #1e2228;
    font-size: 10px;
}

.chat-search-result-bar a {
    font-weight: 700;
}

.chat-message-region {
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.chat-messages {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px clamp(16px, 2.4vw, 34px) 26px;
    background:
        radial-gradient(circle at 70% -10%, rgb(77 143 247 / 5%), transparent 34%),
        #1b1d20;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.chat-day-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 20px;
    color: #757a84;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.chat-day-divider::before,
.chat-day-divider::after {
    height: 1px;
    flex: 1;
    background: #2c2f34;
    content: "";
}

.chat-day-divider span {
    padding: 4px 8px;
    border: 1px solid #30343a;
    border-radius: 999px;
    background: #1f2125;
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    min-width: 0;
    margin: 0 0 17px;
    transition: background-color .2s ease;
}

.chat-message.is-own {
    flex-direction: row-reverse;
}

.chat-message.is-highlighted {
    margin-right: -8px;
    margin-left: -8px;
    padding: 8px;
    border-radius: 12px;
    background: rgb(77 143 247 / 10%);
}

.chat-message-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid #3b3f46;
    background: #2d3137;
    font-size: 9px;
}

.chat-message-stack {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    min-width: 0;
    max-width: min(76%, 760px);
}

.chat-message.is-own .chat-message-stack {
    align-items: flex-end;
}

.chat-message-meta {
    display: flex;
    align-items: baseline;
    gap: 7px;
    max-width: 100%;
    margin: 0 4px 4px;
}

.chat-message.is-own .chat-message-meta {
    flex-direction: row-reverse;
}

.chat-message-meta strong {
    overflow: hidden;
    color: #dfe2e8;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-meta time {
    color: #6f747e;
    font-size: 8px;
    white-space: nowrap;
}

.chat-message-content {
    width: auto;
    max-width: 100%;
    min-width: 72px;
    padding: 10px 12px;
    border: 1px solid #34383e;
    border-radius: 5px 13px 13px 13px;
    color: #d2d5db;
    background: #25282c;
    box-shadow: 0 5px 15px rgb(0 0 0 / 8%);
}

.chat-message.is-own .chat-message-content {
    border-color: rgb(77 143 247 / 38%);
    border-radius: 13px 5px 13px 13px;
    color: #eaf2ff;
    background: linear-gradient(145deg, #214572, #1c3960);
}

.chat-message-content blockquote {
    display: grid;
    gap: 2px;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 7px 9px;
    overflow: hidden;
    border: 0;
    border-left: 2px solid #6ba4ff;
    border-radius: 5px;
    color: #aeb9cc;
    background: rgb(0 0 0 / 14%);
}

.chat-message-content blockquote small {
    color: #85b3ff;
    font-size: 8px;
    font-weight: 700;
}

.chat-message-content blockquote span {
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-text {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.55;
    text-align: left;
    word-break: break-word;
}

.chat-text-line + .chat-text-line {
    margin-top: 1px;
}

.chat-text-spacer {
    height: 8px;
}

.chat-message-text ul,
.chat-message-text ol {
    margin: 5px 0 5px 18px;
    padding: 0;
}

.chat-message-text li + li {
    margin-top: 2px;
}

.chat-message-text code {
    display: inline-block;
    max-width: 100%;
    padding: 1px 5px;
    overflow-wrap: anywhere;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 4px;
    color: #f2c98c;
    background: rgb(0 0 0 / 22%);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .92em;
}

.chat-message-text a {
    color: #8fbcff;
    text-decoration: underline;
    text-decoration-color: rgb(143 188 255 / 45%);
    text-underline-offset: 2px;
}

.chat-text-quote {
    margin: 3px 0;
    padding: 4px 8px;
    border-left: 2px solid #77849a;
    color: #adb5c3;
    background: rgb(0 0 0 / 10%);
}

.chat-mention {
    display: inline;
    padding: 1px 3px;
    border-radius: 4px;
    color: #a9caff;
    background: rgb(77 143 247 / 17%);
    font-weight: 700;
}

.chat-attachments {
    display: grid;
    gap: 6px;
    margin-top: 9px;
}

.chat-attachment {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 190px;
    max-width: 360px;
    padding: 7px 9px;
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 8px;
    color: inherit;
    background: rgb(0 0 0 / 13%);
}

.chat-attachment:hover {
    color: #fff;
    border-color: rgb(143 188 255 / 40%);
    background: rgb(0 0 0 / 20%);
}

.chat-attachment > span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    color: #8fbcff;
    background: rgb(77 143 247 / 14%);
}

.chat-attachment strong,
.chat-attachment small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-attachment strong {
    font-size: 9px;
}

.chat-attachment small {
    margin-top: 1px;
    color: #858b96;
    font-size: 8px;
}

.chat-message-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 17px;
    margin: 3px 4px 0;
    opacity: .72;
    transition: opacity .15s ease;
}

.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions {
    opacity: 1;
}

.chat-message.is-own .chat-message-actions {
    flex-direction: row-reverse;
}

.chat-message-actions .button-link,
.chat-message-actions small {
    font-size: 8px;
}

.message-delivery {
    color: #8fb6ff !important;
}

.chat-empty-state {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 100%;
    padding: 40px;
    text-align: center;
}

.chat-empty-state strong {
    margin-top: 10px;
    font-size: 13px;
}

.chat-empty-state p {
    margin: 3px 0 0;
    font-size: 10px;
}

.chat-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid #343944;
    border-radius: 15px;
    color: #82b1ff;
    background: #202837;
}

.chat-jump-latest {
    position: absolute;
    z-index: 4;
    right: 20px;
    bottom: 14px;
    padding: 7px 11px;
    border: 1px solid rgb(77 143 247 / 45%);
    border-radius: 999px;
    color: #eaf2ff;
    background: #275caa;
    box-shadow: 0 10px 25px rgb(0 0 0 / 28%);
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
}

.chat-compose {
    display: block;
    margin: 0;
    padding: 10px 14px 12px;
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: #1c1e21;
}

.chat-reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 7px 9px;
    border-left: 2px solid var(--blue);
    border-radius: 5px;
    color: #aeb4bf;
    background: #22262d;
    font-size: 9px;
}

.chat-reply-preview[hidden] {
    display: none;
}

.chat-reply-preview button {
    display: inline-flex;
    padding: 2px;
    border: 0;
    color: #8a909a;
    background: transparent;
    cursor: pointer;
}

.chat-format-toolbar {
    display: flex;
    align-items: center;
    gap: 3px;
    min-height: 30px;
    padding: 0 4px 5px;
    overflow: visible;
}

.chat-format-toolbar > button,
.chat-mention-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 27px;
    height: 27px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #9197a2;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    list-style: none;
}

.chat-format-toolbar > button:hover,
.chat-mention-menu > summary:hover,
.chat-mention-menu[open] > summary {
    color: #dce6f7;
    border-color: #343a43;
    background: #252930;
}

.chat-format-toolbar > button strong,
.chat-format-toolbar > button em {
    color: inherit;
    font-size: 11px;
}

.chat-toolbar-separator {
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: #33363b;
}

.chat-mention-menu {
    position: relative;
    min-width: 0;
    max-width: none;
}

.chat-mention-menu > summary::-webkit-details-marker {
    display: none;
}

.chat-mention-menu > summary {
    gap: 4px;
    width: auto;
    font-weight: 700;
}

.chat-mention-menu > summary span {
    color: #8db8ff;
    font-size: 13px;
}

.chat-mention-popover {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 7px);
    left: 0;
    width: min(310px, calc(100vw - 42px));
    max-height: 330px;
    padding: 12px;
    overflow-y: auto;
    border: 1px solid #3a3f48;
    border-radius: 11px;
    background: #202328;
    box-shadow: 0 18px 45px rgb(0 0 0 / 40%);
}

.chat-mention-popover > strong,
.chat-mention-popover > small {
    display: block;
}

.chat-mention-popover > strong {
    font-size: 11px;
}

.chat-mention-popover > small {
    margin: 2px 0 9px;
    color: var(--muted);
    font-size: 9px;
}

.chat-mention-popover .checkbox-grid {
    display: grid;
    gap: 3px;
}

.chat-mention-popover .check-row {
    display: grid;
    grid-template-columns: auto 25px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 6px;
    border-radius: 7px;
}

.chat-mention-popover .check-row:hover {
    background: #292d33;
}

.chat-mention-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    color: #c7d9f7;
    background: #34445c;
    font-size: 7px;
    font-weight: 800;
}

.chat-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 9px;
    padding: 7px 7px 7px 12px;
    border: 1px solid #373b42;
    border-radius: 11px;
    background: #23262a;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.chat-editor-row:focus-within {
    border-color: rgb(77 143 247 / 65%);
    box-shadow: 0 0 0 3px rgb(77 143 247 / 9%);
}

.chat-compose textarea,
.chat-editor-row textarea {
    grid-column: auto;
    width: 100%;
    min-height: 42px;
    max-height: 180px;
    padding: 10px 0 8px;
    resize: none;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    color: #e4e7ec;
    background: transparent;
    box-shadow: none;
    line-height: 1.45;
}

.chat-compose textarea::placeholder {
    color: #777d88;
}

.chat-compose textarea:focus {
    outline: 0;
}

.chat-send-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 92px;
    height: 38px;
    padding: 0 12px;
}

.chat-compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 27px;
    padding: 7px 4px 0;
}

.chat-file-control {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 7px;
}

.chat-file-control input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.chat-file-control label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    color: #969ca7;
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
}

.chat-file-control label:hover {
    color: #b8d1fb;
}

.chat-file-control > span {
    max-width: min(24vw, 260px);
    overflow: hidden;
    color: #6f7580;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-file-control > span.has-file {
    color: #9bbbf0;
}

.chat-compose-hints {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: #6f7580;
    font-size: 8px;
    white-space: nowrap;
}

.chat-compose-status {
    min-width: 0;
    color: #9cbef6;
    font-size: inherit;
    text-align: right;
}

@media (max-width: 1180px) {
    .chat-shell {
        grid-template-columns: minmax(250px, 280px) minmax(0, 1fr);
    }

    .chat-message-stack {
        max-width: 82%;
    }

    .chat-compose-hints > span:last-child {
        display: none;
    }
}

@media (max-width: 820px) {
    .chat-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        height: min(820px, calc(100dvh - 125px));
        min-height: 610px;
    }

    .chat-channels {
        display: block;
        max-height: 118px;
        padding: 9px;
        overflow: hidden;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .chat-sidebar-heading,
    .chat-search {
        display: none;
    }

    .chat-channel-nav {
        display: flex;
        gap: 8px;
        height: 100%;
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
    }

    .chat-channel-section,
    .chat-channel-section + .chat-channel-section {
        display: flex;
        gap: 8px;
        margin: 0;
    }

    .chat-channel-section h2 {
        display: none;
    }

    .chat-channel-item,
    .chat-channel-item + .chat-channel-item {
        width: min(235px, 72vw);
        flex: 0 0 auto;
        margin: 0;
        scroll-snap-align: start;
    }

    .chat-main {
        min-height: 0;
    }
}

@media (max-width: 600px) {
    .chat-page-heading {
        margin-bottom: 12px;
    }

    .chat-shell {
        height: min(800px, calc(100dvh - 98px));
        min-height: 600px;
        margin-right: -12px;
        margin-left: -12px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .chat-channels {
        max-height: 105px;
    }

    .chat-channel-item {
        width: min(215px, 76vw);
        grid-template-columns: 34px minmax(0, 1fr);
        padding: 7px 8px;
    }

    .chat-channel-avatar {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .chat-header {
        min-height: 62px;
        padding: 10px 12px;
    }

    .chat-active-avatar {
        width: 38px;
        height: 38px;
    }

    .chat-active-title h1 {
        max-width: 47vw;
        font-size: 13px;
    }

    .chat-presence-list,
    .chat-header-tools .button {
        display: none;
    }

    .chat-messages {
        padding: 15px 11px 22px;
    }

    .chat-message {
        gap: 7px;
        margin-bottom: 15px;
    }

    .chat-message-avatar {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .chat-message-stack {
        max-width: calc(100% - 37px);
    }

    .chat-message-content {
        min-width: 58px;
        padding: 9px 10px;
    }

    .chat-message-text {
        font-size: 10px;
    }

    .chat-message-meta time {
        display: none;
    }

    .chat-attachment {
        min-width: 0;
        width: min(250px, 64vw);
    }

    .chat-compose {
        padding: 8px 9px calc(9px + env(safe-area-inset-bottom));
    }

    .chat-format-toolbar {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: none;
    }

    .chat-editor-row {
        gap: 6px;
        padding-left: 10px;
    }

    .chat-send-button {
        min-width: 42px;
        width: 42px;
        padding: 0;
    }

    .chat-send-button > span {
        display: none;
    }

    .chat-compose-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .chat-file-control,
    .chat-compose-hints {
        width: 100%;
    }

    .chat-file-control > span {
        max-width: 58vw;
    }

    .chat-compose-hints {
        justify-content: space-between;
    }

    .chat-compose-hints > span:last-child {
        display: none;
    }

    .chat-mention-popover {
        position: fixed;
        right: 12px;
        bottom: calc(108px + env(safe-area-inset-bottom));
        left: 12px;
        width: auto;
        max-height: 48vh;
    }

    .chat-jump-latest {
        right: 12px;
        bottom: 10px;
    }
}

@media (max-width: 390px) {
    .chat-active-title h1 {
        max-width: 43vw;
    }

    .chat-format-toolbar > button,
    .chat-mention-menu > summary {
        padding: 0 6px;
    }

    .chat-mention-menu > summary {
        font-size: 0;
    }

    .chat-mention-menu > summary span {
        font-size: 13px;
    }
}

/* Correções de compatibilidade com regras legadas do composer. */
.chat-compose .chat-mention-menu {
    width: auto;
    min-width: 0;
    max-width: none;
}


/* ========================================================================== 
   Chat workspace — tela cheia e composer fixo (v1.3.3)
   ========================================================================== */

body.workspace-page-chat {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.workspace-main-chat {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    flex-direction: column;
    padding: 26px clamp(18px, 2.2vw, 34px) 0;
    overflow: hidden;
}

.workspace-main-chat > .flash {
    flex: 0 0 auto;
}

.workspace-main-chat .chat-page-heading {
    flex: 0 0 auto;
    margin-bottom: 13px;
}

.workspace-main-chat .chat-shell {
    width: 100%;
    height: 0;
    min-height: 0;
    flex: 1 1 0;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.workspace-main-chat .chat-channels,
.workspace-main-chat .chat-main {
    min-height: 0;
    max-height: 100%;
}

.workspace-main-chat .chat-main {
    display: flex;
    height: auto;
    flex-direction: column;
    overflow: hidden;
}

.workspace-main-chat .chat-header {
    position: relative;
    z-index: 12;
}

.workspace-main-chat .chat-message-region {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.workspace-main-chat .chat-messages {
    height: 100%;
    min-height: 0;
    padding-bottom: 32px;
    overflow-y: auto;
}

.workspace-main-chat .chat-compose {
    position: relative;
    z-index: 14;
    bottom: auto;
    width: 100%;
    min-height: 0;
    flex: 0 0 auto;
    border-top-color: #30343a;
    background: rgb(28 30 33 / 98%);
    box-shadow: 0 -16px 34px rgb(0 0 0 / 15%);
    backdrop-filter: blur(14px);
}

.workspace-main-chat .chat-editor-row {
    background: #24272c;
}

@media (max-width: 1000px) {
    .workspace-main-chat {
        padding-right: max(16px, env(safe-area-inset-right));
        padding-left: max(16px, env(safe-area-inset-left));
    }
}

@media (max-width: 820px) {
    .workspace-main-chat {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        padding-top: calc(72px + env(safe-area-inset-top));
        padding-right: max(14px, env(safe-area-inset-right));
        padding-bottom: 0;
        padding-left: max(14px, env(safe-area-inset-left));
    }

    .workspace-main-chat .chat-page-heading {
        margin-bottom: 10px;
    }

    .workspace-main-chat .chat-shell {
        height: 0;
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .workspace-main-chat {
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
    }

    .workspace-main-chat .chat-page-heading {
        align-items: center;
        gap: 9px;
        margin-bottom: 9px;
    }

    .workspace-main-chat .chat-page-heading p {
        display: none;
    }

    .workspace-main-chat .chat-shell {
        width: calc(100% + 24px);
        height: 0;
        min-height: 0;
        margin-right: -12px;
        margin-left: -12px;
        border-top: 1px solid var(--border);
    }

    .workspace-main-chat .chat-compose {
        padding-bottom: calc(9px + env(safe-area-inset-bottom));
    }
}

/* ========================================================================== 
   Chat workspace — área total e autocomplete de menções (v1.3.4)
   ========================================================================== */

/* A página inteira passa a ser a moldura do chat. O espaçamento fica apenas
   no cabeçalho, eliminando a sensação de uma janela dentro de outra. */
.workspace-main-chat {
    padding: 0;
    background: #151719;
}

.workspace-main-chat .chat-page-heading {
    min-height: 86px;
    margin: 0;
    padding: 23px clamp(24px, 2.4vw, 34px) 14px;
    background: #151719;
}

.workspace-main-chat .chat-shell {
    border-top: 1px solid var(--border);
}

.workspace-main-chat .chat-channels {
    border-left: 0;
}

.workspace-main-chat .chat-main {
    border-right: 0;
}

/* Lista automática exibida ao digitar @ no editor. */
.chat-editor-row {
    position: relative;
    overflow: visible;
}

.chat-mention-suggestions {
    position: absolute;
    z-index: 40;
    bottom: calc(100% + 9px);
    left: 0;
    width: min(370px, calc(100vw - var(--sidebar-width) - 360px));
    min-width: 280px;
    max-height: min(380px, 46vh);
    overflow: hidden;
    border: 1px solid #3b414b;
    border-radius: 13px;
    background: #202328;
    box-shadow: 0 22px 55px rgb(0 0 0 / 45%);
}

.chat-mention-suggestions-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #30343b;
    background: #1d2024;
}

.chat-mention-suggestions-heading strong {
    font-size: 10px;
}

.chat-mention-suggestions-heading small {
    color: #777e89;
    font-size: 8px;
    white-space: nowrap;
}

.chat-mention-suggestions-list {
    max-height: min(320px, 39vh);
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.chat-mention-suggestion {
    width: 100%;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #d8dce4;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.chat-mention-suggestion:hover,
.chat-mention-suggestion.is-active,
.chat-mention-suggestion[aria-selected="true"] {
    border-color: rgb(77 143 247 / 35%);
    background: rgb(77 143 247 / 14%);
}

.chat-mention-suggestion-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #3c4553;
    border-radius: 10px;
    color: #c5dafb;
    background: #2b3647;
    font-size: 8px;
    font-weight: 800;
}

.chat-mention-suggestion-avatar .presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border: 2px solid #202328;
}

.chat-mention-suggestion-copy {
    min-width: 0;
}

.chat-mention-suggestion-copy strong,
.chat-mention-suggestion-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-mention-suggestion-copy strong {
    font-size: 10px;
}

.chat-mention-suggestion-copy small {
    margin-top: 1px;
    color: #858c97;
    font-size: 8px;
}

.chat-mention-suggestion-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    color: #8fb8fb;
    background: rgb(77 143 247 / 10%);
    font-size: 12px;
    font-weight: 800;
}

.chat-mention-no-results {
    margin: 0;
    padding: 16px 12px;
    color: #858b95;
    font-size: 9px;
    text-align: center;
}

@media (max-width: 1000px) {
    .chat-mention-suggestions {
        width: min(350px, calc(100vw - 330px));
    }
}

@media (max-width: 820px) {
    .workspace-main-chat {
        padding: calc(72px + env(safe-area-inset-top)) 0 0;
    }

    .workspace-main-chat .chat-page-heading {
        min-height: 0;
        padding: 0 max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
    }

    .workspace-main-chat .chat-shell {
        width: 100%;
        margin: 0;
    }

    .chat-mention-suggestions {
        width: min(360px, calc(100vw - 38px));
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .workspace-main-chat .chat-page-heading {
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
    }

    .workspace-main-chat .chat-shell {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
    }

    .chat-mention-suggestions {
        position: fixed;
        z-index: 60;
        right: 10px;
        bottom: calc(108px + env(safe-area-inset-bottom));
        left: 10px;
        width: auto;
        max-height: min(360px, 50vh);
    }

    .chat-mention-suggestions-heading small {
        display: none;
    }
}

/* ========================================================================== 
   Workspace — refinamento visual geral e chat fluido (v1.4.0)
   ========================================================================== */

/* Mantém a linguagem visual atual, mas organiza melhor a hierarquia das telas. */
.workspace-page:not(.workspace-page-chat) .workspace-main {
    background:
        radial-gradient(circle at 94% 4%, rgb(77 143 247 / 7%), transparent 25%),
        linear-gradient(180deg, rgb(255 255 255 / 1.2%), transparent 180px);
}

.workspace-main:not(.workspace-main-chat) {
    padding-top: 34px;
}

.workspace-main:not(.workspace-main-chat) > .page-header {
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.workspace-main:not(.workspace-main-chat) > .page-header h1 {
    margin-bottom: 2px;
}

.workspace-main:not(.workspace-main-chat) > .page-header p {
    max-width: 760px;
    margin-top: 5px;
    margin-bottom: 0;
}

.workspace-main:not(.workspace-main-chat) > .page-header .header-actions,
.workspace-main:not(.workspace-main-chat) > .page-header > .button,
.workspace-main:not(.workspace-main-chat) > .page-header > a.button {
    flex: 0 0 auto;
}

.workspace-main:not(.workspace-main-chat) > .metric-grid,
.workspace-main:not(.workspace-main-chat) > .toolbar,
.workspace-main:not(.workspace-main-chat) > .filters-row,
.workspace-main:not(.workspace-main-chat) > .tabs,
.workspace-main:not(.workspace-main-chat) > .panel,
.workspace-main:not(.workspace-main-chat) > .table-card,
.workspace-main:not(.workspace-main-chat) > .dashboard-grid,
.workspace-main:not(.workspace-main-chat) > .detail-grid,
.workspace-main:not(.workspace-main-chat) > .client-grid,
.workspace-main:not(.workspace-main-chat) > .project-grid,
.workspace-main:not(.workspace-main-chat) > .posts-layout,
.workspace-main:not(.workspace-main-chat) > .kanban-board,
.workspace-main:not(.workspace-main-chat) > .stage-track {
    position: relative;
}

.metric-card,
.panel,
.client-card,
.project-card,
.table-card,
.stage-track,
.kanban-column,
.role-summary-card,
.role-permission-card {
    border-color: #303338;
    background: linear-gradient(180deg, rgb(31 33 36 / 98%), rgb(27 29 32 / 98%));
    box-shadow: 0 14px 34px rgb(0 0 0 / 10%);
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    position: absolute;
    right: 18px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    border: 1px solid rgb(77 143 247 / 12%);
    border-radius: 50%;
    background: rgb(77 143 247 / 4%);
    content: "";
    pointer-events: none;
}

.metric-card > strong,
.metric-card > span,
.metric-card > small {
    position: relative;
    z-index: 1;
}

.panel-heading {
    min-height: 34px;
}

.panel-heading > div:first-child {
    min-width: 0;
}

.panel-heading p {
    margin: 4px 0 0;
}

.toolbar {
    padding: 14px;
    border-color: #30343a;
    background: linear-gradient(180deg, #191b1e, #17191b);
    box-shadow: 0 10px 26px rgb(0 0 0 / 8%);
}

.toolbar .button,
.filters-row .button,
.header-actions .button {
    white-space: nowrap;
}

input,
select,
textarea {
    border-color: #35383e;
    background: #202225;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #41454d;
}

.table-card {
    border-radius: 13px;
}

.table-scroll {
    scrollbar-gutter: stable;
}

.table-card thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    background: #181a1d;
    box-shadow: inset 0 -1px 0 var(--border-soft);
}

.table-card tbody tr {
    transition: background-color .15s ease;
}

.table-card tbody tr:hover {
    background: rgb(77 143 247 / 4%);
}

.table-card td:first-child,
.table-card th:first-child {
    padding-left: 18px;
}

.table-card td:last-child,
.table-card th:last-child {
    padding-right: 18px;
}

.client-card,
.project-card {
    border-radius: 13px;
}

.client-card:hover,
.project-card:hover {
    border-color: rgb(77 143 247 / 34%);
    box-shadow: 0 16px 36px rgb(0 0 0 / 18%);
}

.task-row,
.deadline-row,
.post-compact,
.activity-row {
    border-color: rgb(255 255 255 / 2%);
    background: #222428;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.task-row:hover,
.deadline-row:hover,
.activity-row:hover {
    border-color: #3a3e45;
    background: #25282d;
}

.tabs {
    gap: 4px;
}

.tabs > span,
.tabs > a,
.tabs label span {
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.tabs > a:hover,
.tabs label:hover span {
    color: #dce8fa;
    background: rgb(77 143 247 / 6%);
}

.button,
.icon-button {
    transition: transform .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.button:active,
.icon-button:active {
    transform: translateY(0) scale(.985);
}

.sidebar-nav a,
.sidebar-secondary a {
    position: relative;
}

.sidebar-nav a.is-active::before,
.sidebar-secondary a.is-active::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--blue);
    content: "";
}

.empty-state {
    border-radius: 10px;
}

.panel > .empty-state,
.table-card .empty-state {
    background: rgb(255 255 255 / 1.3%);
}

.modal-card {
    border-color: #383c43;
    background: linear-gradient(180deg, #232529, #1d1f22);
    box-shadow: 0 28px 80px rgb(0 0 0 / 48%);
}

.modal-heading {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}

.modal-actions {
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

/* O editor não perde a seleção nem desloca o histórico ao aplicar formatação. */
.chat-format-toolbar > button {
    touch-action: manipulation;
    user-select: none;
}

.chat-format-toolbar > button:active {
    transform: none;
}

.chat-editor-row textarea {
    overflow-anchor: none;
}

.chat-messages {
    overflow-anchor: auto;
    scrollbar-gutter: stable;
}

.chat-compose-status {
    min-height: 12px;
}

.chat-send-button {
    flex: 0 0 auto;
}

@media (max-width: 1000px) {
    .workspace-main:not(.workspace-main-chat) {
        padding-top: 28px;
    }

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

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

@media (max-width: 820px) {
    .workspace-main:not(.workspace-main-chat) > .page-header {
        align-items: flex-start;
    }

    .workspace-main:not(.workspace-main-chat) > .page-header .header-actions,
    .workspace-main:not(.workspace-main-chat) > .page-header > .button,
    .workspace-main:not(.workspace-main-chat) > .page-header > a.button {
        width: auto;
    }
}

@media (max-width: 600px) {
    .workspace-main:not(.workspace-main-chat) {
        padding-top: calc(76px + env(safe-area-inset-top));
    }

    .workspace-main:not(.workspace-main-chat) > .page-header {
        gap: 14px;
        margin-bottom: 17px;
        padding-bottom: 15px;
    }

    .workspace-main:not(.workspace-main-chat) > .page-header .header-actions,
    .workspace-main:not(.workspace-main-chat) > .page-header > .button,
    .workspace-main:not(.workspace-main-chat) > .page-header > a.button {
        width: 100%;
    }

    .workspace-main:not(.workspace-main-chat) > .page-header .header-actions .button,
    .workspace-main:not(.workspace-main-chat) > .page-header .header-actions form,
    .workspace-main:not(.workspace-main-chat) > .page-header .header-actions form .button {
        flex: 1 1 150px;
    }

    .metric-grid,
    .client-grid,
    .project-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 105px;
    }

    .panel,
    .client-card,
    .project-card {
        padding: 16px;
    }

    .toolbar {
        padding: 11px;
    }
}

.chat-text-line strong,
.chat-text-line em,
.chat-text-line code,
.chat-text-line .chat-mention {
    display: inline;
}

/* FluxUI Workspace v1.4.1 — histórico do chat e Drive funcional */
.chat-history-badge,
.chat-history-label {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 7px;
    border: 1px solid rgb(81 139 255 / 28%);
    border-radius: 999px;
    color: #8db7ff;
    background: rgb(64 128 255 / 9%);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.chat-channel-actions,
.drive-item-menu {
    position: relative;
}

.chat-channel-actions > summary,
.drive-item-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.chat-channel-actions > summary::-webkit-details-marker,
.drive-item-menu > summary::-webkit-details-marker {
    display: none;
}

.chat-channel-actions > summary {
    display: grid;
    place-items: center;
    letter-spacing: 2px;
    font-size: 11px;
}

.chat-channel-actions-menu,
.drive-item-menu > div {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 90;
    width: max-content;
    min-width: 190px;
    padding: 6px;
    border: 1px solid #393d45;
    border-radius: 12px;
    background: #202226;
    box-shadow: 0 18px 44px rgb(0 0 0 / 42%);
}

.chat-channel-actions-menu form,
.drive-item-menu form {
    display: contents;
}

.chat-channel-actions-menu button,
.drive-item-menu a,
.drive-item-menu button {
    display: flex;
    width: 100%;
    min-height: 36px;
    align-items: center;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    color: #d9dbe0;
    background: transparent;
    font: inherit;
    font-size: 12px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.chat-channel-actions-menu button:hover,
.drive-item-menu a:hover,
.drive-item-menu button:hover {
    color: #fff;
    background: rgb(255 255 255 / 6%);
}

.chat-channel-actions-menu .is-danger,
.drive-item-menu .is-danger {
    color: #ff929c;
}

.chat-history-banner,
.chat-readonly-composer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-top: 1px solid #30333a;
    border-bottom: 1px solid #30333a;
    color: #9ea5b2;
    background: rgb(76 124 220 / 7%);
    font-size: 12px;
}

.chat-history-banner strong,
.chat-readonly-composer strong {
    color: #e6e9ee;
}

.chat-history-banner svg,
.chat-readonly-composer svg {
    flex: 0 0 auto;
    color: #7faeff;
}

.chat-readonly-composer {
    margin-top: auto;
    min-height: 70px;
    border-bottom: 0;
    background: #1c1e22;
}

.drive-page-heading {
    margin-bottom: 18px;
}

.drive-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: calc(100dvh - 180px);
    overflow: visible;
    border: 1px solid #30343b;
    border-radius: 16px;
    background: #181a1e;
    box-shadow: 0 18px 50px rgb(0 0 0 / 16%);
}

.drive-sidebar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 22px;
    padding: 16px 12px;
    border-right: 1px solid #30343b;
    background: #17191c;
    border-radius: 16px 0 0 16px;
}

.drive-nav {
    display: grid;
    gap: 4px;
}

.drive-nav a {
    display: flex;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #aeb2bb;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.drive-nav a:hover {
    color: #fff;
    background: rgb(255 255 255 / 4%);
}

.drive-nav a.is-active {
    color: #eaf2ff;
    border-color: rgb(73 133 242 / 26%);
    background: rgb(67 126 228 / 16%);
}

.drive-nav a.is-danger.is-active {
    color: #ffc1c7;
    border-color: rgb(255 106 121 / 22%);
    background: rgb(255 92 108 / 10%);
}

.drive-storage-list {
    display: grid;
    gap: 14px;
    margin-top: auto;
    padding: 12px 8px 4px;
    border-top: 1px solid #2c3036;
}

.drive-storage-card {
    display: grid;
    gap: 8px;
}

.drive-storage-card > div {
    display: grid;
    gap: 2px;
}

.drive-storage-card strong {
    color: #d6d9df;
    font-size: 10px;
}

.drive-storage-card small {
    color: #777f8e;
    font-size: 9px;
}

.drive-storage-track {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #292d33;
}

.drive-storage-track i {
    display: block;
    width: var(--storage-progress);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #377be8, #68a0ff);
}

.drive-main {
    min-width: 0;
    padding: 18px;
}

.drive-topbar {
    display: grid;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2e3238;
}

.drive-breadcrumbs {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    color: #707887;
    font-size: 11px;
    overflow-x: auto;
    scrollbar-width: none;
}

.drive-breadcrumbs::-webkit-scrollbar {
    display: none;
}

.drive-breadcrumbs a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    color: #a9afbb;
    text-decoration: none;
}

.drive-breadcrumbs a:last-child {
    color: #fff;
    font-weight: 700;
}

.drive-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 150px minmax(170px, 220px) 150px auto;
    gap: 9px;
    align-items: center;
}

.drive-search {
    min-height: 42px;
}

.drive-filters select {
    min-width: 0;
    min-height: 42px;
}

.drive-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 2px 14px;
}

.drive-section-heading h2 {
    margin: 0;
    color: #f1f3f7;
    font-size: 16px;
}

.drive-section-heading p {
    margin: 4px 0 0;
    color: #777f8d;
    font-size: 10px;
}

.drive-folder-section {
    margin-bottom: 18px;
}

.drive-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.drive-folder-card {
    position: relative;
    display: grid;
    min-width: 0;
    gap: 11px;
    padding: 13px;
    border: 1px solid #30343b;
    border-radius: 13px;
    background: #1d1f23;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.drive-folder-card:hover {
    border-color: #455166;
    background: #202329;
    transform: translateY(-1px);
}

.drive-folder-link {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.drive-folder-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgb(73 136 255 / 25%);
    border-radius: 10px;
    color: #79aaff;
    background: rgb(55 116 224 / 12%);
}

.drive-folder-link > span:last-child {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.drive-folder-link strong,
.drive-file-primary strong,
.drive-file-location strong,
.drive-file-uploader strong {
    overflow: hidden;
    color: #e8ebf0;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-folder-link small,
.drive-file-primary small,
.drive-file-location small,
.drive-file-uploader small {
    overflow: hidden;
    color: #7d8593;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-folder-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #757d8a;
    font-size: 9px;
}

.drive-folder-meta > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-item-menu > summary {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
    color: #8d94a1;
    letter-spacing: 1px;
}

.drive-item-menu > summary:hover {
    color: #fff;
    background: rgb(255 255 255 / 5%);
}

.drive-file-list {
    overflow: visible;
    border: 1px solid #30343b;
    border-radius: 13px;
    background: #1b1d21;
}

.drive-file-list-head,
.drive-file-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.45fr) minmax(135px, .8fr) minmax(130px, .7fr) 125px 80px 92px;
    gap: 12px;
    align-items: center;
}

.drive-file-list-head {
    min-height: 39px;
    padding: 0 13px;
    border-bottom: 1px solid #30343b;
    color: #737b88;
    background: #1d2024;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 13px 13px 0 0;
}

.drive-file-row {
    min-height: 68px;
    padding: 10px 13px;
    border-bottom: 1px solid #292d33;
    transition: background .16s ease;
}

.drive-file-row:last-child {
    border-bottom: 0;
}

.drive-file-row:hover {
    background: rgb(255 255 255 / 2.2%);
}

.drive-file-primary,
.drive-file-location,
.drive-file-uploader {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.drive-file-primary > span:last-child,
.drive-file-location,
.drive-file-uploader {
    min-width: 0;
}

.drive-file-location,
.drive-file-uploader {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
}

.drive-file-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #343944;
    border-radius: 9px;
    color: #95a7c6;
    background: #22262c;
}

.drive-file-primary > span:last-child {
    display: grid;
    gap: 5px;
}

.drive-file-primary small {
    display: flex;
    align-items: center;
    gap: 6px;
}

.drive-file-row > time,
.drive-file-size {
    color: #8a919e;
    font-size: 9px;
}

.drive-file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.drive-file-actions .icon-button {
    width: 30px;
    height: 30px;
}

.drive-empty-state {
    display: grid;
    min-height: 260px;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 30px;
    color: #7f8794;
    text-align: center;
}

.drive-empty-state > span:first-child {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid #343a44;
    border-radius: 15px;
    color: #709ce7;
    background: #20242a;
}

.drive-empty-state strong {
    color: #dce0e6;
    font-size: 13px;
}

.drive-empty-state p {
    max-width: 390px;
    margin: 0 0 7px;
    font-size: 10px;
}

.modal-card-wide {
    width: min(760px, calc(100vw - 32px));
}

.drive-file-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.drive-file-detail-grid > div {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid #34383f;
    border-radius: 10px;
    background: rgb(255 255 255 / 2%);
}

.drive-file-detail-grid span {
    color: #7c8491;
    font-size: 9px;
}

.drive-file-detail-grid strong {
    overflow: hidden;
    color: #e4e7ec;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-version-list {
    display: grid;
    gap: 6px;
}

.drive-version-list .panel-heading {
    padding: 0 0 7px;
}

.drive-version-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 80px auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid #33373e;
    border-radius: 10px;
}

.drive-version-number {
    display: inline-flex;
    width: fit-content;
    padding: 4px 7px;
    border-radius: 999px;
    color: #8db7ff;
    background: rgb(64 128 255 / 10%);
    font-size: 9px;
    font-weight: 700;
}

.drive-version-row > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.drive-version-row strong {
    overflow: hidden;
    color: #e2e5ea;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-version-row small,
.drive-version-row > span:nth-child(3) {
    color: #7d8592;
    font-size: 9px;
}

.drive-new-version {
    display: flex;
    align-items: end;
    gap: 10px;
    padding-top: 13px;
    border-top: 1px solid #34383f;
}

.drive-new-version label {
    flex: 1;
}

.drive-dropzone {
    position: relative;
    display: grid;
    min-height: 205px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 24px;
    border: 1px dashed #465268;
    border-radius: 14px;
    color: #8f98a8;
    background: rgb(67 126 228 / 5%);
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.drive-dropzone:hover,
.drive-dropzone.is-dragging {
    border-color: #5990ed;
    background: rgb(67 126 228 / 10%);
}

.drive-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.drive-dropzone-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: #8bb7ff;
    background: rgb(67 126 228 / 15%);
}

.drive-dropzone strong {
    color: #e4e7ec;
    font-size: 12px;
}

.drive-dropzone small,
.drive-dropzone [data-drive-file-selection] {
    font-size: 9px;
}

.drive-dropzone [data-drive-file-selection].has-files {
    color: #82b0ff;
    font-weight: 700;
}

.drive-upload-status {
    min-height: 16px;
    margin-right: auto;
    color: #8ca7d5;
    font-size: 10px;
}

@media (max-width: 1250px) {
    .drive-filters {
        grid-template-columns: minmax(210px, 1fr) 140px minmax(150px, 190px) 140px;
    }

    .drive-filters .button {
        grid-column: 4;
    }

    .drive-file-list-head,
    .drive-file-row {
        grid-template-columns: minmax(240px, 1.4fr) minmax(130px, .8fr) 110px 75px 80px;
    }

    .drive-file-list-head > span:nth-child(3),
    .drive-file-uploader {
        display: none;
    }
}

@media (max-width: 1000px) {
    .drive-shell {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .drive-filters {
        grid-template-columns: minmax(200px, 1fr) repeat(2, minmax(130px, .6fr));
    }

    .drive-filters select[name="sort"] {
        grid-column: 1 / 2;
    }

    .drive-filters .button {
        grid-column: auto;
    }

    .drive-file-list-head,
    .drive-file-row {
        grid-template-columns: minmax(220px, 1.4fr) minmax(120px, .7fr) 100px 75px;
    }

    .drive-file-list-head > span:nth-child(4),
    .drive-file-row > time {
        display: none;
    }
}

@media (max-width: 820px) {
    .drive-page-heading .header-actions {
        width: 100%;
    }

    .drive-shell {
        display: block;
        border-radius: 14px;
    }

    .drive-sidebar {
        display: block;
        overflow-x: auto;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid #30343b;
        border-radius: 14px 14px 0 0;
        scrollbar-width: none;
    }

    .drive-sidebar::-webkit-scrollbar {
        display: none;
    }

    .drive-nav {
        display: flex;
        width: max-content;
    }

    .drive-nav a {
        min-height: 38px;
        white-space: nowrap;
    }

    .drive-storage-list {
        display: none;
    }

    .drive-main {
        padding: 13px;
    }

    .drive-filters {
        grid-template-columns: 1fr 1fr;
    }

    .drive-search {
        grid-column: 1 / -1;
    }

    .drive-filters .button {
        width: 100%;
    }

    .drive-file-list-head {
        display: none;
    }

    .drive-file-row {
        position: relative;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
        padding: 13px;
    }

    .drive-file-primary {
        grid-column: 1;
    }

    .drive-file-location {
        grid-column: 1;
        display: flex;
        flex-direction: row;
        gap: 6px;
    }

    .drive-file-location strong,
    .drive-file-location small {
        font-size: 9px;
    }

    .drive-file-size {
        grid-column: 1;
    }

    .drive-file-actions {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: center;
    }

    .drive-file-row > time,
    .drive-file-uploader {
        display: none;
    }

    .drive-file-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .drive-page-heading .header-actions .button {
        flex: 1 1 140px;
    }

    .drive-main {
        padding: 10px;
    }

    .drive-filters {
        grid-template-columns: 1fr;
    }

    .drive-search,
    .drive-filters select,
    .drive-filters .button {
        grid-column: 1;
        width: 100%;
    }

    .drive-folder-grid {
        grid-template-columns: 1fr;
    }

    .drive-file-actions > .icon-button {
        display: none;
    }

    .drive-file-detail-grid {
        grid-template-columns: 1fr;
    }

    .drive-version-row {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .drive-version-row > span:nth-child(3) {
        display: none;
    }

    .drive-new-version {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-channel-actions-menu,
    .drive-item-menu > div {
        position: fixed;
        right: 12px;
        left: 12px;
        top: auto;
        bottom: 12px;
        min-width: 0;
    }
}

/* ========================================================================== 
   Projetos — central operacional (v1.4.6)
   ========================================================================== */

.projects-page {
    display: grid;
    gap: 18px;
}

.projects-page > * {
    min-width: 0;
}

.projects-page-header {
    margin-bottom: 0 !important;
}

.projects-history-note {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #383b41;
    border-radius: 9px;
    color: #aeb2ba;
    background: #202225;
    font-size: 11px;
    font-weight: 700;
}

.projects-metric-grid {
    margin-bottom: 0;
}

.project-metric-card {
    position: relative;
    display: block;
    min-height: 112px;
    color: var(--text);
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.project-metric-card:hover {
    color: var(--text);
    border-color: rgb(77 143 247 / 40%);
    transform: translateY(-2px);
}

.project-metric-card.is-active {
    border-color: rgb(77 143 247 / 44%);
    background: linear-gradient(180deg, rgb(77 143 247 / 10%), rgb(27 29 32 / 98%));
}

.project-metric-card.is-alert {
    border-color: rgb(239 68 68 / 42%);
}

.project-metric-card.is-warning {
    border-color: rgb(245 158 11 / 42%);
}

.project-metric-card.is-success {
    border-color: rgb(34 197 94 / 38%);
}

.project-metric-card > strong {
    display: block;
    margin: 5px 0 2px;
    color: #f4f7fb;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1;
}

.projects-view-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 5px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: #181a1d;
    scrollbar-width: thin;
}

.projects-view-tab {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 8px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #9da2aa;
    font-size: 11px;
    font-weight: 700;
    transition: .15s ease;
}

.projects-view-tab:hover {
    color: #e8eef8;
    background: #22252a;
}

.projects-view-tab.is-active {
    color: white;
    border-color: rgb(77 143 247 / 28%);
    background: rgb(77 143 247 / 13%);
}

.projects-view-tab strong {
    min-width: 22px;
    padding: 3px 6px;
    border-radius: 999px;
    color: inherit;
    background: rgb(255 255 255 / 7%);
    font-size: 9px;
    text-align: center;
}

.projects-filter-panel {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(145px, 1fr)) auto;
    gap: 10px;
    padding: 13px;
    border: 1px solid #30343a;
    border-radius: 12px;
    background: linear-gradient(180deg, #1b1d20, #181a1d);
    box-shadow: 0 12px 28px rgb(0 0 0 / 8%);
}

.projects-filter-panel > label:not(.search-box) {
    display: grid;
    gap: 5px;
}

.projects-filter-panel > label > span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.projects-filter-panel input,
.projects-filter-panel select {
    min-height: 42px;
}

.projects-search {
    align-self: end;
    min-width: 0;
}

.projects-filter-actions {
    align-items: end;
    display: flex;
    gap: 7px;
}

.projects-filter-actions .button {
    min-height: 42px;
}

.projects-results-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.projects-results-heading > div:first-child {
    display: grid;
    gap: 3px;
}

.projects-results-heading strong {
    color: #eef2f8;
    font-size: 13px;
}

.projects-results-heading span {
    color: var(--muted);
    font-size: 10px;
}

.projects-layout-switch {
    align-items: center;
    display: flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: #191b1e;
}

.projects-layout-switch .icon-button {
    width: 34px;
    height: 32px;
    border: 0;
    background: transparent;
}

.projects-layout-switch .icon-button.is-active {
    color: white;
    background: rgb(77 143 247 / 16%);
}

.projects-results {
    gap: 15px;
}

.project-card-rich {
    position: relative;
    align-content: start;
    min-height: 395px;
    padding: 17px;
    gap: 15px;
    overflow: visible;
}

.project-card-rich:hover {
    transform: translateY(-2px);
}

.project-card-rich.is-overdue {
    border-color: rgb(239 68 68 / 30%);
}

.project-card-rich.is-archived {
    opacity: .9;
    border-style: dashed;
}

.project-card-topline,
.project-card-status-actions,
.project-card-identity,
.project-card-footer,
.project-card-footer > div {
    align-items: center;
    display: flex;
}

.project-card-topline {
    justify-content: space-between;
    gap: 12px;
}

.project-card-identity {
    min-width: 0;
    gap: 10px;
}

.project-card-identity > span:last-child {
    min-width: 0;
}

.project-card-monogram {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgb(77 143 247 / 25%);
    border-radius: 10px;
    color: #dce9fb;
    background: linear-gradient(145deg, rgb(77 143 247 / 20%), rgb(38 42 48 / 88%));
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .025em;
}

.project-card-title {
    display: block;
    overflow: hidden;
    color: #f4f6f9;
    font-size: 15px;
    font-weight: 780;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-title:hover {
    color: #aecaef;
}

.project-card-identity small {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: #9297a0;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-status-actions {
    flex: 0 0 auto;
    gap: 7px;
}

.project-card-menu {
    position: relative;
}

.project-card-menu > summary {
    list-style: none;
    width: 32px;
    height: 32px;
}

.project-card-menu > summary::-webkit-details-marker {
    display: none;
}

.project-card-menu[open] > summary {
    color: white;
    border-color: #4b5260;
    background: #2a2d32;
}

.project-card-menu > div {
    position: absolute;
    z-index: 12;
    top: calc(100% + 7px);
    right: 0;
    display: grid;
    min-width: 190px;
    padding: 6px;
    border: 1px solid #3a3e45;
    border-radius: 10px;
    background: #1c1e22;
    box-shadow: 0 18px 45px rgb(0 0 0 / 42%);
}

.project-card-menu a,
.project-card-menu button {
    align-items: center;
    display: flex;
    width: 100%;
    min-height: 36px;
    gap: 9px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    color: #c8ccd3;
    background: transparent;
    font: inherit;
    font-size: 10px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.project-card-menu a:hover,
.project-card-menu button:hover {
    color: white;
    background: #282b30;
}

.project-card-progress {
    display: grid;
    gap: 7px;
}

.project-card-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.project-card-kpi {
    display: grid;
    min-width: 0;
    gap: 3px;
    padding: 10px;
    border: 1px solid rgb(255 255 255 / 4%);
    border-radius: 9px;
    background: #202226;
}

.project-card-kpi small,
.project-card-stage small {
    color: #818791;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.project-card-kpi strong {
    overflow: hidden;
    color: #e7e9ed;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-kpi em {
    overflow: hidden;
    color: #8f949d;
    font-size: 9px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-kpi.is-danger {
    border-color: rgb(239 68 68 / 20%);
    background: rgb(239 68 68 / 5%);
}

.project-card-kpi.is-danger strong,
.project-card-kpi.is-warning em {
    color: #f0b4b4;
}

.project-card-kpi.is-warning {
    border-color: rgb(245 158 11 / 18%);
}

.project-card-stage {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-width: 0;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 9px;
    background: #191b1e;
}

.project-card-stage > span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.project-card-stage strong {
    overflow: hidden;
    color: #cbd0d7;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-stage em {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    color: #e7bb75;
    background: rgb(245 158 11 / 10%);
    font-size: 8px;
    font-style: normal;
    font-weight: 750;
}

.project-card-footer {
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 2px;
}

.project-card-footer > span {
    color: #777d86;
    font-size: 8px;
}

.project-card-footer > div {
    justify-content: flex-end;
    gap: 6px;
}

.project-card-footer form {
    margin: 0;
}

.projects-page[data-project-view="list"] .projects-results {
    grid-template-columns: 1fr;
}

.projects-page[data-project-view="list"] .project-card-rich {
    grid-template-columns: minmax(220px, 1.2fr) minmax(170px, .7fr) minmax(350px, 1.5fr);
    min-height: 0;
    align-items: center;
}

.projects-page[data-project-view="list"] .project-card-topline,
.projects-page[data-project-view="list"] .project-card-footer {
    grid-column: 1 / -1;
}

.projects-page[data-project-view="list"] .project-card-progress {
    grid-column: 1;
}

.projects-page[data-project-view="list"] .project-card-stage {
    grid-column: 2;
}

.projects-page[data-project-view="list"] .project-card-kpis {
    grid-column: 3;
    grid-row: 2 / span 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.projects-empty-state {
    min-height: 300px;
    place-content: center;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.projects-empty-state strong {
    color: #edf1f7;
    font-size: 15px;
}

.projects-empty-state p {
    max-width: 460px;
    margin: 0;
    color: var(--muted);
}

.projects-empty-state > div {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.projects-empty-icon {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: 1px solid #353941;
    border-radius: 14px;
    color: #9fbbe2;
    background: #202328;
}

.project-create-form {
    display: grid;
    gap: 16px;
}

.project-form-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #31353b;
    border-radius: 11px;
    background: #1b1d20;
}

.project-form-section-heading {
    align-items: center;
    display: flex;
    gap: 10px;
}

.project-form-section-heading > span {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: white;
    background: var(--blue);
    font-size: 10px;
    font-weight: 800;
}

.project-form-section-heading > div {
    display: grid;
    gap: 2px;
}

.project-form-section-heading strong {
    color: #edf1f6;
    font-size: 11px;
}

.project-form-section-heading small {
    color: var(--muted);
    font-size: 9px;
}

.project-form-hint {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid rgb(77 143 247 / 18%);
    border-radius: 8px;
    background: rgb(77 143 247 / 6%);
}

.project-form-hint strong {
    color: #bdd4f3;
    font-size: 9px;
}

.project-form-hint span {
    color: #8793a4;
    font-size: 8px;
}

.project-member-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 245px;
    overflow-y: auto;
    padding-right: 3px;
}

.project-member-picker .check-row {
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    border: 1px solid #30343a;
    border-radius: 9px;
    background: #202226;
}

.project-member-picker .check-row:has(input:checked) {
    border-color: rgb(77 143 247 / 38%);
    background: rgb(77 143 247 / 8%);
}

.project-member-picker .check-row strong {
    overflow: hidden;
    color: #d5d8de;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-form-error {
    padding: 10px 12px;
    border: 1px solid rgb(239 68 68 / 35%);
    border-radius: 9px;
    color: #f2b6b6;
    background: rgb(239 68 68 / 7%);
    font-size: 10px;
}

.project-archive-banner {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    border-color: rgb(245 158 11 / 28%);
    background: linear-gradient(180deg, rgb(245 158 11 / 8%), rgb(29 30 32 / 98%));
}

.project-archive-banner > span {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #e8bd7d;
    background: rgb(245 158 11 / 10%);
}

.project-archive-banner strong {
    color: #f0e2ce;
    font-size: 11px;
}

.project-archive-banner p {
    margin: 4px 0 0;
    color: #a9a096;
    font-size: 10px;
}

.project-summary.is-readonly {
    border-style: dashed;
}

@media (max-width: 1450px) {
    .projects-filter-panel {
        grid-template-columns: minmax(250px, 2fr) repeat(3, minmax(145px, 1fr));
    }

    .projects-filter-actions {
        grid-column: -2 / -1;
    }

    .projects-page[data-project-view="list"] .project-card-rich {
        grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.5fr);
    }

    .projects-page[data-project-view="list"] .project-card-stage {
        grid-column: 1;
    }

    .projects-page[data-project-view="list"] .project-card-kpis {
        grid-column: 2;
        grid-row: 2 / span 2;
    }
}

@media (max-width: 1100px) {
    .projects-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .projects-search {
        grid-column: 1 / -1;
    }

    .projects-filter-actions {
        grid-column: auto;
    }

    .projects-page[data-project-view="list"] .project-card-rich {
        display: grid;
        grid-template-columns: 1fr;
    }

    .projects-page[data-project-view="list"] .project-card-topline,
    .projects-page[data-project-view="list"] .project-card-progress,
    .projects-page[data-project-view="list"] .project-card-stage,
    .projects-page[data-project-view="list"] .project-card-kpis,
    .projects-page[data-project-view="list"] .project-card-footer {
        grid-column: 1;
        grid-row: auto;
    }

    .projects-page[data-project-view="list"] .project-card-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .projects-page {
        gap: 14px;
    }

    .projects-page-header .header-actions {
        width: 100%;
    }

    .projects-page-header .button,
    .projects-history-note {
        width: 100%;
        justify-content: center;
    }

    .projects-view-tabs {
        margin-inline: -2px;
    }

    .projects-filter-panel {
        grid-template-columns: 1fr;
        padding: 11px;
    }

    .projects-search,
    .projects-filter-actions {
        grid-column: 1;
    }

    .projects-filter-actions,
    .projects-filter-actions .button {
        width: 100%;
    }

    .projects-results-heading {
        align-items: flex-end;
    }

    .project-card-rich {
        min-height: 0;
        padding: 14px;
    }

    .project-card-kpis,
    .projects-page[data-project-view="list"] .project-card-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .project-member-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-archive-banner {
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .projects-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-metric-card {
        min-height: 100px;
        padding: 15px;
    }

    .project-card-topline {
        align-items: flex-start;
    }

    .project-card-status-actions {
        align-items: flex-end;
        flex-direction: column-reverse;
    }

    .project-card-kpis,
    .projects-page[data-project-view="list"] .project-card-kpis {
        grid-template-columns: 1fr;
    }

    .project-card-stage,
    .project-card-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .project-card-footer > div,
    .project-card-footer .button,
    .project-card-footer form {
        width: 100%;
    }

    .project-card-footer .button {
        justify-content: center;
    }

    .project-card-menu > div {
        position: fixed;
        top: auto;
        right: 10px;
        bottom: 10px;
        left: 10px;
        min-width: 0;
    }

    .project-member-picker {
        grid-template-columns: 1fr;
    }

    .projects-empty-state > div {
        flex-direction: column;
        width: 100%;
    }
}

.stage-readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.stage-readonly-grid > div {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgb(255 255 255 / 4%);
    border-radius: 8px;
    background: #1c1e21;
}

.stage-readonly-grid small {
    display: block;
    margin-bottom: 5px;
    color: #858b95;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.stage-readonly-grid p {
    margin: 0;
    color: #c5c9d0;
    font-size: 10px;
    line-height: 1.55;
}

@media (max-width: 640px) {
    .stage-readonly-grid {
        grid-template-columns: 1fr;
    }

    .stage-readonly-grid .span-2 {
        grid-column: auto;
    }
}

.projects-filter-panel.is-compact {
    grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

@media (max-width: 1100px) {
    .projects-filter-panel.is-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .projects-filter-panel.is-compact {
        grid-template-columns: 1fr;
    }
}

/* Projeto — ambiente interno operacional (v1.4.7) */
.project-workspace-page {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.project-workspace-header {
    margin-bottom: 0 !important;
}

.project-workspace-title-row {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
    margin-top: 7px;
}

.project-workspace-title-row > div {
    min-width: 0;
}

.project-workspace-title-row h1 {
    overflow: hidden;
    margin: 0;
    color: #f3f6fb;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-workspace-title-row p {
    overflow: hidden;
    margin: 3px 0 0 !important;
    color: #959ca7;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-workspace-title-row > .badge {
    flex: 0 0 auto;
}

.project-workspace-monogram {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    width: 43px;
    height: 43px;
    border: 1px solid rgb(77 143 247 / 28%);
    border-radius: 12px;
    color: #d9e8ff;
    background: linear-gradient(145deg, rgb(77 143 247 / 18%), rgb(77 143 247 / 7%));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}

.project-workspace-nav {
    min-width: 0;
    padding: 4px;
    border: 1px solid #30343a;
    border-radius: 12px;
    background: linear-gradient(180deg, #1b1d20, #181a1d);
    box-shadow: 0 10px 26px rgb(0 0 0 / 8%);
}

.project-workspace-nav-scroll {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.project-workspace-nav-item {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 7px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #a5abb4;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.project-workspace-nav-item:hover {
    color: #edf4ff;
    background: #22252a;
}

.project-workspace-nav-item.is-active {
    color: #fff;
    border-color: rgb(77 143 247 / 30%);
    background: rgb(77 143 247 / 14%);
}

.project-workspace-nav-item strong {
    min-width: 20px;
    padding: 2px 5px;
    border-radius: 999px;
    color: inherit;
    background: rgb(255 255 255 / 7%);
    font-size: 8px;
    text-align: center;
}

.project-command-center {
    display: grid;
    grid-template-columns: minmax(300px, 1.65fr) repeat(5, minmax(125px, .72fr));
    gap: 10px;
}

.project-command-center.is-readonly {
    opacity: .92;
}

.project-health-card,
.project-command-metric,
.kanban-summary-grid > article,
.project-files-summary > article {
    min-width: 0;
    padding: 14px;
    border: 1px solid #30343a;
    border-radius: 12px;
    background: linear-gradient(180deg, #202226, #1b1d20);
    box-shadow: 0 10px 28px rgb(0 0 0 / 8%);
}

.project-health-card {
    align-content: center;
    display: grid;
    gap: 10px;
}

.project-health-card.is-danger {
    border-color: rgb(239 68 68 / 34%);
    background: linear-gradient(180deg, rgb(239 68 68 / 7%), #1b1d20);
}

.project-health-topline,
.project-health-meta,
.project-command-metric {
    display: flex;
}

.project-health-topline {
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.project-health-topline span,
.project-command-metric > span,
.kanban-summary-grid article > span,
.project-files-summary article > span {
    color: #9ba2ad;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.project-health-topline strong {
    color: #eff6ff;
    font-size: 25px;
    line-height: 1;
}

.project-health-progress,
.kanban-checklist-progress > i {
    display: block;
    overflow: hidden;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #15171a;
}

.project-health-progress i,
.kanban-checklist-progress > i::after {
    display: block;
    width: var(--project-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4d8ff7, #79adff);
    content: "";
}

.project-health-meta {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.project-health-meta span {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    color: #9ca5b2;
    font-size: 9px;
}

.project-command-metric {
    align-content: center;
    flex-direction: column;
    justify-content: center;
}

.project-command-metric strong,
.kanban-summary-grid article strong,
.project-files-summary article strong {
    margin: 7px 0 4px;
    color: #f3f7fd;
    font-size: 24px;
    line-height: 1;
}

.project-command-metric small,
.kanban-summary-grid article small,
.project-files-summary article small {
    color: #7f8793;
    font-size: 8px;
    line-height: 1.45;
}

.project-command-metric.is-warning,
.kanban-summary-grid > article.is-warning {
    border-color: rgb(245 158 11 / 30%);
}

.project-command-metric.is-danger,
.kanban-summary-grid > article.is-danger {
    border-color: rgb(239 68 68 / 32%);
}

.project-overview-grid {
    align-items: start;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(285px, .72fr);
    gap: 16px;
}

.project-overview-grid > * {
    min-width: 0;
}

.project-overview-sidebar {
    position: sticky;
    top: 18px;
}

.project-action-list {
    display: grid;
    gap: 6px;
}

.project-action-row {
    align-items: center;
    display: grid;
    grid-template-columns: 7px minmax(0, 1fr) auto auto;
    gap: 10px;
    min-height: 54px;
    padding: 9px 10px;
    border: 1px solid #2e3237;
    border-radius: 9px;
    color: inherit;
    background: #202226;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.project-action-row:hover {
    border-color: rgb(77 143 247 / 35%);
    background: #24272c;
}

.project-action-row.is-overdue {
    border-color: rgb(239 68 68 / 28%);
}

.project-action-priority {
    width: 6px;
    height: 34px;
    border-radius: 999px;
    background: #64748b;
}

.project-action-priority.priority-low { background: #64748b; }
.project-action-priority.priority-medium { background: #4d8ff7; }
.project-action-priority.priority-high { background: #f59e0b; }
.project-action-priority.priority-critical { background: #ef4444; }

.project-action-main {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.project-action-main strong,
.project-mini-list strong,
.project-team-row strong {
    overflow: hidden;
    color: #e3e8ef;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-action-main small,
.project-action-row time,
.project-action-checklist {
    color: #89919c;
    font-size: 8px;
}

.project-action-checklist {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 7px;
    background: #191b1e;
}

.project-stage-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16px, 1fr));
    gap: 4px;
    margin: 5px 0 13px;
}

.project-stage-track > span {
    height: 5px;
    border-radius: 999px;
    background: #30343a;
}

.project-stage-track > span.is-approved { background: #22c55e; }
.project-stage-track > span.is-in_progress { background: #4d8ff7; }
.project-stage-track > span.is-waiting_approval { background: #f59e0b; }
.project-stage-track > span.is-blocked { background: #ef4444; }

.project-stage-list {
    display: grid;
    gap: 7px;
}

.project-stage-card {
    overflow: hidden;
    border: 1px solid #30343a;
    border-radius: 10px;
    background: #202226;
}

.project-stage-card[open] {
    border-color: #3a4048;
    box-shadow: 0 8px 22px rgb(0 0 0 / 8%);
}

.project-stage-card.is-blocked {
    border-color: rgb(239 68 68 / 30%);
}

.project-stage-card.is-waiting_approval {
    border-color: rgb(245 158 11 / 26%);
}

.project-stage-card > summary {
    align-items: center;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 58px;
    padding: 8px 11px;
    cursor: pointer;
    list-style: none;
}

.project-stage-card > summary::-webkit-details-marker {
    display: none;
}

.project-stage-card > summary:hover {
    background: rgb(255 255 255 / 1.5%);
}

.project-stage-index {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 29px;
    height: 29px;
    border: 1px solid #3a3f46;
    border-radius: 8px;
    color: #aeb5bf;
    background: #191b1e;
    font-size: 9px;
    font-weight: 800;
}

.project-stage-summary-main {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.project-stage-summary-main strong {
    overflow: hidden;
    color: #e2e7ee;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-stage-summary-main small {
    overflow: hidden;
    color: #838b97;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-stage-editor {
    margin: 0;
    padding: 13px;
    border: 0;
    border-top: 1px solid #30343a;
    border-radius: 0;
    background: #1b1d20;
}

.project-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.project-record-card {
    align-content: start;
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #30343a;
    border-radius: 10px;
    background: #202226;
}

.project-record-card > strong {
    color: #e7ebf1;
    font-size: 11px;
}

.project-record-card p {
    margin: 0;
    color: #a1a7b0;
    font-size: 9px;
    line-height: 1.55;
}

.project-record-card > small {
    color: #7d8590;
    font-size: 8px;
}

.project-scope-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.project-scope-grid > div {
    min-width: 0;
    padding: 13px;
    border: 1px solid #30343a;
    border-radius: 10px;
    background: #202226;
}

.project-scope-grid small {
    color: #7e8793;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.project-scope-grid p {
    margin: 8px 0 0;
    color: #b0b6bf;
    font-size: 9px;
    line-height: 1.65;
}

.project-team-list,
.project-mini-list,
.project-activity-list {
    display: grid;
    gap: 6px;
}

.project-team-row {
    align-items: center;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    min-width: 0;
    padding: 8px;
    border: 1px solid #2f3338;
    border-radius: 9px;
    background: #202226;
}

.project-team-row > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.project-team-row small {
    overflow: hidden;
    color: #818a96;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-team-row .icon-button {
    width: 27px;
    height: 27px;
}

.project-member-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
}

.project-mini-list > a {
    align-items: center;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    min-width: 0;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.project-mini-list > a:hover {
    border-color: #343940;
    background: #202226;
}

.project-mini-list > a > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.project-mini-list small {
    overflow: hidden;
    color: #7f8894;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-mini-icon {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    width: 29px;
    height: 29px;
    border: 1px solid #343940;
    border-radius: 8px;
    color: #9dbced;
    background: #191b1e;
}

.project-activity-list > div {
    align-items: start;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 8px;
}

.project-activity-dot {
    width: 7px;
    height: 7px;
    margin-top: 5px;
    border: 2px solid #1d2024;
    border-radius: 50%;
    background: #4d8ff7;
    box-shadow: 0 0 0 2px rgb(77 143 247 / 16%);
}

.project-activity-list p {
    margin: 0;
    color: #929aa5;
    font-size: 8px;
    line-height: 1.45;
}

.project-activity-list strong {
    color: #d2d8e0;
}

.project-activity-list small {
    display: block;
    margin-top: 2px;
    color: #707985;
}

/* Kanban interno */
.kanban-summary-grid,
.project-files-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.project-files-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.project-files-summary article strong.is-date {
    font-size: 15px;
    line-height: 1.2;
}

.kanban-toolbar {
    align-items: end;
    display: grid;
    grid-template-columns: minmax(230px, 1.6fr) repeat(4, minmax(125px, .75fr)) auto;
    gap: 9px;
    padding: 11px;
    border: 1px solid #30343a;
    border-radius: 12px;
    background: linear-gradient(180deg, #1b1d20, #181a1d);
}

.kanban-toolbar > label:not(.search-box) {
    display: grid;
    gap: 5px;
}

.kanban-toolbar > label > span {
    color: #858d98;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.kanban-toolbar input,
.kanban-toolbar select {
    min-height: 39px;
}

.kanban-search {
    align-self: end;
}

.kanban-toolbar-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    min-height: 39px;
}

.kanban-toolbar-actions > span {
    color: #8b939e;
    font-size: 8px;
    white-space: nowrap;
}

.kanban-board-rich {
    align-items: start;
    display: grid;
    grid-auto-columns: minmax(292px, 1fr);
    grid-auto-flow: column;
    gap: 11px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 1px 1px 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.kanban-board-rich .kanban-column {
    min-width: 292px;
    max-width: 365px;
    scroll-snap-align: start;
}

.kanban-board-rich .kanban-column-heading {
    position: sticky;
    z-index: 2;
    top: 0;
    padding: 12px;
    background: #1f2124;
}

.kanban-board-rich .kanban-dropzone {
    display: grid;
    gap: 8px;
    min-height: 190px;
    padding: 9px;
}

.kanban-card-rich {
    display: grid;
    gap: 9px;
    min-width: 0;
    padding: 11px;
    border-radius: 10px;
    background: #25272b;
}

.kanban-card-rich[hidden] {
    display: none;
}

.kanban-card-rich.is-overdue {
    border-color: rgb(239 68 68 / 36%);
    box-shadow: inset 3px 0 0 rgb(239 68 68 / 54%);
}

.kanban-card-topline {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.kanban-card-topline time,
.kanban-overdue-badge {
    color: #858e99;
    font-size: 8px;
}

.kanban-overdue-badge {
    padding: 3px 6px;
    border: 1px solid rgb(239 68 68 / 28%);
    border-radius: 999px;
    color: #f0aaaa;
    background: rgb(239 68 68 / 7%);
    font-weight: 700;
}

.kanban-card-title {
    color: #e9edf3 !important;
    font-size: 11px !important;
    font-weight: 700;
    line-height: 1.45;
}

.kanban-card-description {
    display: -webkit-box;
    overflow: hidden;
    margin: -2px 0 0;
    color: #959ca6;
    font-size: 8px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.kanban-label-list,
.kanban-settings-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.kanban-label-list > span,
.kanban-settings-labels > span {
    padding: 3px 6px;
    border: 1px solid color-mix(in srgb, var(--label-color, #64748b) 55%, transparent);
    border-radius: 999px;
    color: color-mix(in srgb, var(--label-color, #94a3b8) 70%, white);
    background: color-mix(in srgb, var(--label-color, #64748b) 10%, transparent);
    font-size: 7px;
    font-weight: 700;
}

.kanban-checklist-progress {
    display: grid;
    gap: 5px;
}

.kanban-checklist-progress > div {
    align-items: center;
    display: flex;
    justify-content: space-between;
    color: #858e99;
    font-size: 7px;
}

.kanban-checklist-progress > i {
    height: 4px;
}

.kanban-checklist-progress > i::after {
    width: var(--checklist-progress, 0%);
    background: #4d8ff7;
}

.kanban-dependency-warning {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    padding: 6px 7px;
    border: 1px solid rgb(245 158 11 / 20%);
    border-radius: 7px;
    color: #c7a46c;
    background: rgb(245 158 11 / 5%);
    font-size: 7px;
}

.kanban-card-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
}

.kanban-card-meta span {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    color: #7f8792;
    font-size: 7px;
}

.kanban-card-rich .kanban-card-footer {
    min-width: 0;
    padding-top: 7px;
    border-top: 1px solid rgb(255 255 255 / 4%);
}

.kanban-card-rich .kanban-card-footer > small {
    overflow: hidden;
    min-width: 0;
    margin-right: auto;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-quick-move {
    display: none;
}

.kanban-column-empty {
    display: none;
    padding: 20px 10px;
    color: #737b86;
    font-size: 8px;
    text-align: center;
}

.kanban-column-empty:not([hidden]) {
    display: block;
}

.kanban-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
    gap: 18px;
}

.kanban-settings-grid > section {
    min-width: 0;
}

.kanban-settings-list .inline-form,
.kanban-create-inline {
    grid-template-columns: minmax(130px, 1fr) 44px auto auto auto;
}

.kanban-create-inline {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
}

.kanban-settings-labels {
    min-height: 38px;
    padding: 9px;
    border: 1px solid #30343a;
    border-radius: 9px;
    background: #202226;
}

.kanban-label-picker .check-row span {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.kanban-label-picker .check-row i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--label-color, #64748b);
}

@media (max-width: 1500px) {
    .project-command-center {
        grid-template-columns: minmax(300px, 1.5fr) repeat(3, minmax(130px, .72fr));
    }

    .project-command-center > :nth-child(5),
    .project-command-center > :nth-child(6) {
        grid-column: span 1;
    }

    .kanban-toolbar {
        grid-template-columns: minmax(230px, 1.5fr) repeat(3, minmax(130px, .75fr));
    }

    .kanban-toolbar > label:nth-of-type(5),
    .kanban-toolbar-actions {
        grid-column: auto;
    }
}

@media (max-width: 1180px) {
    .project-command-center {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .project-health-card {
        grid-column: span 3;
    }

    .project-overview-grid {
        grid-template-columns: 1fr;
    }

    .project-overview-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-overview-sidebar > .panel:last-child {
        grid-column: 1 / -1;
    }

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

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

    .kanban-search {
        grid-column: 1 / -1;
    }

    .kanban-toolbar-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 820px) {
    .project-workspace-title-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .project-workspace-title-row > div {
        flex: 1 1 180px;
    }

    .project-workspace-title-row > .badge {
        margin-left: 55px;
        margin-top: -12px;
    }

    .project-workspace-header .header-actions,
    .project-workspace-header .header-actions .button,
    .project-workspace-header .header-actions form {
        width: 100%;
    }

    .project-workspace-header .header-actions .button {
        justify-content: center;
    }

    .project-command-center,
    .kanban-summary-grid,
    .project-files-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-health-card {
        grid-column: 1 / -1;
    }

    .project-overview-sidebar {
        grid-template-columns: 1fr;
    }

    .project-overview-sidebar > .panel:last-child {
        grid-column: auto;
    }

    .project-record-grid,
    .project-scope-grid {
        grid-template-columns: 1fr;
    }

    .project-action-row {
        grid-template-columns: 7px minmax(0, 1fr) auto;
    }

    .project-action-row time {
        grid-column: 2 / -1;
    }

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

    .kanban-search {
        grid-column: 1 / -1;
    }

    .kanban-toolbar-actions {
        justify-content: space-between;
    }

    .kanban-quick-move {
        align-items: center;
        display: inline-flex;
        flex: 0 0 auto;
        gap: 4px;
    }

    .kanban-quick-move > span {
        display: none;
    }

    .kanban-quick-move select {
        width: 78px;
        min-height: 28px;
        padding: 3px 21px 3px 6px;
        font-size: 7px;
    }

    .kanban-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .project-workspace-page {
        gap: 12px;
    }

    .project-workspace-monogram {
        width: 38px;
        height: 38px;
    }

    .project-workspace-title-row h1 {
        font-size: 17px;
    }

    .project-workspace-title-row > .badge {
        margin-left: 50px;
    }

    .project-workspace-nav {
        margin-inline: -1px;
    }

    .project-workspace-nav-item {
        min-height: 37px;
        padding-inline: 10px;
    }

    .project-command-center,
    .kanban-summary-grid,
    .project-files-summary {
        grid-template-columns: 1fr 1fr;
    }

    .project-health-card {
        grid-column: 1 / -1;
    }

    .project-command-metric,
    .kanban-summary-grid > article,
    .project-files-summary > article {
        min-height: 104px;
    }

    .project-command-metric strong,
    .kanban-summary-grid article strong,
    .project-files-summary article strong {
        font-size: 21px;
    }

    .project-stage-card > summary {
        grid-template-columns: 29px minmax(0, 1fr);
    }

    .project-stage-card > summary > .badge {
        grid-column: 2;
        justify-self: start;
    }

    .project-action-checklist {
        display: none;
    }

    .kanban-toolbar {
        grid-template-columns: 1fr;
    }

    .kanban-search,
    .kanban-toolbar-actions {
        grid-column: 1;
    }

    .kanban-toolbar-actions,
    .kanban-toolbar-actions .button {
        width: 100%;
    }

    .kanban-toolbar-actions .button {
        justify-content: center;
    }

    .kanban-board-rich {
        grid-auto-columns: minmax(276px, 88vw);
    }

    .kanban-board-rich .kanban-column {
        min-width: 276px;
    }

    .kanban-settings-list .inline-form,
    .kanban-create-inline {
        grid-template-columns: minmax(0, 1fr) 40px auto;
    }

    .kanban-settings-list .inline-form .button:nth-of-type(3) {
        grid-column: 1 / -1;
    }
}

/* Áreas internas do projeto — Kanban, Drive, chamados e horas (v1.4.7) */
.hours-workspace-page,
.tickets-workspace-page {
    display: grid;
    gap: 16px;
}

.hours-project-filter {
    grid-template-columns: minmax(260px, 420px) auto;
    justify-content: start;
}

.hours-metric-grid .metric-card,
.ticket-summary-grid > article {
    min-height: 118px;
}

.hours-table-heading {
    padding: 18px 20px 0;
}

.hours-table-heading h2 {
    margin: 0;
}

.table-subcopy {
    display: block;
    max-width: 430px;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.compact-empty {
    min-height: 120px;
    border: 0;
    background: transparent;
}

.ticket-filter-toolbar {
    align-items: end;
}

.ticket-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.text-danger {
    color: #fda4af !important;
}

.project-archive-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-color: rgba(148, 163, 184, .16);
    background: linear-gradient(135deg, rgba(30, 41, 59, .78), rgba(15, 23, 42, .86));
}

.project-archive-banner > span {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;
    color: #cbd5e1;
    background: rgba(148, 163, 184, .08);
}

.project-archive-banner strong,
.project-archive-banner p {
    margin: 0;
}

.project-archive-banner p {
    margin-top: 4px;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 1180px) {
    .ticket-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .hours-project-filter {
        grid-template-columns: 1fr auto;
    }

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

@media (max-width: 560px) {
    .hours-project-filter,
    .ticket-summary-grid {
        grid-template-columns: 1fr;
    }

    .hours-project-filter .button {
        width: 100%;
        justify-content: center;
    }

    .project-archive-banner {
        padding: 12px;
    }
}

/* ========================================================================== 
   FluxUI Workspace v1.4.8 — Perfil, Drive e Clientes/Financeiro
   ========================================================================== */
.page-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #78a9f8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

/* Corrige a densidade excessiva das áreas internas do projeto. */
.project-workspace-nav-item,
.project-action-main strong,
.project-stage-summary-main strong,
.project-record-card > strong,
.project-team-row strong,
.project-mini-list strong,
.kanban-card-rich h3,
.kanban-card-rich strong {
    font-size: 12px;
}

.project-action-main small,
.project-action-row time,
.project-action-checklist,
.project-stage-summary-main small,
.project-record-card p,
.project-team-row small,
.project-mini-list small,
.kanban-card-rich small,
.kanban-card-meta span,
.kanban-dependency-warning,
.kanban-label-list > span,
.kanban-settings-labels > span {
    font-size: 10px;
}

.project-command-metric small,
.kanban-summary-grid article small,
.project-files-summary article small {
    font-size: 10px;
}

.project-health-topline span,
.project-command-metric > span,
.kanban-summary-grid article > span,
.project-files-summary article > span {
    font-size: 10px;
}

.project-action-row,
.project-stage-card > summary,
.project-team-row,
.project-record-card,
.kanban-card-rich {
    border-radius: 12px;
}

/* Clientes — diretório */
.clients-page-header {
    align-items: flex-end !important;
}

.client-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.client-summary-card,
.client-overview-metrics > article,
.finance-summary-grid > article {
    min-width: 0;
    padding: 16px;
    border: 1px solid #30343a;
    border-radius: 14px;
    background: linear-gradient(180deg, #212327, #1b1d20);
    box-shadow: 0 12px 30px rgb(0 0 0 / 9%);
}

.client-summary-card span,
.client-overview-metrics article > span,
.finance-summary-grid article > span {
    display: block;
    color: #9199a6;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.client-summary-card strong,
.client-overview-metrics article > strong,
.finance-summary-grid article > strong {
    display: block;
    margin: 9px 0 5px;
    color: #f3f7fd;
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.05;
}

.client-summary-card small,
.client-overview-metrics article > small,
.finance-summary-grid article > small {
    color: #7f8793;
    font-size: 10px;
    line-height: 1.4;
}

.client-summary-card.is-money,
.client-overview-metrics > article.is-money,
.finance-summary-grid > article.is-success {
    border-color: rgb(34 197 94 / 24%);
    background: linear-gradient(180deg, rgb(34 197 94 / 7%), #1b1d20);
}

.client-summary-card.is-danger,
.finance-summary-grid > article.is-danger {
    border-color: rgb(239 68 68 / 30%);
    background: linear-gradient(180deg, rgb(239 68 68 / 8%), #1b1d20);
}

.client-directory {
    display: grid;
    gap: 15px;
}

.client-toolbar,
.finance-toolbar {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) repeat(3, minmax(150px, 210px)) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid #30343a;
    border-radius: 14px;
    background: #1b1d20;
    box-shadow: 0 10px 28px rgb(0 0 0 / 8%);
}

.client-toolbar select,
.finance-toolbar select,
.client-toolbar input,
.finance-toolbar input {
    min-height: 42px;
}

.client-results-heading,
.section-heading-row,
.finance-table-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.client-results-heading h2,
.section-heading-row h2,
.finance-table-heading h3 {
    margin: 0;
}

.client-results-heading p,
.section-heading-row p,
.finance-table-heading p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 11px;
}

.client-grid-rich {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.client-card-rich {
    display: grid;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.client-card-main {
    display: grid;
    gap: 15px;
    padding: 16px;
    color: inherit;
    text-decoration: none;
}

.client-card-topline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
}

.avatar-client {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 15px;
}

.client-card-identity {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.client-card-identity strong {
    overflow: hidden;
    color: #edf2f8;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-card-identity small {
    overflow: hidden;
    color: #848d99;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-card-operational {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.client-card-operational > span,
.client-finance-strip > span {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.client-card-operational small,
.client-finance-strip small {
    color: #7d8591;
    font-size: 9px;
}

.client-card-operational strong {
    overflow: hidden;
    color: #dfe6ee;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-finance-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    padding: 11px;
    border: 1px solid #30343a;
    border-radius: 11px;
    background: #191b1e;
}

.client-finance-strip.is-overdue {
    border-color: rgb(239 68 68 / 25%);
    background: rgb(239 68 68 / 4%);
}

.client-finance-strip strong {
    overflow: hidden;
    color: #dfe5ec;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-card-footer {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 16px;
    border-top: 1px solid #30343a;
    background: #191b1e;
    font-size: 10px;
}

.client-card-footer a {
    color: #8db7ff;
    font-weight: 700;
    text-decoration: none;
}

.client-contact-preview {
    display: grid;
    gap: 4px;
    color: #8f97a3;
    font-size: 10px;
}

.client-filter-empty {
    min-height: 150px;
}

/* Cliente — detalhe e financeiro */
.client-detail-header {
    align-items: flex-end !important;
}

.client-detail-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.avatar-client-lg {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 18px;
}

.client-detail-title-row > div {
    min-width: 220px;
    flex: 1;
}

.client-detail-title-row h1,
.client-detail-title-row p {
    margin: 0;
}

.client-detail-title-row p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.client-detail-nav,
.profile-section-nav {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 6px;
    overflow-x: auto;
    border: 1px solid #30343a;
    border-radius: 13px;
    background: rgb(27 29 32 / 94%);
    box-shadow: 0 10px 28px rgb(0 0 0 / 16%);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
}

.client-detail-nav::-webkit-scrollbar,
.profile-section-nav::-webkit-scrollbar {
    display: none;
}

.client-detail-nav a,
.profile-section-nav a {
    min-height: 36px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #939ba7;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.client-detail-nav a:hover,
.profile-section-nav a:hover,
.client-detail-nav a.is-active,
.profile-section-nav a.is-active {
    color: #fff;
    background: rgb(77 143 247 / 13%);
}

.client-overview-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    scroll-margin-top: 74px;
}

.client-finance-section {
    display: grid;
    gap: 15px;
    margin-bottom: 18px;
    scroll-margin-top: 74px;
}

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.finance-toolbar {
    grid-template-columns: minmax(280px, 1fr) 180px 180px auto;
}

.finance-table-card {
    overflow: visible;
}

.finance-table-heading {
    padding: 16px 18px;
    border-bottom: 1px solid #30343a;
}

.finance-description {
    display: grid;
    min-width: 180px;
    gap: 4px;
}

.finance-description strong {
    color: #e3e8ee;
}

.finance-description small,
.table-cell-note {
    display: block;
    margin-top: 3px;
    color: #7f8793;
    font-size: 9px;
}

.finance-type {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid #3b4149;
    border-radius: 999px;
    color: #b7c1cf;
    background: #202328;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.finance-type-receivable,
.finance-type-credit {
    border-color: rgb(34 197 94 / 24%);
    color: #86efac;
    background: rgb(34 197 94 / 7%);
}

.finance-type-expense {
    border-color: rgb(244 63 94 / 24%);
    color: #fda4af;
    background: rgb(244 63 94 / 7%);
}

.finance-amount {
    color: #a7f3d0;
    white-space: nowrap;
}

.finance-amount.is-expense {
    color: #fda4af;
}

.badge-overdue {
    color: #fecaca;
    border-color: rgb(239 68 68 / 30%);
    background: rgb(239 68 68 / 10%);
}

.badge-paid {
    color: #bbf7d0;
    border-color: rgb(34 197 94 / 28%);
    background: rgb(34 197 94 / 9%);
}

.badge-cancelled {
    color: #aeb5c0;
    border-color: #3a3f47;
    background: #24272b;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.finance-filter-empty {
    margin: 12px;
}

.client-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .68fr);
    gap: 16px;
    align-items: start;
}

.client-detail-sidebar {
    position: sticky;
    top: 64px;
}

.client-project-panel,
.client-contact-grid,
#atividade,
#contatos,
#projetos {
    scroll-margin-top: 74px;
}

.client-project-list {
    display: grid;
    gap: 8px;
}

.client-project-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    min-height: 68px;
    padding: 10px;
    border: 1px solid #30343a;
    border-radius: 12px;
    color: inherit;
    background: #202226;
    text-decoration: none;
}

.client-project-row:hover {
    border-color: rgb(77 143 247 / 35%);
    background: #24272b;
}

.project-progress-ring {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#4d8ff7 calc(var(--progress, 0) * 1%), #30343a 0);
}

.project-progress-ring::before {
    grid-area: 1 / 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #202226;
    content: "";
}

.project-progress-ring strong {
    z-index: 1;
    grid-area: 1 / 1;
    font-size: 8px;
}

.client-project-row > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.client-project-row > span:nth-child(2) strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-project-row small {
    color: #7f8793;
    font-size: 9px;
}

.client-project-row > span:nth-child(3) {
    display: grid;
    gap: 3px;
    text-align: right;
}

.client-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.client-contact-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    min-width: 0;
    padding: 11px;
    border: 1px solid #30343a;
    border-radius: 12px;
    background: #202226;
}

.client-contact-card > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.client-contact-card strong {
    color: #e3e8ee;
    font-size: 11px;
}

.client-contact-card small {
    color: #858e9a;
    font-size: 9px;
}

.client-contact-card > div > span {
    display: grid;
    gap: 2px;
    margin-top: 4px;
}

.client-contact-card a {
    overflow: hidden;
    color: #8db7ff;
    font-size: 9px;
    text-overflow: ellipsis;
    text-decoration: none;
    white-space: nowrap;
}

.client-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.finance-entry-fields [hidden] {
    display: none;
}

/* Perfil */
.profile-page-header {
    margin-bottom: 16px !important;
}

.profile-hero {
    display: grid;
    grid-template-columns: minmax(320px, 1.3fr) minmax(260px, .75fr) minmax(280px, .8fr);
    gap: 14px;
    align-items: stretch;
    margin-bottom: 16px;
}

.profile-hero > * {
    min-width: 0;
    padding: 16px;
    border: 1px solid #30343a;
    border-radius: 14px;
    background: linear-gradient(180deg, #212327, #1b1d20);
}

.profile-hero-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-avatar-button {
    position: relative;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.avatar-profile {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    object-fit: cover;
    font-size: 22px;
}

.profile-avatar-button > span:last-child {
    position: absolute;
    right: -3px;
    bottom: -3px;
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 3px solid #1d1f22;
    border-radius: 50%;
    color: #fff;
    background: var(--blue);
}

.profile-hero-identity h2,
.profile-hero-identity p {
    margin: 0;
}

.profile-hero-identity h2 {
    color: #eff4fa;
    font-size: 20px;
}

.profile-hero-identity p {
    margin-top: 5px;
    color: #8d96a2;
    font-size: 11px;
}

.profile-account-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
    color: #a7f3d0;
    font-size: 9px;
    font-weight: 700;
}

.profile-account-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgb(34 197 94 / 9%);
}

.profile-completion-card {
    display: grid;
    align-content: center;
    gap: 10px;
}

.profile-completion-card > div {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.profile-completion-card span {
    color: #939ba7;
    font-size: 10px;
    font-weight: 700;
}

.profile-completion-card strong {
    color: #f1f6fc;
    font-size: 24px;
}

.profile-completion-card small {
    color: #7f8793;
    font-size: 9px;
    line-height: 1.5;
}

.profile-progress,
.password-strength > span {
    display: block;
    overflow: hidden;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: #15171a;
}

.profile-progress i,
.password-strength > span i {
    display: block;
    width: var(--profile-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4d8ff7, #7eb1ff);
}

.profile-quick-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: center;
    gap: 8px;
}

.profile-quick-facts > span {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 10px;
    border: 1px solid #30343a;
    border-radius: 10px;
    background: #1a1c1f;
}

.profile-quick-facts small {
    color: #7e8793;
    font-size: 8px;
}

.profile-quick-facts strong {
    overflow: hidden;
    color: #dce3eb;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(310px, .72fr);
    gap: 16px;
    align-items: start;
}

.profile-security-column {
    position: sticky;
    top: 62px;
}

.profile-form-panel,
.notification-panel,
.password-panel,
.sessions-panel {
    scroll-margin-top: 72px;
}

.profile-form-grid {
    margin-top: 4px;
}

.field-counter {
    justify-self: end;
    color: #737c88 !important;
    font-size: 9px !important;
}

.panel-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    color: #7f8793;
    font-size: 9px;
}

.panel-form-footer .is-dirty {
    color: #fbbf24;
}

.notification-legend {
    display: grid;
    grid-template-columns: repeat(2, 64px);
    gap: 8px;
    color: #7f8793;
    font-size: 8px;
    text-align: center;
    text-transform: uppercase;
}

.notification-preference-list {
    display: grid;
    gap: 7px;
}

.notification-preference-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 64px 64px;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 9px 10px;
    border: 1px solid #30343a;
    border-radius: 11px;
    background: #202226;
}

.notification-preference-icon,
.session-device-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgb(77 143 247 / 22%);
    border-radius: 10px;
    color: #8db7ff;
    background: rgb(77 143 247 / 8%);
}

.notification-preference-row > span:nth-child(2) {
    display: grid;
    gap: 4px;
}

.notification-preference-row strong {
    color: #e1e7ee;
    font-size: 11px;
}

.notification-preference-row strong em,
.session-card strong em {
    padding: 2px 5px;
    border-radius: 999px;
    color: #8db7ff;
    background: rgb(77 143 247 / 10%);
    font-size: 7px;
    font-style: normal;
    text-transform: uppercase;
}

.notification-preference-row small {
    color: #7f8793;
    font-size: 9px;
}

.switch-control {
    display: grid;
    place-items: center;
    cursor: pointer;
}

.switch-control input {
    position: absolute;
    opacity: 0;
}

.switch-control i {
    position: relative;
    width: 34px;
    height: 19px;
    border-radius: 999px;
    background: #373b42;
    transition: background .15s ease;
}

.switch-control i::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #a6adb7;
    content: "";
    transition: transform .15s ease, background .15s ease;
}

.switch-control input:checked + i {
    background: rgb(77 143 247 / 45%);
}

.switch-control input:checked + i::after {
    background: #fff;
    transform: translateX(15px);
}

.switch-control input:disabled + i {
    opacity: .55;
    cursor: not-allowed;
}

.password-strength {
    display: grid;
    gap: 8px;
    margin: 13px 0;
    padding: 11px;
    border: 1px solid #30343a;
    border-radius: 11px;
    background: #191b1e;
}

.password-strength > span i {
    width: var(--password-strength, 0%);
    background: linear-gradient(90deg, #ef4444, #f59e0b 45%, #22c55e);
    transition: width .2s ease;
}

.password-strength > strong {
    color: #cfd6df;
    font-size: 10px;
}

.password-strength ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.password-strength li {
    color: #7f8793;
    font-size: 8px;
}

.password-strength li::before {
    margin-right: 5px;
    color: #59616d;
    content: "○";
}

.password-strength li.is-valid {
    color: #a7f3d0;
}

.password-strength li.is-valid::before {
    color: #22c55e;
    content: "●";
}

.session-list {
    display: grid;
    gap: 7px;
}

.session-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 9px;
    border: 1px solid #30343a;
    border-radius: 11px;
    background: #202226;
}

.session-card.is-current {
    border-color: rgb(34 197 94 / 22%);
}

.session-card > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.session-card strong {
    color: #e2e8ef;
    font-size: 10px;
}

.session-card small,
.session-card > div > span {
    color: #7f8793;
    font-size: 8px;
}

.profile-avatar-dropzone {
    position: relative;
    display: grid;
    min-height: 260px;
    place-items: center;
    align-content: center;
    gap: 9px;
    padding: 24px;
    border: 1px dashed #465268;
    border-radius: 14px;
    background: rgb(77 143 247 / 5%);
    text-align: center;
    cursor: pointer;
}

.profile-avatar-dropzone.is-dragging {
    border-color: #6ca3ff;
    background: rgb(77 143 247 / 10%);
}

.profile-avatar-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.profile-avatar-dropzone img,
.profile-avatar-dropzone .avatar {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    object-fit: cover;
}

.profile-avatar-dropzone strong {
    color: #e2e8ef;
    font-size: 12px;
}

.profile-avatar-dropzone small {
    max-width: 330px;
    color: #818a96;
    font-size: 9px;
    line-height: 1.5;
}

/* Drive refinado */
.drive-overview-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.drive-overview-strip > article {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #30343a;
    border-radius: 12px;
    background: #1d1f22;
}

.drive-overview-strip > article > span {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: #8db7ff;
    background: rgb(77 143 247 / 9%);
}

.drive-overview-strip article > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.drive-overview-strip small {
    color: #7f8793;
    font-size: 8px;
}

.drive-overview-strip strong {
    overflow: hidden;
    color: #e3e8ee;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-shell-refined {
    min-height: 620px;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgb(0 0 0 / 12%);
}

.drive-shell-refined .drive-sidebar {
    background: linear-gradient(180deg, #1c1e21, #181a1d);
}

.drive-shell-refined .drive-main {
    padding: 16px;
}

.drive-section-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.drive-type-filter,
.drive-layout-switch {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid #30343a;
    border-radius: 10px;
    background: #191b1e;
}

.drive-type-filter button,
.drive-layout-switch button {
    min-height: 29px;
    padding: 6px 9px;
    border: 0;
    border-radius: 7px;
    color: #858e9a;
    background: transparent;
    font: inherit;
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
}

.drive-layout-switch button {
    width: 30px;
    padding: 0;
    font-size: 16px;
}

.drive-type-filter button:hover,
.drive-layout-switch button:hover,
.drive-type-filter button.is-active,
.drive-layout-switch button.is-active {
    color: #fff;
    background: rgb(77 143 247 / 13%);
}

.drive-file-list[data-drive-layout="grid"] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid #30343b;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-list-head {
    display: none;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 152px;
    align-content: start;
    padding: 13px;
    border: 1px solid #30343a;
    border-radius: 12px;
    background: #202226;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-row:hover {
    border-color: rgb(77 143 247 / 34%);
    background: #24272b;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-primary {
    grid-column: 1;
    align-items: flex-start;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-location {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    gap: 5px;
    padding-top: 8px;
    border-top: 1px solid #30343a;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-location strong,
.drive-file-list[data-drive-layout="grid"] .drive-file-location small {
    font-size: 9px;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-location small::before {
    content: "· ";
}

.drive-file-list[data-drive-layout="grid"] .drive-file-uploader,
.drive-file-list[data-drive-layout="grid"] .drive-file-row > time {
    display: none;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-size {
    grid-column: 1;
    color: #8f98a4;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-actions {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: start;
}

.drive-filter-empty {
    grid-column: 1 / -1;
    width: 100%;
}

.drive-file-row[hidden],
.client-card-rich[hidden],
.finance-table-card tr[hidden] {
    display: none !important;
}

@media (max-width: 1350px) {
    .client-summary-grid,
    .client-overview-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .profile-hero {
        grid-template-columns: minmax(320px, 1.2fr) minmax(260px, .8fr);
    }

    .profile-quick-facts {
        grid-column: 1 / -1;
    }

    .drive-file-list[data-drive-layout="grid"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .client-toolbar {
        grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(150px, .6fr));
    }

    .client-toolbar > :nth-child(4),
    .client-toolbar > .button {
        grid-column: auto;
    }

    .client-content-grid,
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .client-detail-sidebar,
    .profile-security-column {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-detail-sidebar > :last-child,
    .profile-security-column > :last-child {
        grid-column: 1 / -1;
    }

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

@media (max-width: 820px) {
    .client-summary-grid,
    .client-overview-metrics,
    .drive-overview-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-toolbar,
    .finance-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-toolbar .client-search,
    .finance-toolbar .search-box {
        grid-column: 1 / -1;
    }

    .client-grid-rich {
        grid-template-columns: 1fr;
    }

    .client-secondary-grid,
    .client-contact-grid {
        grid-template-columns: 1fr;
    }

    .client-project-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .client-project-row > span:nth-child(3) {
        grid-column: 2;
        text-align: left;
    }

    .client-project-row > .badge {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .profile-hero {
        grid-template-columns: 1fr;
    }

    .profile-quick-facts {
        grid-column: auto;
    }

    .notification-preference-row {
        grid-template-columns: auto minmax(0, 1fr) 50px 50px;
    }

    .notification-legend {
        grid-template-columns: repeat(2, 50px);
    }

    .drive-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .drive-section-actions {
        width: 100%;
        justify-content: space-between;
    }

    .drive-file-list[data-drive-layout="grid"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .client-summary-grid,
    .client-overview-metrics,
    .finance-summary-grid,
    .drive-overview-strip {
        grid-template-columns: 1fr 1fr;
    }

    .client-summary-card,
    .client-overview-metrics > article,
    .finance-summary-grid > article {
        min-height: 108px;
        padding: 13px;
    }

    .client-toolbar,
    .finance-toolbar {
        grid-template-columns: 1fr;
    }

    .client-toolbar > *,
    .finance-toolbar > * {
        grid-column: 1 !important;
        width: 100%;
    }

    .client-card-operational,
    .client-finance-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-card-operational > :last-child,
    .client-finance-strip > :last-child {
        grid-column: 1 / -1;
    }

    .client-results-heading,
    .section-heading-row,
    .finance-table-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading-row .header-actions {
        width: 100%;
    }

    .section-heading-row .header-actions .button {
        flex: 1;
    }

    .client-detail-title-row .badge {
        margin-left: 64px;
    }

    .client-detail-nav,
    .profile-section-nav {
        margin-inline: -2px;
    }

    .client-detail-sidebar,
    .profile-security-column {
        grid-template-columns: 1fr;
    }

    .client-detail-sidebar > :last-child,
    .profile-security-column > :last-child {
        grid-column: auto;
    }

    .client-project-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .client-project-row > .badge {
        grid-column: 2;
        grid-row: auto;
        justify-self: start;
    }

    .profile-hero-identity {
        align-items: flex-start;
    }

    .avatar-profile {
        width: 64px;
        height: 64px;
        border-radius: 18px;
    }

    .profile-quick-facts {
        grid-template-columns: 1fr;
    }

    .notification-preference-row {
        grid-template-columns: auto minmax(0, 1fr) 44px 44px;
        gap: 7px;
    }

    .notification-preference-row small {
        display: none;
    }

    .notification-legend {
        display: none;
    }

    .panel-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-form-footer .button {
        width: 100%;
    }

    .password-strength ul {
        grid-template-columns: 1fr;
    }

    .drive-type-filter {
        width: 100%;
        overflow-x: auto;
    }

    .drive-type-filter button {
        flex: 0 0 auto;
    }

    .drive-layout-switch {
        display: none;
    }

    .drive-file-list[data-drive-layout="grid"] {
        display: block;
        padding: 0;
        border: 0;
    }

    .drive-file-list[data-drive-layout="grid"] .drive-file-row {
        margin-bottom: 8px;
    }
}

/* FluxUI Workspace v1.5.0 — histórico e responsividade global */
.workspace-main *, .workspace-main *::before, .workspace-main *::after { min-width: 0; }
.view-tabs { display:inline-flex;max-width:100%;margin:0 0 18px;padding:4px;gap:4px;overflow-x:auto;border:1px solid var(--border-soft);border-radius:11px;background:#17191b;scrollbar-width:none }
.view-tabs::-webkit-scrollbar{display:none}.view-tabs a{flex:0 0 auto;min-height:36px;padding:8px 15px;border-radius:8px;color:var(--muted);font-weight:700;white-space:nowrap}.view-tabs a:hover,.view-tabs a.is-active{color:#fff;background:var(--blue-soft)}
.page-control-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;gap:14px}.page-control-row .project-selector,.page-control-row .view-tabs{margin:0}.page-control-row .project-selector label{flex:1 1 240px}.page-control-row .project-selector select{width:100%}
.task-summary-grid,.report-summary-grid,.project-archive-banner{margin-bottom:18px}.kanban-empty{min-height:80px;padding:18px 10px;border:1px dashed var(--border-soft);border-radius:10px;color:var(--muted-2);font-size:12px;text-align:center}
.archived-items-panel{padding:0;overflow:clip}.archived-items-panel>summary{display:flex;align-items:center;justify-content:space-between;min-height:58px;padding:14px 18px;gap:12px;cursor:pointer;list-style:none}.archived-items-panel>summary::-webkit-details-marker{display:none}.archived-items-panel>summary span{display:grid;gap:2px}.archived-items-panel>summary small,.restore-list small,.system-health-grid span,.system-health-grid small{color:var(--muted)}.archived-items-panel[open]>summary{border-bottom:1px solid var(--border-soft)}.archived-items-panel>summary svg{flex:0 0 auto;transition:transform .18s ease}.archived-items-panel[open]>summary svg{transform:rotate(180deg)}
.compact-archive-panel{margin-top:16px;border:1px solid var(--border-soft);border-radius:10px;background:rgb(0 0 0/8%)}.restore-list{display:grid}.restore-list>div{display:flex;align-items:center;justify-content:space-between;padding:13px 18px;gap:14px;border-bottom:1px solid var(--border-soft)}.restore-list>div:last-child{border-bottom:0}.restore-list>div>span{display:grid;gap:2px}.restore-list small{overflow-wrap:anywhere}.restore-list form,.notification-form,.table-actions form{margin:0}
.notification-form,.notification-form .notification{width:100%}.notification-form .notification{border:0;color:inherit;font:inherit;text-align:left;cursor:pointer}.notification-form .notification:hover{background:rgb(77 143 247/8%)}[data-audience-field][hidden]{display:none!important}.archived-task-list .table-subcopy{display:block}.table-actions{flex-wrap:wrap}
.system-health-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:20px;gap:12px}.system-health-grid article{display:grid;min-height:112px;align-content:center;padding:16px;gap:4px;border:1px solid var(--border-soft);border-radius:12px;background:linear-gradient(180deg,#1d1f22,#191b1d)}.system-health-grid article::before{width:8px;height:8px;margin-bottom:3px;border-radius:50%;background:var(--green);box-shadow:0 0 0 4px rgb(36 199 144/10%);content:""}.system-health-grid article.is-warning::before{background:var(--yellow);box-shadow:0 0 0 4px rgb(243 182 31/10%)}.system-health-grid strong{font-size:19px}
.permission-module-group{overflow:clip;border:1px solid var(--border-soft);border-radius:9px}.permission-module-group>summary{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;gap:8px;background:rgb(255 255 255/2%);cursor:pointer}.permission-module-group>summary small{color:var(--muted)}.permission-module-group>div{display:grid;padding:8px;gap:6px;border-top:1px solid var(--border-soft)}
@media(max-width:1180px){.ticket-filter-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}.ticket-filter-toolbar .toolbar-search{grid-column:span 2}.posts-layout{grid-template-columns:minmax(0,1fr) minmax(270px,34%)}.system-health-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:980px){.page-control-row{align-items:stretch;flex-direction:column}.page-control-row .project-selector,.page-control-row .view-tabs{width:100%}.page-control-row .view-tabs{display:flex}.page-control-row .view-tabs a{flex:1 0 auto;text-align:center}.ticket-filter-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}.posts-layout{grid-template-columns:1fr}.notifications-panel{position:static;max-height:none}}
@media(max-width:820px){.workspace-main:not(.workspace-main-chat){padding-top:22px}.page-header,.page-header.page-header-compact{align-items:flex-start;flex-direction:column}.page-header>.button,.page-header>a.button,.page-header>.header-actions,.page-header .header-actions{width:100%}.page-header .header-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.page-header .header-actions .button,.page-header .header-actions form,.page-header .header-actions form .button{width:100%}.kanban-summary-grid,.task-summary-grid,.report-summary-grid,.ticket-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.toolbar,.ticket-filter-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}.toolbar .toolbar-search,.ticket-filter-toolbar .toolbar-search{grid-column:1/-1}.form-grid{grid-template-columns:1fr}.form-grid .span-2{grid-column:auto}.modal-card,.modal-card.modal-card-wide{width:min(100%,680px);max-height:calc(100dvh - 24px);overflow-y:auto}}
@media(max-width:700px){.table-scroll:has(.responsive-table){overflow:visible}.responsive-table tbody tr{overflow:hidden}.responsive-table td{grid-template-columns:minmax(96px,34%) minmax(0,1fr)}.responsive-table td>*{max-width:100%}.responsive-table .table-actions{align-items:stretch;flex-direction:column}.responsive-table .table-actions .button,.responsive-table .table-actions form{width:100%}}
@media(max-width:600px){.workspace-main:not(.workspace-main-chat){padding-top:16px}.workspace-main:not(.workspace-main-chat)>.page-header{margin-bottom:16px;padding-bottom:14px}.page-header .header-actions{grid-template-columns:1fr}.view-tabs{display:flex;width:100%}.view-tabs a{flex:1 0 auto;text-align:center}.toolbar,.ticket-filter-toolbar{grid-template-columns:1fr}.toolbar>*,.ticket-filter-toolbar>*,.toolbar .toolbar-search,.ticket-filter-toolbar .toolbar-search{grid-column:1!important;width:100%}.restore-list>div{align-items:stretch;flex-direction:column;padding:13px}.restore-list .table-actions,.restore-list form,.restore-list .button{width:100%}.archived-items-panel>summary{padding-inline:13px}.client-card-footer{align-items:stretch;flex-direction:column}.client-card-footer form,.client-card-footer .button{width:100%}.modal{width:100%;max-width:none;padding:8px}.modal-card,.modal-card.modal-card-wide{width:100%;max-height:calc(100dvh - 16px);border-radius:14px}.modal-heading,.modal-actions{flex-wrap:wrap}.modal-actions .button{flex:1 1 100%}}
@media(max-width:430px){.kanban-summary-grid,.task-summary-grid,.report-summary-grid,.ticket-summary-grid,.client-summary-grid,.client-overview-metrics,.finance-summary-grid,.system-health-grid{grid-template-columns:1fr}.responsive-table td{display:grid;grid-template-columns:1fr;gap:5px}.responsive-table td::before{margin-bottom:1px}}
@media(prefers-reduced-motion:reduce){.archived-items-panel>summary svg{transition:none}}

/* FluxUI Workspace v1.6.0 — central operacional, equipe por hora e financeiro */
.operations-page,
.project-workspace-page,
.reports-page,
.hours-page,
.team-page,
.posts-page,
.tickets-workspace-page,
.tasks-workspace-page {
    width: 100%;
}

.operations-header {
    align-items: flex-end;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.eyebrow,
.page-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--accent-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.operations-metrics,
.project-finance-strip {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.operations-metrics .metric-card,
.project-finance-strip .metric-card {
    min-height: 118px;
    justify-content: center;
    border-color: var(--border-soft);
    background: linear-gradient(145deg, rgb(255 255 255 / 2.4%), rgb(255 255 255 / .6%));
}

.operations-metrics .metric-card strong,
.project-finance-strip .metric-card strong {
    font-size: clamp(22px, 2.4vw, 29px);
    letter-spacing: -.03em;
}

.operations-filterbar {
    position: relative;
    z-index: 3;
    align-items: end;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(220px, 1.4fr);
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 13px;
    background: rgb(24 26 29 / 94%);
    box-shadow: 0 10px 25px rgb(0 0 0 / 12%);
}

.operations-filterbar label > span,
.task-filterbar label > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.operations-table-card {
    overflow: clip;
    border-color: var(--border-soft);
}

.operations-table-card .panel-heading {
    padding: 17px 18px;
    background: rgb(255 255 255 / 1.6%);
}

.operations-table-card thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #1b1d20;
}

.operations-table-card tbody tr {
    transition: background-color .15s ease;
}

.operations-table-card tbody tr:hover {
    background: rgb(77 143 247 / 4.5%);
}

.person-cell {
    display: flex;
    min-width: 210px;
    align-items: center;
    gap: 10px;
}

.person-cell > span:last-child {
    display: grid;
    gap: 2px;
}

.person-cell small,
.table-subcopy {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.capacity-board {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(145deg, #1c1e21, #181a1d);
}

.capacity-board .panel-heading {
    padding: 0 0 14px;
}

.capacity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 11px;
}

.capacity-card {
    display: grid;
    padding: 14px;
    gap: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgb(255 255 255 / 1.8%);
}

.capacity-card > header,
.capacity-numbers {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.capacity-numbers {
    align-items: flex-end;
}

.capacity-numbers span {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: 11px;
}

.capacity-numbers strong {
    color: var(--text);
    font-size: 16px;
}

.finance-progress {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 16px;
}

.finance-progress > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.inline-progress {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.inline-progress progress,
.capacity-card progress,
.finance-progress progress {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    accent-color: var(--blue);
}

.inline-progress strong {
    min-width: 36px;
    font-size: 12px;
    text-align: right;
}

.capacity-card > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.capacity-card > div:first-child > span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.project-card-finance {
    display: grid;
    padding: 12px;
    gap: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: rgb(0 0 0 / 10%);
}

.project-card-finance > div:first-child,
.project-finance-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-finance-panel {
    overflow: clip;
    border-color: rgb(77 143 247 / 24%);
    background: linear-gradient(145deg, rgb(77 143 247 / 5%), transparent 42%);
}

.project-finance-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.project-finance-summary > div {
    display: grid;
    gap: 3px;
}

.project-finance-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.project-finance-summary strong {
    font-size: 18px;
}

.posts-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
    gap: 16px;
}

.posts-feed,
.notification-list {
    display: grid;
    gap: 12px;
}

.posts-side {
    position: sticky;
    top: 18px;
}

.post-card {
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(145deg, #1d1f22, #191b1e);
}

.post-card.is-pinned {
    border-color: rgb(77 143 247 / 40%);
    box-shadow: inset 3px 0 0 var(--blue);
}

.post-card-top,
.post-card-actions,
.post-card-badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.post-card-badges,
.post-card-actions {
    justify-content: flex-start;
}

.post-body {
    margin: 15px 0;
    overflow-wrap: anywhere;
}

.notification-item {
    display: grid;
    padding: 12px;
    gap: 4px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: rgb(255 255 255 / 1.5%);
}

.notification-item.is-unread {
    border-color: rgb(77 143 247 / 35%);
    background: rgb(77 143 247 / 6%);
}

.danger-zone {
    padding: 15px;
    border: 1px solid rgb(239 87 87 / 32%);
    border-radius: 12px;
    background: rgb(239 87 87 / 5%);
}

/* Drive: menos “janela dentro da janela”, mais área útil e ações previsíveis. */
.drive-page-heading {
    margin-bottom: 16px;
}

.drive-overview-strip {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 14px;
}

.drive-shell-refined {
    min-height: calc(100dvh - 250px);
    overflow: clip;
    border: 1px solid var(--border-soft);
    border-radius: 15px;
    background: #181a1d;
    box-shadow: 0 18px 45px rgb(0 0 0 / 16%);
}

.drive-sidebar {
    background: #16181a;
}

.drive-main {
    min-width: 0;
    background: linear-gradient(180deg, #1b1d20, #181a1d);
}

.drive-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    background: rgb(27 29 32 / 94%);
    backdrop-filter: blur(14px);
}

.drive-filters {
    align-items: center;
}

.drive-search {
    min-width: min(390px, 100%);
}

.drive-folder-section,
.drive-file-section {
    padding: 16px;
}

.drive-folder-card,
.drive-file-row {
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.drive-folder-card:hover,
.drive-file-row:hover {
    border-color: rgb(77 143 247 / 32%);
    background: rgb(77 143 247 / 4%);
}

.drive-file-list[data-drive-layout="grid"] .drive-file-row:hover,
.drive-folder-card:hover {
    transform: translateY(-1px);
}

.drive-dropzone {
    min-height: 148px;
    border-width: 1px;
    background: rgb(77 143 247 / 2.5%);
}

.drive-dropzone.is-dragging {
    border-color: var(--blue);
    background: rgb(77 143 247 / 9%);
}

/* Clientes, chamados e tarefas com leitura e navegação mais consistentes. */
.client-toolbar,
.ticket-filter-toolbar,
.task-filterbar,
.projects-filter-panel {
    border-color: var(--border-soft);
    background: #191b1e;
}

.client-card-rich,
.project-card-rich,
.kanban-card {
    border-color: var(--border-soft);
    box-shadow: 0 10px 25px rgb(0 0 0 / 8%);
}

.client-card-rich:hover,
.project-card-rich:hover,
.kanban-card:hover {
    border-color: rgb(77 143 247 / 30%);
}

.kanban-board {
    padding-bottom: 10px;
    scroll-snap-type: x proximity;
}

.kanban-column {
    scroll-snap-align: start;
    background: #181a1d;
}

.kanban-column-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgb(24 26 29 / 96%);
    backdrop-filter: blur(10px);
}

.task-filterbar {
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 1fr)) auto auto;
}

.toolbar-result-count {
    align-self: center;
    color: var(--muted);
    white-space: nowrap;
}

.toolbar-result-count strong {
    color: var(--text);
}

@media (max-width: 1180px) {
    .operations-filterbar,
    .task-filterbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .operations-filterbar .toolbar-search,
    .task-filterbar .toolbar-search {
        grid-column: 1 / -1;
    }

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

@media (max-width: 980px) {
    .posts-layout {
        grid-template-columns: 1fr;
    }

    .posts-side {
        position: static;
    }

    .drive-shell-refined {
        min-height: 0;
    }

    .drive-topbar {
        position: static;
    }
}

@media (max-width: 760px) {
    .operations-filterbar,
    .task-filterbar {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .operations-filterbar .toolbar-search,
    .task-filterbar .toolbar-search {
        grid-column: auto;
    }

    .operations-filterbar .button,
    .task-filterbar .button {
        width: 100%;
    }

    .project-finance-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .capacity-grid {
        grid-template-columns: 1fr;
    }

    .drive-folder-section,
    .drive-file-section,
    .drive-topbar {
        padding-inline: 12px;
    }
}

@media (max-width: 480px) {
    .operations-metrics,
    .project-finance-strip,
    .project-finance-summary {
        grid-template-columns: 1fr;
    }

    .post-card {
        padding: 14px;
    }
}


/* Form validation v1.6.4 --------------------------------------------------- */
.validated-form :is(input, select, textarea).is-invalid {
    border-color: rgb(239 115 115 / 78%);
    box-shadow: 0 0 0 3px rgb(239 115 115 / 10%);
}

.validated-form :is(input, select, textarea).is-valid {
    border-color: rgb(53 200 148 / 45%);
}

.field-error {
    display: block;
    margin-top: 5px;
    color: #f0a1a1;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.4;
}

.field-error[hidden],
.form-validation-summary[hidden] {
    display: none;
}

.form-validation-summary {
    margin-top: 10px;
    padding: 10px 12px;
    color: #f4c0c0;
    border: 1px solid rgb(239 115 115 / 28%);
    border-radius: 9px;
    background: rgb(239 115 115 / 8%);
    font-size: 11px;
    line-height: 1.45;
}

.validated-form label > span:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.validated-form .field-required {
    flex: 0 0 auto;
    color: #9dbef4;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.validated-form [aria-required="true"]:focus {
    border-color: rgb(77 143 247 / 72%);
}

/* Tarefas v1.7.5 ----------------------------------------------------------- */
.tasks-workspace-page {
    min-width: 0;
}

.tasks-workspace-page > .page-header {
    align-items: flex-end;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.tasks-workspace-page .page-control-row {
    margin-bottom: 16px;
}

.tasks-workspace-page .project-selector {
    width: min(100%, 340px);
    margin-bottom: 0;
    padding: 6px 10px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: #191b1e;
}

.tasks-workspace-page .project-selector label {
    flex: 1 1 auto;
}

.tasks-workspace-page .project-selector select {
    width: 100%;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.tasks-workspace-page .task-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.tasks-workspace-page .task-summary-grid > article {
    display: grid;
    align-content: start;
    min-height: 98px;
    padding: 16px 18px;
    gap: 6px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(145deg, #1d1f22, #191b1e);
}

.tasks-workspace-page .task-summary-grid > article > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tasks-workspace-page .task-summary-grid > article > strong {
    font-size: clamp(28px, 3vw, 34px);
    line-height: 1;
    letter-spacing: -.03em;
}

.tasks-workspace-page .task-summary-grid > article > small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.tasks-workspace-page .task-filterbar {
    grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(150px, 1fr)) auto auto;
    gap: 10px;
    margin-bottom: 16px;
}

.tasks-workspace-page .toolbar-result-count {
    justify-self: end;
}

.tasks-workspace-page .kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    align-items: start;
    gap: 12px;
    overflow: visible;
    padding-bottom: 0;
    overscroll-behavior-inline: auto;
    scroll-snap-type: none;
}

.tasks-workspace-page .kanban-column {
    min-width: 0;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tasks-workspace-page .kanban-column-heading {
    position: static;
    padding: 0 3px 10px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-soft);
    background: transparent;
    backdrop-filter: none;
}

.tasks-workspace-page .kanban-dropzone {
    flex: 1 1 auto;
    min-height: 280px;
    padding-top: 12px;
}

.tasks-workspace-page .kanban-card {
    gap: 10px;
}

.tasks-workspace-page .kanban-card > a {
    line-height: 1.45;
}

.tasks-workspace-page .kanban-card-footer {
    min-width: 0;
}

.tasks-workspace-page .kanban-card-footer small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1320px) {
    .tasks-workspace-page .task-summary-grid,
    .tasks-workspace-page .kanban-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tasks-workspace-page .task-filterbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tasks-workspace-page .task-filterbar .toolbar-search,
    .tasks-workspace-page .toolbar-result-count {
        grid-column: 1 / -1;
    }

    .tasks-workspace-page .toolbar-result-count {
        justify-self: start;
    }
}

@media (max-width: 760px) {
    .tasks-workspace-page .task-summary-grid,
    .tasks-workspace-page .kanban-board,
    .tasks-workspace-page .task-filterbar {
        grid-template-columns: 1fr;
    }

    .tasks-workspace-page .kanban-column {
        min-height: 0;
    }

    .tasks-workspace-page .kanban-dropzone {
        min-height: 0;
    }
}

/* Kanban interno do projeto v1.7.6 ---------------------------------------- */
.project-kanban-page {
    min-width: 0;
}

.project-kanban-page .project-workspace-header {
    align-items: flex-end;
    margin-bottom: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.project-kanban-page .project-workspace-title-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.project-kanban-page .project-workspace-title-row > div {
    min-width: 0;
}

.project-kanban-page .project-workspace-title-row h1,
.project-kanban-page .project-workspace-title-row p {
    margin: 0;
}

.project-kanban-page .project-workspace-title-row p {
    margin-top: 3px;
    color: var(--muted);
}

.project-kanban-page .project-kanban-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.project-kanban-page .project-kanban-summary-grid > article {
    display: grid;
    min-width: 0;
    min-height: 96px;
    align-content: center;
    padding: 15px 16px;
    gap: 6px;
    border: 1px solid var(--border-soft);
    border-radius: 13px;
    background: linear-gradient(145deg, #1d1f22, #191b1e);
}

.project-kanban-page .kanban-summary-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-kanban-page .kanban-summary-heading > span {
    min-width: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .055em;
    line-height: 1.25;
    text-transform: uppercase;
}

.project-kanban-page .kanban-summary-heading > strong {
    flex: 0 0 auto;
    color: var(--text);
    font-size: 27px;
    line-height: 1;
    letter-spacing: -.04em;
}

.project-kanban-page .project-kanban-summary-grid article > small {
    display: block;
    overflow: hidden;
    color: var(--muted-2);
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-kanban-page .project-kanban-toolbar {
    grid-template-columns: minmax(270px, 1.7fr) repeat(4, minmax(135px, 1fr)) auto;
    gap: 9px;
    margin-bottom: 14px;
    padding: 11px;
}

.project-kanban-page .kanban-search-field {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.project-kanban-page .kanban-search-field > span,
.project-kanban-page .project-kanban-toolbar > label > span {
    color: #858d98;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.project-kanban-page .kanban-search-shell {
    min-height: 39px;
    padding-inline: 11px;
    border-color: #30343a;
    border-radius: 8px;
    background: #202327;
}

.project-kanban-page .kanban-search-shell svg {
    position: static;
    flex: 0 0 auto;
    color: #737d89;
}

.project-kanban-page .kanban-search-shell input {
    min-height: 37px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.project-kanban-page .kanban-search-shell input:focus {
    border: 0;
    outline: 0;
    box-shadow: none;
}

.project-kanban-page .kanban-toolbar-actions {
    justify-content: flex-end;
    align-self: end;
}

.project-kanban-page .project-kanban-board,
.project-kanban-page .kanban-board-rich.project-kanban-board {
    display: grid;
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    align-items: start;
    gap: 11px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
}

.project-kanban-page .project-kanban-board .kanban-column,
.project-kanban-page .kanban-board-rich.project-kanban-board .kanban-column {
    display: flex;
    min-width: 0;
    max-width: none;
    min-height: 360px;
    flex-direction: column;
    overflow: hidden;
    scroll-snap-align: none;
}

.project-kanban-page .project-kanban-board .kanban-column-heading,
.project-kanban-page .kanban-board-rich.project-kanban-board .kanban-column-heading {
    position: static;
    top: auto;
    margin: 0;
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: #1f2124;
    backdrop-filter: none;
}

.project-kanban-page .project-kanban-board .kanban-column-heading h2 {
    display: flex;
    min-width: 0;
    align-items: center;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-kanban-page .project-kanban-board .kanban-dropzone,
.project-kanban-page .kanban-board-rich.project-kanban-board .kanban-dropzone {
    flex: 1 1 auto;
    min-height: 270px;
    padding: 10px;
}

.project-kanban-page .kanban-column-empty:not([hidden]) {
    min-height: 100px;
    display: grid;
    place-items: center;
    padding: 16px;
    color: var(--muted-2);
    border: 1px dashed var(--border-soft);
    border-radius: 9px;
    text-align: center;
}

@media (max-width: 1380px) {
    .project-kanban-page .project-kanban-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .project-kanban-page .project-kanban-toolbar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .project-kanban-page .kanban-search-field {
        grid-column: span 2;
    }

    .project-kanban-page .kanban-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1080px) {
    .project-kanban-page .project-kanban-board,
    .project-kanban-page .kanban-board-rich.project-kanban-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-kanban-page .project-kanban-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-kanban-page .project-kanban-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-kanban-page .kanban-search-field,
    .project-kanban-page .kanban-toolbar-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .project-kanban-page .project-workspace-header,
    .project-kanban-page .project-workspace-title-row {
        align-items: flex-start;
    }

    .project-kanban-page .project-workspace-title-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .project-kanban-page .project-workspace-title-row > .badge {
        grid-column: 2;
        justify-self: start;
    }

    .project-kanban-page .project-kanban-summary-grid,
    .project-kanban-page .project-kanban-toolbar,
    .project-kanban-page .project-kanban-board,
    .project-kanban-page .kanban-board-rich.project-kanban-board {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-kanban-page .kanban-search-field,
    .project-kanban-page .kanban-toolbar-actions {
        grid-column: auto;
    }

    .project-kanban-page .kanban-toolbar-actions,
    .project-kanban-page .kanban-toolbar-actions .button {
        width: 100%;
    }

    .project-kanban-page .kanban-toolbar-actions {
        justify-content: space-between;
    }

    .project-kanban-page .project-kanban-board .kanban-column,
    .project-kanban-page .kanban-board-rich.project-kanban-board .kanban-column {
        min-height: 0;
    }

    .project-kanban-page .project-kanban-board .kanban-dropzone,
    .project-kanban-page .kanban-board-rich.project-kanban-board .kanban-dropzone {
        min-height: 0;
    }
}

/* Arquivos v1.7.7 ---------------------------------------------------------- */
.files-page,
.drive-page-heading,
.drive-overview-strip,
.drive-shell,
.drive-shell-refined,
.drive-main,
.drive-topbar,
.drive-file-section {
    width: 100%;
    max-width: none;
}

.drive-page-heading {
    align-items: flex-end;
    margin-bottom: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.drive-page-heading .header-actions {
    gap: 10px;
}

.drive-overview-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.drive-overview-strip > article {
    min-height: 92px;
    padding: 14px;
    border-color: var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(145deg, #1d1f22, #191b1e);
}

.drive-overview-strip small {
    font-size: 11px;
}

.drive-overview-strip strong {
    font-size: 18px;
}

.drive-shell-refined {
    min-height: calc(100dvh - 245px);
    overflow: clip;
    border-color: var(--border-soft);
    background: linear-gradient(180deg, #191b1e, #17191c);
}

.drive-shell-refined .drive-sidebar {
    gap: 18px;
    padding: 18px 14px;
    border-right-color: var(--border-soft);
}

.drive-nav {
    gap: 6px;
}

.drive-nav a {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
}

.drive-storage-list {
    gap: 12px;
    padding-inline: 6px;
}

.drive-shell-refined .drive-main {
    padding: 18px;
}

.drive-topbar {
    gap: 12px;
    padding-bottom: 14px;
    border-bottom-color: var(--border-soft);
}

.drive-breadcrumbs {
    font-size: 12px;
}

.drive-filters {
    grid-template-columns: minmax(280px, 1.6fr) minmax(150px, .75fr) minmax(200px, 1fr) minmax(150px, .75fr) auto;
    gap: 10px;
}

.drive-search,
.drive-filters select,
.drive-filters .button {
    min-height: 42px;
}

.drive-section-heading {
    align-items: flex-start;
    gap: 12px;
    padding: 18px 2px 14px;
}

.drive-section-heading h2 {
    font-size: 18px;
}

.drive-section-heading p {
    font-size: 12px;
}

.drive-section-actions {
    row-gap: 8px;
}

.drive-type-filter button,
.drive-layout-switch button {
    min-height: 32px;
    font-size: 10px;
}

.drive-folder-section {
    margin-bottom: 16px;
}

.drive-folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.drive-folder-card {
    gap: 12px;
    padding: 14px;
    border-color: var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(145deg, #1d1f22, #181a1d);
}

.drive-folder-link strong,
.drive-file-primary strong,
.drive-file-location strong,
.drive-file-uploader strong {
    font-size: 12px;
}

.drive-folder-link small,
.drive-file-primary small,
.drive-file-location small,
.drive-file-uploader small,
.drive-file-row > time,
.drive-file-size,
.drive-folder-meta {
    font-size: 11px;
}

.drive-file-list {
    overflow: clip;
    border-color: var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(180deg, #1b1d20, #181a1d);
}

.drive-file-list-head,
.drive-file-row {
    grid-template-columns: minmax(300px, 1.7fr) minmax(170px, 1fr) 140px 90px 84px;
    gap: 14px;
}

.drive-file-list-head {
    min-height: 44px;
    padding-inline: 16px;
    border-bottom-color: var(--border-soft);
    background: rgb(255 255 255 / 1.8%);
    font-size: 10px;
}

.drive-file-list-head > span:nth-child(3),
.drive-file-row .drive-file-uploader {
    display: none;
}

.drive-file-row {
    min-height: 76px;
    padding: 12px 16px;
    border-bottom-color: rgb(255 255 255 / 5%);
}

.drive-file-primary {
    gap: 12px;
}

.drive-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.drive-file-primary > span:last-child {
    gap: 4px;
}

.drive-file-primary small {
    gap: 8px;
}

.drive-file-location {
    gap: 4px;
}

.drive-file-actions {
    gap: 6px;
}

.drive-file-actions .icon-button {
    width: 32px;
    height: 32px;
}

.drive-file-list[data-drive-layout="grid"] {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    padding: 12px;
}

.drive-file-list[data-drive-layout="grid"] .drive-file-row {
    min-height: 168px;
    padding: 14px;
    border-color: var(--border-soft);
    border-radius: 13px;
    background: linear-gradient(145deg, #1f2124, #1a1c20);
}

.drive-empty-state {
    min-height: 220px;
}

@media (max-width: 1240px) {
    .drive-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .drive-search {
        grid-column: 1 / -1;
    }

    .drive-filters .button {
        width: 100%;
    }

    .drive-file-list-head,
    .drive-file-row {
        grid-template-columns: minmax(250px, 1.45fr) minmax(150px, .9fr) 88px 78px;
    }

    .drive-file-list-head > span:nth-child(4),
    .drive-file-row > time {
        display: none;
    }
}

@media (max-width: 900px) {
    .drive-overview-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .drive-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .drive-shell-refined .drive-sidebar {
        padding-bottom: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
        border-radius: 16px 16px 0 0;
    }

    .drive-storage-list {
        display: none;
    }

    .drive-main {
        padding: 14px;
    }

    .drive-section-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 720px) {
    .drive-page-heading .header-actions,
    .drive-section-actions {
        width: 100%;
    }

    .drive-page-heading .header-actions .button {
        flex: 1 1 160px;
    }

    .drive-overview-strip,
    .drive-filters,
    .drive-folder-grid,
    .drive-file-list[data-drive-layout="grid"] {
        grid-template-columns: 1fr;
    }

    .drive-file-list-head {
        display: none;
    }

    .drive-file-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
        padding: 14px;
    }

    .drive-file-primary,
    .drive-file-location,
    .drive-file-size {
        grid-column: 1;
    }

    .drive-file-location {
        flex-direction: row;
        gap: 6px;
    }

    .drive-file-actions {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: start;
    }
}

/* Campos de anexo / upload v1.8.3 ----------------------------------------- */
.file-upload-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 6px 10px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: linear-gradient(145deg, #1d1f23, #191b1e);
}

.file-upload-field input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgb(77 143 247 / 24%);
    border-radius: 10px;
    color: #edf4ff;
    background: rgb(77 143 247 / 14%);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.file-upload-button:hover {
    background: rgb(77 143 247 / 20%);
    border-color: rgb(77 143 247 / 34%);
}

.file-upload-button:active {
    transform: translateY(1px);
}

.file-upload-name {
    min-width: 0;
    overflow: hidden;
    color: #98a1ae;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload-name.has-file {
    color: #e6ecf5;
    font-weight: 600;
}

.file-upload-field:focus-within {
    border-color: rgb(77 143 247 / 44%);
    box-shadow: 0 0 0 3px rgb(77 143 247 / 10%);
}

.inline-form > .file-upload-field,
.inline-compose .file-upload-field {
    flex: 1 1 260px;
}

label > .file-upload-field {
    margin-top: 8px;
}

@media (max-width: 640px) {
    .file-upload-field {
        align-items: stretch;
        flex-direction: column;
    }

    .file-upload-button {
        width: 100%;
    }

    .file-upload-name {
        width: 100%;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}
