/* Import Satoshi font - using CDN or local files */
@import url('satoshi.css');

/* CSS Variables from old version */
:root {
    --primary: #00003b;
    --secondary: #a8c3f5;
    --success: #c5e4e3;
    --info: #4e69ea;
    --warning: #ff9699;
    --danger: #CA3337;
    --light: #e8eefc;
    --mid: #dcdefe;
    --dark: #00003b;
    --blue: #4e69ea;
    --lightBlue: #a8c3f5;
    --Status-Red: #CA3337; 
    --Status-Green: #1FB74C;
    --white: #ffffff;

    /* Shared semantic tokens */
    --text-primary: var(--dark);
    --text-secondary: var(--blue);
    --surface: var(--white);
    --surface-muted: var(--mid);
    --border-soft: var(--mid);
    --state-overdue-bg: #ffeaeb;
    --state-overdue-text: var(--danger);
    --state-near-bg: #fff3e4;
    --state-near-text: #b15d00;
    --state-ok-bg: var(--success);
    --state-ok-text: var(--dark);
}

html, body {
    font-family: Satoshi-Regular, "Work Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
    width: 100%;
    background-color: var(--light);
    color: var(--dark);
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    overflow-y: auto;
    font-size: 0.875rem;
}

a {
    color: var(--blue);
}

/* Keep Mud palette variables aligned with app-level tokens in CSS contexts */
:root {
    --mud-palette-primary: var(--primary);
    --mud-palette-secondary: var(--secondary);
    --mud-palette-info: var(--info);
    --mud-palette-success: var(--Status-Green);
    --mud-palette-warning: var(--warning);
    --mud-palette-error: var(--danger);
    --mud-palette-dark: var(--dark);
    --mud-palette-surface: var(--surface);
    --mud-palette-background: var(--light);
    --mud-palette-background-grey: var(--mid);
    --mud-palette-text-primary: var(--text-primary);
    --mud-palette-text-secondary: var(--text-secondary);
    --mud-palette-divider: var(--border-soft);
    --mud-typography-default-family: Satoshi, Satoshi-Regular, "Work Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rz-text-font-family: Satoshi-Regular, "Work Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Sidomenyn: länkar ska alltid vara vita, aldrig blå/understrukna */
.sidebar a,
.sidebar a:hover,
.sidebar a:focus,
.sidebar a:visited,
.sidebar a.active {
    color: #FFF !important;
    text-decoration: none !important;
}

/* Sidomenyn hover/aktiv – i global CSS så att :hover inte bryts av Blazor scoped CSS */
.sidebar .sidenav a.nav-row:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}
.sidebar .sidenav a.nav-row.active {
    background-color: rgba(255, 255, 255, 0.28) !important;
}

/* Preloader visas direkt vid klick via JS (body-klass) innan Blazor hinner rendera */
body.nav-loading-active .nav-loading-overlay {
    display: flex !important;
}

/* Global snabb feedback vid knapptryckning innan route/data hinner reagera */
body.alido-click-feedback {
    cursor: progress;
}

/* Button/form styles removed - using MudBlazor components */

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.h1, h1 {
    font-family: Satoshi-Bold, 'Satoshi', sans-serif;
    font-size: 2.0rem;
}

.h2, h2 {
    font-size: 1.5rem;
}

.h3, h3 {
    margin: 70px 0 25px 0;
    font-family: Satoshi-Black, 'Satoshi', sans-serif;
    font-size: 1.3rem;
}

.h4, h4 {
    font-size: 0.9rem;
}

.h5, h5 {
    font-size: 1.1rem;
}

.h6, h6 {
    font-size: 1rem;
    font-family: Satoshi-Bold, 'Satoshi', sans-serif;
}

/* Shared page header primitives */
.section-title,
.ux-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    color: var(--text-primary);
}

.section-subtitle,
.ux-section-subtitle {
    margin: 0;
    color: var(--text-secondary);
}

.ux-helper-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.ux-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--surface-muted);
    color: var(--text-primary);
}

/* Input styles removed - using MudBlazor components */

.bg-info {
    background-color: var(--blue) !important;
}

.bg-blue {
    background-color: var(--blue) !important;
}

.bg-lightBlue {
    background-color: var(--lightBlue) !important;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--Status-Green);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}


/* Table styling */
.table-hover tbody tr:hover {
    background-color: rgba(220, 222, 254, 0.4);
}

/* Card styling */
.card-block {
    background-color: var(--white);
    border-radius: 3px;
    box-shadow: 1px 1px 10px rgba(220, 222, 254, 0.3);
}

/* Badge colors */
.badge.bg-info {
    background-color: var(--blue) !important;
}

.badge.bg-success {
    background-color: var(--Status-Green) !important;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
}

/* Login page (from old project) */
.login-main {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background-color: var(--light);
}

.login-logo {
    position: absolute;
    top: 0;
    left: 10px;
    z-index: 2000;
}

.login-logo img {
    margin-top: 15px;
    height: 27px;
    padding-left: 40px;
    margin-bottom: 40px;
}

.login-background-pattern {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #F7F8FD;
    top: 0;
    left: 0;
}

.pattern-cls-1 {
    fill: rgba(168, 195, 245, 0.5);
}

.pattern-cls-2 {
    fill: rgba(220, 222, 254, 0.75);
}

.login-background-pattern #pattern-1 {
    width: 77%;
    float: right;
    position: relative;
    top: 0;
}

.login-background-pattern #pattern-2 {
    width: 77%;
    position: absolute;
    bottom: 0;
    left: 0;
}

div.card-block-padding.login-container {
    position: relative;
    width: 30%;
    min-width: 350px;
    height: auto;
    min-height: 430px;
    padding: 25px;
    padding-bottom: 25px !important;
    display: block;
    top: 50%;
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    margin: auto;
    background-color: var(--white);
    border-radius: 3px;
    box-shadow: 1px 1px 10px rgba(220, 222, 254, 0.3);
}

.login-container h1 {
    padding: 20px 0 10px 0;
    text-align: center;
}

.login-container h4 {
    text-align: center;
    margin-bottom: 50px;
    font-weight: 400;
}

.login-container input {
    border: none;
    border-bottom: solid 2px var(--light);
    box-shadow: none;
}

.login-container button {
    color: white;
    font-size: 0.7rem;
    height: 35px;
    margin: 0;
    width: 100%;
    display: block;
    text-align: center;
    line-height: 35px;
    padding: 0 12px;
    border-radius: 2px;
    border: none;
    border-bottom: solid 2px var(--light);
    box-shadow: none;
    background-color: var(--blue);
}

.login-container form {
    display: block;
    width: 100%;
}

.login-container .form-control {
    display: block;
    width: 100%;
    height: 25px;
    margin-bottom: 3px;
    border-radius: 3px;
    font-size: 0.8rem;
    background-color: transparent;
}

.login-container .form-group {
    height: 40px;
    margin-bottom: 1rem;
    position: relative;
}

.login-container .form-group p {
    margin: 0;
}

.login-container .login-form-group--auto {
    height: auto;
}

.login-container .login-back-row {
    margin-top: -16px;
    margin-bottom: 14px;
}

.login-container .login-onetap-row {
    margin-top: -4px;
    margin-bottom: 8px;
}

.login-container .login-onetap-hint {
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.68);
    margin-bottom: 2px;
}

.login-container .login-or-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -2px;
    margin-bottom: 4px;
}

.login-container .login-or-divider span {
    font-size: 0.74rem;
    color: rgba(0, 0, 0, 0.52);
    text-transform: lowercase;
}

.login-container .login-onetap-subhint {
    font-size: 0.72rem;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
}

.login-container .google-signin-inline-slot {
    min-height: 42px;
    display: flex;
    justify-content: center;
}

.login-container .login-google-account-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background-color: #fff;
    margin-bottom: 10px;
}

.login-container .login-google-account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.login-container .login-google-account-content {
    min-width: 0;
}

.login-container .login-google-account-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1f1f1f;
    line-height: 1.2;
}

.login-container .login-google-account-email {
    font-size: 0.72rem;
    color: rgba(0, 0, 0, 0.62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.login-container .login-back-link {
    background: none;
    color: var(--blue);
    border: none;
    box-shadow: none;
    width: auto;
    height: auto;
    line-height: normal;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.login-container .login-back-link:hover:not(:disabled) {
    text-decoration: underline;
}

.login-container .google-signin-btn {
    background-color: #fff;
    color: #1f1f1f;
    border: 1px solid #d8d8d8;
    border-bottom: 1px solid #d8d8d8;
    font-size: 0.9rem;
    font-weight: 500;
    height: 42px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

.login-container .google-signin-btn:hover:not(:disabled) {
    background-color: #f8f9fa;
}

.login-container .google-signin-btn:disabled {
    opacity: 0.75;
}

.login-container .google-signin-btn__icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: inherit;
}

.login-container .form-group label {
    position: absolute;
    font-size: 1rem;
    padding-bottom: 20px;
    padding-top: 3px;
    padding-left: 5px;
}

.login-container .form-group .checkbox label {
    position: relative;
    font-size: 0.7rem;
}

.login-container .form-group .checkbox input {
    height: 10px;
    width: 10px;
}

.login-container .form-group input {
    width: 100%;
    padding-left: 35px;
}

.login-container .form-group input:focus {
    border: 0;
    border-bottom: solid 2px var(--light);
    box-shadow: none;
    outline: none;
}

.login-container .form-group:focus-within label {
    color: var(--blue);
}

.login-container .form-group input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.login-container input[type=checkbox] {
    position: relative;
    cursor: pointer;
}

.login-container input[type=checkbox]:before {
    content: "";
    display: block;
    position: absolute;
    width: 11px;
    height: 11px;
    top: 0;
    left: 0;
    border: 2px solid var(--primary);
    border-radius: 3px;
    background-color: var(--white);
}

.login-container input[type=checkbox]:checked:before {
    border: 2px solid var(--secondary);
    border-radius: 3px;
    background-color: var(--secondary);
}

.login-container input[type=checkbox]:checked:after {
    content: "";
    display: block;
    width: 5px;
    height: 8px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    position: absolute;
    top: 1px;
    left: 3px;
}

.login-container .checkbox {
    margin-top: 20px;
    padding-left: 6px;
}

.login-container label.alido-checkbox {
    display: inline;
    margin-top: -6px;
    margin-left: 5px;
    position: relative;
}

.login-container #forgot-password {
    font-size: 0.85rem;
}

.login-error-message {
    margin-bottom: 14px;
    padding: 8px 10px;
    border-radius: 3px;
    border: 1px solid rgba(202, 51, 55, 0.35);
    background-color: rgba(202, 51, 55, 0.12);
    color: #7d1f22;
    font-size: 0.8rem;
    line-height: 1.3;
}

.login-status-bar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 6px 14px;
    border-radius: 3px;
    background-color: rgba(0, 0, 59, 0.06);
    color: rgba(0, 0, 59, 0.6);
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: center;
    max-width: calc(100% - 32px);
}

/* Bäst-i-kolumn-markering i statistiktabeller */
.bg_highlight td, td.bg_highlight {
    background-color: rgba(197, 228, 227, 0.55) !important;
    font-weight: 600;
}

/* Totalrad i statistiktabeller – tydligare avskiljning mot datarader */
.mud-table tfoot .mud-table-cell {
    border-top: 3px solid var(--text-primary) !important;
}

.stats-clickable {
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 0.18em;
}

/* Projektets arbetsordertabell: hela Totalvärde-cellen öppnar fakturering, inte arbetsordern. */
.wo-billing-cell.mud-table-cell {
    padding: 0 !important;
    cursor: pointer;
}

@media (min-width: 600px) {
    .wo-billing-cell.mud-table-cell {
        height: 1px;
    }
}

.wo-billing-cell-hit {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 6px 16px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    text-align: right;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 0.18em;
}

.wo-billing-cell-hit:hover,
.wo-billing-cell-hit:focus-visible {
    background-color: rgba(0, 0, 59, 0.05);
    outline: none;
}

a.renewal-project-link,
a.mud-link.renewal-project-link,
.renewal-project-link {
    cursor: pointer;
    text-decoration: underline dotted !important;
    text-underline-offset: 0.18em;
}

td.renewal-info-cell {
    background-color: rgba(197, 228, 227, 0.55) !important;
}

td.renewal-info-cell.renewal-info-just-updated {
    background-color: rgba(31, 183, 76, 0.22) !important;
    font-weight: 600;
}

/* TB-oversikt: compact table rows */
.tb-overview-table .mud-table-cell {
    padding: 10px;
}

.tb-overview-table .tb-dev-positive {
    color: #1b5e20;
    background-color: rgba(76, 175, 80, 0.14);
    font-weight: 600;
}

.tb-overview-table .tb-dev-negative {
    color: #b71c1c;
    background-color: rgba(244, 67, 54, 0.14);
    font-weight: 600;
}

/* MudBlazor: ta bort max-width-begränsningen på Large containers */
@media (min-width: 1280px) {
    .mud-container-maxwidth-lg {
        max-width: 100% !important;
    }
}

/* S-M-L-Y / R12: fem nivåer – higher, higher-minor, same, lower-minor, lower */
.r12-higher {
    font-weight: 600;
    background-color: var(--success);
    color: var(--dark);
}
.r12-higher-minor {
    background-color: rgba(197, 228, 227, 0.5);
    color: var(--dark);
}
.r12-same {
    background-color: var(--mid);
    color: var(--dark);
}
.r12-lower-minor {
    background-color: rgba(255, 150, 153, 0.4);
    color: var(--dark);
}
.r12-lower {
    background-color: var(--danger);
    color: #FFF;
}

/* Kundkort: projekt-tidslinje (global så att MudPaper får stylingen) */
.project-section-container {
    min-width: 0;
    width: 100%;
}
.project-timeline-scroll-host {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
}
.project-timeline-scroll-host:active {
    cursor: grabbing;
}
.project-timeline-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0;
    align-items: stretch;
    justify-content: flex-end;
    flex: 0 0 auto;
    width: max-content;
    min-width: 100%;
    position: relative;
}
.project-timeline-card {
    flex: 1 1 16rem !important;
    min-width: 16rem !important;
    max-width: none !important;
    width: auto !important;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 59, 0.12);
    border-radius: 0;
    background-color: var(--project-status-color, var(--success)) !important;
    color: var(--project-card-text, var(--dark));
    box-shadow: none !important;
    transition: box-shadow 0.15s ease-in-out;
    position: relative;
    z-index: 1;
    cursor: pointer;
    overflow: hidden;
}
.project-timeline-card:first-child {
    border-radius: 5px 0 0 5px;
}
.project-timeline-card:last-child {
    border-radius: 0 5px 5px 0;
}
.project-timeline-card + .project-timeline-card {
    border-left: none;
}
.project-timeline-card:only-child {
    border-radius: 5px;
}
.project-timeline-card.is-closed {
    background-color: #eee !important;
    color: #bbb;
    --project-card-text: #888;
}
.project-timeline-card.is-closed .mud-typography:not(.project-timeline-title-link) {
    color: #888 !important;
}
.project-timeline-card.is-closed .project-timeline-title-link {
    color: #9aa0a6 !important;
}
.project-timeline-card.is-closed .project-timeline-title-link:hover {
    color: #6b7280 !important;
}
.project-timeline-card.is-closed .person-chip-root,
.project-timeline-card.is-closed .project-timeline-lead-chip {
    opacity: 0.45;
    filter: grayscale(0.4);
}
.project-timeline-card.is-closed .project-growth {
    opacity: 0.45;
}
.project-timeline-card.is-closed .mud-button .mud-button-label,
.project-timeline-card.is-closed .mud-button .mud-typography {
    color: unset !important;
}
.project-timeline-card-body {
    width: 100%;
    padding: 0.75rem 0.75rem 0.5rem;
    text-align: center;
    color: inherit;
}
.project-timeline-card-body + .project-timeline-bar + .project-timeline-card-body {
    padding-top: 0.35rem;
    padding-bottom: 0.75rem;
}
.project-timeline-bar {
    width: 100%;
    height: 3px;
    background: var(--blue);
    margin: 0;
}
.project-timeline-card .mud-typography:not(.project-timeline-title-link) {
    color: inherit !important;
}
.project-timeline-card .mud-button .mud-button-label,
.project-timeline-card .mud-button .mud-typography {
    color: unset !important;
}
.project-timeline-title-link {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.35;
    height: 1.35em;
    font-size: 0.78rem;
    color: var(--blue) !important;
    text-decoration: none;
    font-family: Satoshi-Bold, Satoshi-Regular, "Work Sans", sans-serif;
    font-weight: 700;
    cursor: pointer;
}
.project-timeline-title-link:hover {
    color: var(--primary) !important;
    text-decoration: underline;
    text-decoration-color: var(--secondary);
}
.project-timeline-status {
    font-size: 0.8rem;
    line-height: 1.3;
    min-height: 1.3em;
}
.project-timeline-dates {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    font-size: 0.75rem;
    line-height: 1.3;
}
.project-timeline-card .mud-button {
    align-self: center;
}
.project-timeline-lead {
    display: flex;
    justify-content: center;
    width: 100%;
}
.project-timeline-lead-chip {
    max-width: 100%;
}
.project-timeline-amount {
    font-weight: 700;
}
.project-timeline-bar-fill {
    height: 100%;
    background: var(--lightBlue);
    max-width: 100%;
}
.project-timeline-bar-fill.has-today {
    border-right: 5px solid var(--warning);
    box-sizing: content-box;
}
.project-growth {
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 1.3;
}
.project-growth.is-positive {
    color: #00BB00;
}
.project-growth.is-negative {
    color: #BB0000;
}
.project-growth.is-neutral {
    color: #888800;
}
.project-growth.is-empty {
    color: #999;
    font-weight: 600;
}

/* Kundkort: två kolumner — vänster fyller, höger auto-höjd i linje med header */
.customer-card-left-col,
.customer-card-teamview-col {
    min-width: 0;
}

.customer-main-grid {
    width: 100%;
    min-width: 0;
}

.customer-main-grid > .mud-grid-item {
    min-width: 0;
}

@media (min-width: 960px) {
    .customer-main-grid.mud-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 9fr) minmax(24rem, 3.3fr);
        gap: 1rem;
        align-items: start;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .customer-main-grid > .mud-grid-item {
        padding: 0 !important;
        max-width: none !important;
        flex-basis: auto !important;
        flex-grow: 0 !important;
        width: auto !important;
    }

    .customer-card-teamview-col {
        display: block;
        align-items: start;
    }
}

.customer-card-teamview-col .teamview-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    flex: none;
    height: auto;
    align-self: auto;
}

.customer-card-left-col .mud-expansion-panel-content,
.customer-card-left-col .mud-collapse-container,
.customer-card-left-col .mud-collapse-wrapper,
.customer-card-left-col .customer-info-grid,
.customer-card-left-col .customer-info-grid > .mud-grid-item,
.customer-card-left-col .customer-info-grid .mud-input-control {
    min-width: 0;
    max-width: 100%;
}

.customer-left-panels {
    width: 100%;
    min-width: 0;
}

/* Alido in-app notification toast (shown when app is focused) */
.alido-notification-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}

.alido-notification-toast {
    display: grid;
    grid-template-columns: 2.1rem 1fr auto;
    align-items: center;
    gap: 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(78, 105, 234, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 238, 252, 0.97));
    box-shadow: 0 12px 28px rgba(0, 0, 59, 0.18);
    color: var(--dark);
    padding: 0.72rem 0.75rem 0.72rem 0.68rem;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.alido-notification-toast.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
}

.alido-notification-toast__icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 9px;
    background: var(--white);
    border: 1px solid rgba(78, 105, 234, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
}

.alido-notification-toast__icon img {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.alido-notification-toast__content {
    min-width: 0;
}

.alido-notification-toast__title {
    font-family: Satoshi-Bold, 'Satoshi', sans-serif;
    font-weight: 700;
    font-size: 0.87rem;
    line-height: 1.2;
    margin: 0 0 0.15rem;
}

.alido-notification-toast__body {
    font-size: 0.82rem;
    line-height: 1.3;
    color: rgba(0, 0, 59, 0.86);
    word-break: break-word;
}

.alido-notification-toast__close {
    border: 0;
    background: transparent;
    color: rgba(0, 0, 59, 0.55);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.alido-notification-toast__close:hover {
    background: rgba(78, 105, 234, 0.12);
    color: rgba(0, 0, 59, 0.82);
}

/* Project detail header */
.project-header-card .mud-stack.project-header-row {
    flex-wrap: wrap;
    row-gap: 1rem;
}

.project-header-name {
    flex: 1 1 280px;
    min-width: 280px;
    max-width: 520px;
}

.project-header-name-field .mud-input-slot,
.project-header-name-field input.mud-input-slot,
.project-header-name-field .mud-input > input {
    font-size: 1.2rem !important;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.project-header-status {
    min-width: 9.5rem;
    padding-top: 0.15rem;
}

.project-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--chip-color, #6f7a94);
    background: rgba(111, 122, 148, 0.18);
    color: #2f3a56;
    appearance: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.4rem 0.7rem 0.4rem 0.55rem;
    cursor: pointer;
    white-space: nowrap;
}

.project-status-chip:hover:not(:disabled) {
    filter: brightness(0.97);
    box-shadow: 0 1px 6px rgba(0, 0, 59, 0.08);
}

.project-status-chip:disabled {
    cursor: default;
    opacity: 0.7;
}

.project-status-chip-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--chip-color, #6f7a94);
    flex-shrink: 0;
}

.project-status-chip-menu {
    cursor: default;
    padding: 0.28rem 0.6rem;
}

.project-status-chip-menu.is-selected {
    box-shadow: inset 0 0 0 1px currentColor;
}

.project-status-menu .mud-list-item {
    min-height: 2.25rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

.project-header-dates {
    min-width: 25.5rem;
    flex: 0 0 auto;
}

.project-header-dates .mud-stack-row {
    min-width: 100%;
}

.project-header-dates .mud-input-control,
.project-header-dates .mud-picker {
    min-width: 12rem;
    flex: 1 1 12rem;
}

.project-header-progress {
    margin-top: 0.15rem;
    width: 100%;
}

.project-header-lead {
    min-width: 0;
    max-width: 12rem;
    padding-top: 0.15rem;
}

.project-lead-card {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 12rem;
    height: 24px;
    padding: 0 4px 0 1px;
    border: 0;
    border-radius: 12px;
    background: #E5E7EB;
    color: #111111;
    appearance: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.project-lead-card:hover:not(:disabled) {
    filter: brightness(0.97);
}

.project-lead-card:disabled {
    cursor: default;
    opacity: 0.85;
}

.project-lead-card-name {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.project-lead-card-chevron {
    color: currentColor;
    opacity: 0.75;
    flex-shrink: 0;
    margin-left: auto;
}

.project-lead-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    padding: 2px 6px 2px 1px;
    border-radius: 12px;
    background: #E5E7EB;
}

.project-lead-popover .mud-list {
    max-height: 320px;
    overflow-y: auto;
}

.project-lead-popover .mud-menu-item,
.project-lead-popover .mud-list-item {
    min-height: 28px;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

.project-header-lead-hint {
    max-width: 12rem;
    line-height: 1.3;
}

.project-header-actions {
    margin-left: auto;
    padding-top: 0.35rem;
}