/* Semantic tokens are defined once in design-system.css. */

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

button,
select {
    cursor: pointer;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

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

h1 {
    margin-bottom: 7px;
    color: var(--navy-900);
    font-size: clamp(27px, 2.5vw, 38px);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1.12;
}

h2 {
    margin-bottom: 5px;
    color: var(--navy-900);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h3 {
    color: var(--navy-900);
    font-size: 15px;
}

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

.eyebrow {
    margin-bottom: 8px;
    color: var(--blue);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.19em;
    text-transform: uppercase;
}

.eyebrow-light {
    color: var(--cyan);
}

[hidden] {
    display: none !important;
}

.icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
    background: rgba(67, 153, 202, 0.1);
}

.icon-button:active {
    transform: scale(0.94);
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 690;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

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

.button-primary {
    background: var(--navy-800);
    box-shadow: 0 8px 18px rgba(7, 53, 84, 0.16);
    color: #fff;
}

.button-primary:hover {
    background: var(--navy-700);
    box-shadow: 0 11px 24px rgba(7, 53, 84, 0.2);
}

.button-secondary {
    border-color: #cfdbe3;
    background: #fff;
    color: var(--navy-800);
}

.button-secondary:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
}

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

.button-block {
    width: 100%;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px;
    background: transparent;
    color: var(--navy-700);
    font-size: 12px;
    font-weight: 680;
}

.text-button svg {
    width: 16px;
    height: 16px;
}

.text-button:hover {
    color: var(--blue);
}

.danger-text {
    color: var(--coral);
}

.action-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.form-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.form-field label,
.field-label {
    color: #294b61;
    font-size: 11px;
    font-weight: 720;
}

.form-field input,
.form-field select,
.input-shell,
.control-shell,
.toolbar-search {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d6e1e7;
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.form-field > input,
.form-field > select {
    padding: 0 12px;
}

.form-field input:focus,
.form-field select:focus,
.input-shell:focus-within,
.control-shell:focus-within,
.toolbar-search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67, 153, 202, 0.12);
}

.control-shell,
.input-shell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
}

.control-shell > svg,
.input-shell > svg,
.toolbar-search > svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    color: #7891a2;
}

.control-shell input,
.control-shell select,
.input-shell input {
    min-width: 0;
    min-height: 40px;
    flex: 1;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
}

.control-shell select {
    padding-right: 19px;
    appearance: none;
}

.control-shell .select-chevron {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.field-hint {
    min-height: 15px;
    overflow: hidden;
    color: #8294a1;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-mark {
    display: inline-grid;
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--sage-soft);
    color: #34776e;
}

.selected-mark svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.6;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #536d7f;
    font-size: 12px;
}

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

.check-row.compact {
    align-self: end;
    min-height: 42px;
}

.panel {
    border: 1px solid rgba(218, 228, 234, 0.86);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

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

.panel-head h2,
.panel-head h3 {
    margin-bottom: 3px;
}

.panel-head p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 11px;
}

.panel-head.mini {
    margin-bottom: 10px;
}

.panel-divider {
    height: 1px;
    margin: 22px 0;
    background: var(--line);
}

.subtle-pill {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.eyebrow + h1 {
    margin-top: 0;
}

/* Login */
.login-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(480px, 1.15fr) minmax(420px, 0.85fr);
    background: #fff;
}

.login-brand {
    position: relative;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 5vw, 70px) clamp(38px, 7vw, 105px);
    background:
        linear-gradient(145deg, rgba(4, 35, 58, 0.98), rgba(8, 61, 94, 0.96)),
        radial-gradient(circle at 0 0, rgba(128, 201, 229, 0.25), transparent 40%);
    color: #fff;
}

.brand-top {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 24px;
}

.login-logo {
    width: 148px;
    padding: 9px 12px;
    border-radius: 8px;
    background: #fff;
}

.brand-divider {
    width: 1px;
    height: 38px;
    background: rgba(255, 255, 255, 0.28);
}

.brand-product {
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-message {
    position: relative;
    z-index: 3;
    width: min(650px, 92%);
    margin: 8vh 0;
}

.login-message h1 {
    margin-bottom: 26px;
    color: #fff;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: clamp(46px, 5.3vw, 82px);
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 0.99;
}

.login-message h1 em {
    color: var(--cyan);
    font-weight: 400;
}

.login-lead {
    width: min(540px, 100%);
    margin-bottom: 33px;
    color: rgba(235, 247, 252, 0.74);
    font-size: 16px;
    line-height: 1.7;
}

.promise-list {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
}

.promise-list span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
}

.promise-list svg {
    width: 15px;
    height: 15px;
    color: var(--gold);
}

.login-footnote {
    position: relative;
    z-index: 3;
    margin: 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-orb {
    position: absolute;
    z-index: 1;
    opacity: 0.95;
}

.login-orb-blue {
    right: -150px;
    top: -190px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: rgba(67, 153, 202, 0.45);
}

.login-orb-gold {
    right: 90px;
    top: -180px;
    width: 340px;
    height: 430px;
    border-radius: 70px 0 0 70px;
    background: rgba(230, 204, 79, 0.32);
    transform: rotate(14deg);
}

.login-orb-sage {
    right: -60px;
    bottom: -170px;
    width: 450px;
    height: 450px;
    border-radius: 58% 0 0 0;
    background: rgba(158, 199, 193, 0.2);
}

.login-form-side {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 50px;
    background:
        radial-gradient(circle at 90% 0%, rgba(230, 204, 79, 0.12), transparent 28%),
        #fbfcfd;
}

.login-card {
    width: min(420px, 100%);
    padding: 46px;
    border: 1px solid rgba(219, 228, 234, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 80px rgba(8, 48, 76, 0.1);
}

.login-card-mark {
    display: flex;
    height: 38px;
    align-items: end;
    gap: 6px;
    margin-bottom: 33px;
}

.login-card-mark span {
    width: 17px;
    border-radius: 5px 5px 2px 2px;
}

.login-card-mark span:nth-child(1) {
    height: 28px;
    background: var(--blue);
}

.login-card-mark span:nth-child(2) {
    height: 37px;
    background: var(--gold);
}

.login-card-mark span:nth-child(3) {
    height: 22px;
    background: var(--sage);
}

.login-card h2 {
    margin-bottom: 8px;
    font-size: 29px;
    letter-spacing: -0.04em;
}

.login-subtitle {
    margin-bottom: 28px;
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form .input-shell {
    min-height: 49px;
    border-radius: 10px;
}

.login-form .input-shell input {
    min-height: 47px;
}

.login-form .button {
    min-height: 50px;
    margin-top: 11px;
}

.login-form .check-row {
    margin: 5px 0;
}

.field-error,
.validation-summary {
    color: var(--coral);
    font-size: 11px;
}

.validation-summary:empty {
    display: none;
}

.validation-summary {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--coral-soft);
}

.login-security {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: #8093a1;
    font-size: 10px;
    line-height: 1.5;
}

.standalone-password {
    background:
        radial-gradient(circle at 15% 15%, rgba(67, 153, 202, 0.13), transparent 28%),
        radial-gradient(circle at 90% 80%, rgba(230, 204, 79, 0.12), transparent 28%),
        #f3f7f9;
}

.password-logo {
    width: 135px;
    margin-bottom: 28px;
}

.login-security svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: #679e94;
}

.google-setup-note {
    margin: 14px 0;
    padding: 13px;
    border: 1px solid #eadfaf;
    border-radius: 10px;
    background: #fffaf0;
}

.google-setup-note strong {
    display: block;
    margin-bottom: 5px;
    color: #6e5b1f;
    font-size: 12px;
}

.google-setup-note p {
    margin: 0;
    color: #786a43;
    font-size: 11px;
    line-height: 1.5;
}

.google-callback {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.google-callback > span {
    width: 100%;
    color: #786a43;
    font-size: 10px;
    font-weight: 600;
}

.google-callback code {
    min-width: 0;
    flex: 1;
    padding: 6px 8px;
    overflow: hidden;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-settings {
    grid-column: 1 / -1;
}

.ai-config-form {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
    gap: 12px 18px;
    margin-top: 16px;
}

.ai-config-form .check-row:first-child,
.ai-config-form .form-hint,
.ai-config-form .action-row,
.ai-config-form .check-row.compact {
    grid-column: 1 / -1;
}

.ai-config-form .form-field {
    margin: 0;
}

.ai-config-form .action-row {
    margin-top: 2px;
}

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

    .ai-config-form > * {
        grid-column: 1 !important;
    }
}

body.widget-login-body {
    box-sizing: border-box;
    height: 100vh;
    margin: 0;
    padding: 10px;
    overflow: hidden;
    background: transparent;
}

.login-page.login-page-widget {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(215, 227, 234, 0.9);
    border-radius: 22px;
    background: #f7fafb;
    box-shadow: 0 6px 20px rgba(2, 24, 40, 0.2);
}

.login-page-widget .login-brand {
    min-height: 78px;
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: 13px 17px 23px;
    border-radius: 21px 21px 0 0;
    background: #123c5d;
}

.login-page-widget .login-message,
.login-page-widget .login-orb,
.login-page-widget .login-footnote {
    display: none;
}

.login-page-widget .brand-top {
    gap: 12px;
}

.login-page-widget .login-logo {
    width: 116px;
    padding: 5px 8px;
    border-radius: 7px;
}

.login-page-widget .brand-divider {
    height: 26px;
}

.login-page-widget .brand-product {
    font-size: 10px;
    letter-spacing: 0.08em;
}

.login-page-widget .login-form-side {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    align-items: stretch;
    justify-content: center;
    margin-top: -14px;
    padding: 0 12px 13px;
    overflow-y: auto;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: rgba(18, 60, 93, 0.32) transparent;
}

.login-page-widget .login-card {
    display: flex;
    width: 100%;
    max-width: 440px;
    min-height: 100%;
    flex-direction: column;
    padding: 22px 22px 20px;
    border-color: rgba(220, 230, 236, 0.95);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(8, 48, 76, 0.09);
}

.login-page-widget .login-card-mark,
.login-page-widget .eyebrow,
.login-page-widget .login-security,
.login-page-widget .login-footnote {
    display: none;
}

.login-page-widget .login-card h2 {
    margin: 0 0 5px;
    font-size: 25px;
    letter-spacing: -0.025em;
    line-height: 1.18;
}

.login-page-widget .login-subtitle {
    margin-bottom: 17px;
    font-size: 12.5px;
    line-height: 1.45;
}

.login-page-widget .login-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
}

.login-page-widget .login-form .input-shell,
.login-page-widget .login-form .input-shell input {
    min-height: 43px;
    height: 43px;
}

.login-page-widget .login-form .button {
    min-height: 46px;
    margin-top: auto;
}

.login-page-widget .login-form .check-row {
    min-height: 34px;
    margin: 0;
}

@media (max-width: 410px) {
    .login-page-widget .brand-product,
    .login-page-widget .brand-divider {
        display: none;
    }
}

/* Shell */
.app-shell {
    min-height: 100vh;
    overflow-x: clip;
}

.app-loading {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 20px;
    background: #f5f8fa;
    color: var(--muted);
    transition: opacity 240ms ease, visibility 240ms ease;
}

.app-loading.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.app-loading img {
    width: 130px;
}

.app-loading p {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.loading-line {
    width: 155px;
    height: 2px;
    overflow: hidden;
    border-radius: 2px;
    background: #dfe9ee;
}

.loading-line::after {
    display: block;
    width: 55px;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    content: "";
    animation: loading-slide 1.1s ease-in-out infinite;
}

@keyframes loading-slide {
    from { transform: translateX(-60px); }
    to { transform: translateX(160px); }
}

.sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 23px 18px 18px;
    background:
        linear-gradient(180deg, rgba(8, 54, 84, 0.98), rgba(5, 39, 63, 0.99)),
        radial-gradient(circle at 20% 95%, rgba(67, 153, 202, 0.18), transparent 40%);
    color: #fff;
}

.sidebar::after {
    position: absolute;
    right: -80px;
    bottom: -125px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(158, 199, 193, 0.055);
    content: "";
    pointer-events: none;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 0 9px 27px;
}

.sidebar-brand img {
    width: 122px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #fff;
}

.sidebar-brand span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.main-nav {
    display: grid;
    gap: 5px;
}

.nav-link {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 45px;
    align-items: center;
    gap: 13px;
    padding: 0 13px;
    border-radius: 9px;
    background: transparent;
    color: rgba(236, 247, 253, 0.72);
    font-size: 12.5px;
    text-align: left;
    transition: background 160ms ease, color 160ms ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.nav-link.is-active {
    background: linear-gradient(90deg, rgba(67, 153, 202, 0.27), rgba(67, 153, 202, 0.12));
    color: #fff;
}

.nav-link.is-active::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--cyan);
    content: "";
}

.nav-link svg {
    width: 18px;
    height: 18px;
}

.nav-count {
    min-width: 19px;
    margin-left: auto;
    padding: 2px 5px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy-950);
    font-size: 9px;
    text-align: center;
}

.sidebar-lower {
    display: grid;
    gap: 5px;
    margin-top: auto;
    margin-bottom: 15px;
}

.sidebar-profile {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 9px 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-profile form {
    margin-left: auto;
}

.sidebar-profile .icon-button {
    width: 30px;
    height: 30px;
    color: rgba(255, 255, 255, 0.55);
}

.sidebar-profile .icon-button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.avatar {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--blue), var(--navy-700));
    color: #fff;
    font-size: 11px;
    font-weight: 720;
    letter-spacing: 0.04em;
}

.avatar-large {
    width: 42px;
    height: 42px;
}

.avatar-xl {
    width: 62px;
    height: 62px;
    font-size: 18px;
}

.profile-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.profile-copy strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 9px;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    height: var(--topbar-height);
    align-items: center;
    gap: 22px;
    padding: 0 34px;
    border-bottom: 1px solid rgba(219, 229, 235, 0.9);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
}

.mobile-menu {
    display: none;
}

.global-search {
    position: relative;
    display: flex;
    width: min(470px, 48vw);
    height: 39px;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    border: 1px solid #dfe8ed;
    border-radius: 8px;
    background: #f8fafb;
    color: #7890a0;
}

.global-search:focus-within {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(67, 153, 202, 0.1);
}

.global-search > svg {
    width: 16px;
    height: 16px;
}

.global-search input {
    min-width: 0;
    height: 36px;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 12px;
}

.global-search kbd {
    padding: 2px 5px;
    border: 1px solid #d8e2e8;
    border-radius: 4px;
    background: #fff;
    color: #91a0aa;
    font-family: inherit;
    font-size: 9px;
}

.search-results {
    position: absolute;
    z-index: 80;
    top: 46px;
    right: 0;
    left: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    box-shadow: var(--shadow);
}

.search-results:empty {
    display: none;
}

.search-result {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    background: #fff;
    text-align: left;
}

.search-result:hover {
    background: var(--blue-soft);
}

.search-result i {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--navy-700);
}

.search-result div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.search-result strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result span {
    color: var(--muted);
    font-size: 9px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
}

.install-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid #dce6eb;
    border-radius: 8px;
    background: #fff;
    color: var(--navy-700);
    font-size: 10px;
    font-weight: 680;
}

.install-button svg {
    width: 14px;
    height: 14px;
}

.notification-button {
    position: relative;
    color: #536e80;
}

.notification-count {
    position: absolute;
    top: 2px;
    right: 1px;
    display: grid;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--coral);
    color: #fff;
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    animation: notification-count-pulse 1.45s ease-in-out infinite;
}

@keyframes notification-count-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(180, 68, 68, 0.35);
        opacity: 1;
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(180, 68, 68, 0);
        opacity: 0.72;
        transform: scale(1.08);
    }
}

.profile-button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 4px 4px 8px;
    border-radius: 999px;
    background: transparent;
    text-align: left;
}

.profile-button:hover {
    background: var(--surface-soft);
}

.profile-text {
    display: flex;
    max-width: 135px;
    flex-direction: column;
}

.profile-text strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.profile-button > svg {
    width: 13px;
    height: 13px;
    color: var(--muted);
}

.popover {
    position: absolute;
    z-index: 90;
    top: 65px;
    right: 28px;
    width: 330px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.popover-head {
    display: flex;
    justify-content: space-between;
    padding: 16px 17px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}

.popover-head span {
    color: var(--muted);
    font-size: 9px;
}

.notification-list {
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    width: 100%;
    gap: 10px;
    padding: 13px 17px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item:hover,
.notification-item:focus-visible {
    background: var(--surface-soft);
}

.notification-item i {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-soft);
    color: #9a7e14;
}

.notification-item p {
    margin: 0 0 3px;
    font-size: 10.5px;
    line-height: 1.45;
}

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

.empty-popover {
    padding: 30px 18px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.profile-popover {
    width: 245px;
    padding: 8px;
}

.profile-popover-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 9px 15px;
    border-bottom: 1px solid var(--line);
}

.profile-popover-head div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.profile-popover-head strong {
    font-size: 11px;
}

.profile-popover-head span {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
}

.profile-popover > button,
.profile-popover form button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border-radius: 7px;
    background: transparent;
    color: #466176;
    font-size: 10.5px;
    text-align: left;
}

.profile-popover > button:hover,
.profile-popover form button:hover {
    background: var(--surface-soft);
}

.profile-popover svg {
    width: 15px;
    height: 15px;
}

.content {
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    padding: 29px 34px 48px;
}

.view {
    display: none;
    animation: view-enter 260ms ease both;
}

.view.is-active {
    display: block;
}

@keyframes view-enter {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
}

.page-subtitle {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 12px;
}

.day-status {
    display: flex;
    min-width: 210px;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border: 1px solid var(--state-open-border);
    border-radius: 11px;
    background: var(--state-open-soft);
    text-align: left;
    transition: border-color 160ms ease, background 160ms ease;
}

.day-status:hover {
    border-color: var(--state-open);
}

.day-status.is-closed {
    border-color: var(--state-closed-border);
    background: var(--state-closed-soft);
}

.day-status.is-closed:hover {
    border-color: var(--state-closed);
}

.day-status.is-non-working {
    border-color: #d9e3e8;
    background: #f4f7f8;
}

.day-status > span:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.day-status strong {
    color: var(--state-open);
    font-size: 11px;
}

.day-status small {
    color: #8b4b50;
    font-size: 9px;
}

.day-status > svg {
    width: 14px;
    height: 14px;
    margin-left: auto;
    color: var(--state-open);
}

.day-status.is-closed strong,
.day-status.is-closed > svg {
    color: var(--state-closed);
}

.day-status.is-closed small {
    color: #4f786b;
}

.day-status.is-non-working strong,
.day-status.is-non-working small,
.day-status.is-non-working > svg {
    color: #607986;
}

.status-orb {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--state-open);
    box-shadow: 0 0 0 4px rgba(180, 68, 68, 0.12);
}

.status-orb.closed {
    background: var(--state-closed);
    box-shadow: 0 0 0 4px rgba(17, 111, 84, 0.12);
}

.day-status.is-non-working .status-orb,
.day-state-card.is-non-working .status-orb {
    background: #607986;
    box-shadow: 0 0 0 4px rgba(96, 121, 134, 0.12);
}

/* Quick entry */
.quick-entry-card {
    position: relative;
    margin-bottom: 18px;
    padding: 18px 20px 14px;
    border: 1px solid rgba(211, 224, 232, 0.9);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.quick-entry-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--blue), var(--cyan) 46%, var(--gold));
    content: "";
    opacity: 0.8;
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-heading {
    margin-bottom: 15px;
}

.quick-heading h2 {
    margin: 0;
    font-size: 15px;
}

.quick-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
}

.heading-icon {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--navy-700);
}

.heading-icon svg {
    width: 15px;
    height: 15px;
}

.quick-heading .text-button {
    margin-left: auto;
}

.quick-entry-form {
    display: grid;
    grid-template-columns: minmax(190px, 1.18fr) minmax(190px, 1.18fr) minmax(190px, 1.18fr) minmax(100px, 0.55fr) minmax(145px, 0.72fr);
    align-items: start;
    gap: 11px;
}

.quick-entry-form .form-field {
    position: relative;
}

.autocomplete-field {
    z-index: 5;
}

.suggestion-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% - 13px);
    right: 0;
    left: 0;
    max-height: 245px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}

.suggestion-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border-bottom: 1px solid #eef2f4;
    background: #fff;
    text-align: left;
}

.suggestion-item:hover {
    background: var(--blue-soft);
}

.suggestion-item div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.suggestion-item strong {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-item span {
    color: var(--muted);
    font-size: 8.5px;
}

.suggestion-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 10px;
}

.hours-field .control-shell input {
    text-align: center;
    font-weight: 700;
}

.save-entry {
    align-self: end;
    min-height: 42px;
    margin-top: 17px;
    white-space: nowrap;
}

.save-entry svg {
    width: 15px;
    height: 15px;
}

.timer-panel {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--blue-soft);
}

.timer-display {
    min-width: 90px;
    color: var(--navy-800);
    font-variant-numeric: tabular-nums;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.timer-panel .button {
    min-height: 34px;
    margin-left: auto;
}

.more-options {
    display: inline-flex;
    grid-column: 1 / -1;
    width: max-content;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 5px 8px;
    border-radius: 7px;
    background: #eaf3f8;
    color: var(--navy-700);
    font-size: 12.5px;
    font-weight: 680;
}

.more-options svg {
    width: 14px;
    height: 14px;
}

.more-options svg:last-child {
    transition: transform 180ms ease;
}

.more-options.is-expanded svg:last-child {
    transform: rotate(180deg);
}

.advanced-fields {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr 2fr auto;
    gap: 12px;
    margin-top: 4px;
    padding: 15px;
    border: 1px solid #cbdfe8;
    border-radius: 12px;
    background: #e4f0f5;
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 18px;
}

.metric-card {
    position: relative;
    display: flex;
    min-height: 103px;
    align-items: center;
    gap: 13px;
    padding: 17px;
    border: 1px solid rgba(218, 228, 234, 0.86);
    border-radius: 15px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.metric-icon {
    display: grid;
    width: 37px;
    height: 37px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
}

.metric-icon svg {
    width: 18px;
    height: 18px;
}

.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.gold { background: var(--gold-soft); color: #b99a16; }
.metric-icon.sage { background: var(--sage-soft); color: #6e9c96; }
.metric-icon.coral { background: var(--coral-soft); color: var(--coral); }
.metric-icon.state-open { background: var(--state-open-soft); color: var(--state-open); }
.metric-icon.state-closed { background: var(--state-closed-soft); color: var(--state-closed); }

.metric-card > div:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

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

.metric-card strong {
    margin: 3px 0 1px;
    color: var(--navy-900);
    font-size: 22px;
    font-weight: 720;
    letter-spacing: -0.04em;
}

.metric-card small {
    overflow: hidden;
    color: #8a9ba7;
    font-size: 8.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ring {
    --progress: 0%;
    display: grid;
    width: 43px;
    height: 43px;
    margin-left: auto;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--blue) var(--progress), #eaf1f5 0);
}

.ring span {
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: #fff;
}

.metrics-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics-grid.compact .metric-card {
    min-height: 88px;
}

.metrics-grid.compact .metric-card strong {
    font-size: 20px;
}

.metrics-grid.compact .metric-card > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.78fr);
    gap: 15px;
}

.dashboard-grid > .panel {
    padding: 19px;
}

.activity-panel {
    grid-row: span 2;
}

.week-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 18px;
}

.week-day {
    display: flex;
    min-height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f8fafb;
    color: var(--muted);
}

.week-day.is-today {
    background: var(--navy-800);
    color: #fff;
}

.week-day span {
    font-size: 8px;
    text-transform: uppercase;
}

.week-day strong {
    margin-top: 2px;
    font-size: 10px;
}

.timeline {
    display: grid;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 61px 3px 1fr auto;
    gap: 10px;
    min-height: 58px;
    padding: 5px 0 8px;
}

.timeline-time {
    padding-top: 2px;
    color: #8c9ca7;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
}

.timeline-line {
    position: relative;
    width: 3px;
    border-radius: 3px;
    background: var(--s-thumb, #dfe8ec);
}

.timeline-line::before {
    position: absolute;
    top: 0;
    left: -2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--s-color, var(--blue));
    content: "";
}

.timeline-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.timeline-copy strong {
    overflow: hidden;
    color: #27495d;
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-copy span {
    overflow: hidden;
    color: var(--muted);
    font-size: 8.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-duration {
    padding-top: 3px;
    color: var(--navy-800);
    font-size: 10px;
    font-weight: 700;
}

.proposal-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.proposal-item {
    display: flex;
    min-width: 0;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid #e4ebef;
    border-radius: 10px;
    background: #fbfcfd;
}

.proposal-source {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: var(--blue-soft);
    color: var(--navy-700);
    font-size: 9px;
    font-weight: 750;
}

.proposal-source.tasks {
    background: var(--gold-soft);
    color: #9a7c0d;
}

.proposal-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.proposal-copy strong {
    overflow: hidden;
    color: #2b4b5f;
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proposal-copy span {
    color: var(--muted);
    font-size: 8px;
}

.proposal-action {
    padding: 5px 7px;
    border-radius: 5px;
    background: var(--blue-soft);
    color: var(--navy-700);
    font-size: 8px;
    font-weight: 700;
}

.proposal-action:hover {
    background: #d9eef8;
}

.proposal-count {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    place-items: center;
    border-radius: 999px;
    background: var(--gold-soft);
    color: #977910;
    font-size: 9px;
    font-weight: 700;
}

.panel-link {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 13px;
    padding: 8px 0 0;
    border-top: 1px solid var(--line);
    background: transparent;
    color: var(--navy-700);
    font-size: 9px;
    font-weight: 650;
}

.panel-link svg {
    width: 12px;
    height: 12px;
}

.recent-list {
    display: grid;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid #eef2f4;
}

.recent-item:last-child {
    border-bottom: 0;
}

.recent-client {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.recent-client strong {
    overflow: hidden;
    color: #2c4d61;
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-client span {
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-duration {
    color: var(--navy-800);
    font-size: 9px;
    font-weight: 700;
}

.empty-state {
    display: grid;
    min-height: 210px;
    place-content: center;
    justify-items: center;
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.empty-state.compact {
    min-height: 300px;
}

.empty-state > svg {
    width: 34px;
    height: 34px;
    margin-bottom: 12px;
    color: #acc0cc;
}

.empty-state h3 {
    margin-bottom: 5px;
}

.empty-state p {
    max-width: 320px;
    margin: 0;
    font-size: 10px;
}

/* Day view */
.day-layout {
    display: grid;
    grid-template-columns: minmax(245px, 0.6fr) minmax(420px, 1.4fr);
    gap: 15px;
}

.day-layout .panel {
    padding: 20px;
}

.day-summary-panel {
    align-self: start;
}

.day-date-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.day-date-control > div {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.day-date-control span {
    color: var(--muted);
    font-size: 8px;
    text-transform: uppercase;
}

.day-date-control strong {
    font-size: 11px;
}

.day-big-total {
    display: flex;
    flex-direction: column;
    padding: 26px 0 20px;
    text-align: center;
}

.day-big-total span {
    color: var(--navy-900);
    font-size: 46px;
    font-weight: 720;
    letter-spacing: -0.06em;
    line-height: 1;
}

.day-big-total small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 9px;
}

.day-state-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px;
    border-radius: 10px;
    background: var(--state-open-soft);
}

.day-state-card.closed {
    background: var(--state-closed-soft);
}

.day-state-card strong {
    color: var(--state-open);
    font-size: 10.5px;
}

.day-state-card p {
    margin: 2px 0 0;
    color: #8b4b50;
    font-size: 8.5px;
}

.day-state-card.closed strong {
    color: var(--state-closed);
}

.day-state-card.closed p {
    color: #4f786b;
}

.day-state-card.is-non-working {
    background: #f2f5f6;
}

.day-state-card.is-non-working strong,
.day-state-card.is-non-working p {
    color: #607986;
}

.day-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 13px 0;
}

.day-facts div {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 8px;
    background: var(--surface-soft);
}

.day-facts span {
    color: var(--muted);
    font-size: 8px;
}

.day-facts strong {
    margin-top: 2px;
    font-size: 16px;
}

.day-detail-panel {
    min-height: 440px;
}

.day-proposals-panel {
    grid-column: 2;
}

.entry-list {
    display: grid;
    gap: 8px;
}

.entry-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5ecef;
    border-radius: 10px;
    background: #fdfefe;
}

.entry-icon {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--navy-700);
    font-size: 9px;
    font-weight: 750;
}

.entry-icon.internal {
    background: var(--gold-soft);
    color: #93780d;
}

.entry-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.entry-copy strong {
    overflow: hidden;
    color: #2b4b5f;
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-copy span,
.entry-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 8.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-copy small {
    margin-top: 3px;
    color: #91a2ac;
}

.entry-time {
    color: var(--navy-800);
    font-size: 11px;
    font-weight: 720;
}

.entry-actions {
    display: flex;
    gap: 1px;
}

.entry-actions .icon-button {
    width: 28px;
    height: 28px;
    color: #8395a1;
}

.entry-actions svg {
    width: 14px;
    height: 14px;
}

/* Tables */
.panel-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.toolbar-search {
    display: flex;
    max-width: 430px;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
}

.toolbar-search input {
    min-width: 0;
    height: 40px;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
}

.result-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 9px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.data-table th {
    padding: 9px 11px;
    border-bottom: 1px solid #dce6eb;
    color: #7c909e;
    font-size: 8px;
    font-weight: 720;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.data-table td {
    padding: 12px 11px;
    border-bottom: 1px solid #edf1f3;
    color: #38586a;
    vertical-align: middle;
}

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

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

.data-table .num {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.data-table .primary-cell {
    color: var(--navy-900);
    font-weight: 650;
}

.cell-copy {
    display: flex;
    flex-direction: column;
}

.cell-copy small {
    color: var(--muted);
    font-size: 8px;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--sage-soft);
    color: #39766d;
    font-size: 8px;
    font-weight: 650;
    white-space: nowrap;
}

.status-tag.archived {
    background: #eef2f4;
    color: #677e8c;
}

.status-tag.closed {
    background: var(--state-closed-soft);
    color: var(--state-closed);
}

.status-tag.open {
    background: var(--state-open-soft);
    color: var(--state-open);
}

.status-tag.reserved {
    background: var(--coral-soft);
    color: var(--coral);
}

.status-tag.internal {
    background: var(--gold-soft);
    color: #97790e;
}

/* Project tree */
.projects-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.72fr) minmax(400px, 1.28fr);
    gap: 15px;
}

.projects-layout > .panel {
    min-height: 540px;
    padding: 18px;
}

.project-tree {
    display: grid;
    gap: 3px;
}

.tree-node {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 9px 8px;
    border-radius: 7px;
    background: transparent;
    color: #426174;
    text-align: left;
}

.tree-node:hover,
.tree-node.is-selected {
    background: var(--blue-soft);
    color: var(--navy-800);
}

.tree-node svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.tree-node span {
    overflow: hidden;
    flex: 1;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-node small {
    color: var(--muted);
    font-size: 8px;
}

.tree-indent {
    flex: 0 0 auto;
}

.project-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 17px;
    border-bottom: 1px solid var(--line);
}

.project-detail-head h2 {
    margin: 2px 0 4px;
    font-size: 22px;
}

.project-detail-head p {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
}

.detail-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.detail-facts div {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 8px;
    background: var(--surface-soft);
}

.detail-facts span {
    color: var(--muted);
    font-size: 8px;
}

.detail-facts strong {
    margin-top: 2px;
    font-size: 10px;
}

.task-tree {
    display: grid;
    gap: 5px;
    margin-top: 10px;
}

.task-node {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid #e7edef;
    border-radius: 8px;
    background: #fff;
    font-size: 10px;
}

.task-node > i {
    color: #9dafba;
}

.task-node strong {
    flex: 1;
    font-size: 10px;
}

/* Reports */
.report-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr 1fr auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 15px;
    padding: 16px;
}

.report-filters .button {
    min-height: 42px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 15px;
}

.report-grid .panel {
    min-height: 310px;
    padding: 18px;
}

/* Team */
.team-layout {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 15px;
}

.team-layout > .panel {
    min-height: 480px;
    padding: 19px;
}

.pending-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-align: left;
    box-shadow: inset 0 -1px 0 #edf2f4;
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease;
}

.assignment-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 3px;
    padding-right: 0;
    box-shadow: inset 0 -1px 0 #edf2f4;
}

.pending-row:last-child,
.assignment-row:last-child {
    box-shadow: none;
}

.pending-row:hover,
.pending-row:focus-visible,
.assignment-main:hover,
.assignment-main:focus-visible {
    background: var(--surface-soft);
}

.pending-row:focus-visible,
.assignment-main:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}

.assignment-main {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-align: left;
    transition: background 160ms ease;
}

.assignment-revoke {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.row-chevron {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    color: #7890a1;
}

.pending-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.pending-copy strong {
    font-size: 12px;
    line-height: 1.32;
}

.pending-copy span {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.4;
}

.pending-date {
    color: var(--muted);
    font-size: 10.5px;
    white-space: nowrap;
}

.team-detail-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.team-detail-head > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.team-detail-head strong {
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.4;
}

.team-detail-head span:not(.avatar, .status-tag) {
    color: var(--muted);
    font-size: 11px;
}

.team-detail-head .status-tag {
    padding: 5px 9px;
    font-size: 10px;
}

.team-detail-note {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f7fafc;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.62;
}

.team-detail-note strong {
    color: var(--ink);
}

.project-closure-warning {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--coral-soft);
}

.project-closure-warning h3 {
    margin: 0 0 9px;
    color: var(--coral);
    font-size: 13px;
}

.project-closure-warning ul {
    display: grid;
    max-height: 220px;
    gap: 7px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.project-closure-warning li {
    padding-bottom: 7px;
    box-shadow: inset 0 -1px 0 rgba(180, 68, 68, 0.13);
    color: var(--ink);
    font-size: 11.5px;
    line-height: 1.45;
}

.project-closure-warning li:last-child {
    padding-bottom: 0;
    box-shadow: none;
}

.project-closure-warning p,
.project-closure-empty,
.project-closure-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.project-closure-empty {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface-soft);
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.settings-grid .panel {
    padding: 20px;
}

.settings-profile {
    grid-row: span 2;
}

.profile-settings-head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 8px 0 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.profile-settings-head > div {
    display: flex;
    flex-direction: column;
}

.profile-settings-head strong {
    font-size: 13px;
}

.profile-settings-head span {
    color: var(--muted);
    font-size: 10px;
}

.profile-settings-head small {
    margin-top: 5px;
    color: var(--blue);
    font-size: 9px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.settings-row > div,
.settings-row > span:first-child {
    display: flex;
    flex-direction: column;
}

.settings-row strong {
    font-size: 10.5px;
}

.settings-row span {
    color: var(--muted);
    font-size: 8.5px;
}

.switch {
    display: inline-flex !important;
    width: 31px;
    height: 18px;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    background: #d5e0e5;
}

.switch span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
}

.switch.is-on {
    justify-content: flex-end;
    background: var(--sage);
}

.status-chip {
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2f4;
    color: var(--muted);
    font-size: 8px;
}

.status-chip.connected {
    background: var(--sage-soft);
    color: #39756c;
}

.integration-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: #496578;
    font-size: 10px;
}

.google-g {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #4285f4;
    font-size: 18px;
    font-weight: 750;
}

.settings-copy {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.65;
}

.install-settings > .panel-head svg {
    width: 28px;
    height: 28px;
    color: var(--blue);
}

/* Admin */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    border-radius: 10px;
    background: #e8eff2;
}

.admin-tabs button {
    flex: 1;
    padding: 8px 12px;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
}

.admin-tabs button.is-active {
    background: #fff;
    box-shadow: 0 3px 10px rgba(10, 53, 87, 0.07);
    color: var(--navy-800);
    font-weight: 680;
}

.admin-tabs + .panel {
    padding: 18px;
}

/* Modal and toast */
.modal-backdrop {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    padding: 22px;
    place-items: center;
    background: rgba(3, 31, 50, 0.48);
    backdrop-filter: blur(5px);
}

.modal {
    width: min(570px, 100%);
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(3, 31, 50, 0.28);
    animation: modal-in 220ms ease both;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.modal > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--line);
}

.modal > header h2 {
    margin: 0;
    font-size: 22px;
}

.modal-body {
    padding: 21px 24px;
}

.modal-footer,
.modal > footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 15px 24px 22px;
}

.modal-copy {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.65;
}

.modal-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 15px 0;
}

.modal-summary div {
    display: flex;
    flex-direction: column;
    padding: 11px;
    border-radius: 8px;
    background: var(--surface-soft);
}

.modal-summary span {
    color: var(--muted);
    font-size: 8.5px;
}

.modal-summary strong {
    font-size: 14px;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.modal-form-grid .full {
    grid-column: 1 / -1;
}

.billing-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.billing-choice legend {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
}

.billing-choice label {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.billing-choice label:has(input:checked) {
    border-color: #91bbd2;
    background: #f1f8fb;
    box-shadow: inset 0 0 0 1px rgba(75, 159, 209, 0.16);
}

.billing-choice input {
    accent-color: var(--navy-800);
}

.client-internal-choice {
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fafcfd;
}

.client-internal-choice > span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.client-internal-choice small {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 400;
    line-height: 1.4;
}

@media (max-width: 430px) {
    .billing-choice {
        grid-template-columns: 1fr;
    }
}

.toast-region {
    position: fixed;
    z-index: 500;
    right: 24px;
    bottom: 24px;
    display: grid;
    gap: 8px;
}

.toast {
    display: flex;
    max-width: 380px;
    align-items: center;
    gap: 9px;
    padding: 12px 15px;
    border: 1px solid #dbe6eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
    color: #365568;
    font-size: 10.5px;
    animation: toast-in 220ms ease both;
}

.toast.success {
    border-left: 3px solid #52a68c;
}

.toast.error {
    border-left: 3px solid var(--coral);
}

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

.simple-result {
    display: grid;
    min-height: 100vh;
    place-content: center;
    justify-items: center;
    padding: 30px;
    text-align: center;
}

.simple-result img {
    width: 150px;
    margin-bottom: 28px;
}

.simple-result p {
    margin-bottom: 24px;
    color: var(--muted);
}

.mini-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.inline-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 13px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--gold-soft);
    color: #846d12;
    font-size: 10px;
}

.inline-warning svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

textarea {
    width: 100%;
    padding: 10px 12px;
    resize: vertical;
    border: 1px solid #d6e1e7;
    border-radius: 9px;
    outline: 0;
}

textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67, 153, 202, 0.12);
}

.widget-mode {
    background: transparent;
}

.widget-mode .app-main {
    margin: 0;
}

.widget-mode .content {
    padding: 0;
}

.widget-mode .sidebar,
.widget-mode .topbar,
.widget-mode .mobile-nav,
.widget-mode .page-title-row,
.widget-mode .metrics-grid,
.widget-mode .dashboard-grid,
.widget-mode .more-options,
.widget-mode .advanced-fields,
.widget-mode .timer-panel,
.widget-mode .quick-heading {
    display: none !important;
}

.widget-mode .quick-entry-card {
    margin: 0;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 14px 42px rgba(3, 31, 50, 0.2);
}

.widget-mode .quick-entry-form {
    grid-template-columns: 1fr 1fr;
}

.widget-mode .save-entry {
    grid-column: 1 / -1;
    margin-top: 0;
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.widget-header img {
    width: 80px;
}

.widget-header > span {
    margin-left: auto;
    color: #4f6d7e;
    font-size: 9px;
    font-weight: 650;
}

.widget-header .icon-button {
    width: 28px;
    height: 28px;
}

.widget-mode .widget-collapsed .form-field,
.widget-mode .widget-collapsed .save-entry {
    display: none;
}

.widget-mode .widget-collapsed {
    min-height: 64px;
}

.mobile-nav {
    display: none;
}

@media (max-width: 1180px) {
    .content,
    .topbar {
        padding-right: 24px;
        padding-left: 24px;
    }

    .quick-entry-form {
        grid-template-columns: 1fr 1fr 1fr 90px;
    }

    .save-entry {
        grid-column: 4;
        grid-row: 2;
    }

    .quick-entry-form .save-entry {
        margin-top: 0;
    }

    .quick-entry-form .form-field:nth-child(5) {
        grid-row: 1;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .right-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .sidebar {
        width: 246px;
        transform: translateX(-102%);
        transition: transform 220ms ease;
        box-shadow: 20px 0 50px rgba(5, 38, 63, 0.2);
    }

    .sidebar.is-open {
        transform: none;
    }

    .app-main {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-grid;
    }

    .topbar {
        padding-right: 18px;
        padding-left: 18px;
    }

    .global-search {
        width: min(430px, 55vw);
    }

    .content {
        padding: 22px 20px 80px;
    }

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

    .activity-panel {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .day-layout {
        grid-template-columns: 1fr;
    }

    .day-proposals-panel {
        grid-column: 1;
    }

    .day-summary-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .day-date-control {
        grid-column: 1 / -1;
    }

    .day-big-total {
        justify-content: center;
        padding: 12px 0;
    }

    .day-state-card {
        align-self: center;
    }

    .day-facts {
        grid-column: 1 / -1;
        margin: 0;
    }

    .day-summary-panel > .button {
        grid-column: 1 / -1;
    }

    .projects-layout,
    .team-layout,
    .report-grid {
        grid-template-columns: 1fr;
    }

    .projects-layout > .panel {
        min-height: auto;
    }

    .report-filters {
        grid-template-columns: 1fr 1fr;
    }

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

    .settings-profile {
        grid-row: auto;
    }
}

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

    .login-page {
        display: block;
        background: #f8fafb;
    }

    .login-brand {
        min-height: 320px;
        padding: 25px;
    }

    .login-message {
        margin: 44px 0 35px;
    }

    .login-message h1 {
        margin-bottom: 15px;
        font-size: 42px;
    }

    .login-lead {
        display: none;
    }

    .promise-list {
        display: none;
    }

    .login-form-side {
        min-height: auto;
        margin-top: -24px;
        padding: 0 16px 28px;
        background: transparent;
    }

    .login-card {
        position: relative;
        z-index: 5;
        padding: 28px 22px;
        border-radius: 18px;
    }

    .login-card-mark,
    .login-security {
        display: none;
    }

    .brand-divider,
    .brand-product {
        display: none;
    }

    .login-footnote {
        display: none;
    }

    .topbar {
        gap: 8px;
        padding: 0 13px;
    }

    .global-search {
        flex: 1;
        width: auto;
    }

    .global-search kbd,
    .profile-text,
    .install-button,
    .profile-button > svg {
        display: none;
    }

    .topbar-actions {
        gap: 2px;
    }

    .profile-button {
        padding: 2px;
    }

    .content {
        padding: 19px 14px 92px;
    }

    .page-title-row {
        align-items: flex-start;
        margin-bottom: 17px;
    }

    .page-title-row .button {
        flex: 0 0 auto;
        padding: 0 13px;
    }

    .day-status {
        min-width: auto;
        padding: 8px 10px;
    }

    .day-status small,
    .day-status > svg {
        display: none;
    }

    .day-status strong {
        font-size: 9px;
    }

    .quick-entry-card {
        padding: 16px;
    }

    .quick-heading {
        margin-bottom: 14px;
    }

    .quick-heading .text-button {
        font-size: 0;
    }

    .quick-heading .text-button svg {
        width: 18px;
        height: 18px;
    }

    .quick-entry-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .quick-entry-form .form-field:nth-child(5) {
        grid-row: auto;
    }

    .save-entry {
        grid-column: 1;
        grid-row: auto;
        margin-top: 1px;
    }

    .advanced-fields {
        grid-template-columns: 1fr;
    }

    .metrics-grid,
    .metrics-grid.compact {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .metric-card {
        min-height: 92px;
        padding: 13px;
    }

    .metric-icon {
        width: 32px;
        height: 32px;
    }

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

    .ring {
        display: none;
    }

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

    .dashboard-grid > *,
    .view,
    .panel {
        min-width: 0;
    }

    .activity-panel {
        grid-column: 1;
    }

    .dashboard-grid > .panel {
        padding: 16px;
    }

    .timeline-item {
        grid-template-columns: 43px 3px 1fr auto;
    }

    .entry-row {
        grid-template-columns: 38px minmax(0, 1fr) auto;
    }

    .entry-time {
        grid-column: 2;
    }

    .entry-actions {
        grid-row: 1;
        grid-column: 3;
    }

    .day-summary-panel {
        display: block;
    }

    .day-big-total {
        padding: 18px 0;
    }

    .day-state-card,
    .day-facts {
        margin-top: 12px;
    }

    .day-detail-panel,
    .day-proposals-panel {
        padding: 16px !important;
    }

    .modal-backdrop {
        align-items: end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
    }

    .modal-form-grid,
    .report-filters {
        grid-template-columns: 1fr;
    }

    .modal-form-grid .full {
        grid-column: 1;
    }

    .report-filters .button {
        width: 100%;
    }

    .page-title-row .action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-nav {
        position: fixed;
        z-index: 70;
        right: 10px;
        bottom: max(9px, env(safe-area-inset-bottom));
        left: 10px;
        display: grid;
        height: 61px;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        border: 1px solid rgba(212, 224, 231, 0.8);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 14px 40px rgba(4, 39, 64, 0.16);
        backdrop-filter: blur(16px);
    }

    .mobile-nav button {
        display: grid;
        height: 55px;
        place-content: center;
        justify-items: center;
        gap: 2px;
        background: transparent;
        color: #738b9a;
        font-size: 7.5px;
    }

    .mobile-nav button.is-active {
        color: var(--navy-800);
    }

    .mobile-nav svg {
        width: 18px;
        height: 18px;
    }

    .mobile-nav .mobile-primary {
        width: 47px;
        height: 47px;
        margin: -25px auto 0;
        border-radius: 50%;
        background: var(--navy-800);
        box-shadow: 0 8px 20px rgba(7, 53, 84, 0.28);
        color: #fff;
    }

    .mobile-primary svg {
        width: 22px;
        height: 22px;
    }

    .toast-region {
        right: 12px;
        bottom: 83px;
        left: 12px;
    }

    .toast {
        max-width: none;
    }

    .data-table {
        min-width: 650px;
    }

    .admin-tabs {
        overflow-x: auto;
    }

    .admin-tabs button {
        min-width: 92px;
    }
}

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

/* DUAL reference refinement: clearer type, richer corporate geometry, better density. */
body {
    font-size: 15px;
}

.app-main {
    position: relative;
    background:
        radial-gradient(circle at 96% -8%, rgba(67, 153, 202, 0.13) 0, rgba(67, 153, 202, 0.13) 165px, transparent 166px),
        radial-gradient(circle at 105% 8%, rgba(230, 204, 79, 0.1) 0, rgba(230, 204, 79, 0.1) 105px, transparent 106px),
        linear-gradient(180deg, #f8fbfc 0, var(--canvas) 340px);
}

.sidebar {
    width: 264px;
    padding: 27px 20px 20px;
    background:
        linear-gradient(180deg, #ffffff 0, #ffffff 128px, #edf4f7 142px, #0b4a75 220px, #052f4c 100%);
}

.sidebar::before {
    position: absolute;
    right: -50px;
    bottom: 135px;
    width: 135px;
    height: 210px;
    border-radius: 72px 0 0 28px;
    background: linear-gradient(180deg, rgba(230, 204, 79, 0.16), rgba(230, 204, 79, 0.02));
    content: "";
    pointer-events: none;
    transform: rotate(12deg);
}

.sidebar-brand {
    margin: -27px -20px 0;
    padding: 27px 28px 28px;
    background: linear-gradient(180deg, #fff 0%, #fff 72%, #f2f7f9 100%);
}

.sidebar-brand img {
    width: 146px;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.sidebar-brand span {
    margin-top: 3px;
    color: var(--navy-700);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.15em;
}

.main-nav,
.sidebar-lower {
    gap: 7px;
}

.main-nav {
    margin-top: 35px;
}

.nav-link {
    min-height: 49px;
    gap: 15px;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 520;
}

.nav-link svg {
    width: 20px;
    height: 20px;
}

.nav-link.is-active {
    background: linear-gradient(90deg, rgba(86, 174, 219, 0.38), rgba(67, 153, 202, 0.13));
}

.nav-count {
    min-width: 23px;
    padding: 3px 7px;
    font-size: 10px;
}

.profile-copy strong {
    font-size: 12px;
}

.profile-copy span {
    font-size: 10px;
}

.topbar {
    height: 80px;
    padding: 0 38px;
    background: rgba(255, 255, 255, 0.96);
}

.global-search {
    width: min(500px, 45vw);
    height: 44px;
    padding: 0 14px;
}

.global-search input {
    font-size: 13px;
}

.global-search kbd {
    font-size: 10px;
}

.profile-text strong {
    font-size: 12px;
}

.profile-text small {
    font-size: 10px;
}

.content {
    max-width: 1540px;
    padding: 35px 38px 56px;
}

.page-title-row {
    align-items: flex-end;
    margin-bottom: 29px;
}

h1 {
    margin-bottom: 9px;
    font-size: clamp(32px, 2.8vw, 43px);
    font-weight: 730;
}

h2 {
    font-size: 20px;
}

.eyebrow {
    margin-bottom: 10px;
    font-size: 11px;
    letter-spacing: 0.17em;
}

.page-subtitle {
    font-size: 14px;
    line-height: 1.55;
}

.day-status {
    min-width: 235px;
    padding: 12px 16px;
    border-radius: 14px;
}

.day-status strong {
    font-size: 13px;
}

.day-status small {
    font-size: 11px;
}

.quick-entry-card {
    margin-bottom: 22px;
    padding: 24px 24px 19px;
    border-color: #cddfe9;
    border-radius: 20px;
    background: #edf5f9;
    overflow: visible;
}

.quick-heading {
    margin-bottom: 19px;
}

.quick-heading h2 {
    font-size: 18px;
}

.quick-heading p {
    margin-top: 2px;
    font-size: 11.5px;
}

.heading-icon {
    width: 34px;
    height: 34px;
}

.quick-entry-form {
    grid-template-columns: minmax(205px, 1.2fr) minmax(205px, 1.15fr) minmax(220px, 1.25fr) 142px 172px;
    gap: 15px;
}

.form-field {
    gap: 8px;
}

.form-field label,
.field-label {
    font-size: 12.5px;
    font-weight: 720;
}

.form-field input,
.form-field select,
.input-shell,
.control-shell,
.toolbar-search {
    min-height: 48px;
    border-radius: 11px;
}

.control-shell,
.input-shell {
    padding: 0 13px;
}

.control-shell input,
.control-shell select,
.input-shell input {
    min-height: 46px;
    font-size: 14px;
}

.control-shell > svg,
.input-shell > svg {
    width: 19px;
    height: 19px;
}

.field-hint {
    min-height: 17px;
    font-size: 11px;
}

.save-entry {
    min-height: 48px;
    margin-top: 20px;
    border-radius: 11px;
    font-size: 13.5px;
}

.text-button {
    font-size: 12.5px;
}

.more-options {
    font-size: 11.5px;
}

.metrics-grid {
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card {
    min-height: 125px;
    gap: 16px;
    padding: 20px 21px;
    border-radius: 18px;
}

.metric-icon {
    width: 44px;
    height: 44px;
}

.metric-icon svg {
    width: 21px;
    height: 21px;
}

.metric-card span {
    font-size: 11.5px;
    font-weight: 560;
}

.metric-card strong {
    margin: 4px 0 2px;
    font-size: 29px;
    line-height: 1.1;
}

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

.ring {
    width: 50px;
    height: 50px;
}

.ring span {
    width: 39px;
    height: 39px;
}

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

.metrics-grid.compact .metric-card strong {
    font-size: 24px;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.48fr) minmax(320px, 0.82fr);
    gap: 18px;
}

.dashboard-grid > .panel {
    padding: 23px;
    border-radius: 20px;
}

.panel-head {
    margin-bottom: 23px;
}

.panel-head h2 {
    font-size: 20px;
}

.panel-head p {
    font-size: 12px;
}

.week-strip {
    gap: 8px;
    margin-bottom: 23px;
}

.week-day {
    min-height: 58px;
    border-radius: 10px;
}

.week-day span {
    font-size: 9.5px;
    font-weight: 630;
}

.week-day strong {
    margin-top: 4px;
    font-size: 12px;
}

.timeline-item {
    grid-template-columns: 70px 4px 1fr auto;
    min-height: 67px;
    gap: 12px;
    padding: 7px 0 10px;
}

.timeline-time {
    font-size: 11px;
}

.timeline-copy strong {
    font-size: 12.5px;
}

.timeline-copy span {
    margin-top: 2px;
    font-size: 10.5px;
}

.timeline-duration {
    font-size: 12px;
}

.proposal-item {
    min-height: 67px;
    padding: 13px;
    border-radius: 12px;
}

.proposal-source {
    width: 37px;
    height: 37px;
    border-radius: 10px;
    font-size: 10px;
}

.proposal-copy strong {
    font-size: 11.5px;
}

.proposal-copy span {
    margin-top: 3px;
    font-size: 9.5px;
}

.proposal-action {
    padding: 7px 10px;
    font-size: 10px;
}

.proposal-count {
    min-width: 30px;
    height: 30px;
    font-size: 11px;
}

.panel-link {
    margin-top: 16px;
    padding-top: 11px;
    font-size: 11px;
}

.recent-item {
    gap: 11px;
    padding: 12px 0;
}

.recent-client strong {
    font-size: 11.5px;
}

.recent-client span {
    margin-top: 2px;
    font-size: 9.5px;
}

.recent-duration {
    font-size: 11px;
}

.avatar {
    width: 38px;
    height: 38px;
    font-size: 12px;
}

.activity-chart-block {
    margin-top: 21px;
    padding-top: 19px;
    border-top: 1px solid var(--line);
}

.activity-chart-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.activity-chart-head > div {
    display: flex;
    flex-direction: column;
}

.activity-chart-head span {
    color: var(--blue);
    font-size: 9px;
    font-weight: 730;
    letter-spacing: 0.12em;
}

.activity-chart-head strong {
    margin-top: 3px;
    color: var(--navy-900);
    font-size: 13px;
}

.activity-chart-head small {
    color: var(--muted);
    font-size: 9.5px;
}

.activity-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    align-items: end;
}

.activity-bar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.activity-bar-value {
    color: #6d8190;
    font-size: 9.5px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.activity-bar-track {
    display: flex;
    width: 100%;
    max-width: 38px;
    height: 120px;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 7px;
    background: #edf3f6;
}

.activity-bar-track i {
    display: block;
    width: 100%;
    border-radius: 7px;
    background: linear-gradient(180deg, var(--cyan), var(--blue));
}

.activity-bar.is-current .activity-bar-track i {
    background: linear-gradient(180deg, var(--gold), #c8ab24);
}

.activity-bar small {
    color: #778b98;
    font-size: 9px;
    font-weight: 630;
    text-transform: uppercase;
}

/* Internal views */
.day-layout,
.projects-layout,
.team-layout,
.settings-grid,
.report-grid {
    gap: 18px;
}

.day-layout {
    grid-template-columns: minmax(286px, 0.68fr) minmax(500px, 1.48fr);
}

.day-layout .panel,
.projects-layout > .panel,
.team-layout > .panel,
.settings-grid .panel,
.report-grid .panel {
    padding: 23px;
}

.day-date-control strong {
    font-size: 13px;
}

.day-date-control span {
    font-size: 9.5px;
}

.day-big-total span {
    font-size: 53px;
}

.day-big-total small {
    font-size: 11px;
}

.day-state-card {
    padding: 16px;
    border-radius: 12px;
}

.day-state-card strong {
    font-size: 12.5px;
}

.day-state-card p {
    margin-top: 3px;
    font-size: 10.5px;
}

.day-facts div,
.detail-facts div {
    padding: 13px;
}

.day-facts span,
.detail-facts span {
    font-size: 9.5px;
}

.day-facts strong {
    font-size: 19px;
}

.detail-facts strong {
    font-size: 12px;
}

.entry-row {
    grid-template-columns: 46px minmax(0, 1fr) auto auto;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
}

.entry-icon {
    width: 40px;
    height: 40px;
    font-size: 10px;
}

.entry-copy strong {
    font-size: 12.5px;
}

.entry-copy span {
    margin-top: 2px;
    font-size: 10.5px;
}

.entry-copy small {
    font-size: 9.5px;
}

.entry-time {
    font-size: 13px;
}

.data-table {
    font-size: 12px;
}

.data-table th {
    padding: 12px;
    font-size: 9.5px;
}

.data-table td {
    padding: 14px 12px;
}

.cell-copy small {
    margin-top: 2px;
    font-size: 9.5px;
}

.tree-node {
    min-height: 43px;
    padding: 11px 10px;
}

.tree-node span,
.tree-node small,
.task-node,
.task-node strong {
    font-size: 11.5px;
}

.project-detail-head h2 {
    font-size: 26px;
}

.project-detail-head p {
    font-size: 11px;
}

.settings-row strong {
    font-size: 12px;
}

.settings-row span {
    font-size: 10px;
}

.settings-copy {
    font-size: 12px;
}

.admin-tabs button {
    padding: 11px 14px;
    font-size: 11.5px;
}

.modal > header h2 {
    font-size: 25px;
}

.modal-copy {
    font-size: 12.5px;
}

.modal-summary span {
    font-size: 10px;
}

.modal-summary strong {
    font-size: 16px;
}

/* Widget preview */
.widget-mode {
    min-width: 390px;
    min-height: 100vh;
    overflow: hidden;
    padding: 12px;
    background:
        radial-gradient(circle at 100% 0, rgba(67, 153, 202, 0.18), transparent 34%),
        radial-gradient(circle at 0 100%, rgba(158, 199, 193, 0.22), transparent 30%),
        #edf3f6;
}

.widget-mode .app-main {
    min-height: auto;
    margin: 0;
    background: transparent;
}

.widget-mode .content {
    width: 100%;
    max-width: none;
    padding: 0;
}

.widget-mode .quick-entry-card {
    min-height: 548px;
    margin: 0;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(212, 226, 234, 0.9);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 253, 0.98));
    box-shadow: 0 22px 60px rgba(3, 36, 58, 0.22);
}

.widget-mode .quick-entry-card::before {
    height: 5px;
    background: linear-gradient(90deg, var(--blue) 0 50%, var(--gold) 50% 72%, var(--sage) 72%);
}

.widget-mode .quick-entry-card::after {
    position: absolute;
    top: 20px;
    right: -46px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(67, 153, 202, 0.09);
    content: "";
    pointer-events: none;
}

.widget-header {
    position: relative;
    z-index: 1;
    margin: 0 0 13px;
    padding: 0 0 13px;
}

.widget-header img {
    width: 100px;
}

.widget-header > span {
    margin-left: auto;
    font-size: 11px;
}

.widget-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--state-open-soft);
    color: var(--state-open) !important;
    min-height: 30px;
    font-size: 14px !important;
    font-weight: 650;
    line-height: 1.2;
}

.widget-state > span {
    font-size: 14px;
    line-height: 1.2;
}

.widget-state i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--state-open);
}

.widget-state.has-action {
    padding: 5px 9px;
    border: 1px solid var(--state-open-border);
    background: var(--state-open-soft);
    cursor: pointer;
}

.widget-state.has-action span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.12;
}

.widget-state.has-action strong {
    color: var(--state-open);
    font-size: 14px;
    font-weight: 780;
    white-space: nowrap;
}

.widget-state.has-action small {
    margin-top: 2px;
    color: #8b4b50;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.2;
}

.widget-state.has-action:hover {
    border-color: var(--state-open);
    background: #f8e4e4;
}

.widget-state.is-non-working,
.widget-state.has-action.is-non-working {
    border-color: #d9e3e8;
    background: #f4f7f8;
    color: #607986 !important;
}

.widget-state.is-non-working i {
    background: #607986;
}

.widget-state.has-action.is-non-working strong,
.widget-state.has-action.is-non-working small {
    color: #607986;
}

.widget-controls {
    display: flex;
    gap: 1px;
    margin-left: 2px;
}

.widget-controls .icon-button {
    width: 27px;
    height: 27px;
}

.widget-summary {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 15px 17px;
    border-radius: 14px;
    background:
        linear-gradient(110deg, #0a3b5e, #0d547c);
    color: #fff;
}

.widget-summary > div {
    display: flex;
    flex-direction: column;
}

.widget-summary span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.widget-summary strong {
    margin: 2px 0;
    font-size: 32px;
    letter-spacing: -0.05em;
    line-height: 1;
}

.widget-summary small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 9.5px;
}

.widget-summary .widget-entry-count {
    display: inline-flex;
    width: max-content;
    align-items: center;
    gap: 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font-size: 9.5px;
    text-align: left;
}

.widget-summary .widget-entry-count:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.widget-summary .widget-entry-count:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.widget-summary .widget-entry-count:disabled {
    cursor: default;
    text-decoration: none;
}

.widget-summary .widget-entry-count svg {
    width: 11px;
    height: 11px;
}

.widget-summary .widget-proposals {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
    cursor: pointer;
    font-size: 9px;
    letter-spacing: 0;
}

.widget-summary .widget-proposals:hover {
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.18);
}

.widget-summary .widget-proposals:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.widget-summary .widget-proposals:disabled {
    cursor: default;
    opacity: 0.82;
}

.widget-summary .widget-proposals svg {
    width: 12px;
    height: 12px;
}

.widget-pending-preview {
    position: fixed;
    z-index: 180;
    display: flex;
    max-height: min(70vh, 520px);
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(3, 31, 54, 0.28);
    color: #173b56;
    animation: widget-pending-preview-in 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.widget-pending-preview[hidden] {
    display: none;
}

.widget-pending-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #dbe7ef;
    background: #f4f9fc;
}

.widget-pending-preview-head > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.widget-pending-preview-head strong {
    color: #123c5d;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.widget-pending-preview-head span {
    color: #5b7487;
    font-size: 10.5px;
    line-height: 1.35;
}

.widget-pending-preview-head .widget-pending-preview-hint {
    flex: 0 0 auto;
    color: #2b719e;
    font-weight: 600;
}

.widget-pending-preview-body {
    min-height: 0;
    padding: 0 16px 5px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #9bb9cc transparent;
    scrollbar-width: thin;
}

.widget-pending-preview-body::-webkit-scrollbar {
    width: 7px;
}

.widget-pending-preview-body::-webkit-scrollbar-thumb {
    border: 2px solid #fff;
    border-radius: 999px;
    background: #9bb9cc;
}

.widget-pending-detail {
    padding: 13px 0 14px;
    border-bottom: 1px solid #e2ebf1;
}

.widget-pending-detail:last-of-type {
    border-bottom: 0;
}

.widget-pending-detail header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.widget-pending-detail header > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.widget-pending-detail header > div > span {
    color: #5b7487;
    font-size: 10px;
    font-weight: 600;
}

.widget-pending-detail h3,
.widget-pending-detail header strong {
    color: #123c5d;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
}

.widget-pending-detail .task-priority {
    flex: 0 0 auto;
    min-height: 22px;
    padding: 4px 8px;
    font-size: 9.5px;
}

.widget-pending-detail dl {
    display: grid;
    margin: 10px 0 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.widget-pending-detail dl > div {
    min-width: 0;
}

.widget-pending-detail dt {
    margin: 0 0 2px;
    color: #6b7f8e;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.3;
}

.widget-pending-detail dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #24475f;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.widget-pending-google {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 13px 0;
    border-top: 1px solid #dbe7ef;
}

.widget-pending-google > strong {
    color: #123c5d;
    font-size: 11.5px;
    font-weight: 700;
}

.widget-pending-google > div {
    padding: 9px 10px;
    border-radius: 8px;
    background: #fff7e8;
}

.widget-pending-google span {
    color: #8b6019;
    font-size: 9px;
    font-weight: 700;
}

.widget-pending-google p {
    margin: 3px 0;
    color: #4b3b25;
    font-size: 11px;
    line-height: 1.4;
}

.widget-pending-google small,
.widget-pending-preview-empty {
    color: #647d8e;
    font-size: 10px;
    line-height: 1.4;
}

@keyframes widget-pending-preview-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .widget-pending-preview {
        animation: none;
    }
}

.widget-mode .quick-entry-form {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.widget-mode .quick-entry-form .form-field:nth-child(1),
.widget-mode .quick-entry-form .form-field:nth-child(2) {
    grid-column: 1 / -1;
}

.widget-mode .save-entry {
    grid-column: 1 / -1;
    min-height: 45px;
    margin-top: 2px;
}

.widget-mode .form-field label {
    font-size: 11px;
}

.widget-mode .control-shell {
    min-height: 44px;
}

.widget-mode .control-shell input,
.widget-mode .control-shell select {
    min-height: 42px;
    font-size: 13px;
}

.widget-mode .field-hint {
    font-size: 9.5px;
}

.widget-mode .widget-collapsed .quick-entry-form {
    display: none;
}

.widget-mode .quick-entry-card.widget-collapsed {
    min-height: 0;
}

.mobile-nav {
    z-index: 1000;
}

@media (max-width: 1180px) {
    .sidebar {
        width: 232px;
    }

    .quick-entry-form {
        grid-template-columns: 1fr 1fr 1fr 132px;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.3fr) minmax(290px, 0.7fr);
    }
}

@media (max-width: 920px) {
    .sidebar {
        width: 264px;
    }

    .content {
        padding: 25px 22px 82px;
    }

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

    .activity-panel {
        grid-column: 1 / -1;
    }

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

    .save-entry {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}

@media (max-width: 700px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 30px;
    }

    .content {
        padding: 21px 14px 94px;
    }

    .page-title-row {
        align-items: flex-start;
    }

    .view[data-view-panel="home"] .page-title-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .view[data-view-panel="home"] .day-status {
        width: 100%;
    }

    .view[data-view-panel="home"] h1 {
        max-width: 350px;
        font-size: 34px;
        line-height: 1.03;
    }

    .quick-entry-card {
        padding: 18px 16px 16px;
    }

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

    .metric-card {
        min-width: 0;
        min-height: 106px;
        padding: 15px;
    }

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

    .metric-card small {
        overflow: visible;
        white-space: normal;
    }

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

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

    .dashboard-grid > *,
    .view,
    .panel {
        min-width: 0;
    }

    .dashboard-grid > .panel {
        padding: 18px;
    }

    .activity-chart-head small {
        display: none;
    }

    .activity-bars {
        gap: 7px;
    }

    .activity-bar-track {
        height: 90px;
    }

    .entry-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        padding: 12px;
    }

    .data-table {
        min-width: 720px;
    }
}

/* Final legibility and consultation workspace. */
body {
    font-size: 16px;
}

.app-main h1 {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: clamp(36px, 3.2vw, 50px);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.page-title-row {
    margin-bottom: 31px;
}

.page-title-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.page-subtitle {
    max-width: 720px;
    font-size: 15px;
}

.form-field label,
.field-label {
    font-size: 14px;
}

.control-shell input,
.control-shell select,
.input-shell input {
    font-size: 15.5px;
}

.field-hint {
    font-size: 12px;
}

.text-button {
    font-size: 13.5px;
}

.quick-heading h2 {
    font-size: 20px;
}

.quick-heading p,
.panel-head p,
.metric-card span,
.metric-card small {
    font-size: 12px;
}

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

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

.timeline-copy strong,
.proposal-copy strong,
.recent-client strong,
.entry-copy strong {
    font-size: 13.5px;
}

.timeline-copy span,
.proposal-copy span,
.recent-client span,
.entry-copy span,
.entry-copy small {
    font-size: 11.5px;
}

.data-table {
    font-size: 13.5px;
}

.data-table th {
    font-size: 10.5px;
}

.cell-copy small {
    font-size: 11px;
}

.hour-helper-button {
    display: inline-grid;
    width: 25px;
    height: 25px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 6px;
    background: var(--blue-soft);
    color: var(--navy-700);
}

.hour-helper-button:hover {
    background: #d8ecf7;
}

.hour-helper-button svg {
    width: 14px;
    height: 14px;
}

.hours-field {
    position: relative;
}

.hour-presets {
    position: absolute;
    z-index: 30;
    top: calc(100% - 8px);
    right: 0;
    width: 300px;
    max-height: 350px;
    padding: 14px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(6, 43, 68, 0.23);
}

.hour-presets-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.hour-presets-title span {
    color: var(--navy-800);
    font-size: 13px;
    font-weight: 720;
}

.hour-presets-title small {
    color: var(--muted);
    font-size: 10.5px;
}

.hour-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.hour-presets button {
    min-height: 36px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--navy-800);
    font-size: 12.5px;
    font-weight: 680;
}

.hour-presets button:hover {
    background: var(--blue-soft);
}

/* Natural-language activity inquiries */
.insight-search-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    padding: 28px;
    border: 1px solid rgba(211, 225, 233, 0.9);
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0, rgba(67, 153, 202, 0.18), transparent 27%),
        radial-gradient(circle at 85% 120%, rgba(230, 204, 79, 0.15), transparent 24%),
        #fff;
    box-shadow: var(--shadow);
}

.insight-search-panel::after {
    position: absolute;
    right: -55px;
    bottom: -80px;
    width: 195px;
    height: 170px;
    border: 28px solid rgba(158, 199, 193, 0.16);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.insight-search-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.insight-search-head h2 {
    margin-bottom: 3px;
    font-size: 23px;
}

.insight-search-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.insight-mark {
    display: grid;
    width: 47px;
    height: 47px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--blue-soft), #f6fafc);
    color: var(--navy-700);
}

.insight-mark svg {
    width: 22px;
    height: 22px;
}

.insight-form {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 11px;
}

.insight-input-shell {
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 11px;
    padding: 0 17px;
    border: 1px solid #ccdae2;
    border-radius: 13px;
    background: #fff;
}

.insight-input-shell:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(67, 153, 202, 0.12);
}

.insight-input-shell svg {
    width: 20px;
    height: 20px;
    color: #6d899a;
}

.insight-input-shell input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    font-size: 15px;
}

.insight-form .button {
    min-height: 54px;
    padding: 0 24px;
}

.insight-suggestions {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.insight-suggestions button {
    padding: 7px 11px;
    border: 1px solid #dce7ec;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: #4e6a7c;
    font-size: 10.5px;
}

.insight-suggestions button:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--navy-800);
}

.insight-empty {
    display: grid;
    min-height: 300px;
    place-content: center;
    justify-items: center;
    padding: 40px;
    color: var(--muted);
    text-align: center;
}

.insight-empty h2 {
    margin: 17px 0 7px;
    font-size: 24px;
}

.insight-empty p {
    max-width: 530px;
    font-size: 13px;
}

.insight-geometry {
    display: flex;
    height: 52px;
    align-items: flex-end;
    gap: 8px;
}

.insight-geometry i {
    display: block;
    width: 24px;
    background: var(--blue);
}

.insight-geometry i:nth-child(1) {
    height: 34px;
    border-radius: 15px 15px 3px 3px;
}

.insight-geometry i:nth-child(2) {
    height: 51px;
    border-radius: 4px;
    background: var(--gold);
}

.insight-geometry i:nth-child(3) {
    height: 28px;
    border-radius: 3px;
    background: var(--sage);
}

.insight-answer-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 17px;
    padding: 22px 24px;
    border-radius: 18px;
    background: linear-gradient(120deg, #08395a, #0c547d);
    box-shadow: 0 15px 38px rgba(7, 53, 84, 0.16);
    color: #fff;
}

.answer-icon {
    display: grid;
    width: 45px;
    height: 45px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.11);
    color: var(--gold);
}

.insight-answer-card .eyebrow {
    color: var(--cyan);
}

.insight-answer-card h2 {
    margin-bottom: 9px;
    color: #fff;
    font-size: clamp(21px, 1.7vw, 28px);
    font-weight: 560;
    line-height: 1.35;
}

.insight-interpretation {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.insight-interpretation span {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 10.5px;
}

.insight-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    gap: 17px;
    margin-top: 17px;
}

.insight-dashboard-grid > .panel {
    min-height: 320px;
    padding: 22px;
}

.insight-chart {
    display: flex;
    height: 205px;
    align-items: flex-end;
    gap: 9px;
    padding-top: 22px;
    overflow-x: auto;
}

.insight-column {
    display: flex;
    min-width: 28px;
    height: 100%;
    flex: 1 0 28px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.insight-column strong {
    color: #617888;
    font-size: 9.5px;
    white-space: nowrap;
}

.insight-column i {
    display: block;
    width: min(36px, 72%);
    min-height: 5px;
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, var(--cyan), var(--blue));
}

.insight-column.is-empty i {
    background: #dce8ee;
}

.insight-column small {
    color: #7c909d;
    font-size: 9px;
    white-space: nowrap;
}

.insight-breakdown-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 13px;
    margin-bottom: 16px;
}

.insight-breakdown-row strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-breakdown-row span {
    color: var(--navy-800);
    font-size: 12px;
    font-weight: 700;
}

.insight-progress {
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eff3;
}

.insight-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.insight-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

.insight-highlights span {
    padding: 8px 11px;
    border: 1px solid #dbe6eb;
    border-radius: 9px;
    background: #fff;
    color: #4b6678;
    font-size: 11px;
}

.widget-mode {
    min-width: 350px;
    padding: 20px;
    background: transparent;
}

.widget-mode .quick-entry-card {
    min-height: 0;
    padding: 15px;
    overflow: visible;
    border-radius: 28px;
    border-color: rgba(218, 230, 236, 0.82);
    box-shadow: none;
    filter: drop-shadow(0 3px 7px rgba(2, 24, 40, 0.22));
}

.widget-mode .hour-presets {
    position: fixed;
    z-index: 400;
    top: auto;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
    max-height: calc(100vh - 32px);
    padding: 16px;
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 0 0 100vmax rgba(3, 30, 49, 0.34),
        0 14px 35px rgba(3, 30, 49, 0.25);
}

.widget-mode .hour-presets-title span {
    font-size: 15px;
}

.widget-mode .hour-presets-title small {
    font-size: 11px;
}

.widget-mode .hour-preset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.widget-mode .hour-presets button {
    min-height: 37px;
    font-size: 13px;
}

.widget-header {
    cursor: grab;
    user-select: none;
}

.widget-header:active {
    cursor: grabbing;
}

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

@media (max-width: 700px) {
    body {
        font-size: 15px;
    }

    .app-main h1 {
        font-size: 38px;
    }

    .page-subtitle {
        font-size: 14px;
    }

    .insight-search-panel {
        padding: 19px 16px;
        border-radius: 18px;
    }

    .insight-search-head {
        align-items: flex-start;
    }

    .insight-search-head h2 {
        font-size: 20px;
    }

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

    .insight-form .button {
        width: 100%;
    }

    .insight-suggestions {
        flex-wrap: nowrap;
        padding-bottom: 4px;
        overflow-x: auto;
    }

    .insight-suggestions button {
        flex: 0 0 auto;
    }

    .insight-answer-card {
        padding: 18px;
    }

    .answer-icon {
        display: none;
    }

    .insight-answer-card h2 {
        font-size: 21px;
    }

    .insight-dashboard-grid > .panel {
        padding: 17px;
    }
}

/* Consultas: analytical workspace and data views. */
.insight-chart,
.insight-donut-legend {
    --chart-1: #15577e;
    --chart-2: #4399ca;
    --chart-3: #e6cc4f;
    --chart-4: #7ea7a2;
    --chart-5: #7f91c5;
    --chart-6: #9dc8df;
    --chart-7: #b88b4f;
    --chart-8: #7d8f9c;
}

.insight-answer-card {
    align-items: stretch;
    gap: 20px;
    padding: 25px 27px;
    border-radius: 16px;
    background: var(--navy-900);
    box-shadow: 0 14px 34px rgba(7, 53, 84, 0.14);
}

.answer-icon {
    width: 42px;
    height: 42px;
    margin-top: 2px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
}

.insight-answer-content {
    min-width: 0;
    flex: 1;
}

.insight-answer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.insight-answer-head > div {
    min-width: 0;
}

.insight-answer-label {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.insight-answer-card h2 {
    max-width: 1000px;
    margin-bottom: 15px;
    color: #fff;
    font-size: 25px;
    font-weight: 560;
    letter-spacing: -0.025em;
    line-height: 1.35;
}

.insight-answer-card .insight-download {
    flex: 0 0 auto;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.insight-answer-card .insight-download:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.14);
}

.insight-interpretation span {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
}

.insight-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 17px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.insight-kpi {
    position: relative;
    min-width: 0;
    padding: 17px 20px 16px;
}

.insight-kpi + .insight-kpi {
    border-left: 1px solid var(--line);
}

.insight-kpi::before {
    position: absolute;
    top: 0;
    right: 20px;
    left: 20px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--blue);
    content: "";
}

.insight-kpi.is-billable::before {
    background: var(--sage);
}

.insight-kpi.is-internal::before {
    background: var(--gold);
}

.insight-kpi.is-average::before {
    background: var(--coral);
}

.insight-kpi span,
.insight-kpi small {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-kpi span {
    margin-bottom: 3px;
    font-weight: 650;
}

.insight-kpi strong {
    display: block;
    margin-bottom: 2px;
    color: var(--navy-900);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 27px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.insight-financial-estimate {
    margin: -3px 0 17px;
    padding: 18px 20px;
    border: 1px solid #cfe0e7;
    border-radius: 14px;
    background: #f5fafb;
}

.insight-financial-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.insight-financial-head span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.insight-financial-head h2 {
    margin: 0;
    font-size: 17px;
}

.insight-financial-head small {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--navy-900);
    color: #fff;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.insight-financial-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid #dbe8ed;
    border-radius: 10px;
    background: var(--surface);
}

.insight-financial-values article {
    min-width: 0;
    padding: 14px 16px;
}

.insight-financial-values article + article {
    border-left: 1px solid #dbe8ed;
}

.insight-financial-values span,
.insight-financial-values small {
    display: block;
    color: var(--muted);
    font-size: 10.5px;
}

.insight-financial-values strong {
    display: block;
    margin: 3px 0;
    color: var(--navy-900);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 25px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.insight-financial-estimate > p {
    margin: 11px 0 0;
    color: #526c7d;
    font-size: 10.5px;
    line-height: 1.45;
}

.insight-financial-group-section {
    margin-top: 14px;
    border-top: 1px solid #dbe8ed;
    padding-top: 13px;
}

.insight-financial-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.insight-financial-group-head h3 {
    margin: 0;
    font-size: 13px;
}

.insight-financial-group-head span {
    color: var(--muted);
    font-size: 9.5px;
}

.insight-financial-groups {
    max-height: 380px;
    overflow: auto;
    border: 1px solid #dbe8ed;
    border-radius: 9px;
    background: var(--surface);
}

.insight-financial-group-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 75px 105px 105px;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 12px;
    border-bottom: 1px solid #edf2f5;
}

.insight-financial-group-row:last-child {
    border-bottom: 0;
}

.insight-financial-group-row.is-head {
    position: sticky;
    z-index: 1;
    top: 0;
    min-height: 32px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.insight-financial-group-row > span:first-child {
    overflow: hidden;
    font-size: 11px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-financial-group-row > span:not(:first-child),
.insight-financial-group-row > strong {
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.insight-financial-group-row .insight-financial-group-metric small {
    display: none;
}

.insight-financial-group-row .insight-financial-group-metric b {
    font-weight: inherit;
}

.insight-financial-group-row > span:nth-child(2) {
    color: var(--muted);
}

.insight-financial-group-row > strong {
    color: var(--navy-800);
}

.insight-custom-calculations {
    margin-bottom: 17px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.insight-custom-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.insight-custom-head h2 {
    margin: 0;
    font-size: 17px;
}

.insight-custom-head span {
    color: var(--muted);
    font-size: 10.5px;
}

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

.insight-calculation-grid article {
    min-width: 0;
    padding: 13px 14px;
    border-radius: 9px;
    background: var(--surface-soft);
}

.insight-calculation-grid span,
.insight-calculation-grid code {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-calculation-grid span {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 650;
}

.insight-calculation-grid strong {
    display: block;
    margin: 3px 0 5px;
    color: var(--navy-900);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 21px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
}

.insight-calculation-grid code {
    padding: 0;
    background: transparent;
    color: #657d8d;
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 9.5px;
}

.insight-chart-panel,
.insight-ranking-panel,
.insight-context-panel,
.insight-table-panel {
    min-width: 0;
    padding: 21px 22px;
    border-radius: 15px;
    box-shadow: none;
}

.insight-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 17px;
}

.insight-panel-head h2 {
    margin-bottom: 3px;
    font-size: 19px;
}

.insight-panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: 11.5px;
}

.insight-view-switcher,
.insight-metric-switcher,
.insight-table-switcher {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}

.insight-view-switcher button,
.insight-metric-switcher button,
.insight-table-switcher button {
    min-height: 31px;
    padding: 0 11px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.insight-view-switcher button:hover,
.insight-metric-switcher button:hover,
.insight-table-switcher button:hover {
    color: var(--navy-800);
}

.insight-view-switcher button.is-active,
.insight-metric-switcher button.is-active,
.insight-table-switcher button.is-active {
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(10, 53, 87, 0.1);
    color: var(--navy-900);
}

.insight-view-switcher button:disabled,
.insight-metric-switcher button:disabled,
.insight-table-switcher button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.insight-chart-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.insight-chart-frame {
    position: relative;
    min-height: 350px;
    padding-top: 8px;
}

.insight-chart-tooltip {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 8px;
    max-width: 340px;
    padding: 8px 11px;
    border-radius: 8px;
    background: var(--navy-950);
    box-shadow: 0 8px 22px rgba(5, 38, 63, 0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.insight-chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 330px;
    padding: 0;
    overflow: visible;
}

#insight-chart.insight-chart {
    height: auto;
}

.insight-chart[data-view="bar"] {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    min-height: 350px;
    gap: 10px;
}

.insight-bars-axis {
    display: flex;
    height: 282px;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 0 25px;
    color: var(--muted);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.insight-bars-plot {
    position: relative;
    display: grid;
    min-width: calc(var(--insight-columns) * 68px);
    height: 320px;
    grid-template-columns: repeat(var(--insight-columns), minmax(56px, 1fr));
    align-items: end;
    gap: 10px;
    padding: 0 5px;
    overflow-x: auto;
}

.insight-bars-grid {
    position: absolute;
    inset: 0 0 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.insight-bars-grid i {
    display: block;
    width: 100%;
    border-top: 1px solid #e9eff3;
}

.insight-bar-group {
    position: relative;
    z-index: 1;
    display: grid;
    height: 100%;
    min-width: 0;
    grid-template-rows: minmax(0, 1fr) 25px;
    align-items: end;
    gap: 5px;
}

.insight-bar-stack {
    display: flex;
    width: min(42px, 72%);
    height: 100%;
    flex-direction: column-reverse;
    align-self: end;
    justify-self: center;
    justify-content: flex-start;
    overflow: hidden;
    border-radius: 6px 6px 2px 2px;
}

.insight-bar-segment {
    display: block;
    width: 100%;
    min-height: 0;
    transition: filter 160ms ease, opacity 160ms ease;
}

.insight-bar-segment:hover,
.insight-bar-segment:focus-visible {
    filter: brightness(0.88);
}

.insight-bar-group small {
    overflow: hidden;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-series-0 {
    background: var(--chart-1);
    fill: var(--chart-1);
    stroke: var(--chart-1);
}

.chart-series-1 {
    background: var(--chart-2);
    fill: var(--chart-2);
    stroke: var(--chart-2);
}

.chart-series-2 {
    background: var(--chart-3);
    fill: var(--chart-3);
    stroke: var(--chart-3);
}

.chart-series-3 {
    background: var(--chart-4);
    fill: var(--chart-4);
    stroke: var(--chart-4);
}

.chart-series-4 {
    background: var(--chart-5);
    fill: var(--chart-5);
    stroke: var(--chart-5);
}

.chart-series-5 {
    background: var(--chart-6);
    fill: var(--chart-6);
    stroke: var(--chart-6);
}

.chart-series-6 {
    background: var(--chart-7);
    fill: var(--chart-7);
    stroke: var(--chart-7);
}

.chart-series-7 {
    background: var(--chart-8);
    fill: var(--chart-8);
    stroke: var(--chart-8);
}

.insight-line-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 4px;
}

.insight-line-legend button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.insight-line-legend button:hover {
    color: var(--navy-800);
}

.insight-line-legend i {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.insight-line-svg {
    width: 100%;
    height: auto;
    overflow: visible;
    fill: none;
    stroke: none;
}

.insight-line-grid line {
    stroke: #e8eef2;
    stroke-width: 1;
}

.insight-line-grid text {
    fill: var(--muted);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    text-anchor: end;
    stroke: none;
}

.insight-line-path {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.insight-line-point {
    cursor: pointer;
    outline: none;
}

.insight-line-point circle:not(.insight-line-hit) {
    stroke: #fff;
    stroke-width: 2.5;
}

.insight-line-hit {
    fill: transparent;
    stroke: transparent;
}

.insight-line-point:focus .insight-line-hit {
    fill: rgba(67, 153, 202, 0.14);
    stroke: var(--blue);
    stroke-width: 2;
}

.insight-line-label {
    fill: var(--muted);
    font-size: 9px;
    text-anchor: middle;
    stroke: none;
}

.insight-donut-layout {
    display: grid;
    min-height: 330px;
    grid-template-columns: minmax(240px, 0.9fr) minmax(260px, 1.1fr);
    align-items: center;
    gap: 32px;
}

.insight-donut {
    width: min(100%, 350px);
    height: auto;
    justify-self: center;
    overflow: visible;
}

.insight-donut-track {
    fill: none;
    stroke: #edf2f5;
    stroke-width: 26;
}

.insight-donut-segment {
    fill: none;
    stroke-width: 26;
    cursor: pointer;
    outline: none;
    transition: opacity 160ms ease, stroke-width 160ms ease;
}

.insight-donut-segment:hover,
.insight-donut-segment:focus {
    opacity: 0.82;
    stroke-width: 30;
}

.insight-donut-value {
    fill: var(--navy-900);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 25px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    stroke: none;
}

.insight-donut-label {
    fill: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    stroke: none;
}

.insight-donut-legend {
    display: grid;
    gap: 0;
}

.insight-donut-legend > div {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto 50px;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    border-bottom: 1px solid var(--line);
}

.insight-donut-legend > div:last-child {
    border-bottom: 0;
}

.insight-donut-legend i {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.insight-donut-legend span {
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-donut-legend strong {
    color: var(--navy-900);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.insight-donut-legend small {
    color: var(--muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.insight-chart-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 13px;
    border-top: 1px solid var(--line);
}

.insight-chart-summary > div {
    min-width: 0;
    padding: 12px 15px 0 0;
}

.insight-chart-summary > div + div {
    padding-left: 15px;
    border-left: 1px solid var(--line);
}

.insight-chart-summary span,
.insight-chart-summary small {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-chart-summary strong {
    display: block;
    overflow: hidden;
    margin: 2px 0;
    color: var(--navy-900);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-chart-empty {
    display: grid;
    min-height: 300px;
    place-content: center;
    justify-items: center;
    color: var(--muted);
    text-align: center;
}

.insight-chart-empty strong {
    margin-bottom: 4px;
    color: var(--navy-900);
    font-size: 16px;
}

.insight-chart-empty span {
    font-size: 12px;
}

.insight-analysis-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 17px;
    margin-top: 17px;
}

.insight-analysis-grid.is-sql {
    grid-template-columns: 1fr;
}

.insight-rank-row {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.insight-rank-row:first-child {
    padding-top: 2px;
}

.insight-rank-row:last-child {
    padding-bottom: 1px;
    border-bottom: 0;
}

.insight-rank-index {
    padding-top: 2px;
    color: #94a5b1;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.insight-rank-copy {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
}

.insight-rank-copy strong,
.insight-rank-copy small {
    display: block;
}

.insight-rank-copy > div:first-child {
    min-width: 0;
}

.insight-rank-copy > div:first-child strong {
    overflow: hidden;
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-rank-copy small {
    color: var(--muted);
    font-size: 10px;
}

.insight-rank-value {
    text-align: right;
}

.insight-rank-value strong {
    color: var(--navy-900);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.insight-rank-value span {
    color: var(--muted);
    font-size: 9.5px;
}

.insight-rank-copy .insight-progress {
    height: 4px;
    background: #edf2f5;
}

.insight-rank-copy .insight-progress i {
    background: var(--blue);
}

.insight-ranking-empty,
.insight-table-empty {
    display: grid;
    min-height: 150px;
    place-content: center;
    justify-items: center;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.insight-context-panel .insight-highlights {
    display: grid;
    gap: 0;
    margin: 0;
}

.insight-context-panel .insight-highlights span {
    position: relative;
    padding: 10px 0 10px 17px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: #496477;
    font-size: 11.5px;
    line-height: 1.4;
}

.insight-context-panel .insight-highlights span:last-child {
    border-bottom: 0;
}

.insight-context-panel .insight-highlights span::before {
    position: absolute;
    top: 16px;
    left: 1px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--blue);
    content: "";
}

.insight-table-panel {
    margin-top: 17px;
}

.insight-table-head {
    align-items: center;
}

.insight-table-actions,
.insight-table-tools,
.insight-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.insight-table-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.insight-export-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.insight-export-actions .button {
    white-space: nowrap;
}

.insight-table-search {
    display: flex;
    width: min(100%, 430px);
    min-height: 39px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.insight-table-search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67, 153, 202, 0.12);
}

.insight-table-search svg {
    width: 15px;
    height: 15px;
    color: var(--muted);
}

.insight-table-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 12px;
}

.insight-table-count {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 10.5px;
}

.insight-table-tools {
    margin-bottom: 12px;
}

.insight-data-table {
    max-height: 610px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.insight-pro-table {
    width: 100%;
    min-width: 820px;
    table-layout: fixed;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 11.5px;
}

.insight-pro-table.is-details {
    min-width: 1020px;
}

.insight-pro-table.is-details th:nth-child(1) {
    width: 100px;
}

.insight-pro-table.is-details th:nth-child(2) {
    width: 155px;
}

.insight-pro-table.is-details th:nth-child(3) {
    width: 190px;
}

.insight-pro-table.is-details th:nth-child(4) {
    width: 145px;
}

.insight-pro-table.is-details th:nth-child(5) {
    width: 110px;
}

.insight-pro-table.is-details th:nth-child(6) {
    width: 190px;
}

.insight-pro-table.is-details th:nth-child(7) {
    width: 80px;
}

.insight-pro-table.is-details th:nth-child(8) {
    width: 100px;
}

.insight-pro-table.is-summary th:nth-child(1) {
    width: 28%;
}

.insight-pro-table.is-summary th:nth-child(2) {
    width: 12%;
}

.insight-pro-table.is-summary th:nth-child(3),
.insight-pro-table.is-summary th:nth-child(4),
.insight-pro-table.is-summary th:nth-child(5),
.insight-pro-table.is-summary th:nth-child(6) {
    width: 11%;
}

.insight-pro-table.is-summary th:nth-child(7) {
    width: 16%;
}

.insight-pro-table.is-sql-result {
    width: max-content;
    min-width: 100%;
    max-width: none;
    table-layout: auto;
}

.insight-pro-table.is-sql-result td {
    max-width: 280px;
}

.insight-pro-table th {
    position: sticky;
    z-index: 1;
    top: 0;
    padding: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    text-align: center;
}

.insight-pro-table th button {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 24px;
    background: transparent;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    text-transform: uppercase;
}

.insight-pro-table th button:hover,
.insight-pro-table th button.is-active {
    color: var(--navy-800);
}

.insight-pro-table th button span {
    position: absolute;
    right: 10px;
    color: #9aabb5;
    font-size: 10px;
}

.insight-pro-table td {
    max-width: 210px;
    padding: 10px 11px;
    overflow: hidden;
    border-bottom: 1px solid #edf2f5;
    color: #385468;
    line-height: 1.35;
    text-align: center;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.insight-pro-table tbody tr:last-child td {
    border-bottom: 0;
}

.insight-pro-table tbody tr:hover td {
    background: #f8fbfc;
}

.insight-pro-table td strong {
    color: var(--navy-900);
    font-weight: 680;
}

.insight-number {
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.insight-billing-tag {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    white-space: nowrap;
}

.insight-billing-tag.is-billable {
    background: var(--sage-soft);
    color: #315f59;
}

.insight-billing-tag.is-internal {
    background: var(--gold-soft);
    color: #74601b;
}

.insight-share {
    display: grid;
    width: min(110px, 100%);
    grid-template-columns: minmax(45px, 1fr) 40px;
    align-items: center;
    gap: 7px;
    margin-inline: auto;
}

.insight-share > i {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: var(--blue);
}

.insight-share b {
    color: var(--navy-800);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

.insight-table-footer {
    margin-top: 12px;
}

.insight-table-footer > span {
    color: var(--muted);
    font-size: 10.5px;
}

.insight-table-footer > div {
    display: flex;
    gap: 7px;
}

.insight-table-footer button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.insight-table-empty strong,
.insight-table-empty span {
    display: block;
}

.insight-table-empty strong {
    margin-bottom: 4px;
    color: var(--navy-900);
    font-size: 14px;
}

@media (max-width: 1080px) {
    .insight-analysis-grid {
        grid-template-columns: 1fr;
    }

    .insight-donut-layout {
        grid-template-columns: minmax(220px, 0.8fr) minmax(230px, 1.2fr);
        gap: 20px;
    }
}

@media (max-width: 760px) {
    .insight-answer-card {
        padding: 20px;
    }

    .insight-answer-head {
        display: block;
    }

    .insight-answer-card h2 {
        font-size: 20px;
    }

    .insight-answer-head .insight-download {
        margin-top: 13px;
    }

    .insight-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insight-kpi:nth-child(3) {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .insight-kpi:nth-child(4) {
        border-top: 1px solid var(--line);
    }

    .insight-kpi {
        padding: 15px;
    }

    .insight-kpi strong {
        font-size: 23px;
    }

    .insight-financial-head {
        flex-direction: column;
        gap: 8px;
    }

    .insight-financial-values {
        grid-template-columns: 1fr;
    }

    .insight-financial-values article + article {
        border-top: 1px solid #dbe8ed;
        border-left: 0;
    }

    .insight-financial-group-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .insight-financial-groups {
        margin-right: -8px;
        margin-left: -8px;
    }

    .insight-financial-group-row {
        min-width: 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 11px;
    }

    .insight-financial-group-row.is-head {
        display: none;
    }

    .insight-financial-group-row > span:first-child {
        grid-column: 1 / -1;
        font-size: 11.5px;
    }

    .insight-financial-group-row > span:not(:first-child),
    .insight-financial-group-row > strong {
        text-align: left;
    }

    .insight-financial-group-row .insight-financial-group-metric small {
        display: block;
        margin-bottom: 1px;
        color: var(--muted);
        font-size: 8.5px;
        font-weight: 500;
    }

    .insight-calculation-grid {
        grid-template-columns: 1fr;
    }

    .insight-panel-head,
    .insight-table-head,
    .insight-table-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .insight-view-switcher,
    .insight-metric-switcher,
    .insight-table-actions,
    .insight-table-switcher {
        width: 100%;
    }

    .insight-view-switcher button,
    .insight-metric-switcher button,
    .insight-table-switcher button {
        flex: 1;
    }

    .insight-chart-controls {
        width: 100%;
        justify-content: stretch;
    }

    .insight-table-actions {
        align-items: stretch;
    }

    .insight-table-actions > .button {
        width: 100%;
    }

    .insight-export-actions {
        flex: 1 1 100%;
    }

    .insight-export-actions .button {
        flex: 1;
    }

    .insight-table-search {
        width: 100%;
    }

    .insight-chart-panel,
    .insight-ranking-panel,
    .insight-context-panel,
    .insight-table-panel {
        padding: 17px 15px;
    }

    .insight-chart-frame {
        min-height: 300px;
        overflow: hidden;
    }

    .insight-chart[data-view="bar"] {
        grid-template-columns: 62px minmax(0, 1fr);
        min-height: 310px;
    }

    .insight-bars-axis,
    .insight-bars-plot {
        height: 280px;
    }

    .insight-donut-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .insight-donut {
        max-width: 265px;
    }

    .insight-chart-summary {
        grid-template-columns: 1fr;
    }

    .insight-chart-summary > div {
        padding: 10px 0;
    }

    .insight-chart-summary > div + div {
        padding-left: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .insight-data-table {
        margin-right: -15px;
        margin-left: -15px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .insight-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 540px) {
    .team-detail-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .team-detail-head .status-tag {
        grid-column: 2;
        justify-self: start;
    }

    .team-detail-modal .modal-summary {
        grid-template-columns: 1fr;
    }
}

/* User editor: role template plus explicit capability overrides. */
.modal-backdrop {
    z-index: 1500;
}

#modal.user-editor-modal {
    width: min(980px, 100%);
}

.user-editor-form {
    display: grid;
    gap: 22px;
}

.user-editor-section + .user-editor-section {
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.user-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.user-section-head h3 {
    margin: 0 0 3px;
    font-size: 16px;
}

.user-section-head p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.team-membership-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.schedule-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid #dbe8ed;
    border-radius: 9px;
    background: var(--surface-soft);
    color: #506b7d;
}

.schedule-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--navy-700);
}

.schedule-note p {
    margin: 0;
    font-size: 10.5px;
    line-height: 1.45;
}

.team-membership-option {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    font-size: 12px;
    font-weight: 600;
}

.team-membership-option:has(input:checked) {
    border-color: #abc6d5;
    background: var(--blue-soft);
    color: var(--navy-800);
}

.team-membership-option:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.56;
}

.team-membership-option input {
    width: 15px;
    height: 15px;
    accent-color: var(--navy-700);
}

.permission-section-head {
    align-items: center;
}

.permission-section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 10.5px;
    white-space: nowrap;
}

.capability-editor {
    display: grid;
    gap: 16px;
}

.capability-group h4 {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.capability-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
}

.capability-row {
    position: relative;
    display: grid;
    min-height: 56px;
    grid-template-columns: minmax(0, 1fr) auto 38px;
    align-items: center;
    gap: 13px;
    padding: 9px 12px;
    border-bottom: 1px solid #edf2f5;
    cursor: pointer;
}

.capability-row:last-child {
    border-bottom: 0;
}

.capability-row:hover {
    background: #f8fbfc;
}

.capability-row.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.capability-copy {
    min-width: 0;
}

.capability-copy strong,
.capability-copy small {
    display: block;
}

.capability-copy strong {
    margin-bottom: 2px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 680;
}

.capability-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.capability-origin {
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 650;
    white-space: nowrap;
}

.capability-row[data-profile="true"] .capability-origin {
    color: var(--navy-700);
}

.capability-row input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.capability-switch {
    position: relative;
    display: block;
    width: 36px;
    height: 21px;
    border: 1px solid #c8d7df;
    border-radius: 999px;
    background: #edf2f5;
    transition: background 160ms ease, border-color 160ms ease;
}

.capability-switch i {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(10, 53, 87, 0.18);
    transition: transform 170ms ease;
}

.capability-row input:checked + .capability-switch {
    border-color: var(--navy-700);
    background: var(--navy-700);
}

.capability-row input:checked + .capability-switch i {
    transform: translateX(15px);
}

.capability-row input:focus-visible + .capability-switch {
    outline: 3px solid rgba(67, 153, 202, 0.22);
    outline-offset: 2px;
}

@media (max-width: 700px) {
    #modal.user-editor-modal {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .team-membership-options {
        grid-template-columns: 1fr;
    }

    .permission-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .capability-row {
        grid-template-columns: minmax(0, 1fr) 36px;
        gap: 9px;
    }

    .capability-origin {
        grid-column: 1;
        grid-row: 2;
    }

    .capability-switch {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .capability-copy small {
        white-space: normal;
    }
}

.pending-close-list {
    max-height: 330px;
    margin: 14px 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.pending-close-row {
    display: grid;
    min-height: 46px;
    grid-template-columns: minmax(0, 1fr) auto 70px;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #edf2f5;
}

.pending-close-row:last-child {
    border-bottom: 0;
}

.pending-close-row > span:first-child {
    min-width: 0;
}

.pending-close-row strong,
.pending-close-row small {
    display: block;
}

.pending-close-row span:first-child strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-close-row small,
.pending-close-row span:nth-child(2) {
    color: var(--muted);
    font-size: 10px;
}

.pending-close-row > strong {
    color: var(--navy-800);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

@media (max-width: 700px) {
    .page-title-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .page-title-actions .button {
        width: 100%;
    }

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

    .pending-close-row > strong {
        grid-column: 2;
    }
}

/* Integrated user manual. */
.help-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.help-header h1 {
    margin-bottom: 7px;
    font-size: 38px;
    font-weight: 650;
    letter-spacing: -0.035em;
}

.help-header p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.help-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0;
}

.help-search {
    display: flex;
    width: min(620px, 100%);
    min-height: 45px;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.help-search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67, 153, 202, 0.12);
}

.help-search svg {
    width: 17px;
    height: 17px;
    color: var(--muted);
}

.help-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
}

.help-toolbar > span {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.manual-shell {
    display: grid;
    grid-template-columns: 225px minmax(0, 850px);
    align-items: start;
    gap: 44px;
}

.manual-index {
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
    padding: 16px 0;
}

.manual-index > p {
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.manual-index nav {
    display: grid;
    gap: 1px;
}

.manual-index a {
    position: relative;
    display: block;
    padding: 7px 10px;
    border-radius: 7px;
    color: #536d7e;
    font-size: 11.5px;
    line-height: 1.35;
}

.manual-index a:hover {
    background: var(--blue-soft);
    color: var(--navy-800);
}

.manual-index a.is-active {
    background: var(--surface);
    color: var(--navy-900);
    font-weight: 700;
}

.manual-content {
    min-width: 0;
    padding-bottom: 70px;
}

.manual-intro {
    padding: 8px 0 28px;
}

.manual-intro h2,
.manual-section h2 {
    color: var(--navy-900);
    font-size: 27px;
    font-weight: 680;
    letter-spacing: -0.03em;
}

.manual-intro > p,
.manual-section > p,
.manual-section > ul,
.manual-section > ol {
    max-width: 72ch;
}

.manual-intro p,
.manual-section p,
.manual-section li {
    color: #3f5969;
    font-size: 14px;
    line-height: 1.65;
}

.manual-section {
    padding: 34px 0;
    border-top: 1px solid var(--line);
    scroll-margin-top: calc(var(--topbar-height) + 18px);
}

.manual-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.manual-section-head > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.manual-section-head > div > span {
    color: var(--blue);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.manual-section-head h2 {
    margin: 0;
}

.manual-section-head small {
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 9.5px;
    white-space: nowrap;
}

.manual-section h3 {
    margin: 25px 0 8px;
    font-size: 17px;
}

.manual-section ul,
.manual-section ol {
    padding-left: 20px;
}

.manual-section li + li {
    margin-top: 5px;
}

.manual-section code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #edf3f6;
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 0.92em;
}

.manual-key-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin-top: 18px;
}

.manual-key-grid > div {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
}

.manual-key-grid kbd {
    min-width: 28px;
    padding: 4px 7px;
    border: 1px solid #d7e2e8;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
    color: var(--navy-800);
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: 10px;
    text-align: center;
}

.manual-key-grid span {
    margin-left: 4px;
}

.manual-table {
    width: 100%;
    margin: 18px 0;
    border-collapse: collapse;
    border: 1px solid var(--line);
    font-size: 12px;
}

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

.manual-table th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 9.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.manual-callout {
    margin: 20px 0;
    padding: 15px 17px;
    border: 1px solid #cfe0e7;
    border-radius: 11px;
    background: #f3f9fa;
}

.manual-callout.is-warning {
    border-color: #ebdfaa;
    background: #fffdf2;
}

.manual-callout strong {
    display: block;
    margin-bottom: 4px;
    color: var(--navy-900);
    font-size: 12.5px;
}

.manual-callout p {
    margin: 0;
    font-size: 12px;
}

.manual-figure {
    margin: 22px 0 26px;
}

.manual-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.manual-figure-widget img {
    width: min(100%, 520px);
}

.manual-figure figcaption {
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
}

.manual-faq {
    border-top: 1px solid var(--line);
}

.manual-faq details {
    border-bottom: 1px solid var(--line);
}

.manual-faq summary {
    padding: 13px 30px 13px 0;
    color: var(--navy-900);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    list-style-position: outside;
}

.manual-faq details p {
    max-width: 68ch;
    margin: -3px 0 15px;
}

.help-no-results {
    display: grid;
    min-height: 300px;
    place-content: center;
    justify-items: center;
    text-align: center;
}

.help-no-results > svg {
    width: 28px;
    height: 28px;
    color: var(--muted);
}

.help-no-results h2 {
    margin: 12px 0 4px;
}

.help-no-results p {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 920px) {
    .manual-shell {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 26px;
    }
}

@media (max-width: 700px) {
    .help-header {
        flex-direction: column;
    }

    .help-header h1 {
        font-size: 32px;
    }

    .help-header .button {
        width: 100%;
    }

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

    .manual-shell {
        display: block;
    }

    .manual-index {
        position: static;
        margin-bottom: 14px;
        padding: 0 0 14px;
        border-bottom: 1px solid var(--line);
    }

    .manual-index nav {
        display: flex;
        gap: 7px;
        padding-bottom: 4px;
        overflow-x: auto;
    }

    .manual-index a {
        flex: 0 0 auto;
        padding: 7px 10px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: var(--surface);
        white-space: nowrap;
    }

    .manual-section-head {
        flex-direction: column;
        gap: 7px;
    }

    .manual-section-head > div {
        align-items: flex-start;
    }

    .manual-section-head h2 {
        font-size: 23px;
    }

    .manual-intro h2 {
        font-size: 25px;
    }

    .manual-table {
        display: block;
        overflow-x: auto;
    }
}

/* PWA presentation modes */
.mode-switch-button,
.quick-mode-full {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid #d7e3e9;
    border-radius: 10px;
    background: #fff;
    color: var(--navy-800);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.mode-switch-button:hover,
.quick-mode-full:hover {
    border-color: #a9c5d5;
    background: #f6fafc;
}

.mode-switch-button:focus-visible,
.quick-mode-full:focus-visible,
.quick-mode-day-status:focus-visible {
    outline: 3px solid rgba(67, 153, 202, 0.28);
    outline-offset: 2px;
}

.mode-switch-button svg,
.quick-mode-full svg {
    width: 17px;
    height: 17px;
}

.quick-mode-header,
.quick-mode-overview,
.quick-mode-extra-fields {
    display: none;
}

.pwa-quick-mode {
    min-height: 100vh;
    background: #edf3f6;
}

.pwa-quick-mode .sidebar,
.pwa-quick-mode .topbar,
.pwa-quick-mode .mobile-nav,
.pwa-quick-mode .page-title-row,
.pwa-quick-mode .metrics-grid,
.pwa-quick-mode .dashboard-grid,
.pwa-quick-mode .view:not([data-view-panel="home"]) {
    display: none !important;
}

.pwa-quick-mode .app-main {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 100% 0, rgba(67, 153, 202, 0.12), transparent 31%),
        #edf3f6;
}

.pwa-quick-mode .content {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 18px 16px 32px;
}

.pwa-quick-mode .quick-mode-header {
    display: flex;
    width: 100%;
    max-width: 640px;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 auto;
    padding: 12px 16px 4px;
}

.quick-mode-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.quick-mode-brand img {
    width: 92px;
    flex: 0 0 auto;
}

.quick-mode-brand span {
    overflow: hidden;
    color: #5c7484;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-mode-full {
    min-height: 40px;
    flex: 0 0 auto;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.76);
    font-size: 14px;
}

.pwa-quick-mode .quick-mode-overview {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.quick-mode-welcome p {
    margin: 0 0 3px;
    color: #627b8b;
    font-size: 16px;
    font-weight: 600;
}

.pwa-quick-mode .view[data-view-panel="home"] .quick-mode-welcome h1 {
    margin: 0;
    color: var(--navy-900);
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 740;
    letter-spacing: -0.035em;
    line-height: 1.14;
}

.quick-mode-day-status {
    display: grid;
    width: 100%;
    min-height: 64px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid var(--state-open-border);
    border-radius: 16px;
    background: var(--state-open-soft);
    color: var(--state-open);
    text-align: left;
}

.quick-mode-day-status > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.quick-mode-day-status strong {
    color: var(--state-open);
    font-size: 18px;
    font-weight: 760;
}

.quick-mode-day-status small {
    margin-top: 1px;
    color: #8b4b50;
    font-size: 15px;
}

.quick-mode-day-status > svg {
    width: 18px;
    height: 18px;
    color: var(--state-open);
}

.quick-mode-day-status.is-warning {
    border-color: #e0b0aa;
    background: #fff3f1;
    color: var(--coral);
}

.quick-mode-day-status.is-warning strong {
    color: #9e3e37;
}

.quick-mode-day-status.is-warning small {
    color: #99645f;
}

.quick-mode-day-status.is-warning .status-orb {
    background: var(--coral);
    animation: quick-mode-warning 1.35s ease-in-out infinite;
}

.quick-mode-day-status.is-closed {
    border-color: var(--state-closed-border);
    background: var(--state-closed-soft);
    color: var(--state-closed);
}

.quick-mode-day-status.is-closed strong {
    color: var(--state-closed);
}

.quick-mode-day-status.is-closed small {
    color: #4f786b;
}

.quick-mode-day-status.is-closed .status-orb {
    background: var(--state-closed);
    box-shadow: 0 0 0 4px rgba(17, 111, 84, 0.12);
}

.quick-mode-day-status.is-closed > svg {
    visibility: hidden;
}

.quick-mode-day-status.is-non-working {
    border-color: #dce5e9;
    background: #f4f7f8;
    color: #607986;
}

.quick-mode-day-status.is-non-working strong,
.quick-mode-day-status.is-non-working small,
.quick-mode-day-status.is-non-working > svg {
    color: #607986;
}

.quick-mode-day-status.is-non-working .status-orb {
    background: #607986;
    box-shadow: 0 0 0 4px rgba(96, 121, 134, 0.12);
}

.quick-mode-day-status:disabled {
    cursor: default;
}

@keyframes quick-mode-warning {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(183, 74, 67, 0.12);
        opacity: 1;
    }

    50% {
        box-shadow: 0 0 0 7px rgba(183, 74, 67, 0.04);
        opacity: 0.55;
    }
}

.quick-mode-summary {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: 17px;
    background: var(--navy-900);
    color: #fff;
}

.quick-mode-summary > div,
.quick-mode-summary > button {
    display: flex;
    flex-direction: column;
}

.quick-mode-summary > * + * {
    min-width: 104px;
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.quick-mode-summary span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 650;
}

.quick-mode-summary strong {
    margin: 2px 0;
    font-size: 34px;
    font-variant-numeric: tabular-nums;
    font-weight: 740;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.quick-mode-summary small {
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
}

.quick-mode-proposals strong {
    font-size: 28px;
}

.quick-mode-proposals {
    align-items: flex-start;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-align: left;
}

.quick-mode-proposals small {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.quick-mode-proposals small svg {
    width: 13px;
    height: 13px;
    transition: transform 160ms ease;
}

.quick-mode-proposals:hover small,
.quick-mode-proposals:focus-visible small {
    color: #fff;
}

.quick-mode-proposals:hover small svg {
    transform: translateX(2px);
}

.quick-mode-proposals:focus-visible {
    border-radius: 7px;
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
}

.pwa-quick-mode .view[data-view-panel="home"] > .quick-entry-card {
    margin: 0;
    padding: 18px;
    border: 1px solid rgba(211, 224, 232, 0.92);
    border-radius: 21px;
    box-shadow: 0 12px 30px rgba(10, 53, 87, 0.09);
}

.pwa-quick-mode .quick-entry-card::before {
    height: 3px;
    background: var(--blue);
    opacity: 1;
}

.pwa-quick-mode .quick-heading {
    margin-bottom: 16px;
}

.pwa-quick-mode .quick-heading .heading-icon {
    width: 36px;
    height: 36px;
}

.pwa-quick-mode .quick-heading h2 {
    font-family: var(--font-heading);
    font-size: 22px;
}

.pwa-quick-mode .quick-heading p {
    margin-top: 2px;
    font-size: 16px;
}

.pwa-quick-mode .quick-heading .text-button,
.pwa-quick-mode .more-options,
.pwa-quick-mode .timer-panel,
.pwa-quick-mode .advanced-fields,
.pwa-quick-mode .quick-recents {
    display: none !important;
}

.pwa-quick-mode .quick-entry-form {
    grid-template-columns: 1fr;
    gap: 13px;
}

.pwa-quick-mode .quick-entry-form .autocomplete-field,
.pwa-quick-mode .quick-entry-form .task-field,
.pwa-quick-mode .quick-entry-form .project-field,
.pwa-quick-mode .quick-entry-form .hours-field,
.pwa-quick-mode .quick-entry-form .save-entry,
.pwa-quick-mode .entry-day-lock,
.pwa-quick-mode .quick-mode-extra-fields {
    grid-column: 1;
}

.pwa-quick-mode .entry-day-lock {
    align-items: center;
}

.pwa-quick-mode .quick-mode-extra-fields {
    display: grid;
    gap: 13px;
}

.pwa-quick-mode .form-field {
    gap: 7px;
}

.pwa-quick-mode .form-field label {
    font-size: 16.5px;
    font-weight: 720;
}

.pwa-quick-mode .control-shell {
    min-height: 51px;
    border-radius: 12px;
}

.pwa-quick-mode .control-shell input,
.pwa-quick-mode .control-shell select,
.pwa-quick-mode .form-field > input,
.pwa-quick-mode .form-field > select {
    min-height: 49px;
    font-size: 17px;
}

.pwa-quick-mode .field-hint {
    color: #607887;
    font-size: 14px;
}

.pwa-quick-mode .quick-mode-extra-fields .check-row {
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f6f9fa;
    font-size: 16px;
}

.pwa-quick-mode .quick-mode-extra-fields .check-row input {
    width: 19px;
    height: 19px;
}

.pwa-quick-mode .save-entry {
    min-height: 52px;
    margin-top: 1px;
    border-radius: 12px;
    font-size: 17px;
}

@media (max-width: 700px) {
    .mode-switch-button {
        width: 36px;
        min-height: 36px;
        padding: 0;
    }

    .mode-switch-button span {
        display: none;
    }

    .pwa-quick-mode .content {
        padding: 8px 12px max(24px, env(safe-area-inset-bottom));
    }

    .pwa-quick-mode .quick-mode-header {
        padding: 10px 12px 2px;
    }

    .quick-mode-brand span {
        display: none;
    }

    .quick-mode-brand img {
        width: 96px;
    }

    .quick-mode-full {
        padding: 0 11px;
    }

    .pwa-quick-mode .view[data-view-panel="home"] .quick-mode-welcome h1 {
        font-size: 33px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quick-mode-day-status.is-warning .status-orb {
        animation: none;
    }
}

/* Task presentation is consolidated in design-system.css (NEXO A V3). */

.notification-alert-region {
    position: sticky;
    z-index: 35;
    top: 12px;
    display: flex;
    max-height: min(58vh, 520px);
    flex-direction: column;
    gap: 9px;
    margin-bottom: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.persistent-alert {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 15px 17px;
    border-radius: 14px;
    background: #a62f2b;
    box-shadow: 0 12px 32px rgba(5, 38, 63, 0.2);
    color: #fff;
    animation: notification-alert-attention 1.35s ease-in-out infinite;
}

.persistent-alert.tone-critical {
    background: #a62f2b;
    box-shadow: 0 14px 38px rgba(126, 31, 28, 0.3);
}

.persistent-alert.tone-success {
    background: #a62f2b;
}

.persistent-alert.tone-closure {
    background: #a62f2b;
}

.persistent-alert.tone-task {
    background: #a62f2b;
}

.persistent-alert-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.persistent-alert-icon svg {
    width: 21px;
    height: 21px;
}

.persistent-alert-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.persistent-alert-type {
    color: rgba(255, 255, 255, 0.74);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.persistent-alert-kicker {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px 12px;
}

.notification-carousel-controls {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.notification-carousel-controls button {
    display: inline-grid;
    width: 25px;
    height: 25px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.notification-carousel-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-carousel-controls button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.notification-carousel-controls svg {
    display: none;
}

.notification-carousel-controls button::before {
    width: 5px;
    height: 5px;
    border-bottom: 1.8px solid currentColor;
    border-left: 1.8px solid currentColor;
    content: "";
}

.notification-carousel-controls [data-notification-carousel-prev]::before {
    transform: rotate(45deg);
}

.notification-carousel-controls [data-notification-carousel-next]::before {
    transform: rotate(225deg);
}

.notification-carousel-controls > span {
    min-width: 47px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.notification-carousel:hover .persistent-alert,
.notification-carousel:focus-within .persistent-alert {
    animation-play-state: paused;
}

@keyframes notification-alert-attention {
    0%,
    100% {
        outline: 0 solid rgba(255, 255, 255, 0);
        filter: brightness(1);
    }

    45% {
        outline: 4px solid rgba(255, 255, 255, 0.78);
        filter: brightness(1.2);
        box-shadow: 0 12px 32px rgba(166, 47, 43, 0.42);
    }
}

.persistent-alert-copy strong {
    margin: 2px 0;
    color: #fff;
    font-size: 13.5px;
    line-height: 1.45;
}

.persistent-alert-copy small {
    color: rgba(255, 255, 255, 0.73);
    font-size: 10px;
}

.persistent-alert-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.persistent-alert-actions .button {
    border-color: rgba(255, 255, 255, 0.34);
    background: #fff;
    color: var(--navy-900);
}

.persistent-alert-actions .text-button {
    height: auto;
    padding: 7px 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.notification-item.is-unread {
    background: #f4f9fc;
}

.notification-item > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.notification-item strong {
    margin-bottom: 2px;
    color: var(--navy-900);
    font-size: 11.5px;
}

.notification-item p {
    color: #435f71;
    font-size: 11.5px;
}

.notification-item span {
    font-size: 10px;
}

/* The transparent widget owns exactly one rounded, scrollable card. */
html:has(body.widget-mode) {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    background: transparent !important;
}

body.widget-mode {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 18px !important;
    overflow: hidden !important;
    background: transparent !important;
}

.widget-mode .app-shell,
.widget-mode .app-main,
.widget-mode .content,
.widget-mode .view[data-view-panel="home"] {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: visible;
    background: transparent !important;
}

.widget-mode #persistent-alerts {
    display: none !important;
}

.widget-mode .quick-entry-card {
    position: relative;
    width: 100%;
    height: calc(100vh - 36px);
    min-height: 0;
    max-height: calc(100vh - 36px);
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto !important;
    border: 0;
    border-radius: 26px;
    background: #fff !important;
    box-shadow:
        0 16px 38px rgba(2, 24, 40, 0.28),
        0 3px 9px rgba(2, 24, 40, 0.18);
    scrollbar-width: none;
}

.widget-mode .quick-entry-card::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.widget-mode .quick-entry-card::before {
    height: 5px;
    border-radius: 26px 26px 0 0;
    background: linear-gradient(90deg, var(--blue) 0 56%, var(--gold) 56% 76%, var(--sage) 76%);
}

.widget-mode .quick-entry-card::after {
    display: none;
}

.widget-mode .widget-notification-alert-region {
    position: sticky;
    top: -1px;
    z-index: 8;
    max-height: 42vh;
    margin: 0 0 10px;
}

.widget-mode .persistent-alert {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    padding: 11px;
    border-radius: 12px;
}

.widget-mode .persistent-alert-icon {
    width: 34px;
    height: 34px;
}

.widget-mode .persistent-alert-copy strong {
    font-size: 12px;
}

.widget-mode .persistent-alert-copy small {
    display: none;
}

.widget-mode .persistent-alert-kicker {
    gap: 5px 8px;
}

.widget-mode .notification-carousel-controls {
    gap: 3px;
}

.widget-mode .notification-carousel-controls button {
    width: 23px;
    height: 23px;
}

.widget-mode .notification-carousel-controls > span {
    min-width: 38px;
    font-size: 9px;
}

.widget-mode .persistent-alert-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.widget-mode .persistent-alert-actions .button {
    min-height: 31px;
    padding: 0 10px;
    font-size: 10.5px;
}

.widget-mode .entry-day-lock {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
}

.widget-mode .entry-day-lock-icon,
.widget-mode #entry-day-lock-copy {
    display: none;
}

.widget-mode .entry-day-lock strong {
    font-size: 13.5px;
    line-height: 1.25;
}

.widget-mode .entry-day-lock .button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 11px;
    white-space: nowrap;
}

.widget-mode .quick-entry-card.widget-collapsed {
    width: 100%;
    height: auto;
    max-height: none;
}

.widget-mode .assigned-task-item.priority-alta,
.widget-mode .assigned-task-item.priority-critica {
    border-color: #d2e4e7;
    background: #eff7f7;
}

@media (max-width: 700px) {
    .notification-alert-region {
        top: 6px;
        max-height: 65vh;
    }

    .persistent-alert {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 13px;
    }

    .persistent-alert-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    .persistent-alert {
        animation: none;
    }

    .notification-count {
        animation: none;
    }
}

/* Legacy task workspace removed; canonical V3 rules live in design-system.css. */

@media print {
    .sidebar,
    .topbar,
    .mobile-nav,
    .help-toolbar,
    .help-header .button,
    .manual-index,
    .toast-region,
    .notification-popover,
    .profile-popover {
        display: none !important;
    }

    .app-main {
        margin: 0;
    }

    .content {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .view:not([data-view-panel="help"]) {
        display: none !important;
    }

    .manual-shell {
        display: block;
    }

    .manual-section {
        break-inside: avoid-page;
    }

    .manual-figure {
        break-inside: avoid;
    }
}
