:root {
    --bg: #111315;
    --bg-elevated: #1A1F24;
    --surface: #242B31;
    --surface-2: #2C343B;
    --surface-3: #343E46;
    --blue: #6E8BA7;
    --blue-bright: #7FA7C9;
    --cyan: #C7D7E5;
    --light-blue: #AABDCF;
    --white: #F3F5F7;
    --soft-white: #E7ECEF;
    --navy: var(--white);
    --navy-2: var(--soft-white);
    --teal: var(--cyan);
    --teal-dark: var(--light-blue);
    --paper: var(--bg-elevated);
    --cream: var(--surface);
    --sand: var(--surface-2);
    --clay: #B5816D;
    --ink: var(--soft-white);
    --muted: #AAB4C0;
    --line: rgba(199, 215, 229, 0.14);
    --danger: #D18B7B;
    --success: #8FB9A2;
    --brand-gradient: linear-gradient(135deg, #6E8BA7 0%, #C7D7E5 100%);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    --radius: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--paper), var(--cream));
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
}

body.auth-loading .shell,
body.firebase-required:not(.auth-authorized) .shell {
    display: none;
}

body.auth-authorized .login-screen {
    display: none;
}

.login-screen {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 10%, rgba(15, 176, 186, 0.14), transparent 28rem),
        radial-gradient(circle at 85% 5%, rgba(196, 111, 79, 0.12), transparent 30rem),
        linear-gradient(180deg, var(--paper), var(--cream));
    padding: 24px;
}

.login-card {
    width: min(100%, 520px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow);
    padding: clamp(24px, 4vw, 42px);
}

.login-brand {
    display: grid;
    justify-items: start;
    gap: 8px;
    margin-bottom: 24px;
}

.login-card h1 {
    margin-top: 12px;
}

.login-card p:not(.eyebrow) {
    margin-top: 12px;
    color: var(--muted);
}

.google-button {
    width: 100%;
    margin-top: 24px;
    background: var(--navy);
}

.google-button span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--paper);
    color: var(--navy);
    font-weight: 900;
}

#loginSignOutButton {
    width: 100%;
    margin-top: 12px;
}

.access-note {
    margin-top: 18px;
    border: 1px solid rgba(15, 176, 186, 0.24);
    border-radius: 16px;
    background: rgba(15, 176, 186, 0.08);
    color: var(--muted);
    padding: 14px;
}

.access-note strong {
    display: block;
    color: var(--navy);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

.shell {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(217, 208, 194, 0.85);
    background: rgba(255, 253, 248, 0.94);
    padding: 22px;
}

.brand {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--navy);
    text-decoration: none;
}

.brand-logo {
    width: min(100%, 220px);
    height: auto;
}

.sidebar-brand {
    display: grid;
    justify-items: stretch;
    gap: 8px;
}

.sidebar-brand .brand-logo {
    width: 100%;
    max-width: 306px;
}

.sidebar-company-name {
    display: block;
    color: var(--navy);
    font-size: 25px;
    font-weight: 850;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.portal-label {
    display: inline-flex;
    border: 1px solid rgba(13, 37, 83, 0.14);
    border-radius: 999px;
    background: rgba(15, 176, 186, 0.08);
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
}

.sidebar-brand .portal-label {
    width: fit-content;
    font-size: 14px;
    padding: 6px 11px;
}

.eyebrow {
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.nav-list {
    display: grid;
    gap: 9px;
    margin-top: 28px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    cursor: pointer;
    color: var(--navy);
    font-weight: 800;
    padding: 13px 14px;
    text-align: left;
}

.nav-item small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.nav-item[data-nav="dashboard"] {
    flex-wrap: wrap;
}

#dashboardUnreadPosts {
    flex-basis: 100%;
    color: var(--light-blue);
}

.nav-item.active,
.nav-item:hover {
    border-color: rgba(15, 176, 186, 0.24);
    background: rgba(15, 176, 186, 0.08);
}

.sidebar-card,
.notice,
.panel,
.stat-card,
.task-card,
.workload-card,
.employee-card,
.pricing-card,
.calendar-day {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 253, 248, 0.84);
    box-shadow: var(--shadow);
}

.sidebar-card {
    margin-top: 24px;
    padding: 16px;
}

.online-card {
    margin-top: 14px;
}

.online-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.online-card-header span {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(76, 128, 103, 0.12);
    color: var(--success);
    font-size: 13px;
    font-weight: 900;
}

.online-list {
    display: grid;
    gap: 9px;
    margin-top: 12px;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(217, 208, 194, 0.78);
    border-radius: 14px;
    background: rgba(245, 241, 234, 0.56);
    padding: 10px;
}

.online-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(76, 128, 103, 0.12);
}

.online-user strong,
.online-user small {
    display: block;
}

.online-user strong {
    color: var(--navy);
    font-size: 13px;
}

.online-user small,
.online-empty {
    color: var(--muted);
    font-size: 12px;
}

.sidebar-card p:last-child {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

#firebaseStatus {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

#firebaseStatus.synced {
    color: var(--success);
    font-weight: 800;
}

.auth-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.auth-user {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.auth-user span {
    color: var(--navy);
    font-size: 13px;
    font-weight: 800;
    word-break: break-word;
}

.main {
    min-width: 0;
    padding: 24px clamp(18px, 3vw, 42px) 60px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

h1,
h2,
h3 {
    color: var(--navy);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 {
    margin-top: 5px;
    font-size: clamp(30px, 4vw, 46px);
}

h2 {
    margin-top: 7px;
    font-size: clamp(22px, 2.5vw, 30px);
}

h3 {
    font-size: 17px;
}

.topbar-actions,
.split-heading,
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--navy);
    color: var(--paper);
    cursor: pointer;
    font-weight: 800;
    padding: 10px 15px;
}

.button.secondary {
    border-color: rgba(13, 37, 83, 0.16);
    background: var(--paper);
    color: var(--navy);
}

.checklist-task-button {
    min-height: 34px;
    padding: 6px 11px;
}

.form-action-button {
    width: fit-content;
    min-height: 34px;
    align-self: end;
    border-radius: 14px;
    padding: 6px 13px;
    box-shadow: 0 8px 18px rgba(13, 37, 83, 0.12);
}

.button.danger,
.icon-button {
    border-color: rgba(166, 66, 42, 0.25);
    background: rgba(166, 66, 42, 0.1);
    color: var(--danger);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 20px;
}

.notice {
    margin-top: 20px;
    padding: 14px 16px;
    color: var(--muted);
}

.notice strong {
    color: var(--navy);
}

.view-root {
    display: grid;
    gap: 22px;
    margin-top: 22px;
    outline: none;
}

.panel {
    padding: clamp(18px, 2.2vw, 28px);
}

.section-heading {
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat-card {
    padding: 18px;
}

.stat-card span,
.stat-card small,
.helper,
.empty-state {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin: 4px 0;
    color: var(--navy);
    font-size: 32px;
}

.two-column,
.pricing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
    gap: 22px;
}

.task-form,
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    outline: none;
    padding: 10px 11px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(15, 176, 186, 0.6);
    box-shadow: 0 0 0 4px rgba(15, 176, 186, 0.12);
}

.wide {
    grid-column: span 3;
}

.workload-list,
.task-list,
.employee-list,
.pricing-main {
    display: grid;
    gap: 12px;
}

.workload-card,
.task-card,
.employee-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
}

.workload-card span,
.task-card span,
.task-card small,
.employee-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.task-card.overdue {
    border-color: rgba(166, 66, 42, 0.32);
    background: rgba(166, 66, 42, 0.07);
}

.bulletin-form {
    display: grid;
    gap: 10px;
}

.bulletin-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.bulletin-expand-button {
    margin-top: 14px;
}

.bulletin-read-status {
    color: var(--muted);
    font-size: 13px;
    margin-top: 10px;
}

.bulletin-unread-badge {
    display: inline-block;
    margin: 6px 0;
    border-radius: 999px;
    padding: 2px 8px;
    background: rgba(127, 167, 201, 0.2);
    color: var(--light-blue);
    font-size: 12px;
    font-weight: 800;
}

.bulletin-card {
    border: 1px solid rgba(217, 208, 194, 0.82);
    border-radius: 18px;
    background: rgba(245, 241, 234, 0.62);
    padding: 12px 14px;
}

.bulletin-card strong,
.bulletin-card small,
.bulletin-card p {
    display: block;
}

.bulletin-card small,
.bulletin-card p {
    color: var(--muted);
}

.bulletin-open {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.bulletin-message,
.bulletin-comment p,
.notification-comment {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bulletin-message {
    margin: 12px 0;
}

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

.bulletin-actions {
    justify-content: space-between;
}

.reaction-button {
    gap: 5px;
}

.button.reaction-button[aria-pressed="true"] {
    border-color: var(--blue-bright);
    background: rgba(127, 167, 201, 0.24);
    color: var(--white);
}

.bulletin-thread {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.bulletin-comments,
.bulletin-comment-form,
.notification-list {
    display: grid;
    gap: 12px;
}

.bulletin-comments,
.notification-list {
    max-height: 360px;
    overflow-y: auto;
    margin: 12px 0;
}

.bulletin-comment {
    border-left: 2px solid var(--line);
    padding-left: 12px;
}

.bulletin-comment p {
    margin: 6px 0;
}

.notification-panel {
    margin-top: 22px;
}

.notification-count {
    margin-left: 8px;
    border-radius: 999px;
    padding: 2px 8px;
    background: rgba(127, 167, 201, 0.2);
}

.notification-item {
    display: grid;
    gap: 6px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface-3);
    color: var(--soft-white);
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.notification-item small {
    color: var(--muted);
}

.notification-item.unread {
    border-left: 4px solid var(--blue-bright);
}

.bulletin-open:focus-visible,
.bulletin-actions button:focus-visible,
.notification-item:focus-visible,
#notificationsButton:focus-visible {
    outline: 2px solid var(--blue-bright);
    outline-offset: 3px;
}

.bulletin-form .button:disabled,
.bulletin-card .button:disabled,
.notification-panel .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.task-board-list {
    gap: 14px;
}

.task-board-card {
    display: grid;
    gap: 12px;
    align-items: start;
    justify-content: stretch;
}

.task-card-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.task-card-summary strong {
    display: block;
    color: var(--navy);
}

.task-card-meta {
    text-align: right;
}

.task-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.compact-button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.task-card-details {
    display: grid;
    gap: 10px;
    border-top: 1px solid rgba(217, 208, 194, 0.9);
    padding-top: 10px;
}

.task-card-details-grid,
.task-editor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.task-card-details-grid span {
    display: grid;
    gap: 3px;
    border: 1px solid rgba(217, 208, 194, 0.8);
    border-radius: 14px;
    background: rgba(245, 241, 234, 0.52);
    padding: 10px;
    color: var(--muted);
    font-size: 13px;
}

.task-card-details-grid strong,
.task-card-description {
    color: var(--navy);
}

.task-card-description {
    font-size: 13px;
}

.task-editor-grid .wide {
    grid-column: 1 / -1;
}

.filter-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 160px 180px;
    gap: 10px;
}

.task-table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid var(--line);
    padding: 9px;
    vertical-align: top;
}

th {
    background: var(--navy);
    color: var(--paper);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

td {
    background: rgba(255, 253, 248, 0.85);
    font-size: 13px;
}

td input,
td select {
    min-width: 120px;
}

.empty-cell,
.empty-state {
    padding: 18px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.day-labels {
    margin: 18px 0 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.calendar-day {
    min-height: 138px;
    padding: 10px;
}

.calendar-day.today {
    border-color: rgba(15, 176, 186, 0.55);
}

.muted-day {
    opacity: 0.5;
}

.calendar-tasks {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.calendar-tasks span {
    border-radius: 8px;
    background: rgba(13, 37, 83, 0.08);
    color: var(--navy);
    font-size: 12px;
    padding: 5px 7px;
}

.calendar-tasks span.high,
.calendar-tasks span.urgent {
    background: rgba(196, 111, 79, 0.14);
}

.employee-card {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto auto;
}

.pricing-layout {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 360px;
}

.pricing-summary {
    position: sticky;
    top: 24px;
}

.pricing-summary h2 {
    font-size: 40px;
}

.pricing-note {
    margin: -4px 0 16px;
    border: 1px solid rgba(196, 111, 79, 0.22);
    border-radius: 14px;
    background: rgba(196, 111, 79, 0.08);
    color: var(--muted);
    padding: 12px 14px;
}

.form-grid.five {
    grid-template-columns: 1.4fr repeat(4, 0.7fr);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--teal);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pricing-card {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.pricing-card.selected {
    border-color: rgba(15, 176, 186, 0.55);
    box-shadow: 0 12px 30px rgba(15, 176, 186, 0.12);
}

.pricing-card p,
.pricing-card small {
    color: var(--muted);
    font-size: 13px;
}

.pricing-controls {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr;
    gap: 10px;
}

.service-checklist-grid {
    display: grid;
    gap: 16px;
}

.service-checklist-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    padding: 16px;
}

.checklist-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.checklist-card-header h3 {
    margin-bottom: 4px;
}

.checklist-card-header span {
    color: var(--muted);
    font-size: 13px;
}

.checklist-progress {
    height: 10px;
    overflow: hidden;
    margin: 14px 0 16px;
    border-radius: 999px;
    background: rgba(13, 37, 83, 0.08);
}

.checklist-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--teal-dark));
}

.checklist-phases {
    display: grid;
    gap: 14px;
}

.checklist-phase {
    display: grid;
    gap: 9px;
}

.checklist-phase h4 {
    color: var(--teal-dark);
    font-size: 13px;
    letter-spacing: 0.03em;
}

.checklist-items {
    display: grid;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid rgba(217, 208, 194, 0.82);
    border-radius: 14px;
    background: rgba(245, 241, 234, 0.52);
    padding: 10px;
}

.checklist-item.complete {
    border-color: rgba(76, 128, 103, 0.28);
    background: rgba(76, 128, 103, 0.08);
}

.checklist-item input {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--teal);
}

.checklist-item span {
    display: grid;
    gap: 3px;
}

.checklist-item strong {
    color: var(--navy);
}

.checklist-item small {
    color: var(--muted);
    font-weight: 500;
}

.summary-list {
    display: grid;
    gap: 9px;
    margin-top: 16px;
}

.summary-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 8px;
}

.summary-list dt {
    color: var(--muted);
}

.summary-list dd {
    color: var(--navy);
    font-weight: 800;
}

.compact td {
    white-space: nowrap;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    transform: translateY(20px);
    opacity: 0;
    border-radius: 999px;
    background: var(--navy);
    color: var(--paper);
    padding: 12px 16px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* ZeroPhase public-site visual system. Kept separate from portal behavior and state. */
body {
    background:
        radial-gradient(circle at top left, rgba(127, 167, 201, 0.08), transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(199, 215, 229, 0.06), transparent 24%),
        linear-gradient(180deg, #0F1113 0%, #111315 35%, #171B1F 100%);
    color: var(--soft-white);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.login-screen {
    background:
        radial-gradient(circle at 18% 10%, rgba(127, 167, 201, 0.13), transparent 28rem),
        radial-gradient(circle at 85% 5%, rgba(199, 215, 229, 0.08), transparent 30rem),
        linear-gradient(180deg, #0F1113 0%, #171B1F 100%);
}

.login-card,
.sidebar-card,
.notice,
.panel,
.stat-card,
.task-card,
.workload-card,
.employee-card,
.pricing-card,
.calendar-day {
    border-color: var(--line);
    background: rgba(26, 31, 36, 0.82);
    box-shadow: var(--shadow);
}

.login-card {
    background: rgba(26, 31, 36, 0.94);
}

.login-card p:not(.eyebrow),
.sidebar-card p:last-child,
#firebaseStatus,
.stat-card span,
.stat-card small,
.helper,
.empty-state,
.workload-card span,
.task-card span,
.task-card small,
.employee-card span,
.bulletin-card small,
.bulletin-card p,
.pricing-card p,
.pricing-card small,
.checklist-card-header span,
.checklist-item small,
.summary-list dt {
    color: var(--muted);
}

.access-note {
    border-color: rgba(199, 215, 229, 0.2);
    background: rgba(127, 167, 201, 0.12);
    color: var(--light-blue);
}

.access-note strong,
.online-user strong,
.auth-user span,
.task-card-summary strong,
.task-card-details-grid strong,
.task-card-description,
.checklist-item strong,
.summary-list dd {
    color: var(--white);
}

.sidebar {
    border-color: var(--line);
    background: rgba(17, 19, 21, 0.9);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(20px);
}

.brand,
.sidebar-company-name,
h1,
h2,
h3,
label,
.nav-item,
.notice strong,
.stat-card strong {
    color: var(--white);
}

.portal-label {
    border-color: rgba(199, 215, 229, 0.2);
    background: rgba(127, 167, 201, 0.12);
    color: var(--cyan);
}

.eyebrow,
.checklist-phase h4 {
    color: var(--light-blue);
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.nav-item small,
.online-user small,
.online-empty {
    color: var(--muted);
}

.nav-item.active,
.nav-item:hover {
    border-color: rgba(199, 215, 229, 0.2);
    background: linear-gradient(90deg, rgba(110, 139, 167, 0.2), rgba(199, 215, 229, 0.07));
}

.online-user,
.bulletin-card,
.task-card-details-grid span,
.checklist-item {
    border-color: rgba(199, 215, 229, 0.14);
    background: rgba(44, 52, 59, 0.58);
}

.online-card-header span {
    background: rgba(143, 185, 162, 0.14);
    color: var(--success);
}

.online-dot {
    box-shadow: 0 0 0 4px rgba(143, 185, 162, 0.14);
}

.button {
    background: var(--brand-gradient);
    color: #111315;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

.button.secondary {
    border-color: rgba(199, 215, 229, 0.2);
    background: rgba(44, 52, 59, 0.72);
    color: var(--cyan);
    box-shadow: none;
}

.button.danger,
.icon-button {
    border-color: rgba(209, 139, 123, 0.3);
    background: rgba(209, 139, 123, 0.12);
    color: var(--danger);
    box-shadow: none;
}

input,
select,
textarea {
    border-color: rgba(199, 215, 229, 0.16);
    background: rgba(17, 19, 21, 0.76);
    color: var(--soft-white);
}

input::placeholder,
textarea::placeholder {
    color: #8290A0;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue-bright);
    box-shadow: 0 0 0 4px rgba(127, 167, 201, 0.16);
}

select option {
    background: var(--bg-elevated);
    color: var(--soft-white);
}

.task-card.overdue {
    border-color: rgba(209, 139, 123, 0.4);
    background: rgba(79, 47, 43, 0.52);
}

.task-card-details {
    border-color: var(--line);
}

th {
    background: var(--surface-3);
    color: var(--white);
}

td {
    background: rgba(26, 31, 36, 0.86);
}

.calendar-day.today,
.pricing-card.selected {
    border-color: rgba(199, 215, 229, 0.5);
    box-shadow: 0 12px 30px rgba(110, 139, 167, 0.12);
}

.calendar-tasks span {
    background: rgba(110, 139, 167, 0.2);
    color: var(--cyan);
}

.calendar-tasks span.high,
.calendar-tasks span.urgent,
.pricing-note {
    border-color: rgba(181, 129, 109, 0.35);
    background: rgba(181, 129, 109, 0.13);
    color: var(--light-blue);
}

.service-checklist-card {
    border-color: var(--line);
    background: rgba(36, 43, 49, 0.78);
}

.checklist-progress {
    background: rgba(199, 215, 229, 0.12);
}

.checklist-progress span {
    background: var(--brand-gradient);
}

.check-row input[type="checkbox"],
.checklist-item input {
    accent-color: var(--blue-bright);
}

.checklist-item.complete {
    border-color: rgba(143, 185, 162, 0.3);
    background: rgba(143, 185, 162, 0.1);
}

.toast {
    border: 1px solid rgba(199, 215, 229, 0.16);
    background: var(--surface-3);
    color: var(--white);
    box-shadow: var(--shadow);
}

.calculator-selector {
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 0%, rgba(127, 167, 201, 0.16), transparent 34rem),
        linear-gradient(135deg, rgba(36, 43, 49, 0.94), rgba(26, 31, 36, 0.86));
}

.calculator-selector-copy {
    max-width: 640px;
    margin-top: 10px;
    color: var(--muted);
}

.calculator-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.calculator-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    width: 100%;
    min-height: 190px;
    border: 1px solid rgba(199, 215, 229, 0.16);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(44, 52, 59, 0.9), rgba(26, 31, 36, 0.96));
    color: var(--white);
    cursor: pointer;
    padding: 24px;
    text-align: left;
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.calculator-choice:hover {
    transform: translateY(-5px);
    border-color: rgba(199, 215, 229, 0.42);
    background: linear-gradient(145deg, rgba(79, 96, 111, 0.88), rgba(36, 43, 49, 0.98));
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

.calculator-choice:active {
    transform: translateY(-1px) scale(0.99);
}

.calculator-choice:focus-visible {
    outline: 3px solid var(--blue-bright);
    outline-offset: 4px;
}

.calculator-choice-number {
    color: var(--blue-bright);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.calculator-choice-content {
    display: grid;
    gap: 8px;
}

.calculator-choice-content strong {
    color: var(--white);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    letter-spacing: -0.03em;
}

.calculator-choice-content small {
    color: var(--light-blue);
    font-size: 14px;
    line-height: 1.55;
}

.calculator-choice-arrow {
    color: var(--cyan);
    font-size: 28px;
    transition: transform 0.24s ease;
}

.calculator-choice:hover .calculator-choice-arrow {
    transform: translateX(5px);
}

.calculator-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.invoice-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.invoice-sheet {
    max-width: 1040px;
    margin: 0 auto;
    background:
        radial-gradient(circle at 100% 0%, rgba(127, 167, 201, 0.14), transparent 26rem),
        rgba(26, 31, 36, 0.92);
}

.invoice-header,
.invoice-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
    gap: 28px;
}

.invoice-header {
    align-items: start;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.invoice-reference {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.invoice-meta,
.invoice-summary {
    display: grid;
    gap: 10px;
}

.invoice-meta div,
.invoice-summary div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 9px;
}

.invoice-meta dt,
.invoice-summary dt {
    color: var(--muted);
}

.invoice-meta dd,
.invoice-summary dd {
    color: var(--white);
    font-weight: 800;
    text-align: right;
}

.invoice-intro {
    margin: 24px 0;
    border: 1px solid rgba(199, 215, 229, 0.16);
    border-radius: 16px;
    background: rgba(44, 52, 59, 0.58);
    color: var(--light-blue);
    padding: 14px 16px;
}

.invoice-table-wrap {
    overflow-x: auto;
}

.invoice-table td:first-child {
    min-width: 230px;
}

.invoice-table td:last-child,
.invoice-table th:last-child {
    text-align: right;
    white-space: nowrap;
}

.invoice-table strong,
.invoice-table small {
    display: block;
}

.invoice-table strong {
    color: var(--white);
}

.invoice-table small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.invoice-footer-grid {
    align-items: start;
    margin-top: 28px;
}

.invoice-notes {
    border: 1px solid rgba(199, 215, 229, 0.14);
    border-radius: 18px;
    background: rgba(17, 19, 21, 0.52);
    padding: 18px;
}

.invoice-notes ul {
    display: grid;
    gap: 8px;
    margin: 10px 0 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.invoice-total {
    border-bottom: 0 !important;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(110, 139, 167, 0.28), rgba(199, 215, 229, 0.1));
    margin-top: 5px;
    padding: 13px !important;
}

.invoice-total dt,
.invoice-total dd {
    color: var(--white);
    font-size: 17px;
}

@media (max-width: 1180px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav-list {
        grid-template-columns: repeat(5, 1fr);
    }

    .pricing-layout,
    .two-column {
        grid-template-columns: 1fr;
    }

    .pricing-summary {
        position: static;
    }
}

@media (max-width: 820px) {
    .topbar,
    .split-heading,
    .calendar-toolbar,
    .checklist-card-header,
    .topbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .nav-list,
    .stats-grid,
    .task-form,
    .form-grid,
    .form-grid.five,
    .task-card-details-grid,
    .task-editor-grid,
    .filter-row,
    .catalog-grid,
    .pricing-controls,
    .employee-card {
        grid-template-columns: 1fr;
    }

    .wide {
        grid-column: auto;
    }

    .calendar-grid {
        gap: 6px;
    }

    .calendar-day {
        min-height: 110px;
    }

    .calculator-choice-grid {
        grid-template-columns: 1fr;
    }

    .calculator-actions {
        width: 100%;
    }

    .invoice-header,
    .invoice-footer-grid {
        grid-template-columns: 1fr;
    }

    .invoice-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
}

.calculator-workspace,
.calculator-workspace .pricing-main,
.calculator-workspace .panel,
.calculator-workspace .pricing-card,
.calculator-workspace label,
.calculator-workspace input,
.calculator-workspace select,
.calculator-workspace .invoice-table-wrap {
    min-width: 0;
    max-width: 100%;
}

.calculator-workspace {
    display: grid;
    gap: 22px;
}

.calculator-workspace .pricing-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.calculator-workspace .pricing-main {
    grid-template-columns: minmax(0, 1fr);
}

.calculator-workspace .catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.calculator-workspace .pricing-card {
    align-content: start;
}

.calculator-workspace .pricing-controls {
    grid-template-columns: minmax(0, 1fr);
}

.calculator-context-grid,
.calculator-filters,
.calculator-row-grid,
.calculator-adjustments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 14px;
    margin: 16px 0;
    align-items: end;
}

.calculator-editable-rows,
.calculator-editable-row {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.calculator-editable-row {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}

.calculator-workspace .split-heading {
    flex-wrap: wrap;
}

.calculator-workspace p,
.calculator-workspace small,
.calculator-workspace label,
.calculator-workspace summary,
.calculator-workspace dd,
.calculator-workspace td {
    overflow-wrap: anywhere;
}

.calculator-workspace .check-row input {
    flex: 0 0 18px;
}

.calculator-workspace summary {
    padding: 10px 0;
    cursor: pointer;
    font-weight: 700;
}

.calculator-workspace summary:focus-visible,
.calculator-workspace button:focus-visible {
    outline: 2px solid var(--blue-bright);
    outline-offset: 3px;
}

.calculator-unit-price small {
    display: block;
}

.calculator-save-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
}

.calculator-errors,
.calculator-warning {
    border-left: 3px solid var(--danger);
    padding: 12px;
    margin-top: 12px;
    color: var(--soft-white);
}

.calculator-errors ul {
    padding-left: 18px;
}

.calculator-workspace label[data-error]:not([data-error=""])::after {
    content: attr(data-error);
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
}

.calculator-workspace [aria-invalid="true"] {
    border-color: var(--danger);
}

.calculator-output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.calculator-workspace .button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.calculator-workspace .pricing-summary {
    background: var(--bg-elevated);
}

.calculator-workspace .pricing-summary h2 {
    font-size: clamp(26px, 3vw, 38px);
    overflow-wrap: anywhere;
}

.calculator-breakdown[open] {
    max-height: 55vh;
    overflow-y: auto;
}

.calculator-workspace .service-checklist-card .button {
    margin: 12px 0;
}

@media (max-width: 1380px) {
    .calculator-workspace .pricing-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .calculator-workspace .pricing-summary {
        order: -1;
        position: sticky;
        top: 8px;
        z-index: 10;
        padding: 16px;
    }

    .calculator-workspace .pricing-summary h2 {
        margin: 4px 0;
    }
}

@media (max-width: 600px) {
    .calculator-workspace .catalog-grid,
    .calculator-context-grid,
    .calculator-row-grid,
    .calculator-filters,
    .calculator-adjustments {
        grid-template-columns: minmax(0, 1fr);
    }

    .calculator-workspace .calculator-actions .button {
        flex: 1 1 160px;
    }

    .calculator-workspace .pricing-summary {
        position: static;
    }
}

@media print {
    @page {
        margin: 16mm;
    }

    body,
    .main,
    .invoice-sheet {
        background: #fff !important;
        color: #1A1F24 !important;
    }

    .sidebar,
    .topbar,
    .notice,
    #notificationPanel,
    .invoice-toolbar,
    .toast {
        display: none !important;
    }

    .shell,
    .main,
    .view-root {
        display: block;
        margin: 0;
        padding: 0;
    }

    .invoice-sheet {
        border: 0;
        box-shadow: none;
    }

    .invoice-sheet,
    .invoice-sheet h2,
    .invoice-sheet strong,
    .invoice-sheet dd,
    .invoice-table strong {
        color: #1A1F24 !important;
    }

    .invoice-sheet td,
    .invoice-sheet th {
        border-color: #D4DCE3;
        background: #fff;
        color: #1A1F24;
    }

    .invoice-sheet th {
        background: #E7ECEF;
    }

    .invoice-table-wrap {
        overflow: visible;
    }

    .invoice-table thead {
        display: table-header-group;
    }

    .invoice-table tr {
        break-inside: avoid;
    }

    .invoice-table td {
        overflow-wrap: anywhere;
    }

    .invoice-intro,
    .invoice-notes,
    .invoice-total {
        border-color: #D4DCE3;
        background: #F3F5F7;
        color: #34414D;
    }

    .invoice-sheet .eyebrow,
    .invoice-sheet small,
    .invoice-sheet dt,
    .invoice-sheet li {
        color: #52606D !important;
    }
}
