:root {
    color-scheme: dark;
    --bg: #07101a;
    --bg-soft: #0d1724;
    --panel: rgba(11, 19, 33, 0.9);
    --panel-border: rgba(121, 168, 181, 0.18);
    --text: #e6edf6;
    --text-muted: #98a8be;
    --accent: #7ef2ff;
    --accent-soft: #79a8b5;
    --warm: #ff9c66;
    --success: #5fd5a6;
    --danger: #ff7b7b;
    --display: 'Sora', sans-serif;
    --body: 'Plus Jakarta Sans', sans-serif;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #eef4fb;
    --bg-soft: #ffffff;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-border: rgba(72, 97, 122, 0.14);
    --text: #162334;
    --text-muted: #5a6a7c;
    --accent: #1db7cf;
    --accent-soft: #557d95;
    --warm: #ff9163;
    --success: #27a97a;
    --danger: #d96868;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--body);
    background:
        radial-gradient(circle at top, rgba(126, 242, 255, 0.18), transparent 22%),
        radial-gradient(circle at 80% 10%, rgba(88, 166, 255, 0.12), transparent 30%),
        radial-gradient(circle at 15% 24%, rgba(255, 156, 102, 0.08), transparent 22%),
        linear-gradient(180deg, #050915 0%, #07101a 48%, #060a13 100%);
    color: var(--text);
    transition: background 0.25s ease, color 0.25s ease;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--display);
    letter-spacing: -0.03em;
}

p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(121, 168, 181, 0.18);
    background: rgba(8, 15, 27, 0.9);
    color: var(--text);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(126, 242, 255, 0.32);
    border-color: rgba(126, 242, 255, 0.42);
}

button {
    cursor: pointer;
    border: 0;
}

code {
    font-family: 'Fira Code', monospace;
    color: var(--accent);
}

.app-shell {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-shell.has-sidebar .main-content {
    margin-left: 300px;
    transition: margin-left 0.25s ease, padding-top 0.25s ease;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: 300px;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        calc(5.5rem + var(--safe-area-top))
        calc(1.5rem + var(--safe-area-right))
        calc(3rem + var(--safe-area-bottom))
        calc(1.5rem + var(--safe-area-left));
    border-right: 1px solid rgba(121, 168, 181, 0.12);
    background: rgba(5, 10, 19, 0.78);
    box-shadow: 0 22px 56px rgba(3, 8, 20, 0.3);
    backdrop-filter: blur(20px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    transform: translateX(0);
    z-index: 55;
    transition:
        transform 0.25s ease,
        opacity 0.2s ease,
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.app-shell.sidebar-collapsed .sidebar,
html[data-portal-sidebar="closed"] .app-shell.has-sidebar .sidebar {
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
    transform: translateX(calc(-100% - 1rem));
}

.sidebar-toggle-button {
    position: fixed;
    top: calc(1.25rem + var(--safe-area-top));
    left: calc(1.25rem + var(--safe-area-left));
    z-index: 70;
    display: inline-grid;
    align-content: center;
    gap: 0.32rem;
    width: 3rem;
    height: 3rem;
    padding: 0.75rem;
    border: 1px solid rgba(121, 168, 181, 0.18);
    border-radius: 1rem;
    background: rgba(8, 15, 27, 0.9);
    box-shadow: 0 14px 30px rgba(3, 8, 20, 0.22);
    backdrop-filter: blur(16px);
}

.sidebar-toggle-button span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.sidebar-toggle-button.is-open span:nth-child(1),
html[data-portal-sidebar="open"] .sidebar-toggle-button span:nth-child(1) {
    transform: translateY(0.4rem) rotate(45deg);
}

.sidebar-toggle-button.is-open span:nth-child(2),
html[data-portal-sidebar="open"] .sidebar-toggle-button span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle-button.is-open span:nth-child(3),
html[data-portal-sidebar="open"] .sidebar-toggle-button span:nth-child(3) {
    transform: translateY(-0.4rem) rotate(-45deg);
}

.pwa-back-button {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

/* A menu selection must disappear in the very next paint. The destination can
   still be loading, but it must never hold the drawer open while it does. */
html[data-portal-navigation="pending"] .sidebar,
html[data-portal-navigation="pending"] .sidebar-backdrop,
html[data-portal-navigation="pending"] .sidebar-toggle-button span {
    transition: none !important;
}

.app-shell.has-sidebar.sidebar-open .main-content,
html[data-portal-sidebar="open"] .app-shell.has-sidebar .main-content {
    padding-top: calc(2.5rem + var(--safe-area-top));
}

.app-shell.has-sidebar.sidebar-collapsed .main-content,
html[data-portal-sidebar="closed"] .app-shell.has-sidebar .main-content {
    margin-left: 0;
    padding-top: calc(5rem + var(--safe-area-top));
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-theme-toggle {
    margin-top: 1rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--display);
}

.brand-mark span {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, rgba(126, 242, 255, 0.25), rgba(255, 156, 102, 0.2));
    color: white;
    text-transform: lowercase;
}

.sidebar-copy {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.nav-links {
    display: grid;
    gap: 0.85rem;
    margin: 2rem 0;
}

.nav-group {
    border-radius: 1.2rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    background:
        radial-gradient(circle at top right, rgba(126, 242, 255, 0.08), transparent 42%),
        rgba(7, 12, 23, 0.62);
    overflow: hidden;
}

.nav-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    cursor: pointer;
    list-style: none;
    transition: background 0.22s ease, color 0.22s ease;
}

.nav-group-summary::-webkit-details-marker {
    display: none;
}

.nav-group-summary::after {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid rgba(221, 236, 255, 0.72);
    border-bottom: 2px solid rgba(221, 236, 255, 0.72);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-right: 0.2rem;
}

.nav-group[open] .nav-group-summary::after {
    transform: rotate(225deg);
}

.nav-group-summary strong {
    display: block;
    font-size: 0.97rem;
    color: var(--text);
}

.nav-group-summary small {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.nav-group-summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.nav-group-links {
    display: grid;
    gap: 0.45rem;
    padding: 0 0.8rem 0.85rem;
}

.nav-links a {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    color: var(--text-muted);
    transition: 0.22s ease;
}

.nav-links a.active,
.nav-links a:hover {
    background: linear-gradient(135deg, rgba(126, 242, 255, 0.12), rgba(255, 156, 102, 0.1));
    color: white;
}

.nav-group-empty {
    padding: 0.35rem 0.25rem 0.1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.nav-project-list {
    display: grid;
    gap: 0.45rem;
    max-height: 18rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.nav-project-link {
    display: grid;
    gap: 0.14rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.1);
    background: rgba(8, 15, 27, 0.52);
}

.nav-project-link span {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.nav-project-link small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.nav-links .nav-project-link.active,
.nav-links .nav-project-link:hover {
    border-color: rgba(126, 242, 255, 0.2);
}

.sidebar-footer {
    display: grid;
    gap: 1rem;
    margin-top: auto;
}

.sidebar-signature {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-muted);
}

.sidebar-signature a {
    color: var(--accent);
}

.user-chip {
    display: grid;
    gap: 0.2rem;
    padding: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    border-radius: 1.25rem;
    background: rgba(10, 17, 31, 0.85);
}

.user-chip span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.main-content {
    position: relative;
    overflow: hidden;
    padding:
        calc(2.5rem + var(--safe-area-top))
        calc(2.5rem + var(--safe-area-right))
        calc(2.5rem + var(--safe-area-bottom))
        calc(2.5rem + var(--safe-area-left));
    min-width: 0;
}

.public-content {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    padding-top: var(--safe-area-top);
    padding-right: var(--safe-area-right);
    padding-bottom: var(--safe-area-bottom);
    padding-left: var(--safe-area-left);
}

.background-glow {
    position: absolute;
    width: 30rem;
    height: 30rem;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.18;
    pointer-events: none;
}

.glow-a {
    top: -9rem;
    right: -10rem;
    background: #58a6ff;
}

.glow-b {
    left: -12rem;
    bottom: -12rem;
    background: #ff9c66;
}

.page-shell,
.login-shell {
    position: relative;
    z-index: 1;
}

.page-shell {
    display: grid;
    gap: 1.6rem;
}

.page-shell > * {
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.page-actions,
.form-actions,
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-kicker {
    margin-bottom: 0.45rem;
    color: #93f7ff;
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.metrics-grid,
.client-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.panel-card,
.client-card,
.login-card,
.empty-state,
.list-card,
.info-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    background: linear-gradient(180deg, rgba(10, 17, 34, 0.9), rgba(8, 13, 26, 0.92));
    box-shadow: 0 18px 50px rgba(3, 8, 20, 0.4);
    backdrop-filter: blur(16px);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.metric-card {
    display: grid;
    gap: 0.35rem;
    padding: 1.2rem;
    border-radius: 1.45rem;
}

.metric-card span,
.metric-card small {
    color: var(--text-muted);
}

.metric-card strong {
    font-size: 2rem;
    font-family: var(--display);
}

.content-grid {
    display: grid;
    gap: 1rem;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-card,
.empty-state,
.login-card,
.info-panel {
    border-radius: 1.6rem;
    padding: 1.5rem;
}

.panel-card h2 {
    margin-bottom: 1rem;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.9rem 1.35rem;
    font-weight: 700;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), #58a6ff 52%, var(--warm));
    color: #08101d;
}

.ghost-button {
    border: 1px solid rgba(121, 168, 181, 0.2);
    background: rgba(8, 15, 27, 0.66);
    color: var(--text);
}

.ghost-button:hover,
.primary-button:hover {
    transform: translateY(-1px);
}

.theme-toggle {
    gap: 0.65rem;
    min-width: 10.5rem;
    padding-inline: 1rem 1.15rem;
    justify-content: center;
}

.theme-toggle-indicator {
    position: relative;
    width: 2rem;
    height: 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(126, 242, 255, 0.35), rgba(255, 156, 102, 0.35));
}

.theme-toggle-indicator::after {
    content: "";
    position: absolute;
    top: 0.13rem;
    left: 0.14rem;
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    transition: transform 0.22s ease;
}

.full-width {
    width: 100%;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid label {
    display: grid;
    gap: 0.45rem;
}

.form-grid span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-row input {
    width: auto;
}

.list-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-radius: 1.2rem;
    margin-bottom: 0.85rem;
}

.static-card {
    cursor: default;
}

.list-card strong,
.client-card strong {
    display: block;
    margin-bottom: 0.35rem;
}

.list-card small,
.client-card small,
.list-meta small {
    color: var(--text-muted);
}

.list-meta {
    display: grid;
    gap: 0.6rem;
    justify-items: end;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid rgba(121, 168, 181, 0.12);
}

.summary-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.timeline-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(121, 168, 181, 0.12);
}

.timeline-card:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.client-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-card {
    display: grid;
    gap: 0.55rem;
    padding: 1.2rem;
    border-radius: 1.3rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-planned { background: rgba(88, 166, 255, 0.14); color: #9dd8ff; }
.status-active { background: rgba(95, 213, 166, 0.15); color: #98f2c7; }
.status-blocked { background: rgba(255, 123, 123, 0.16); color: #ffb2b2; }
.status-review { background: rgba(255, 156, 102, 0.16); color: #ffd0b6; }
.status-completed { background: rgba(121, 168, 181, 0.18); color: #d6e6ed; }

.table-shell {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.95rem 0.75rem;
    border-bottom: 1px solid rgba(121, 168, 181, 0.12);
    text-align: left;
}

th {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.alert {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid transparent;
}

.alert.success {
    background: rgba(95, 213, 166, 0.14);
    border-color: rgba(95, 213, 166, 0.22);
}

.alert.error {
    background: rgba(255, 123, 123, 0.14);
    border-color: rgba(255, 123, 123, 0.22);
}

.alert.warning {
    background: rgba(255, 191, 102, 0.12);
    border-color: rgba(255, 191, 102, 0.24);
}

.request-feedback-banner {
    position: fixed;
    top: calc(1.5rem + var(--safe-area-top));
    right: calc(1.5rem + var(--safe-area-right));
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    max-width: min(28rem, calc(100vw - 3rem));
    padding: 0.9rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.18);
    background: rgba(8, 15, 27, 0.88);
    box-shadow: 0 12px 30px rgba(3, 8, 20, 0.28);
    backdrop-filter: blur(18px);
    animation: toast-enter 0.22s ease;
}

.request-feedback-banner strong {
    font-size: 0.95rem;
}

.request-feedback-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--accent);
}

.request-feedback-banner.is-loading .request-feedback-dot {
    animation: request-pulse 1s ease-in-out infinite;
}

.request-feedback-banner.is-success .request-feedback-dot {
    background: var(--success);
}

.request-feedback-banner.is-error .request-feedback-dot {
    background: var(--danger);
}

html.is-pwa-standalone .request-feedback-banner.is-success {
    display: none;
}

.portal-refresh-button {
    position: fixed;
    right: calc(1.25rem + var(--safe-area-right));
    bottom: calc(1.25rem + var(--safe-area-bottom));
    z-index: 58;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.9rem;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(121, 168, 181, 0.24);
    border-radius: 999px;
    background: rgba(8, 15, 27, 0.9);
    box-shadow: 0 12px 30px rgba(3, 8, 20, 0.28);
    backdrop-filter: blur(18px);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
}

.portal-refresh-button:hover {
    border-color: rgba(126, 242, 255, 0.5);
    transform: translateY(-1px);
}

.portal-refresh-button svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.portal-refresh-button.is-refreshing svg {
    animation: portal-reconnect-spin 0.75s linear infinite;
}

:root[data-theme="light"] .portal-refresh-button {
    border-color: rgba(72, 97, 122, 0.16);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(38, 68, 104, 0.14);
    color: #162334;
}

button:disabled,
.primary-button:disabled,
.ghost-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.login-card {
    width: min(100%, 560px);
    display: grid;
    gap: 1.5rem;
    margin-inline: auto;
}

.login-card-corporate {
    width: min(100%, 880px);
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.82fr);
    gap: 1.75rem;
    padding: clamp(2rem, 4vw, 2.8rem);
}

.login-card-main {
    display: grid;
    align-content: start;
    gap: 0.9rem;
    padding-right: 0.75rem;
}

.login-brand-image {
    display: block;
    width: min(100%, 440px);
    height: auto;
    margin-bottom: 0.5rem;
    object-fit: contain;
}

.login-card-main h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 0.96;
    max-width: 9ch;
    letter-spacing: -0.04em;
}

.login-lead {
    max-width: 32rem;
    font-size: 1.18rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.login-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.4rem;
}

.login-highlights span {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
}

.login-card-action {
    display: flex;
    align-items: center;
}

.login-action-panel {
    width: 100%;
    display: grid;
    align-content: center;
    gap: 0.9rem;
    padding: 1.45rem;
    border-radius: 1.45rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background: rgba(255, 255, 255, 0.028);
    min-height: 100%;
}

.login-action-panel strong {
    font-family: var(--display);
    font-size: 1.4rem;
    letter-spacing: -0.03em;
}

.login-action-panel p {
    color: var(--text-muted);
    line-height: 1.7;
}

.login-action-panel .alert {
    margin-top: 0.25rem;
}

.login-action-panel .primary-button {
    min-height: 3.5rem;
    font-size: 1rem;
}

.compact-form {
    gap: 1rem;
}

.info-panel {
    display: grid;
    gap: 0.5rem;
}

.hours-chart {
    width: 100%;
    overflow-x: auto;
}

.hours-chart-shell {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
}

.hours-chart-y-axis {
    display: grid;
    align-content: space-between;
    min-height: 420px;
    padding-block: 0.2rem 4.4rem;
}

.hours-chart-y-axis span {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1;
    text-align: right;
}

.hours-chart-stage {
    display: grid;
    min-width: 620px;
}

.hours-chart-plot {
    position: relative;
    min-height: 420px;
    padding: 0 0 4.5rem;
    border-bottom: 1px solid rgba(121, 168, 181, 0.28);
}

.hours-chart-grid-row {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(121, 168, 181, 0.2);
}

.hours-chart-bar-base {
    fill: rgba(121, 168, 181, 0.08);
    stroke: rgba(121, 168, 181, 0.08);
}

.hours-chart-bars {
    position: relative;
    z-index: 1;
    min-height: 370px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    align-items: end;
    height: 100%;
}

.hours-chart-column {
    display: grid;
    gap: 0.65rem;
    justify-items: center;
    text-align: center;
    align-self: end;
    min-height: 100%;
    width: 100%;
    padding: 0;
    background: transparent;
    color: inherit;
}

.hours-chart-value-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.75rem;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    box-shadow: 0 10px 20px rgba(18, 31, 48, 0.12);
}

.hours-chart-bar-track {
    width: min(100%, 92px);
    min-height: 300px;
    height: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.45rem;
    border-radius: 1.6rem 1.6rem 1rem 1rem;
    background: linear-gradient(180deg, rgba(121, 168, 181, 0.08), rgba(121, 168, 181, 0.02));
    border: 1px solid rgba(121, 168, 181, 0.12);
}

.hours-chart-bar {
    width: 100%;
    min-height: 18px;
    border-radius: 1.2rem 1.2rem 0.75rem 0.75rem;
    box-shadow: 0 18px 30px rgba(18, 31, 48, 0.2);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.hours-chart-column:hover .hours-chart-bar {
    transform: translateY(-4px);
    filter: saturate(1.08);
}

.hours-chart-column.is-selected .hours-chart-bar-track {
    border-color: rgba(126, 242, 255, 0.34);
    box-shadow: 0 0 0 4px rgba(126, 242, 255, 0.08);
}

.hours-chart-column span {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.hours-chart-detail {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1.2rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background: linear-gradient(180deg, rgba(8, 15, 27, 0.82), rgba(10, 18, 32, 0.88));
}

.hours-chart-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.hours-chart-detail-head strong {
    display: block;
    margin-bottom: 0.25rem;
}

.hours-chart-detail-head small {
    color: var(--text-muted);
}

.hours-task-list {
    display: grid;
    gap: 0.7rem;
}

.hours-task-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.hours-task-row strong {
    display: block;
    font-size: 0.95rem;
}

.hours-task-row span {
    color: var(--text-muted);
    white-space: nowrap;
}

.hours-chart-bar-0 { fill: #1db7cf; }
.hours-chart-bar-1 { fill: #58a6ff; }
.hours-chart-bar-2 { fill: #ff9c66; }
.hours-chart-bar-3 { fill: #5fd5a6; }
.hours-chart-bar-4 { fill: #9a8cff; }

.hours-chart-value-badge-0 { background: rgba(29, 183, 207, 0.14); color: #0d7282; }
.hours-chart-value-badge-1 { background: rgba(88, 166, 255, 0.14); color: #2c6dbe; }
.hours-chart-value-badge-2 { background: rgba(255, 156, 102, 0.16); color: #b85c30; }
.hours-chart-value-badge-3 { background: rgba(95, 213, 166, 0.16); color: #1f8762; }
.hours-chart-value-badge-4 { background: rgba(154, 140, 255, 0.16); color: #6250c9; }

.empty-state {
    text-align: center;
    display: grid;
    gap: 0.75rem;
    justify-items: center;
}

.flex-link {
    flex: 1;
}

.project-list-card {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.project-list-card .flex-link {
    width: 100%;
    min-width: 0;
}

.project-list-card .card-actions {
    width: 100%;
    justify-content: flex-start;
    align-items: center;
}

.project-archive-card .flex-link {
    min-width: 0;
}

.project-archive-card-actions {
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.project-archive-card-actions .ghost-button {
    padding: 0.65rem 0.95rem;
    font-size: 0.88rem;
    line-height: 1.1;
    white-space: nowrap;
}

.project-board-panel {
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
    background: rgba(4, 8, 16, 0.35) !important;
    border-color: rgba(121, 168, 181, 0.07) !important;
    box-shadow: none !important;
    backdrop-filter: blur(6px) !important;
    overflow: visible !important;
}

.project-board-shell,
.project-board-scroller {
    min-width: 0;
}

.project-board-anchor {
    scroll-margin-top: calc(1.25rem + var(--safe-area-top));
}

.project-board-scroller {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0.75rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.color-field {
    display: grid;
    gap: 0.35rem;
    align-content: start;
}

.color-field span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.color-field input[type="color"] {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0.15rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.22);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 18px rgba(3, 8, 20, 0.12);
    cursor: pointer;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 999px;
}

.color-field input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 999px;
}

.color-field input[type="color"]::-moz-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 999px;
}

/* ── Kanban board container ──────────────────────────────────────── */
.kanban-board {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    overflow-x: visible;
    overflow-y: visible;
    min-width: max-content;
}

/* ── Column ──────────────────────────────────────────────────────── */
.kanban-column {
    --kanban-column-width: 310px;
    position: relative;
    flex: 0 0 var(--kanban-column-width);
    width: var(--kanban-column-width);
    min-width: 280px;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    max-height: min(76vh, 940px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1a1d23;
}

.kanban-column.is-resizing {
    user-select: none;
}

.kanban-column-sortable {
    cursor: default;
}

/* Thin color accent strip at the top of each column */
.kanban-column-accent {
    height: 4px;
    width: 100%;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

/* ── Column header ───────────────────────────────────────────────── */
.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 10px 8px 8px;
    flex-shrink: 0;
}

.kanban-column-drag-handle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    cursor: grab;
    padding: 2px 0;
    user-select: none;
}

.kanban-column-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.kanban-column-badge {
    flex-shrink: 0;
    background: rgba(121, 168, 181, 0.14);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Column edit form (inline, replaces header) */
.kanban-column-edit-form {
    padding: 10px 10px 6px !important;
    flex-shrink: 0;
    gap: 0.65rem !important;
}

/* ── Column context menu (three-dot) ─────────────────────────────── */
.kanban-menu {
    position: relative;
    flex-shrink: 0;
}

.kanban-menu summary {
    list-style: none;
}

.kanban-menu summary::-webkit-details-marker {
    display: none;
}

.kanban-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    touch-action: manipulation;
}

.kanban-menu-button:hover {
    background: rgba(121, 168, 181, 0.12);
    color: var(--text);
}

.kanban-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    min-width: 185px;
    display: grid;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e2229;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.4);
}

.kanban-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    border-radius: 5px;
    padding: 9px 12px;
    background: transparent;
    color: #e6edf6;
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.12s ease;
    touch-action: manipulation;
    width: 100%;
}

.kanban-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.kanban-menu-item.danger {
    color: #ff8585;
}

.kanban-menu-item.danger:hover {
    background: rgba(255, 100, 100, 0.12);
}

.kanban-column-resize-handle {
    position: absolute;
    top: 50%;
    right: -0.55rem;
    width: 1.1rem;
    height: 4.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: col-resize;
    touch-action: none;
    z-index: 3;
    transform: translateY(-50%);
}

.kanban-column-resize-handle::before {
    content: "";
    width: 0.22rem;
    height: 4rem;
    border-radius: 999px;
    background: rgba(121, 168, 181, 0.2);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.kanban-column-resize-handle:hover::before,
.kanban-column-resize-handle.is-active::before,
.kanban-column.is-resizing .kanban-column-resize-handle::before {
    background: rgba(126, 242, 255, 0.78);
    box-shadow: 0 0 0 4px rgba(126, 242, 255, 0.12);
    transform: scaleY(1.04);
}

/* Delete button in edit forms */
.kanban-danger-btn {
    color: var(--danger) !important;
}

/* ── Card list ───────────────────────────────────────────────────── */
.kanban-card-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 8px;
    min-height: 40px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ── Card ────────────────────────────────────────────────────────── */
.kanban-card {
    position: relative;
    background: #22262e;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    overflow: visible;
    min-width: 0;
    min-height: 96px;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kanban-card:not(.has-custom-height) {
    min-height: 190px;
}

.kanban-card.is-resizing {
    user-select: none;
}

.kanban-card.has-custom-height {
    height: var(--kanban-card-height);
}

.kanban-card-sortable {
    cursor: pointer;
}

.kanban-card-sortable:hover {
    border-color: rgba(126, 242, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    background: #272b34;
}

/* Thin color label bar at the top of each card */
.kanban-card-color-bar {
    height: 5px;
    width: 100%;
    border-radius: 7px 7px 0 0;
}

/* Card content area (also the drag handle) */
.kanban-card-content {
    position: relative;
    padding: 10px 40px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.kanban-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
}

.kanban-card-grip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: -0.15rem;
    border-radius: 0.55rem;
    color: rgba(185, 195, 210, 0.58);
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.kanban-card-grip:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(230, 237, 246, 0.88);
}

.kanban-card-grip:active {
    cursor: grabbing;
}

.kanban-card-title {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #c9d1d9;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Description – capped with scroll */
.kanban-card-desc {
    font-size: 0.75rem;
    color: rgba(185, 195, 210, 0.7);
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.55;
    max-height: 5.5rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.kanban-card.has-custom-height .kanban-card-desc {
    flex: 1;
    min-height: 0;
    max-height: none;
}

/* Block elements: paragraphs and divs */
.kanban-card-desc p,
.kanban-card-desc div {
    margin: 0 0 0.25rem;
}

.kanban-card-desc p:last-child,
.kanban-card-desc div:last-child {
    margin-bottom: 0;
}

/* Lists */
.kanban-card-desc ul,
.kanban-card-desc ol {
    padding-left: 1.1rem;
    margin: 0.2rem 0 0.3rem;
}

.kanban-card-desc li {
    margin: 0.1rem 0;
    line-height: 1.5;
}

/* Inline formatting — make it visible against the muted base */
.kanban-card-desc strong,
.kanban-card-desc b {
    font-weight: 700;
    color: rgba(230, 237, 246, 0.95);
}

.kanban-card-desc em,
.kanban-card-desc i {
    font-style: italic;
    color: rgba(230, 237, 246, 0.88);
}

.kanban-card-desc u {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kanban-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: auto;
    padding-top: 0.35rem;
}

.kanban-card-meta small {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.65rem;
    color: rgba(185, 195, 210, 0.55);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

/* Pencil icon edit button – shows on hover (always on touch screens) */
.kanban-card-edit-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 16, 28, 0.9);
    border: 1px solid rgba(121, 168, 181, 0.18);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.82;
    pointer-events: auto;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    touch-action: manipulation;
}

@media (hover: none) {
    .kanban-card-edit-btn {
        opacity: 1;
        pointer-events: auto;
        width: 36px;
        height: 36px;
    }
}

.kanban-card-sortable:hover .kanban-card-edit-btn,
.kanban-card:focus-within .kanban-card-edit-btn {
    opacity: 1;
}

.kanban-card-edit-btn:hover {
    background: rgba(126, 242, 255, 0.12);
    color: var(--accent);
    border-color: rgba(126, 242, 255, 0.28);
}

.kanban-card-resize-handle {
    position: static;
    flex-shrink: 0;
    width: calc(100% - 1rem);
    margin: 0 0.5rem 0.35rem;
    height: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    touch-action: none;
    z-index: 3;
}

.kanban-card-resize-handle::before {
    content: "";
    width: 3.2rem;
    height: 0.26rem;
    border-radius: 999px;
    background: rgba(121, 168, 181, 0.28);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.kanban-card-resize-handle:hover::before,
.kanban-card-resize-handle.is-active::before,
.kanban-card.is-resizing .kanban-card-resize-handle::before {
    background: rgba(126, 242, 255, 0.78);
    box-shadow: 0 0 0 4px rgba(126, 242, 255, 0.12);
    transform: scaleX(1.04);
}



/* ── Drag & drop states ───────────────────────────────────────────── */
.kanban-card-ghost,
.kanban-column-ghost {
    opacity: 0.28;
}

.kanban-card-dragging,
.kanban-column-dragging {
    transform: rotate(1.5deg);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}

.kanban-card-chosen {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    border-color: rgba(126, 242, 255, 0.35) !important;
}

.kanban-column-chosen {
    border-color: rgba(126, 242, 255, 0.35) !important;
}

/* ── Empty column placeholder ────────────────────────────────────── */
.kanban-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 10px 8px;
    border-radius: 6px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    opacity: 0.6;
}

/* ── "Agregar tarjeta" button at bottom of column ────────────────── */
.kanban-add-card-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    border-radius: 0 0 10px 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    touch-action: manipulation;
    flex-shrink: 0;
    min-height: 38px;
    gap: 0;
}

.kanban-add-card-btn .btn-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

.kanban-add-card-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.kanban-add-card-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── New card form (below card list inside column) ───────────────── */
.board-card-form {
    margin: 4px 8px 4px;
    padding: 10px;
    background: #22262e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 96px;
    max-height: min(44vh, 480px);
    overflow-y: auto;
    overflow-x: hidden;
}

.board-card-form > form,
.board-card-form > .form-grid {
    flex: 1;
    min-height: 0;
}

.board-card-form .rich-editor-surface {
    min-height: 10rem;
    max-height: none;
    overflow-y: auto;
    resize: vertical;
}

/* Rich editor inside inline card edit form */
.kanban-card-edit-form .rich-editor-surface {
    min-height: 10rem;
    max-height: none;
    overflow-y: auto;
    resize: vertical;
}

/* Smaller action buttons inside card forms */
.kanban-card-edit-form .primary-button,
.kanban-card-edit-form .ghost-button,
.board-card-form .primary-button,
.board-card-form .ghost-button {
    padding: 4px 10px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    min-height: 26px !important;
    border-radius: 5px !important;
    line-height: 1.2 !important;
}

/* Compact color swatch in card form actions */
.kanban-form-actions .color-inline input[type="color"] {
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 1px !important;
    border-radius: 5px !important;
    cursor: pointer;
}

.board-card-form .kanban-form-actions {
    position: sticky;
    bottom: 0;
    padding-top: 6px;
    background: #22262e;
}

/* Inline card edit form — fixed height with internal scroll */
.kanban-card-edit-form {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
    background: #22262e;
    border-radius: 8px;
    max-height: min(58vh, 420px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Rich editor surface inside edit form — capped height */
.kanban-card-edit-form .rich-editor-surface {
    min-height: 10rem;
    max-height: none;
    overflow-y: auto;
    resize: vertical;
}

/* Sticky action bar — always visible at the bottom of the form */
.kanban-card-edit-form .kanban-form-actions {
    position: sticky;
    bottom: 0;
    background: #22262e;
    padding: 6px 0 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
    z-index: 1;
    flex-wrap: wrap;
}

/* ── "Agregar columna" section at end of board ───────────────────── */
.kanban-add-list {
    flex: 0 0 310px;
    width: 310px;
    align-self: flex-start;
}

.kanban-add-list-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.14);
    border: none;
    color: #e6edf6;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    touch-action: manipulation;
    white-space: nowrap;
    min-height: 44px;
}

.kanban-add-list-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.kanban-add-list-form {
    background: rgba(13, 22, 37, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
}

/* ── Scrollbars ──────────────────────────────────────────────────── */
.project-board-scroller,
.kanban-board,
.kanban-card-list,
.kanban-card-desc,
.rich-editor-surface {
    scrollbar-width: auto;
    scrollbar-color: rgba(121, 168, 181, 0.46) transparent;
}

.project-board-scroller::-webkit-scrollbar,
.kanban-board::-webkit-scrollbar {
    height: 12px;
}

.kanban-card-list::-webkit-scrollbar {
    width: 12px;
}

.kanban-card-desc::-webkit-scrollbar,
.rich-editor-surface::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.project-board-scroller::-webkit-scrollbar-thumb,
.kanban-board::-webkit-scrollbar-thumb,
.kanban-card-list::-webkit-scrollbar-thumb,
.kanban-card-desc::-webkit-scrollbar-thumb,
.rich-editor-surface::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 3px solid transparent;
    background: rgba(121, 168, 181, 0.46);
    background-clip: padding-box;
    min-height: 2.5rem;
}

.project-board-scroller::-webkit-scrollbar-track,
.kanban-board::-webkit-scrollbar-track,
.kanban-card-list::-webkit-scrollbar-track,
.kanban-card-desc::-webkit-scrollbar-track,
.rich-editor-surface::-webkit-scrollbar-track {
    background: transparent;
}

/* ── Compact inputs inside kanban forms ──────────────────────────── */
.kanban-column input:not([type="color"]):not([type="checkbox"]):not([type="hidden"]),
.kanban-add-list input:not([type="color"]):not([type="checkbox"]):not([type="hidden"]) {
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 0.84rem;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.kanban-column input:not([type="color"]):not([type="checkbox"]):not([type="hidden"]):focus,
.kanban-add-list input:not([type="color"]):not([type="checkbox"]):not([type="hidden"]):focus {
    outline: 2px solid rgba(126, 242, 255, 0.28);
    border-color: rgba(126, 242, 255, 0.42);
    background: rgba(255, 255, 255, 0.08);
}

/* ── Column create/edit form layout ─────────────────────────────── */
.kanban-col-form {
    display: grid;
    gap: 8px;
    padding: 10px;
}

/* Footer row: color picker + action buttons side by side */
.kanban-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* Inline color picker label */
.color-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.color-inline span {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.color-inline input[type="color"] {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 2px !important;
    border-radius: 6px !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Action buttons container in form footer */
.kanban-form-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Inline single-row form (column create / column edit) ───────────── */
.kanban-inline-form {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kanban-inline-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-inline-row input {
    flex: 1;
    min-width: 0;
}

/* Compact submit button inside inline row forms */
.kanban-inline-btn {
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    min-height: 32px !important;
    line-height: 1.2 !important;
    white-space: nowrap;
}

/* X close button */
.kanban-inline-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: rgba(185, 195, 210, 0.45);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    touch-action: manipulation;
}

.kanban-inline-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.12);
}

.kanban-inline-close:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Danger delete-column button (bottom of edit form) */
.kanban-delete-col-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    margin-top: 2px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 107, 107, 0.75);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
}

.kanban-delete-col-btn:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.kanban-delete-col-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Column edit form background (matches column) */
.kanban-col-edit-form {
    background: #1a1d23;
}

/* ── Compact buttons inside kanban forms ─────────────────────────── */
/* Override the global pill-buttons (0.9rem padding) with small ones  */
.kanban-column .primary-button,
.kanban-column .ghost-button,
.kanban-add-list .primary-button,
.kanban-add-list .ghost-button {
    padding: 6px 13px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    min-height: 30px;
    line-height: 1.3;
}

/* "Eliminar" button in kanban edit forms — subtle danger style */
.kanban-column .kanban-danger-btn,
.kanban-add-list .kanban-danger-btn {
    color: var(--danger) !important;
    border-color: rgba(255, 123, 123, 0.18) !important;
    background: rgba(255, 123, 123, 0.06) !important;
}

/* Rich editor toolbar buttons inside kanban — also compact */
.kanban-column .rich-editor-button {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 5px;
}

/* ── Rich content (card description preview) ─────────────────────── */
.rich-content,
.rich-content p,
.rich-content li,
.rich-content div,
.rich-content span {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rich-editor {
    display: grid;
    gap: 0.65rem;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rich-editor-button {
    border: 1px solid rgba(121, 168, 181, 0.18);
    background: rgba(8, 15, 27, 0.58);
    color: var(--text);
    border-radius: 0.9rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.rich-editor-button:hover {
    background: rgba(126, 242, 255, 0.1);
}

.rich-editor-surface {
    min-height: 8rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(121, 168, 181, 0.18);
    background: rgba(8, 15, 27, 0.9);
    color: var(--text);
    border-radius: 1rem;
    line-height: 1.6;
    overflow-y: auto;
}

.rich-editor-surface:focus {
    outline: 2px solid rgba(126, 242, 255, 0.32);
    border-color: rgba(126, 242, 255, 0.42);
}

.rich-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

.rich-content p,
.rich-content ul,
.rich-content ol {
    margin: 0 0 0.6rem;
}

.rich-content p:last-child,
.rich-content ul:last-child,
.rich-content ol:last-child {
    margin-bottom: 0;
}

.rich-content ul,
.rich-content ol {
    padding-left: 1.2rem;
}

.rich-content a {
    color: var(--accent);
    text-decoration: underline;
}

.rich-editor-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.rich-editor-status {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.rich-editor-status.is-error {
    color: #ff9d9d;
}

.kanban-attachment-count {
    background: rgba(126, 242, 255, 0.12) !important;
    border-color: rgba(126, 242, 255, 0.24) !important;
    color: #a7f3ff !important;
}

.kanban-attachments-editor,
.kanban-modal-attachments {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.kanban-attachments-editor-head,
.kanban-modal-attachments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.kanban-attachments-editor-head strong,
.kanban-modal-attachments-head strong {
    color: var(--text);
    font-size: 0.88rem;
}

.kanban-attachments-editor-head span,
.kanban-modal-attachments-head span,
.kanban-attachments-empty,
.kanban-attachments-note {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.kanban-attachments-note {
    margin: 0;
    line-height: 1.5;
}

.kanban-attachment-list {
    display: grid;
    gap: 0.65rem;
}

.kanban-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    background: rgba(8, 15, 27, 0.38);
}

.kanban-attachment-link {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    border: none;
    padding: 0;
    background: transparent;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.kanban-attachment-link strong {
    display: block;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.kanban-attachment-link small {
    display: block;
    margin-top: 0.18rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.kanban-attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(126, 242, 255, 0.18);
    background: rgba(126, 242, 255, 0.1);
    color: #a7f3ff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.kanban-attachment-icon.large {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    font-size: 0.78rem;
}

.kanban-attachment-remove {
    border: 1px solid rgba(255, 123, 123, 0.18);
    background: rgba(255, 123, 123, 0.08);
    color: #ffb3b3;
    border-radius: 0.8rem;
    padding: 0.48rem 0.8rem;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.kanban-attachment-remove:hover:not(:disabled) {
    background: rgba(255, 123, 123, 0.14);
    border-color: rgba(255, 123, 123, 0.28);
    color: #ffd0d0;
}

.kanban-attachment-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kanban-modal-attachments {
    margin-top: 1rem;
}

.kanban-file-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    isolation: isolate;
}

.kanban-file-modal {
    width: min(900px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border-radius: 1.3rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #161c25;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.52);
}

.kanban-file-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 16, 26, 0.95);
}

.kanban-file-modal-title {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.kanban-file-modal-title strong {
    display: block;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.kanban-file-modal-title small {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.kanban-file-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: end;
}

.kanban-file-modal-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1.15rem;
    background:
        radial-gradient(circle at top, rgba(126, 242, 255, 0.08), transparent 28%),
        rgba(6, 10, 17, 0.92);
}

.kanban-file-preview-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 72vh;
    margin: 0 auto;
    border-radius: 1rem;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.kanban-file-preview-frame {
    width: 100%;
    min-height: 68vh;
    border: 1px solid rgba(121, 168, 181, 0.14);
    border-radius: 1rem;
    background: #ffffff;
}

.kanban-file-preview-fallback {
    display: grid;
    justify-items: center;
    gap: 0.85rem;
    padding: 3rem 1rem;
    text-align: center;
}

.kanban-file-preview-fallback strong {
    color: var(--text);
    font-size: 1rem;
}

.kanban-file-preview-fallback p {
    max-width: 32rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.rich-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0.7rem 0;
    border-radius: 0.95rem;
    border: 1px solid rgba(121, 168, 181, 0.16);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.kanban-card-desc.rich-content img {
    max-height: 10rem;
    object-fit: cover;
}

.kanban-modal-desc.rich-content img {
    max-height: 24rem;
    object-fit: contain;
}

:root[data-theme="light"] .rich-editor-status.is-error {
    color: #c25555;
}

:root[data-theme="light"] .kanban-attachment-count {
    color: #16728d !important;
    background: rgba(29, 183, 207, 0.14) !important;
    border-color: rgba(29, 183, 207, 0.22) !important;
}

:root[data-theme="light"] .kanban-attachments-editor,
:root[data-theme="light"] .kanban-modal-attachments {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .kanban-attachment-item {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(244, 248, 252, 0.88);
}

:root[data-theme="light"] .kanban-attachment-link strong,
:root[data-theme="light"] .kanban-file-modal-title strong,
:root[data-theme="light"] .kanban-file-preview-fallback strong {
    color: #172b4d;
}

:root[data-theme="light"] .kanban-attachment-link small,
:root[data-theme="light"] .kanban-file-modal-title small,
:root[data-theme="light"] .kanban-file-preview-fallback p,
:root[data-theme="light"] .kanban-attachments-editor-head span,
:root[data-theme="light"] .kanban-modal-attachments-head span,
:root[data-theme="light"] .kanban-attachments-empty,
:root[data-theme="light"] .kanban-attachments-note {
    color: rgba(23, 43, 77, 0.72);
}

:root[data-theme="light"] .kanban-attachment-icon {
    border-color: rgba(29, 183, 207, 0.2);
    background: rgba(29, 183, 207, 0.12);
    color: #16728d;
}

:root[data-theme="light"] .kanban-file-modal {
    border-color: rgba(72, 97, 122, 0.12);
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(38, 68, 104, 0.22);
}

:root[data-theme="light"] .kanban-file-modal-header {
    border-color: rgba(72, 97, 122, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.98));
}

:root[data-theme="light"] .kanban-file-modal-body {
    background:
        radial-gradient(circle at top, rgba(29, 183, 207, 0.1), transparent 28%),
        #f5f8fc;
}

@media (max-width: 760px) {
    .kanban-attachment-item,
    .kanban-file-modal-header,
    .kanban-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .kanban-file-modal-actions {
        justify-content: flex-start;
    }

    .kanban-file-preview-frame {
        min-height: 52vh;
    }
}

@media (max-width: 1180px) {
    .sidebar {
        width: min(300px, calc(100vw - 1rem));
    }

    .app-shell.sidebar-collapsed .sidebar,
    html[data-portal-sidebar="closed"] .app-shell.has-sidebar .sidebar {
        width: min(300px, calc(100vw - 1rem));
        opacity: 1;
        pointer-events: none;
        transform: translateX(calc(-100% - 1rem));
    }

    .metrics-grid,
    .client-grid,
    .two-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        opacity: 0;
        pointer-events: none;
        background: rgba(3, 8, 20, 0.5);
        backdrop-filter: blur(2px);
        z-index: 50;
        transition: opacity 0.22s ease;
    }

    .sidebar-backdrop.is-visible,
    html[data-portal-sidebar="open"] .app-shell.has-sidebar .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell.has-sidebar .main-content,
    .app-shell.has-sidebar.sidebar-collapsed .main-content {
        margin-left: 0;
        padding-top: calc(4.75rem + var(--safe-area-top));
    }
}

@media (max-width: 760px) {
    .main-content {
        padding:
            calc(1.25rem + var(--safe-area-top))
            calc(1.25rem + var(--safe-area-right))
            calc(1.25rem + var(--safe-area-bottom))
            calc(1.25rem + var(--safe-area-left));
    }

    .page-header,
    .list-card,
    .summary-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .metrics-grid,
    .client-grid,
    .two-columns {
        grid-template-columns: 1fr;
    }

    .login-card-corporate {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.5rem;
    }

    .login-card-main {
        padding-right: 0;
    }

    .login-card-main h1 {
        max-width: none;
        font-size: clamp(2.2rem, 9vw, 3.2rem);
    }

    .login-brand-image {
        width: min(100%, 360px);
    }

    .sidebar-top {
        align-items: flex-start;
    }

    .kanban-board {
        min-width: unset;
        gap: 12px;
    }

    .project-board-scroller {
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-x: contain !important;
    }

    .kanban-column,
    .kanban-add-list {
        flex: 0 0 calc(100vw - 3rem);
        width: calc(100vw - 3rem);
        max-height: none;
        scroll-snap-align: start;
    }

    .kanban-column-resize-handle {
        display: none;
    }

    .kanban-card-list {
        overflow-y: visible;
    }

    .kanban-menu-button {
        width: 40px;
        height: 40px;
    }

    .kanban-add-card-btn {
        min-height: 44px;
        font-size: 0.875rem;
    }

    .request-feedback-banner {
        top: auto;
        right: 1rem;
        bottom: calc(5rem + var(--safe-area-bottom));
        left: 1rem;
        max-width: none;
    }

    .portal-refresh-button {
        right: calc(0.85rem + var(--safe-area-right));
        bottom: calc(0.85rem + var(--safe-area-bottom));
        width: 3.15rem;
        height: 3.15rem;
        justify-content: center;
        padding: 0;
    }

    .portal-refresh-button span {
        display: none;
    }

    .hours-chart-detail-head,
    .hours-task-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

:root[data-theme="light"] body {
    background:
        radial-gradient(circle at top, rgba(29, 183, 207, 0.14), transparent 22%),
        radial-gradient(circle at 80% 10%, rgba(94, 157, 236, 0.14), transparent 30%),
        radial-gradient(circle at 15% 24%, rgba(255, 145, 99, 0.12), transparent 22%),
        linear-gradient(180deg, #f9fbff 0%, #edf4fb 48%, #e7eff8 100%);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
    border-color: rgba(72, 97, 122, 0.18);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
    outline-color: rgba(29, 183, 207, 0.22);
    border-color: rgba(29, 183, 207, 0.35);
}

:root[data-theme="light"] .sidebar {
    border-right-color: rgba(72, 97, 122, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .sidebar-toggle-button {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 28px rgba(38, 68, 104, 0.14);
}

:root[data-theme="light"] .sidebar-toggle-button span {
    background: #162334;
}

:root[data-theme="light"] .sidebar-copy,
:root[data-theme="light"] .user-chip span,
:root[data-theme="light"] p,
:root[data-theme="light"] .list-card small,
:root[data-theme="light"] .client-card small,
:root[data-theme="light"] .list-meta small,
:root[data-theme="light"] th,
:root[data-theme="light"] .form-grid span,
:root[data-theme="light"] .metric-card span,
:root[data-theme="light"] .metric-card small {
    color: var(--text-muted);
}

:root[data-theme="light"] .nav-links a.active,
:root[data-theme="light"] .nav-links a:hover {
    color: #102033;
}

:root[data-theme="light"] .nav-group {
    border-color: rgba(72, 97, 122, 0.12);
    background:
        radial-gradient(circle at top right, rgba(29, 183, 207, 0.08), transparent 42%),
        rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .nav-group-summary:hover {
    background: rgba(72, 97, 122, 0.04);
}

:root[data-theme="light"] .nav-group-summary::after {
    border-right-color: rgba(23, 43, 77, 0.6);
    border-bottom-color: rgba(23, 43, 77, 0.6);
}

:root[data-theme="light"] .nav-project-link {
    border-color: rgba(72, 97, 122, 0.1);
    background: rgba(255, 255, 255, 0.92);
}

:root[data-theme="light"] .nav-project-link span {
    color: #102033;
}

:root[data-theme="light"] .nav-project-link small,
:root[data-theme="light"] .nav-group-empty {
    color: rgba(23, 43, 77, 0.62);
}

:root[data-theme="light"] .user-chip {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .panel-card,
:root[data-theme="light"] .client-card,
:root[data-theme="light"] .login-card,
:root[data-theme="light"] .empty-state,
:root[data-theme="light"] .list-card,
:root[data-theme="light"] .info-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.98));
    box-shadow: 0 18px 42px rgba(38, 68, 104, 0.12);
}

:root[data-theme="light"] .ghost-button {
    border-color: rgba(72, 97, 122, 0.16);
    background: rgba(255, 255, 255, 0.86);
}

:root[data-theme="light"] .section-kicker {
    color: #198ca2;
}

:root[data-theme="light"] .login-highlights span {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.9);
    color: #23344a;
}

:root[data-theme="light"] .login-action-panel {
    border-color: rgba(72, 97, 122, 0.12);
    background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .summary-row,
:root[data-theme="light"] .timeline-card,
:root[data-theme="light"] th,
:root[data-theme="light"] td {
    border-color: rgba(72, 97, 122, 0.12);
}

:root[data-theme="light"] .status-planned { background: rgba(88, 166, 255, 0.16); color: #2568a8; }
:root[data-theme="light"] .status-active { background: rgba(39, 169, 122, 0.14); color: #1c7f5b; }
:root[data-theme="light"] .status-blocked { background: rgba(217, 104, 104, 0.14); color: #b34d4d; }
:root[data-theme="light"] .status-review { background: rgba(255, 145, 99, 0.14); color: #b85c30; }
:root[data-theme="light"] .status-completed { background: rgba(85, 125, 149, 0.14); color: #4b667d; }

:root[data-theme="light"] .alert.success {
    background: rgba(39, 169, 122, 0.12);
    border-color: rgba(39, 169, 122, 0.2);
}

:root[data-theme="light"] .alert.error {
    background: rgba(217, 104, 104, 0.12);
    border-color: rgba(217, 104, 104, 0.2);
}

:root[data-theme="light"] .alert.warning {
    background: rgba(214, 153, 62, 0.12);
    border-color: rgba(214, 153, 62, 0.22);
}

:root[data-theme="light"] .android-update-warning-alert {
    background: rgba(214, 153, 62, 0.12);
    border-color: rgba(214, 153, 62, 0.22);
}

:root[data-theme="light"] .android-update-log-pill {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.84);
    color: rgba(23, 43, 77, 0.7);
}

:root[data-theme="light"] .android-update-log-pill.is-secondary {
    background: rgba(29, 183, 207, 0.1);
    color: #146b7a;
}

:root[data-theme="light"] .request-feedback-banner {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(38, 68, 104, 0.12);
}

/* Light mode: Kanban overrides — fondo blanco, texto negro */
:root[data-theme="light"] .project-board-panel {
    background: rgba(230, 235, 242, 0.55) !important;
    border-color: rgba(72, 97, 122, 0.1) !important;
}

:root[data-theme="light"] .kanban-column {
    border-color: rgba(0, 0, 0, 0.1);
    background: #f1f2f4;
    backdrop-filter: none;
}

:root[data-theme="light"] .kanban-column-resize-handle::before {
    background: rgba(72, 97, 122, 0.18);
}

:root[data-theme="light"] .kanban-card-resize-handle::before {
    background: rgba(72, 97, 122, 0.22);
}

:root[data-theme="light"] .kanban-column-resize-handle:hover::before,
:root[data-theme="light"] .kanban-column-resize-handle.is-active::before,
:root[data-theme="light"] .kanban-column.is-resizing .kanban-column-resize-handle::before {
    background: rgba(29, 183, 207, 0.72);
    box-shadow: 0 0 0 4px rgba(29, 183, 207, 0.12);
}

:root[data-theme="light"] .kanban-card-resize-handle:hover::before,
:root[data-theme="light"] .kanban-card-resize-handle.is-active::before,
:root[data-theme="light"] .kanban-card.is-resizing .kanban-card-resize-handle::before {
    background: rgba(29, 183, 207, 0.72);
    box-shadow: 0 0 0 4px rgba(29, 183, 207, 0.12);
}

:root[data-theme="light"] .kanban-menu-panel {
    border-color: rgba(0, 0, 0, 0.12);
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .kanban-menu-item {
    color: #1a1d23;
}

:root[data-theme="light"] .kanban-menu-button:hover {
    background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .kanban-menu-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .kanban-menu-item.danger {
    color: #c0392b;
}

:root[data-theme="light"] .rich-editor-button {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .rich-editor-surface {
    border-color: rgba(72, 97, 122, 0.18);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:root[data-theme="light"] .board-card-form {
    background: rgba(225, 228, 234, 0.85);
    border-color: rgba(72, 97, 122, 0.14);
}

:root[data-theme="light"] .board-card-form .card-actions {
    background: rgba(225, 228, 234, 0.98);
}

:root[data-theme="light"] .color-field input[type="color"] {
    border-color: rgba(72, 97, 122, 0.16);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 18px rgba(38, 68, 104, 0.12);
}

:root[data-theme="light"] .kanban-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #1a1d23;
}

:root[data-theme="light"] .kanban-card-sortable:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(29, 183, 207, 0.4);
    background: #fafbfc;
}

:root[data-theme="light"] .kanban-card-title {
    color: #1a1d23;
}

:root[data-theme="light"] .kanban-card-grip {
    color: rgba(23, 43, 77, 0.45);
}

:root[data-theme="light"] .kanban-card-grip:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #172b4d;
}

:root[data-theme="light"] .kanban-card-desc {
    color: #4a5568;
}

:root[data-theme="light"] .kanban-card-desc strong,
:root[data-theme="light"] .kanban-card-desc b {
    color: #1a1d23;
}

:root[data-theme="light"] .kanban-card-edit-btn {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
    color: #4a5568;
}

:root[data-theme="light"] .kanban-add-card-btn {
    border-top-color: rgba(0, 0, 0, 0.07);
}

:root[data-theme="light"] .board-card-form {
    background: #f4f5f7;
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .board-card-form .kanban-form-actions {
    background: #f4f5f7;
}

:root[data-theme="light"] .kanban-card-edit-form {
    background: #f4f5f7;
}

:root[data-theme="light"] .kanban-card-edit-form .kanban-form-actions {
    background: #f4f5f7;
    border-top-color: rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .board-card-form .kanban-form-actions {
    background: #f4f5f7;
}

:root[data-theme="light"] .kanban-col-edit-form {
    background: #f1f2f4;
}

:root[data-theme="light"] .kanban-inline-close {
    color: rgba(30, 50, 70, 0.45);
}

:root[data-theme="light"] .kanban-inline-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1d23;
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .kanban-delete-col-btn {
    color: rgba(200, 50, 50, 0.8);
}

:root[data-theme="light"] .kanban-delete-col-btn:hover:not(:disabled) {
    background: rgba(200, 50, 50, 0.08);
    color: #c0392b;
}

:root[data-theme="light"] .kanban-card-title {
    color: #172b4d;
}

:root[data-theme="light"] .kanban-card-desc {
    color: rgba(23, 43, 77, 0.72);
}

:root[data-theme="light"] .kanban-card-meta small {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(23, 43, 77, 0.5);
}


:root[data-theme="light"] .kanban-add-list-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: #4a5568;
}

:root[data-theme="light"] .kanban-add-list-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1d23;
}

:root[data-theme="light"] .kanban-add-list-form {
    background: #f1f2f4;
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .kanban-card-edit-btn {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(72, 97, 122, 0.2);
}

:root[data-theme="light"] .kanban-card-edit-btn:hover {
    background: rgba(29, 183, 207, 0.1);
    color: var(--accent);
    border-color: rgba(29, 183, 207, 0.3);
}

:root[data-theme="light"] .kanban-empty {
    border-color: rgba(72, 97, 122, 0.2);
}

:root[data-theme="light"] .kanban-add-card-btn:hover:not(:disabled) {
    background: rgba(72, 97, 122, 0.08);
}

:root[data-theme="light"] .kanban-add-list-btn {
    background: rgba(0, 0, 0, 0.12);
    color: #172b4d;
}

:root[data-theme="light"] .kanban-add-list-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #172b4d;
}

:root[data-theme="light"] .kanban-add-list-form {
    background: #e4e9f0;
    border-color: rgba(72, 97, 122, 0.14);
}

:root[data-theme="light"] .kanban-column input:not([type="color"]):not([type="checkbox"]):not([type="hidden"]),
:root[data-theme="light"] .kanban-add-list input:not([type="color"]):not([type="checkbox"]):not([type="hidden"]) {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(72, 97, 122, 0.2);
    color: var(--text);
}

:root[data-theme="light"] .color-inline input[type="color"] {
    border-color: rgba(72, 97, 122, 0.2) !important;
}

:root[data-theme="light"] .hours-chart-detail {
    border-color: rgba(72, 97, 122, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.98));
}

:root[data-theme="light"] .hours-task-row {
    border-color: rgba(72, 97, 122, 0.12);
    background: rgba(255, 255, 255, 0.88);
}

:root[data-theme="light"] .glow-a {
    background: #6bcfe8;
}

:root[data-theme="light"] .glow-b {
    background: #ffbc95;
}

:root[data-theme="light"] .theme-toggle-indicator::after {
    transform: translateX(0.9rem);
    background: rgba(22, 35, 52, 0.92);
}

/* ── Card detail modal ───────────────────────────────────────────── */
.kanban-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(3px);
}

.kanban-modal {
    background: #1e2229;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    width: min(580px, 100%);
    max-height: 82vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.kanban-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 18px 12px;
    position: sticky;
    top: 0;
    background: #1e2229;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    z-index: 1;
}

.kanban-modal-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: 4px;
}

.kanban-modal-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #e6edf6;
    line-height: 1.4;
    margin: 0;
}

.kanban-modal-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: rgba(185, 195, 210, 0.5);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.kanban-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e6edf6;
}

.kanban-modal-body {
    padding: 16px 18px;
    flex: 1;
}

.kanban-modal-desc {
    color: rgba(185, 195, 210, 0.88);
    font-size: 0.9rem;
    line-height: 1.7;
}

.kanban-modal-desc p { margin: 0 0 0.5rem; }
.kanban-modal-desc p:last-child { margin-bottom: 0; }
.kanban-modal-desc ul, .kanban-modal-desc ol { padding-left: 1.2rem; margin: 0.3rem 0; }
.kanban-modal-desc li { margin: 0.2rem 0; }
.kanban-modal-desc strong, .kanban-modal-desc b { color: #e6edf6; font-weight: 700; }

.kanban-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    position: sticky;
    bottom: 0;
    background: #1e2229;
    gap: 8px;
}

.kanban-modal-date {
    font-size: 0.68rem;
    color: rgba(185, 195, 210, 0.45);
    letter-spacing: 0.02em;
}

/* Card content area — pointer cursor to hint it's clickable */
.kanban-card-content {
    cursor: pointer;
}

/* Light mode modal */
:root[data-theme="light"] .kanban-modal {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

:root[data-theme="light"] .kanban-modal-header,
:root[data-theme="light"] .kanban-modal-footer {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .kanban-modal-title {
    color: #172b4d;
}

:root[data-theme="light"] .kanban-modal-desc {
    color: rgba(23, 43, 77, 0.85);
}

:root[data-theme="light"] .kanban-modal-desc strong,
:root[data-theme="light"] .kanban-modal-desc b {
    color: #172b4d;
}

:root[data-theme="light"] .kanban-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #172b4d;
}

@keyframes request-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.55; }
}

@keyframes toast-enter {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes portal-reconnect-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#components-reconnect-modal {
    position: fixed;
    right: calc(1rem + var(--safe-area-right));
    bottom: calc(1rem + var(--safe-area-bottom));
    z-index: 1500;
    display: none;
    max-width: calc(100vw - 2rem - var(--safe-area-left) - var(--safe-area-right));
    pointer-events: none;
}

#components-reconnect-modal.portal-reconnect-visible.components-reconnect-show,
#components-reconnect-modal.portal-reconnect-visible.components-reconnect-failed,
#components-reconnect-modal.portal-reconnect-visible.components-reconnect-rejected {
    display: flex;
}

html[data-portal-cached-screen="true"] #components-reconnect-modal {
    display: none !important;
}

.portal-reconnect-card {
    width: min(25rem, 100%);
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    padding: 1rem 1.1rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(121, 168, 181, 0.18);
    background: linear-gradient(180deg, rgba(10, 17, 34, 0.96), rgba(8, 13, 26, 0.98));
    box-shadow: 0 18px 44px rgba(3, 8, 20, 0.4);
    text-align: center;
    color: var(--text);
    pointer-events: auto;
}

.portal-reconnect-spinner {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 3px solid rgba(121, 168, 181, 0.18);
    border-top-color: var(--accent);
    animation: portal-reconnect-spin 0.9s linear infinite;
}

.portal-reconnect-title {
    font-family: var(--display);
    font-size: 1rem;
    letter-spacing: -0.03em;
    color: var(--text);
}

.portal-reconnect-message {
    display: none;
    max-width: 26rem;
    margin: 0;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.45;
}

.portal-reconnect-action {
    display: none;
    min-width: 12rem;
    margin-top: 0.35rem;
}

.portal-reconnect-action.is-loading {
    gap: 0.55rem;
    cursor: wait;
    opacity: 0.88;
}

.portal-reconnect-action.is-loading::before {
    content: "";
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: portal-reconnect-spin 0.7s linear infinite;
}

#components-reconnect-modal.components-reconnect-show .portal-reconnect-message-show,
#components-reconnect-modal.components-reconnect-failed .portal-reconnect-message-failed,
#components-reconnect-modal.components-reconnect-rejected .portal-reconnect-message-rejected {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .portal-reconnect-spinner {
    border-top-color: var(--warm);
}

#components-reconnect-modal.components-reconnect-rejected .portal-reconnect-spinner {
    display: none;
}

#components-reconnect-modal.components-reconnect-rejected .portal-reconnect-action {
    display: inline-flex;
}

:root[data-theme="light"] #components-reconnect-modal {
    background: rgba(238, 244, 251, 0.74);
}

:root[data-theme="light"] .portal-reconnect-card {
    border-color: rgba(72, 97, 122, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 249, 255, 0.99));
    box-shadow: 0 24px 54px rgba(38, 68, 104, 0.2);
    color: #162334;
}

:root[data-theme="light"] .portal-reconnect-title,
:root[data-theme="light"] .portal-reconnect-message {
    color: #162334;
}

:root[data-theme="light"] .portal-reconnect-spinner {
    border-color: rgba(72, 97, 122, 0.14);
    border-top-color: var(--accent);
}

:root[data-theme="light"] .portal-reconnect-action.is-loading::before {
    border-color: rgba(22, 35, 52, 0.3);
    border-top-color: #162334;
}

.invoice-filter-grid,
.invoice-field-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-filter-search,
.invoice-field-wide {
    grid-column: span 2;
}

.invoice-filter-panel {
    display: block;
    padding: 0;
}

.invoice-filter-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 5rem;
    padding: 1.25rem 1.35rem;
    cursor: pointer;
    list-style: none;
}

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

.invoice-filter-panel > summary::before {
    content: "\203A";
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.18);
    color: #93f7ff;
    font-size: 1.4rem;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 0.18s ease, background 0.18s ease;
}

.invoice-filter-panel[open] > summary {
    border-bottom: 1px solid rgba(121, 168, 181, 0.1);
}

.invoice-filter-panel[open] > summary::before {
    transform: rotate(90deg);
    background: rgba(126, 242, 255, 0.1);
}

.invoice-filter-summary-copy {
    display: grid;
    gap: 0.32rem;
    min-width: 0;
    margin-right: auto;
}

.invoice-filter-summary-copy h2 {
    margin: 0;
}

.invoice-filter-summary-copy p {
    margin: 0;
    color: var(--text-muted);
}

.invoice-filter-summary-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: min(100%, 18rem);
    color: var(--text-muted);
    text-align: right;
}

.invoice-filter-summary-meta span {
    font-size: 0.86rem;
    line-height: 1.45;
}

.invoice-filter-summary-meta strong {
    color: #93f7ff;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.invoice-filter-panel[open] .invoice-filter-summary-meta strong {
    color: #ffd166;
}

.invoice-filter-panel[open] .invoice-filter-summary-meta strong::before {
    content: "Cerrar filtros";
}

.invoice-filter-panel[open] .invoice-filter-summary-meta strong {
    font-size: 0;
}

.invoice-filter-panel[open] .invoice-filter-summary-meta strong::before {
    font-size: 0.8rem;
}

.invoice-filter-content {
    display: grid;
    gap: 1rem;
    padding: 0 1.35rem 1.35rem;
}

.invoice-filter-actions {
    justify-content: flex-end;
    margin-top: 0;
}

.invoice-list {
    display: grid;
    gap: 0.85rem;
}

.invoice-quarter-group {
    overflow: hidden;
    border-radius: 1.15rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background: rgba(8, 15, 27, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.invoice-quarter-group[open] {
    background: rgba(8, 15, 27, 0.54);
}

.invoice-quarter-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.4rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    list-style: none;
    background: rgba(255, 255, 255, 0.015);
}

.invoice-quarter-group[open] summary {
    border-bottom: 1px solid rgba(121, 168, 181, 0.1);
}

.invoice-quarter-group summary::-webkit-details-marker {
    display: none;
}

.invoice-quarter-group summary::before {
    content: "›";
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.18);
    color: #93f7ff;
    font-size: 1.35rem;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 0.18s ease, background 0.18s ease;
}

.invoice-quarter-group[open] summary::before {
    transform: rotate(90deg);
    background: rgba(126, 242, 255, 0.1);
}

.invoice-quarter-group summary > div:first-child {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    margin-right: auto;
}

.invoice-quarter-group summary strong {
    color: var(--text);
    font-family: var(--display);
    font-size: 1.05rem;
}

.invoice-quarter-group summary span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.invoice-quarter-group-totals {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
    text-align: right;
}

.invoice-quarter-group-totals strong {
    color: #ffd166;
    white-space: nowrap;
}

.invoice-quarter-group-list {
    display: grid;
    gap: 0.85rem;
    padding: 0 1rem 1rem;
    background: transparent;
}

.invoice-quarter-group-list .list-card {
    margin-bottom: 0;
}

.invoice-list-card {
    align-items: center;
}

.invoice-list-card.is-visually-paid {
    border-color: rgba(95, 213, 166, 0.34);
    box-shadow: 0 20px 48px rgba(9, 29, 24, 0.4);
}

.invoice-list-card.is-visually-paid::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #61dfad 0%, #93f7ff 100%);
}

.invoice-list-main {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.invoice-list-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.invoice-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.invoice-visual-paid-badge {
    background: rgba(95, 213, 166, 0.18);
    color: #a8f4cf;
}

.invoice-paid-toggle.is-active {
    border-color: rgba(95, 213, 166, 0.28);
    background: rgba(35, 87, 64, 0.32);
    color: #b8f7d8;
}

.invoice-list-meta span,
.invoice-project-chip,
.invoice-summary-card small {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.android-update-wide {
    grid-column: 1 / -1;
}

.android-update-upload-summary {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.16);
    background: rgba(9, 16, 30, 0.48);
}

.android-update-warning-alert {
    background: rgba(255, 191, 102, 0.12);
    border-color: rgba(255, 191, 102, 0.24);
}

.android-update-summary-card {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding: 1rem 1.1rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(121, 168, 181, 0.16);
    background: rgba(8, 15, 27, 0.62);
}

.android-update-summary-card div {
    display: grid;
    gap: 0.18rem;
}

.android-update-summary-card span {
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.android-update-summary-card strong {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.android-update-manual-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.android-update-manual-grid label {
    gap: 0.45rem;
}

.android-update-manual-grid small {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.android-update-card,
.android-update-release-card,
.android-update-log-card {
    display: grid;
    gap: 1rem;
}

.android-update-card-main {
    display: grid;
    gap: 0.8rem;
    min-width: 0;
}

.android-update-card-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.android-update-card-head p,
.android-update-release-card p,
.android-update-log-card p {
    margin: 0;
}

.android-update-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.android-update-meta span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.android-update-notes {
    margin: 0;
    white-space: pre-line;
    color: var(--text);
    line-height: 1.6;
}

.android-update-links {
    display: grid;
    gap: 0.9rem;
}

.android-update-links label {
    display: grid;
    gap: 0.4rem;
}

.android-update-links span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.android-update-links input {
    font-size: 0.84rem;
}

.android-update-delete-button {
    border-color: rgba(255, 123, 123, 0.24);
}

.android-update-required-badge {
    background: rgba(255, 156, 102, 0.16);
    color: #ffd0b6;
}

.android-update-log-main {
    display: grid;
    gap: 0.7rem;
    min-width: 0;
}

.android-update-log-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.android-update-log-top strong {
    font-size: 1.02rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.android-update-log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.android-update-log-meta span,
.android-update-log-side small {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.android-update-log-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.18);
    background: rgba(8, 15, 27, 0.74);
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    text-align: center;
}

.android-update-log-pill.is-secondary {
    background: rgba(126, 242, 255, 0.08);
    color: rgba(221, 248, 255, 0.9);
}

.android-update-timeline-card {
    display: grid;
    gap: 1.1rem;
}

.android-update-timeline-group-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: start;
}

.android-update-timeline-toggle {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.android-update-timeline-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.android-update-timeline-head strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.android-update-timeline-head p {
    margin: 0.28rem 0 0;
}

.android-update-timeline-head-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.android-update-timeline {
    display: grid;
    gap: 0.95rem;
}

.android-update-timeline-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.95rem;
    align-items: stretch;
}

.android-update-timeline-marker {
    position: relative;
    display: flex;
    justify-content: center;
    width: 1rem;
    min-height: 100%;
}

.android-update-timeline-marker::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: -0.95rem;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(121, 168, 181, 0.08), rgba(121, 168, 181, 0.34));
}

.android-update-timeline-item:last-child .android-update-timeline-marker::before {
    bottom: 0.7rem;
}

.android-update-timeline-marker span {
    position: relative;
    z-index: 1;
    width: 0.9rem;
    height: 0.9rem;
    margin-top: 0.28rem;
    border-radius: 999px;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 4px rgba(126, 242, 255, 0.08);
    background: #7ef2ff;
}

.android-update-timeline-item.is-downloaded .android-update-timeline-marker span {
    background: #7ef2ff;
    box-shadow: 0 0 0 4px rgba(126, 242, 255, 0.08);
}

.android-update-timeline-item.is-installed .android-update-timeline-marker span {
    background: #5fd5a6;
    box-shadow: 0 0 0 4px rgba(95, 213, 166, 0.08);
}

.android-update-timeline-item.is-failed .android-update-timeline-marker span {
    background: #ff7b7b;
    box-shadow: 0 0 0 4px rgba(255, 123, 123, 0.08);
}

.android-update-timeline-content {
    min-width: 0;
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.05rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(121, 168, 181, 0.16);
    background: linear-gradient(180deg, rgba(8, 15, 27, 0.72), rgba(10, 18, 32, 0.82));
}

.android-update-timeline-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.android-update-timeline-top strong {
    display: block;
    font-size: 1rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.android-update-timeline-top p {
    margin: 0.22rem 0 0;
}

.android-update-timeline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.android-update-timeline-actions .ghost-button {
    margin-left: auto;
}

.android-update-delete-group-button {
    align-self: center;
    white-space: nowrap;
}

.budget-editor-grid > *,
.budget-editor-grid .invoice-field-grid > *,
.budget-editor-grid .invoice-line-row > * {
    min-width: 0;
}

.budget-editor-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.budget-editor-grid .invoice-side-column {
    grid-template-columns: 1fr;
}

.budget-editor-grid .invoice-field-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.budget-editor-grid .invoice-field-wide {
    grid-column: 1 / -1;
}

.budget-editor-grid .section-head {
    flex-wrap: wrap;
}

.budget-editor-grid .section-head > div {
    min-width: 0;
}

.android-update-control-row {
    display: grid;
    gap: 0.35rem;
}

.android-update-control-row small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.android-update-required-toggle {
    width: fit-content;
}

.android-update-required-toggle.is-disabled {
    opacity: 0.68;
}

.android-update-log-side {
    display: grid;
    gap: 0.6rem;
    align-content: start;
    justify-items: stretch;
    text-align: right;
    justify-self: end;
    width: min(100%, 12rem);
}

.android-update-log-side .ghost-button {
    width: 100%;
    justify-content: center;
}

.android-update-status-downloaded {
    background: rgba(126, 242, 255, 0.14);
    color: #a7f5ff;
}

.android-update-status-installed {
    background: rgba(95, 213, 166, 0.15);
    color: #98f2c7;
}

.android-update-status-failed {
    background: rgba(255, 123, 123, 0.16);
    color: #ffb2b2;
}

.invoice-fiscal-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-fiscal-annual-card {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: clamp(1rem, 2vw, 1.35rem);
    border-radius: 1.45rem;
    border: 1px solid rgba(121, 168, 181, 0.16);
    background:
        radial-gradient(circle at top right, rgba(255, 209, 102, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(94, 205, 244, 0.12), transparent 44%),
        linear-gradient(180deg, rgba(10, 18, 34, 0.98), rgba(8, 13, 26, 0.95));
    box-shadow: 0 24px 58px rgba(3, 8, 20, 0.28);
}

.invoice-fiscal-annual-card.is-empty {
    opacity: 0.82;
}

.invoice-fiscal-annual-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
    gap: 1rem;
    align-items: stretch;
}

.invoice-fiscal-annual-main > div:first-child {
    display: grid;
    align-content: center;
    gap: 0.55rem;
    min-width: 0;
}

.invoice-fiscal-annual-main span {
    color: #93f7ff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.invoice-fiscal-annual-main h3 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.35rem, 2.4vw, 2.05rem);
    line-height: 1.1;
}

.invoice-fiscal-annual-main p,
.invoice-fiscal-annual-net small {
    color: var(--text-muted);
}

.invoice-fiscal-annual-net {
    display: grid;
    align-content: center;
    gap: 0.4rem;
    padding: 1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(255, 209, 102, 0.18);
    background: rgba(255, 255, 255, 0.045);
}

.invoice-fiscal-annual-net strong {
    color: #ffd166;
    font-family: var(--display);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1;
    overflow-wrap: anywhere;
}

.invoice-fiscal-annual-net small {
    line-height: 1.45;
}

.invoice-fiscal-annual-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.invoice-fiscal-annual-metrics div {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.invoice-fiscal-annual-metrics span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-fiscal-annual-metrics strong {
    color: var(--text);
    font-size: 1.02rem;
    overflow-wrap: anywhere;
}

.invoice-fiscal-card {
    display: grid;
    gap: 1.1rem;
    padding: 1.2rem;
    border-radius: 1.45rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background:
        radial-gradient(circle at top right, rgba(126, 242, 255, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(11, 19, 33, 0.96), rgba(8, 13, 26, 0.94));
}

.invoice-fiscal-card.is-empty {
    opacity: 0.82;
}

.invoice-fiscal-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.invoice-fiscal-card-head span {
    display: inline-flex;
    margin-bottom: 0.4rem;
    color: #93f7ff;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.invoice-fiscal-card-head strong {
    display: block;
    font-size: 1.15rem;
}

.invoice-fiscal-card-head small {
    color: var(--text-muted);
    text-align: right;
}

.invoice-fiscal-chart-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
}

.invoice-fiscal-donut-shell {
    display: grid;
    place-items: center;
    min-height: 240px;
}

.invoice-fiscal-donut {
    position: relative;
    width: min(240px, 100%);
    aspect-ratio: 1;
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 20px 40px rgba(3, 8, 20, 0.24);
}

.invoice-fiscal-donut::after {
    content: "";
    position: absolute;
    inset: 12%;
    border-radius: 999px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 48%),
        linear-gradient(180deg, rgba(9, 16, 29, 0.95), rgba(6, 10, 18, 0.96));
    border: 1px solid rgba(121, 168, 181, 0.12);
}

.invoice-fiscal-donut-core {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 0.2rem;
}

.invoice-fiscal-donut-core strong {
    font-size: 2rem;
    font-family: var(--display);
}

.invoice-fiscal-donut-core span {
    color: var(--text-muted);
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-fiscal-legend {
    display: grid;
    gap: 0.8rem;
}

.invoice-fiscal-legend-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.invoice-fiscal-legend-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04);
}

.invoice-fiscal-legend-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.35;
}

.invoice-fiscal-legend-item small {
    color: rgba(230, 237, 246, 0.76);
    line-height: 1.5;
}

.invoice-fiscal-legend-item.tone-vat .invoice-fiscal-legend-dot {
    background: #5ecdf4;
}

.invoice-fiscal-legend-item.tone-withholding .invoice-fiscal-legend-dot {
    background: #ff8460;
}

.invoice-fiscal-legend-item.tone-net .invoice-fiscal-legend-dot {
    background: #ffd166;
}

.invoice-fiscal-metrics {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-fiscal-metrics div {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.invoice-fiscal-metrics span {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.invoice-fiscal-report-panel {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background:
        linear-gradient(135deg, rgba(94, 205, 244, 0.09), transparent 34%),
        rgba(255, 255, 255, 0.025);
}

.invoice-fiscal-report-panel .section-head {
    align-items: center;
}

.invoice-fiscal-report-panel .section-head h3 {
    margin: 0;
    font-family: var(--display);
    font-size: 1.08rem;
}

.invoice-fiscal-report-panel .section-head > strong {
    color: #ffd166;
    font-family: var(--display);
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    white-space: nowrap;
}

.invoice-fiscal-report-table {
    display: grid;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
}

.invoice-fiscal-report-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.8fr) 0.6fr repeat(4, minmax(110px, 1fr));
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 0.95rem;
    border-bottom: 1px solid rgba(121, 168, 181, 0.1);
    color: var(--text-muted);
}

.invoice-fiscal-report-row:last-child {
    border-bottom: 0;
}

.invoice-fiscal-report-row strong {
    color: var(--text);
}

.invoice-fiscal-report-row span:not(:first-child) {
    text-align: right;
}

.invoice-fiscal-report-row.is-head,
.invoice-fiscal-report-row.is-total {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-fiscal-report-row.is-total {
    color: #ffd166;
}

.invoice-fiscal-client-ledger {
    display: grid;
    gap: 0.7rem;
}

.invoice-fiscal-client-detail {
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.invoice-fiscal-client-detail summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
}

.invoice-fiscal-client-detail summary span {
    color: var(--text);
    font-weight: 800;
}

.invoice-fiscal-client-detail summary strong {
    color: #93f7ff;
    white-space: nowrap;
}

.invoice-fiscal-client-donut-panel {
    display: grid;
    gap: 1rem;
    margin-top: 0.35rem;
    padding: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    border-radius: 1rem;
    background:
        linear-gradient(135deg, rgba(255, 209, 102, 0.08), transparent 38%),
        rgba(255, 255, 255, 0.03);
}

.invoice-fiscal-client-donut-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
    gap: 1rem;
    align-items: center;
}

.invoice-fiscal-client-donut-shell {
    display: grid;
    place-items: center;
    min-height: 260px;
}

.invoice-fiscal-client-donut {
    position: relative;
    width: min(260px, 100%);
    aspect-ratio: 1;
    border-radius: 999px;
    cursor: help;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 20px 40px rgba(3, 8, 20, 0.24);
}

.invoice-fiscal-client-donut::after {
    content: "";
    position: absolute;
    inset: 18%;
    z-index: 1;
    border-radius: 999px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 48%),
        linear-gradient(180deg, rgba(9, 16, 29, 0.95), rgba(6, 10, 18, 0.96));
    border: 1px solid rgba(121, 168, 181, 0.12);
    pointer-events: none;
}

.invoice-fiscal-client-donut-svg {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.invoice-fiscal-client-donut-segment {
    fill: none;
    pointer-events: stroke;
    stroke-linecap: butt;
    stroke-width: 18;
    transition: filter 160ms ease, opacity 160ms ease, stroke-width 160ms ease;
}

.invoice-fiscal-client-donut-segment:hover {
    filter: drop-shadow(0 0 10px var(--client-donut-color));
    opacity: 0.92;
    stroke-width: 19.5;
}

.invoice-fiscal-client-donut-core {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-content: center;
    gap: 0.2rem;
    padding: 0 3rem;
    text-align: center;
    pointer-events: none;
}

.invoice-fiscal-client-donut-core strong {
    color: var(--text);
    font-family: var(--display);
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1;
}

.invoice-fiscal-client-donut-core span {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.invoice-fiscal-client-donut-hover-card {
    position: absolute;
    left: 50%;
    bottom: -0.35rem;
    z-index: 4;
    display: grid;
    gap: 0.15rem;
    width: max-content;
    max-width: min(18rem, 86vw);
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(121, 168, 181, 0.2);
    border-radius: 0.8rem;
    background: rgba(8, 15, 27, 0.96);
    box-shadow: 0 16px 34px rgba(3, 8, 20, 0.32);
    color: var(--text);
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, 100%);
}

.invoice-fiscal-client-donut-hover-card strong {
    overflow-wrap: anywhere;
    font-size: 0.82rem;
    line-height: 1.25;
}

.invoice-fiscal-client-donut-hover-card span {
    color: rgba(230, 237, 246, 0.76);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.25;
}

.invoice-fiscal-client-donut-js-tooltip {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 6;
    display: grid;
    gap: 0.12rem;
    width: max-content;
    max-width: min(18rem, 82vw);
    padding: 0.5rem 0.62rem;
    border: 1px solid rgba(121, 168, 181, 0.2);
    border-radius: 0.72rem;
    background: rgba(8, 15, 27, 0.97);
    box-shadow: 0 16px 34px rgba(3, 8, 20, 0.34);
    color: var(--text);
    opacity: 1;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, -50%);
}

.invoice-fiscal-client-donut-js-tooltip[hidden] {
    display: none;
}

.invoice-fiscal-client-donut-js-tooltip strong {
    overflow-wrap: anywhere;
    font-size: 0.78rem;
    line-height: 1.25;
}

.invoice-fiscal-client-donut-js-tooltip span {
    color: #ffd166;
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1.25;
}

.invoice-fiscal-client-donut-legend {
    display: grid;
    gap: 0.75rem;
}

.invoice-fiscal-client-donut-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
}

.invoice-fiscal-client-donut-dot {
    position: relative;
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 999px;
    background: var(--client-donut-color);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04);
    cursor: help;
}

.invoice-fiscal-client-donut-dot::after {
    content: attr(data-client-name);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.85rem);
    z-index: 5;
    width: max-content;
    max-width: min(16rem, 70vw);
    padding: 0.42rem 0.58rem;
    border: 1px solid rgba(121, 168, 181, 0.18);
    border-radius: 0.65rem;
    background: rgba(8, 15, 27, 0.96);
    box-shadow: 0 12px 28px rgba(3, 8, 20, 0.28);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.25;
    opacity: 0;
    overflow-wrap: anywhere;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, 0.25rem) scale(0.98);
    transition: opacity 160ms ease, transform 160ms ease;
}

.invoice-fiscal-client-donut-dot::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.45rem);
    z-index: 6;
    width: 0.52rem;
    height: 0.52rem;
    border-right: 1px solid rgba(121, 168, 181, 0.18);
    border-bottom: 1px solid rgba(121, 168, 181, 0.18);
    background: rgba(8, 15, 27, 0.96);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 0.25rem) rotate(45deg);
    transition: opacity 160ms ease, transform 160ms ease;
}

.invoice-fiscal-client-donut-dot:hover::after,
.invoice-fiscal-client-donut-dot:focus-visible::after,
.invoice-fiscal-client-donut-dot:hover::before,
.invoice-fiscal-client-donut-dot:focus-visible::before {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.invoice-fiscal-client-donut-dot:focus-visible {
    outline: 2px solid var(--client-donut-color);
    outline-offset: 0.35rem;
}

.invoice-fiscal-client-donut-item strong {
    display: block;
    margin-bottom: 0.25rem;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.35;
}

.invoice-fiscal-client-donut-item small {
    color: rgba(230, 237, 246, 0.76);
    line-height: 1.5;
}

@media (min-width: 801px) {
    html:not(.is-pwa-standalone) .invoice-fiscal-report-panel {
        background: rgba(255, 255, 255, 0.025);
    }

    html:not(.is-pwa-standalone) .invoice-fiscal-report-table,
    html:not(.is-pwa-standalone) .invoice-fiscal-client-detail,
    html:not(.is-pwa-standalone) .invoice-fiscal-client-donut-panel {
        background: rgba(8, 15, 27, 0.34);
    }

    html:not(.is-pwa-standalone) .invoice-fiscal-report-row.is-head,
    html:not(.is-pwa-standalone) .invoice-fiscal-report-row.is-total {
        background: rgba(255, 255, 255, 0.04);
    }
}

.invoice-fiscal-invoice-list {
    display: grid;
    padding: 0 1rem 1rem;
}

.invoice-fiscal-invoice-list > div {
    display: grid;
    grid-template-columns: minmax(140px, 1.4fr) repeat(4, minmax(96px, 1fr));
    gap: 0.7rem;
    padding: 0.65rem 0;
    border-top: 1px solid rgba(121, 168, 181, 0.1);
    color: var(--text-muted);
}

.invoice-fiscal-invoice-list > div span:not(:first-child),
.invoice-fiscal-invoice-list > div strong {
    text-align: right;
}

.invoice-fiscal-invoice-list > div strong {
    color: var(--text);
}

.invoice-editor-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    align-items: start;
}

.invoice-side-column {
    display: grid;
    gap: 1rem;
}

.invoice-summary-card {
    display: grid;
    gap: 0.65rem;
}

.invoice-summary-total {
    padding-top: 0.6rem;
    border-top: 1px solid rgba(121, 168, 181, 0.14);
}

.invoice-project-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.3rem;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.invoice-payment-current {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.invoice-payment-current > span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.invoice-payment-current > p {
    color: var(--text);
    white-space: pre-line;
}

.invoice-payment-current.is-empty > p {
    color: var(--text-muted);
}

.invoice-lines-shell {
    display: grid;
    gap: 0.85rem;
}

.invoice-line-row {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: minmax(0, 2.4fr) repeat(3, minmax(110px, 0.7fr)) auto;
    align-items: start;
    padding: 1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.invoice-line-description {
    align-self: stretch;
}

.invoice-line-description .rich-editor {
    gap: 0.55rem;
}

.invoice-line-description .rich-editor-surface {
    min-height: 6.5rem;
    max-height: 14rem;
}

.invoice-line-remove {
    align-self: end;
}

.invoice-line-description {
    min-width: 0;
}

.invoice-line-remove {
    min-width: 6rem;
}

.status-draft {
    background: rgba(255, 156, 102, 0.16);
    color: #ffd0b6;
}

.status-accepted {
    background: rgba(95, 213, 166, 0.15);
    color: #98f2c7;
}

.status-deleted {
    background: rgba(255, 123, 123, 0.16);
    color: #ffb2b2;
}

.invoice-preview {
    display: grid;
    gap: 1.4rem;
    padding: clamp(1.2rem, 2vw, 2rem);
    border-radius: 1.5rem;
    background: linear-gradient(180deg, #ffffff, #f7f9fc);
    color: #1c2230;
    box-shadow: 0 24px 60px rgba(3, 8, 20, 0.18);
}

.invoice-preview p,
.invoice-preview span,
.invoice-preview small,
.invoice-preview th,
.invoice-preview td {
    color: inherit;
}

.invoice-preview-header,
.invoice-preview-footer {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
}

.invoice-preview-logo {
    width: min(240px, 100%);
    height: auto;
    object-fit: contain;
}

.invoice-preview-brand {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #26207a !important;
}

.invoice-preview-meta {
    min-width: 220px;
    display: grid;
    justify-items: end;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d7dce5;
    border-radius: 1.1rem;
    background: #f5f7fb;
}

.invoice-preview-meta span {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: #70757f !important;
}

.invoice-preview-meta strong {
    font-size: 1.3rem;
    color: #26207a;
}

.invoice-preview-party-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-preview-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid #d7dce5;
    background: #ffffff;
}

.invoice-preview-card > span,
.invoice-preview-payment > span {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #70757f !important;
}

.invoice-preview-card strong {
    font-size: 1rem;
    color: #26207a;
}

.invoice-preview-table-shell {
    overflow-x: auto;
    border: 1px solid #d7dce5;
    border-radius: 1.2rem;
    background: #ffffff;
}

.invoice-preview-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-preview-table th,
.invoice-preview-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e7ebf2;
    text-align: left;
}

.invoice-preview-table th {
    background: #eff3f8;
    color: #26207a !important;
    font-size: 0.8rem;
}

.invoice-preview-description {
    min-width: 22rem;
    vertical-align: top;
    line-height: 1.55;
}

.invoice-preview-description.rich-content ul,
.invoice-preview-description.rich-content ol {
    padding-left: 1.15rem;
}

.admin-sheet-card {
    display: grid;
    gap: 1.1rem;
}

.admin-sheet-empty-state {
    display: grid;
    gap: 0.8rem;
}

.admin-sheet-empty-state code {
    font-size: 0.94em;
}

.admin-sheet-toolbar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.admin-sheet-toolbar p {
    margin: 0.45rem 0 0;
    max-width: 58rem;
}

.admin-sheet-frame-shell {
    min-height: 78vh;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid rgba(121, 168, 181, 0.16);
    background: rgba(9, 16, 29, 0.66);
}

.admin-sheet-frame {
    width: 100%;
    min-height: 78vh;
    border: 0;
    background: #ffffff;
}

.invoice-preview-payment {
    display: grid;
    gap: 0.4rem;
    max-width: 28rem;
}

.invoice-preview-totals {
    margin-left: auto;
    min-width: 280px;
    display: grid;
    gap: 0.65rem;
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid #d7dce5;
    background: #ffffff;
}

.invoice-preview-totals div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.invoice-preview-grand-total {
    margin-top: 0.35rem;
    padding-top: 0.7rem;
    border-top: 1px solid #d7dce5;
}

.invoice-preview-grand-total span,
.invoice-preview-grand-total strong {
    font-size: 1.1rem;
    color: #26207a !important;
}

:root[data-theme="light"] .status-draft {
    background: rgba(255, 145, 99, 0.14);
    color: #b85c30;
}

:root[data-theme="light"] .status-accepted {
    background: rgba(39, 169, 122, 0.14);
    color: #1c7f5b;
}

:root[data-theme="light"] .invoice-list-card.is-visually-paid {
    border-color: rgba(39, 169, 122, 0.22);
    box-shadow: 0 18px 38px rgba(58, 108, 87, 0.12);
}

:root[data-theme="light"] .invoice-quarter-group {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 32px rgba(38, 68, 104, 0.08);
}

:root[data-theme="light"] .invoice-filter-panel > summary::before {
    border-color: rgba(72, 97, 122, 0.16);
    color: #12879a;
}

:root[data-theme="light"] .invoice-filter-panel[open] > summary {
    border-bottom-color: rgba(72, 97, 122, 0.1);
}

:root[data-theme="light"] .invoice-filter-panel[open] > summary::before {
    background: rgba(29, 183, 207, 0.1);
}

:root[data-theme="light"] .invoice-filter-summary-meta strong {
    color: #12879a;
}

:root[data-theme="light"] .invoice-filter-panel[open] .invoice-filter-summary-meta strong {
    color: #9a6700;
}

:root[data-theme="light"] .invoice-quarter-group[open] {
    background: rgba(247, 250, 255, 0.96);
}

:root[data-theme="light"] .invoice-quarter-group summary {
    background: rgba(255, 255, 255, 0.52);
}

:root[data-theme="light"] .invoice-quarter-group[open] summary {
    border-bottom-color: rgba(72, 97, 122, 0.1);
}

:root[data-theme="light"] .invoice-quarter-group summary::before {
    border-color: rgba(72, 97, 122, 0.16);
    color: #12879a;
}

:root[data-theme="light"] .invoice-quarter-group-totals strong {
    color: #9a6700;
}

:root[data-theme="light"] .invoice-visual-paid-badge {
    background: rgba(39, 169, 122, 0.14);
    color: #1d7b58;
}

:root[data-theme="light"] .invoice-paid-toggle.is-active {
    border-color: rgba(39, 169, 122, 0.22);
    background: rgba(39, 169, 122, 0.1);
    color: #1d7b58;
}

:root[data-theme="light"] .android-update-upload-summary {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(246, 250, 255, 0.94);
}

:root[data-theme="light"] .android-update-summary-card {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(246, 250, 255, 0.94);
}

:root[data-theme="light"] .android-update-required-badge {
    background: rgba(255, 145, 99, 0.14);
    color: #b85c30;
}

:root[data-theme="light"] .android-update-timeline-content {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(246, 250, 255, 0.94);
}

:root[data-theme="light"] .android-update-timeline-marker::before {
    background: linear-gradient(180deg, rgba(72, 97, 122, 0.08), rgba(72, 97, 122, 0.28));
}

:root[data-theme="light"] .status-deleted {
    background: rgba(217, 104, 104, 0.14);
    color: #b34d4d;
}

:root[data-theme="light"] .invoice-fiscal-card {
    border-color: rgba(72, 97, 122, 0.14);
    background:
        radial-gradient(circle at top right, rgba(29, 183, 207, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 249, 255, 0.99));
    box-shadow: 0 20px 46px rgba(38, 68, 104, 0.14);
}

:root[data-theme="light"] .invoice-fiscal-annual-card {
    border-color: rgba(72, 97, 122, 0.14);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 34%),
        linear-gradient(135deg, rgba(29, 183, 207, 0.1), transparent 44%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.99));
    box-shadow: 0 22px 48px rgba(38, 68, 104, 0.14);
}

:root[data-theme="light"] .invoice-fiscal-annual-main span {
    color: #12879a;
}

:root[data-theme="light"] .invoice-fiscal-annual-net,
:root[data-theme="light"] .invoice-fiscal-annual-metrics div {
    border-color: rgba(72, 97, 122, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .invoice-fiscal-annual-net strong {
    color: #9a6700;
}

:root[data-theme="light"] .invoice-fiscal-card-head span {
    color: var(--accent-soft);
}

:root[data-theme="light"] .invoice-fiscal-donut {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 18px 32px rgba(38, 68, 104, 0.14);
}

:root[data-theme="light"] .invoice-fiscal-donut::after {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.9), transparent 48%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 252, 0.99));
    border-color: rgba(72, 97, 122, 0.12);
}

:root[data-theme="light"] .invoice-fiscal-legend-item,
:root[data-theme="light"] .invoice-fiscal-metrics div {
    border-color: rgba(72, 97, 122, 0.12);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

:root[data-theme="light"] .invoice-fiscal-legend-dot {
    box-shadow: 0 0 0 6px rgba(22, 35, 52, 0.04);
}

:root[data-theme="light"] .invoice-fiscal-legend-item small {
    color: var(--text-muted);
}

:root[data-theme="light"] .invoice-fiscal-report-panel {
    border-color: rgba(72, 97, 122, 0.14);
    background:
        linear-gradient(135deg, rgba(29, 183, 207, 0.1), transparent 34%),
        rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .invoice-fiscal-report-table,
:root[data-theme="light"] .invoice-fiscal-client-detail {
    border-color: rgba(72, 97, 122, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .invoice-fiscal-report-row,
:root[data-theme="light"] .invoice-fiscal-invoice-list > div {
    border-color: rgba(72, 97, 122, 0.1);
}

:root[data-theme="light"] .invoice-fiscal-report-row.is-head,
:root[data-theme="light"] .invoice-fiscal-report-row.is-total {
    background: rgba(245, 249, 255, 0.95);
}

:root[data-theme="light"] .invoice-fiscal-report-panel .section-head > strong,
:root[data-theme="light"] .invoice-fiscal-report-row.is-total {
    color: #9a6700;
}

:root[data-theme="light"] .invoice-fiscal-client-detail summary strong {
    color: #12879a;
}

:root[data-theme="light"] .invoice-fiscal-client-donut-panel,
:root[data-theme="light"] .invoice-fiscal-client-donut-item {
    border-color: rgba(72, 97, 122, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .invoice-fiscal-client-donut {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 18px 32px rgba(38, 68, 104, 0.14);
}

:root[data-theme="light"] .invoice-fiscal-client-donut::after {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.9), transparent 48%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 252, 0.99));
    border-color: rgba(72, 97, 122, 0.12);
}

:root[data-theme="light"] .invoice-fiscal-client-donut-dot {
    box-shadow: 0 0 0 6px rgba(22, 35, 52, 0.04);
}

:root[data-theme="light"] .invoice-fiscal-client-donut-item small {
    color: var(--text-muted);
}

@media (min-width: 801px) {
    :root[data-theme="light"]:not(.is-pwa-standalone) .invoice-fiscal-report-panel {
        background: rgba(255, 255, 255, 0.9);
    }

    :root[data-theme="light"]:not(.is-pwa-standalone) .invoice-fiscal-report-table,
    :root[data-theme="light"]:not(.is-pwa-standalone) .invoice-fiscal-client-detail,
    :root[data-theme="light"]:not(.is-pwa-standalone) .invoice-fiscal-client-donut-panel {
        background: rgba(255, 255, 255, 0.78);
    }

    :root[data-theme="light"]:not(.is-pwa-standalone) .invoice-fiscal-report-row.is-head,
    :root[data-theme="light"]:not(.is-pwa-standalone) .invoice-fiscal-report-row.is-total {
        background: rgba(245, 249, 255, 0.95);
    }
}

:root[data-theme="light"] .document-type-group,
:root[data-theme="light"] .document-client-group {
    border-color: rgba(72, 97, 122, 0.14);
}

:root[data-theme="light"] .document-type-group {
    background:
        radial-gradient(circle at top right, rgba(29, 183, 207, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.98));
    box-shadow: 0 18px 42px rgba(38, 68, 104, 0.1);
}

:root[data-theme="light"] .document-client-group {
    background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .document-type-group > summary::before,
:root[data-theme="light"] .document-client-group > summary::before {
    border-color: rgba(72, 97, 122, 0.16);
    color: #12879a;
}

:root[data-theme="light"] .document-type-group > summary > div:first-child > span {
    color: #12879a;
}

:root[data-theme="light"] .document-type-summary-meta span,
:root[data-theme="light"] .document-type-summary-meta strong {
    border-color: rgba(72, 97, 122, 0.12);
    background: rgba(255, 255, 255, 0.68);
}

:root[data-theme="light"] .document-type-summary-meta strong {
    color: #9a6700;
}

@media (min-width: 801px) {
    :root[data-theme="light"]:not(.is-pwa-standalone) .document-type-group {
        background: rgba(255, 255, 255, 0.9);
        box-shadow: none;
    }

    :root[data-theme="light"]:not(.is-pwa-standalone) .document-client-group {
        background: rgba(255, 255, 255, 0.78);
    }

    :root[data-theme="light"]:not(.is-pwa-standalone) .document-type-summary-meta span,
    :root[data-theme="light"]:not(.is-pwa-standalone) .document-type-summary-meta strong {
        background: rgba(255, 255, 255, 0.72);
    }
}

.document-share-section,
.document-share-editor {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.document-share-section strong {
    display: block;
    margin-bottom: 0.35rem;
}

.document-share-fields {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-share-result {
    gap: 1rem;
}

.document-share-link-row {
    display: grid;
    gap: 0.75rem;
}

.document-share-link-row input {
    font-size: 0.92rem;
}

.document-share-caption {
    display: grid;
    gap: 0.2rem;
    color: var(--text-muted);
}

.document-list-head {
    align-items: end;
    margin-bottom: 1rem;
}

.document-search-box {
    display: grid;
    gap: 0.35rem;
    width: min(100%, 24rem);
}

.document-search-box span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document-search-box input {
    min-height: 2.75rem;
    border-radius: 0.95rem;
}

.document-group-list {
    display: grid;
    gap: 0.9rem;
}

.document-type-group,
.document-client-group {
    overflow: hidden;
    border-radius: 1.15rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
}

.document-type-group {
    background:
        radial-gradient(circle at top right, rgba(126, 242, 255, 0.11), transparent 34%),
        linear-gradient(180deg, rgba(10, 17, 34, 0.86), rgba(8, 13, 26, 0.9));
}

.document-client-group {
    background: rgba(255, 255, 255, 0.028);
}

.document-type-group summary,
.document-client-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
}

.document-type-group summary::-webkit-details-marker,
.document-client-group summary::-webkit-details-marker {
    display: none;
}

.document-type-group > summary {
    min-height: 4.6rem;
    padding: 1rem 1.1rem;
}

.document-client-group > summary {
    min-height: 3.75rem;
    padding: 0.9rem 1rem;
}

.document-type-group > summary::before,
.document-client-group > summary::before {
    content: "›";
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.18);
    color: #93f7ff;
    line-height: 1;
    transition: transform 0.18s ease, background 0.18s ease;
}

.document-type-group > summary::before {
    width: 2rem;
    height: 2rem;
    font-size: 1.35rem;
}

.document-client-group > summary::before {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 1.1rem;
}

.document-type-group[open] > summary::before,
.document-client-group[open] > summary::before {
    transform: rotate(90deg);
    background: rgba(126, 242, 255, 0.1);
}

.document-type-group > summary > div:first-child,
.document-client-group > summary > div:first-child {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    margin-right: auto;
}

.document-type-group > summary span,
.document-client-group > summary span {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.document-type-group > summary > div:first-child > span {
    color: #93f7ff;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.document-type-group > summary strong,
.document-client-group > summary strong {
    color: var(--text);
}

.document-type-group > summary strong {
    font-family: var(--display);
    font-size: 1.1rem;
}

.document-type-summary-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
    text-align: right;
}

.document-type-summary-meta span,
.document-type-summary-meta strong {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.12);
    background: rgba(255, 255, 255, 0.035);
}

.document-type-summary-meta strong {
    color: #ffd166;
    white-space: nowrap;
}

@media (min-width: 801px) {
    html:not(.is-pwa-standalone) .document-type-group {
        background: rgba(8, 15, 27, 0.46);
        box-shadow: none;
    }

    html:not(.is-pwa-standalone) .document-client-group {
        background: rgba(8, 15, 27, 0.34);
    }

    html:not(.is-pwa-standalone) .document-type-summary-meta span,
    html:not(.is-pwa-standalone) .document-type-summary-meta strong {
        background: rgba(255, 255, 255, 0.045);
    }
}

.document-client-groups {
    display: grid;
    gap: 0.75rem;
    padding: 0 1rem 1rem;
}

.document-client-documents {
    display: grid;
    gap: 0.75rem;
    padding: 0 0.85rem 0.85rem;
}

.document-list-card {
    display: grid;
    gap: 0.95rem;
    align-items: stretch;
    padding: 1.15rem 1.2rem;
}

.document-card-top {
    display: flex;
    justify-content: flex-end;
}

.document-list-main {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
}

.document-form-wide {
    grid-column: 1 / -1;
}

.document-file-link strong {
    display: block;
    font-size: 1.1rem;
    line-height: 1.25;
}

.document-project-line {
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.5;
}

.document-description-line {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.document-meta-line {
    display: block;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.document-share-meta {
    display: grid;
    gap: 0.35rem;
    padding-top: 0.25rem;
}

.document-share-meta small {
    display: block;
    line-height: 1.45;
}

.document-share-highlight {
    color: var(--text);
    font-size: 0.96rem;
}

.document-share-highlight strong {
    color: var(--text);
    font-weight: 800;
}

.document-card-actions {
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
}

.document-viewer-shell {
    min-height: calc(100dvh - 2rem);
    gap: 0.8rem;
}

.document-viewer-toolbar {
    position: sticky;
    top: calc(0.75rem + var(--safe-area-top));
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(121, 168, 181, 0.16);
    border-radius: 1.1rem;
    background: rgba(8, 15, 27, 0.88);
    box-shadow: 0 16px 38px rgba(3, 8, 20, 0.28);
    backdrop-filter: blur(18px);
}

.document-viewer-back {
    gap: 0.45rem;
}

.document-viewer-title {
    display: grid;
    min-width: 0;
    gap: 0.15rem;
}

.document-viewer-title span {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.document-viewer-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}

.document-viewer-frame-card {
    min-height: 72dvh;
    overflow: hidden;
    border: 1px solid rgba(121, 168, 181, 0.16);
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 46px rgba(3, 8, 20, 0.24);
}

.document-viewer-frame {
    display: block;
    width: 100%;
    height: min(78dvh, 62rem);
    border: 0;
    background: #111827;
}

.document-viewer-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.privacy-policy-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: clamp(1.4rem, 4vw, 3rem);
    display: grid;
    gap: 1rem;
}

.privacy-policy-hero,
.privacy-policy-summary-card,
.privacy-policy-section-card,
.privacy-policy-footer {
    border-radius: 1.8rem;
}

.privacy-policy-hero {
    display: grid;
    gap: 1.5rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background:
        radial-gradient(circle at top right, rgba(126, 242, 255, 0.14), transparent 34%),
        radial-gradient(circle at 12% 22%, rgba(255, 156, 102, 0.12), transparent 24%),
        linear-gradient(180deg, rgba(10, 17, 34, 0.96), rgba(8, 13, 26, 0.98));
}

.privacy-policy-toolbar,
.privacy-policy-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.privacy-policy-toolbar-actions,
.privacy-policy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.privacy-policy-hero-copy {
    display: grid;
    gap: 0.9rem;
    max-width: 50rem;
}

.privacy-policy-hero-copy h1,
.privacy-policy-footer h2 {
    font-size: clamp(2.1rem, 5vw, 3.9rem);
    line-height: 0.96;
}

.privacy-policy-footer h2 {
    font-size: clamp(1.6rem, 4vw, 2.25rem);
}

.privacy-policy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.6rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 168, 181, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.9rem;
}

.privacy-policy-badge strong {
    color: #93f7ff;
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.privacy-policy-language-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem;
    border: 1px solid rgba(121, 168, 181, 0.16);
    border-radius: 999px;
    background: rgba(8, 15, 27, 0.7);
}

.privacy-policy-language-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.4rem;
    min-height: 2.6rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    touch-action: manipulation;
}

.privacy-policy-language-button.is-active {
    background: linear-gradient(135deg, rgba(126, 242, 255, 0.2), rgba(255, 156, 102, 0.18));
    color: var(--text);
}

.privacy-policy-summary-grid,
.privacy-policy-sections {
    display: grid;
    gap: 1rem;
}

.privacy-policy-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.privacy-policy-summary-card {
    display: grid;
    gap: 0.8rem;
    padding: 1.4rem;
}

.privacy-policy-summary-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.privacy-policy-summary-card strong {
    font-size: 1.2rem;
    line-height: 1.3;
}

.privacy-policy-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.privacy-policy-section-card {
    display: grid;
    gap: 1.15rem;
    padding: 1.6rem;
}

.privacy-policy-section-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.privacy-policy-section-number {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(126, 242, 255, 0.2), rgba(255, 156, 102, 0.18));
    color: var(--text);
    font-family: var(--display);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
}

.privacy-policy-section-title-block {
    display: grid;
    gap: 0.55rem;
}

.privacy-policy-section-title-block h2 {
    font-size: 1.28rem;
    line-height: 1.15;
}

.privacy-policy-section-lead {
    color: var(--text);
}

.privacy-policy-section-content {
    display: grid;
    gap: 0.9rem;
}

.privacy-policy-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
}

.privacy-policy-list li {
    line-height: 1.65;
}

.privacy-policy-footer {
    padding: clamp(1.5rem, 4vw, 2.2rem);
    background:
        radial-gradient(circle at top right, rgba(255, 156, 102, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(10, 17, 34, 0.96), rgba(8, 13, 26, 0.98));
}

.privacy-policy-footer-copy {
    display: grid;
    gap: 0.75rem;
    max-width: 44rem;
}

:root[data-theme="light"] .privacy-policy-hero,
:root[data-theme="light"] .privacy-policy-footer {
    background:
        radial-gradient(circle at top right, rgba(29, 183, 207, 0.16), transparent 34%),
        radial-gradient(circle at 12% 22%, rgba(255, 145, 99, 0.12), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.99));
    box-shadow: 0 22px 52px rgba(38, 68, 104, 0.16);
}

:root[data-theme="light"] .privacy-policy-badge,
:root[data-theme="light"] .privacy-policy-language-switch {
    border-color: rgba(72, 97, 122, 0.14);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .privacy-policy-badge strong {
    color: var(--accent-soft);
}

:root[data-theme="light"] .privacy-policy-language-button.is-active {
    background: linear-gradient(135deg, rgba(29, 183, 207, 0.18), rgba(255, 145, 99, 0.14));
}

.document-action-button {
    min-height: 2.25rem;
    padding: 0.52rem 0.9rem;
    border-radius: 0.95rem;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
}

.document-action-button.is-danger {
    border-color: rgba(255, 123, 123, 0.24);
}

.document-share-editor .card-actions {
    justify-content: flex-start;
}

@media (max-width: 1100px) {
    .invoice-editor-grid {
        grid-template-columns: 1fr;
    }

    .invoice-side-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .invoice-field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .privacy-policy-summary-grid,
    .privacy-policy-sections {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1700px) {
    .app-shell.has-sidebar.sidebar-open .budget-editor-grid,
    html[data-portal-sidebar="open"] .app-shell.has-sidebar .budget-editor-grid {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

@media (max-width: 1460px) {
    .app-shell.has-sidebar.sidebar-open .budget-editor-grid,
    html[data-portal-sidebar="open"] .app-shell.has-sidebar .budget-editor-grid {
        grid-template-columns: 1fr;
    }

    .app-shell.has-sidebar.sidebar-open .budget-editor-grid .invoice-side-column,
    html[data-portal-sidebar="open"] .app-shell.has-sidebar .budget-editor-grid .invoice-side-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1500px) {
    .app-shell.has-sidebar.sidebar-open .budget-editor-grid .invoice-field-grid,
    html[data-portal-sidebar="open"] .app-shell.has-sidebar .budget-editor-grid .invoice-field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-shell.has-sidebar.sidebar-open .budget-editor-grid .invoice-line-row,
    html[data-portal-sidebar="open"] .app-shell.has-sidebar .budget-editor-grid .invoice-line-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .invoice-filter-grid,
    .invoice-field-grid,
    .invoice-preview-party-grid,
    .invoice-side-column,
    .document-share-fields {
        grid-template-columns: 1fr;
    }

    .invoice-fiscal-grid,
    .invoice-fiscal-chart-row,
    .invoice-fiscal-metrics,
    .invoice-fiscal-annual-main,
    .invoice-fiscal-annual-metrics {
        grid-template-columns: 1fr;
    }

    .invoice-fiscal-report-table {
        overflow-x: auto;
    }

    .invoice-fiscal-report-row {
        min-width: 720px;
    }

    .invoice-fiscal-client-detail summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .invoice-fiscal-client-donut-row {
        grid-template-columns: 1fr;
    }

    .invoice-fiscal-client-donut-shell {
        min-height: 220px;
    }

    .invoice-fiscal-client-donut {
        width: min(220px, 100%);
    }

    .invoice-fiscal-invoice-list {
        overflow-x: auto;
    }

    .invoice-fiscal-invoice-list > div {
        min-width: 560px;
    }

    .invoice-quarter-group summary {
        align-items: flex-start;
        flex-direction: column;
        padding-left: 3.5rem;
        position: relative;
    }

    .invoice-filter-panel > summary {
        align-items: flex-start;
        flex-direction: column;
        padding-left: 3.5rem;
        position: relative;
    }

    .invoice-quarter-group summary::before,
    .invoice-filter-panel > summary::before {
        position: absolute;
        top: 1rem;
        left: 1rem;
    }

    .invoice-filter-summary-meta {
        justify-content: flex-start;
        min-width: 0;
        text-align: left;
        width: 100%;
    }

    .invoice-filter-content {
        padding: 0 1rem 1rem;
    }

    .invoice-filter-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

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

    .invoice-quarter-group-totals {
        justify-content: flex-start;
        text-align: left;
    }

    .invoice-filter-search,
    .invoice-field-wide {
        grid-column: span 1;
    }

    .invoice-line-row {
        grid-template-columns: 1fr;
    }

    .invoice-preview-header,
    .invoice-preview-footer,
    .invoice-list-card,
    .document-list-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .document-card-top,
    .document-card-actions {
        justify-content: flex-start;
    }

    .document-list-head {
        align-items: stretch;
    }

    .document-search-box {
        width: 100%;
    }

    .document-type-group > summary,
    .document-client-group > summary {
        align-items: flex-start;
        flex-direction: column;
        position: relative;
    }

    .document-type-group > summary {
        padding-left: 3.5rem;
    }

    .document-client-group > summary {
        padding-left: 3.1rem;
    }

    .document-type-group > summary::before,
    .document-client-group > summary::before {
        position: absolute;
        left: 1rem;
    }

    .document-type-group > summary::before {
        top: 1rem;
    }

    .document-client-group > summary::before {
        top: 0.9rem;
    }

    .document-type-summary-meta {
        justify-content: flex-start;
        text-align: left;
    }

    .document-viewer-toolbar {
        grid-template-columns: auto 1fr;
    }

    .document-viewer-download {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }

    .document-viewer-frame-card {
        min-height: 68dvh;
        border-radius: 0.95rem;
    }

    .document-viewer-frame {
        height: 72dvh;
    }

    .invoice-preview-meta,
    .invoice-preview-totals {
        width: 100%;
    }

    .privacy-policy-shell {
        padding: 1rem;
    }

    .privacy-policy-toolbar,
    .privacy-policy-footer,
    .privacy-policy-toolbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .privacy-policy-summary-grid,
    .privacy-policy-sections {
        grid-template-columns: 1fr;
    }

    .privacy-policy-language-switch {
        width: fit-content;
    }

    .privacy-policy-meta {
        flex-direction: column;
    }

    .privacy-policy-badge {
        width: 100%;
        justify-content: flex-start;
        border-radius: 1.1rem;
    }

    .privacy-policy-hero-copy h1,
    .privacy-policy-footer h2 {
        line-height: 1.02;
    }

    .android-update-timeline-head,
    .android-update-timeline-top,
    .android-update-timeline-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .android-update-timeline-group-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .android-update-timeline-head-pills {
        justify-content: flex-start;
    }

    .android-update-timeline-actions .ghost-button {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .android-update-delete-group-button {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 821px) and (hover: hover) and (pointer: fine) {
    :root:not([data-theme="light"]) .document-group-list > .document-type-group {
        background: rgba(8, 15, 27, 0.72) !important;
        background-image: none !important;
        box-shadow:
            0 18px 42px rgba(3, 8, 20, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.035);
        transform: translateZ(0);
        isolation: isolate;
    }

    :root:not([data-theme="light"]) .document-group-list > .document-type-group > summary {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0));
    }

    :root:not([data-theme="light"]) .document-group-list .document-client-group {
        background: rgba(10, 18, 32, 0.58) !important;
        background-image: none !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }

    :root:not([data-theme="light"]) .document-group-list .document-type-summary-meta span,
    :root:not([data-theme="light"]) .document-group-list .document-type-summary-meta strong {
        background: rgba(255, 255, 255, 0.045);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    }
}

.portal-offline-banner {
    position: fixed;
    left: calc(1rem + var(--safe-area-left));
    right: calc(1rem + var(--safe-area-right));
    bottom: calc(1rem + var(--safe-area-bottom));
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.1rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 191, 102, 0.26);
    border-radius: 1.1rem;
    background: rgba(28, 18, 10, 0.92);
    color: #ffe0ad;
    box-shadow: 0 18px 42px rgba(3, 8, 20, 0.3);
    backdrop-filter: blur(18px);
}

.portal-offline-banner strong,
.portal-offline-banner span {
    line-height: 1.35;
}

.portal-offline-banner span {
    color: rgba(255, 224, 173, 0.82);
    font-size: 0.9rem;
}

html.is-offline .portal-offline-banner {
    display: flex;
}

.portal-install-prompt[hidden] {
    display: none;
}

.portal-install-prompt {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: grid;
    align-items: end;
    justify-items: center;
    padding:
        calc(1rem + var(--safe-area-top))
        calc(1rem + var(--safe-area-right))
        calc(1rem + var(--safe-area-bottom))
        calc(1rem + var(--safe-area-left));
    background: rgba(3, 8, 20, 0.58);
    backdrop-filter: blur(14px);
    animation: pwa-prompt-fade 0.2s ease;
}

.portal-install-sheet {
    position: relative;
    width: min(100%, 27rem);
    overflow: hidden;
    padding: 1.15rem;
    border: 1px solid rgba(121, 168, 181, 0.2);
    border-radius: 1.35rem;
    background:
        linear-gradient(145deg, rgba(13, 23, 37, 0.98), rgba(7, 13, 24, 0.98));
    color: var(--text);
    box-shadow: 0 24px 70px rgba(3, 8, 20, 0.46);
    animation: pwa-prompt-rise 0.24s ease;
}

.portal-install-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid rgba(121, 168, 181, 0.18);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}

.portal-install-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: center;
    padding-right: 2.6rem;
}

.portal-install-icon {
    display: grid;
    place-items: center;
    width: 4.15rem;
    height: 4.15rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.portal-install-icon img {
    width: 3.55rem;
    height: 3.55rem;
    border-radius: 0.9rem;
    box-shadow: 0 10px 24px rgba(3, 8, 20, 0.28);
}

.portal-install-kicker {
    margin: 0 0 0.25rem;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-install-sheet h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.08;
}

.portal-install-copy {
    margin: 1rem 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.portal-install-steps {
    display: grid;
    gap: 0.65rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: install-step;
}

.portal-install-steps[hidden] {
    display: none;
}

.portal-install-steps li {
    counter-increment: install-step;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: center;
    min-height: 2.7rem;
    padding: 0.72rem 0.8rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.portal-install-steps li::before {
    content: counter(install-step);
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: rgba(126, 242, 255, 0.13);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.82rem;
}

.portal-install-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.portal-install-actions .primary-button[hidden] {
    display: none;
}

.portal-install-actions .primary-button[hidden] + .ghost-button {
    grid-column: 1 / -1;
}

html.has-pwa-install-prompt body {
    overflow: hidden;
}

.url-directory-page {
    gap: 1.2rem;
}

.url-directory-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.45rem;
    border: 1px solid rgba(126, 242, 255, 0.16);
    border-radius: 1.4rem;
    background:
        linear-gradient(135deg, rgba(126, 242, 255, 0.12), rgba(255, 156, 102, 0.08)),
        rgba(8, 15, 27, 0.78);
    box-shadow: 0 20px 48px rgba(3, 8, 20, 0.34);
    overflow: hidden;
}

.url-directory-hero h2 {
    max-width: 760px;
    margin-bottom: 0.65rem;
    font-size: clamp(1.45rem, 2vw, 2.2rem);
    letter-spacing: 0;
}

.url-directory-hero p {
    max-width: 820px;
}

.url-directory-hero .section-kicker {
    margin-bottom: 0;
}

.url-directory-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    gap: 0.75rem;
    min-width: min(420px, 100%);
}

.url-directory-metrics > div {
    display: grid;
    align-content: center;
    gap: 0.3rem;
    min-height: 7rem;
    padding: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.16);
    border-radius: 1rem;
    background: rgba(6, 12, 22, 0.54);
}

.url-directory-metrics strong {
    font-family: var(--display);
    font-size: 2rem;
}

.url-directory-metrics span {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.url-directory-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.url-directory-form-panel {
    position: sticky;
    top: 1rem;
}

.url-directory-list-head {
    align-items: end;
}

.url-directory-search {
    display: grid;
    gap: 0.45rem;
    min-width: min(320px, 100%);
}

.url-directory-search span {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.url-environment-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.url-environment-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.65rem 0.95rem;
    border: 1px solid rgba(121, 168, 181, 0.18);
    border-radius: 0.9rem;
    background: rgba(8, 15, 27, 0.62);
    color: var(--text);
    font-weight: 800;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

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

.url-environment-button.is-selected {
    border-color: rgba(126, 242, 255, 0.32);
    background: linear-gradient(135deg, rgba(126, 242, 255, 0.18), rgba(255, 156, 102, 0.12));
    color: white;
}

.url-environment-picker span {
    display: inline-flex;
    align-items: center;
    min-height: 2.65rem;
    padding: 0.65rem 0.9rem;
    border: 1px dashed rgba(126, 242, 255, 0.24);
    border-radius: 0.9rem;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
}

.url-client-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.url-client-card {
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(121, 168, 181, 0.14);
    border-radius: 1.15rem;
    background: rgba(8, 15, 27, 0.58);
}

.url-client-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.url-client-card header span,
.url-client-card header small,
.url-empty-line {
    color: var(--text-muted);
}

.url-client-card header span {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.url-client-card header strong {
    display: block;
    font-family: var(--display);
    font-size: 1.15rem;
    letter-spacing: 0;
}

.url-card-count {
    display: grid;
    justify-items: center;
    min-width: 4.5rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.9rem;
    background: rgba(126, 242, 255, 0.1);
}

.url-card-count strong {
    font-size: 1.35rem;
}

.url-link-list {
    display: grid;
    gap: 0.8rem;
}

.url-link-card {
    display: grid;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.95rem;
    border: 1px solid rgba(121, 168, 181, 0.12);
    border-radius: 1rem;
    background: rgba(5, 10, 19, 0.45);
}

.url-link-card.is-favorite {
    border-color: rgba(255, 156, 102, 0.34);
    background:
        linear-gradient(135deg, rgba(255, 156, 102, 0.1), transparent 54%),
        rgba(5, 10, 19, 0.48);
}

.url-link-top,
.url-link-actions,
.url-client-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.url-link-top {
    justify-content: space-between;
}

.url-env-pill,
.url-key-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.url-env-pill {
    background: rgba(88, 166, 255, 0.13);
    color: #a5d7ff;
}

.url-env-pill.is-production {
    background: rgba(95, 213, 166, 0.15);
    color: #9ef1ca;
}

.url-key-badge {
    margin-left: 0.35rem;
    background: rgba(255, 156, 102, 0.16);
    color: #ffd0b6;
}

.url-link-title {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-family: var(--display);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0;
}

.url-link-host,
.url-link-notes {
    overflow-wrap: anywhere;
}

.url-link-host {
    color: var(--accent);
    font-size: 0.9rem;
}

.url-link-notes {
    font-size: 0.92rem;
}

.url-link-card small {
    color: var(--text-muted);
}

.url-icon-button,
.url-link-actions .ghost-button,
.url-client-actions .ghost-button {
    padding: 0.62rem 0.85rem;
    font-size: 0.82rem;
}

.ghost-button.is-danger {
    border-color: rgba(255, 123, 123, 0.28);
    color: #ffb2b2;
}

:root[data-theme="light"] .url-directory-hero,
:root[data-theme="light"] .url-client-card,
:root[data-theme="light"] .url-link-card {
    background-color: rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .url-directory-metrics > div,
:root[data-theme="light"] .url-card-count {
    background: rgba(238, 244, 251, 0.82);
}

@media (max-width: 1280px) {
    .url-directory-hero,
    .url-directory-layout {
        grid-template-columns: 1fr;
    }

    .url-directory-form-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .url-directory-hero,
    .url-client-card,
    .url-link-card {
        border-radius: 1rem;
    }

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

    .url-directory-list-head,
    .url-client-card header,
    .url-link-top {
        align-items: stretch;
        flex-direction: column;
    }

    .url-directory-search,
    .url-link-top .card-actions,
    .url-link-top .ghost-button,
    .url-link-actions .ghost-button,
    .url-client-actions .ghost-button {
        width: 100%;
    }
}

.portal-pwa-zoom-control {
    position: fixed;
    top: calc(0.85rem + var(--safe-area-top));
    right: calc(0.85rem + var(--safe-area-right));
    z-index: 90;
    display: none;
    grid-template-columns: 2.45rem auto 2.45rem;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem;
    border: 1px solid rgba(121, 168, 181, 0.18);
    border-radius: 1.15rem;
    background: rgba(8, 15, 27, 0.82);
    box-shadow: 0 16px 38px rgba(3, 8, 20, 0.3);
    backdrop-filter: blur(18px);
    font-size: 16px;
}

.portal-pwa-zoom-control button {
    display: inline-grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    height: 2.45rem;
    border: 0;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.portal-pwa-zoom-control button:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

.portal-pwa-zoom-control button:not(:disabled):active {
    transform: scale(0.96);
}

.portal-pwa-zoom-value {
    gap: 0.1rem;
    min-width: 4.5rem;
    padding: 0 0.72rem;
}

.portal-pwa-zoom-value span {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
}

.portal-pwa-zoom-value strong {
    color: var(--accent);
    font-size: 0.92rem;
    line-height: 1.1;
}

html.is-pwa-standalone .portal-pwa-zoom-control {
    display: grid;
}

html.has-pwa-install-prompt .portal-pwa-zoom-control {
    display: none;
}

:root[data-theme="light"] .portal-pwa-zoom-control {
    border-color: rgba(72, 97, 122, 0.16);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 34px rgba(38, 68, 104, 0.16);
}

:root[data-theme="light"] .portal-pwa-zoom-control button {
    background: rgba(22, 35, 52, 0.055);
    color: #162334;
}

:root[data-theme="light"] .portal-pwa-zoom-value strong {
    color: #12879a;
}

html.is-pwa-standalone,
html.is-pwa-standalone body {
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

html.is-pwa-standalone body {
    background-color: var(--bg);
    zoom: var(--pwa-zoom, 1);
}

@media (max-width: 800px) {
    html.is-pwa-standalone .app-shell,
    html.is-pwa-standalone .main-content {
        min-height: 100dvh;
    }

    html.is-pwa-standalone .main-content {
        padding:
            calc(0.95rem + var(--safe-area-top))
            calc(0.95rem + var(--safe-area-right))
            calc(1.15rem + var(--safe-area-bottom))
            calc(0.95rem + var(--safe-area-left));
    }

    html.is-pwa-standalone .app-shell.has-sidebar .main-content,
    html.is-pwa-standalone .app-shell.has-sidebar.sidebar-collapsed .main-content {
        padding-top: calc(4.5rem + var(--safe-area-top));
    }

    html.is-pwa-standalone .sidebar-toggle-button {
        top: calc(0.85rem + var(--safe-area-top));
        left: calc(0.85rem + var(--safe-area-left));
        width: 3.2rem;
        height: 3.2rem;
        border-radius: 1.05rem;
        background: rgba(8, 15, 27, 0.88);
        box-shadow: 0 14px 34px rgba(3, 8, 20, 0.28);
    }

    html.is-pwa-standalone .pwa-back-button {
        position: fixed;
        top: calc(0.85rem + var(--safe-area-top));
        left: calc(4.42rem + var(--safe-area-left));
        z-index: 70;
        display: grid;
        place-items: center;
        width: 3.2rem;
        height: 3.2rem;
        padding: 0;
        border: 1px solid rgba(121, 168, 181, 0.18);
        border-radius: 1.05rem;
        background: rgba(8, 15, 27, 0.88);
        color: var(--text);
        box-shadow: 0 14px 34px rgba(3, 8, 20, 0.28);
        backdrop-filter: blur(16px);
    }

    html.is-pwa-standalone .pwa-back-button span {
        display: block;
        font-size: 2.35rem;
        font-weight: 700;
        line-height: 0.8;
        transform: translateY(-0.08rem);
    }

    :root[data-theme="light"].is-pwa-standalone .pwa-back-button {
        border-color: rgba(72, 97, 122, 0.14);
        background: rgba(255, 255, 255, 0.92);
        color: #162334;
        box-shadow: 0 14px 28px rgba(38, 68, 104, 0.14);
    }

    html.is-pwa-standalone .sidebar {
        width: min(100vw, 420px);
        padding:
            calc(5.2rem + var(--safe-area-top))
            calc(1.05rem + var(--safe-area-right))
            calc(2rem + var(--safe-area-bottom))
            calc(1.05rem + var(--safe-area-left));
        border-right: 1px solid rgba(121, 168, 181, 0.14);
        border-radius: 0 1.35rem 1.35rem 0;
        background: rgba(5, 10, 19, 0.92);
    }

    html.is-pwa-standalone .sidebar-backdrop {
        background: rgba(3, 8, 20, 0.62);
        backdrop-filter: blur(4px);
    }

    html.is-pwa-standalone .page-shell {
        gap: 0.95rem;
    }

    html.is-pwa-standalone .page-header {
        padding: 1.15rem;
    }

    html.is-pwa-standalone .panel-card {
        padding: 1rem;
    }

    html.is-pwa-standalone .page-header h1 {
        font-size: clamp(1.65rem, 9vw, 2.35rem);
        line-height: 1.05;
    }

    html.is-pwa-standalone .section-head {
        gap: 0.85rem;
    }

    html.is-pwa-standalone .url-directory-page {
        gap: 0.85rem;
    }

    html.is-pwa-standalone .url-directory-hero {
        gap: 0.9rem;
        padding: 1rem;
        border-radius: 1.1rem;
    }

    html.is-pwa-standalone .url-directory-hero h2 {
        font-size: clamp(1.25rem, 7vw, 1.75rem);
        line-height: 1.12;
    }

    html.is-pwa-standalone .url-directory-hero p {
        font-size: 0.92rem;
        line-height: 1.5;
    }

    html.is-pwa-standalone .url-directory-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
    }

    html.is-pwa-standalone .url-directory-metrics > div {
        min-height: 4.8rem;
        padding: 0.65rem 0.5rem;
        border-radius: 0.85rem;
    }

    html.is-pwa-standalone .url-directory-metrics strong {
        font-size: 1.35rem;
    }

    html.is-pwa-standalone .url-directory-metrics span {
        font-size: 0.66rem;
        letter-spacing: 0.05em;
    }

    html.is-pwa-standalone .url-directory-layout,
    html.is-pwa-standalone .url-client-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    html.is-pwa-standalone .url-directory-form-panel {
        position: static;
    }

    html.is-pwa-standalone .url-client-card,
    html.is-pwa-standalone .url-link-card {
        padding: 0.85rem;
        border-radius: 1rem;
    }

    html.is-pwa-standalone .url-link-title,
    html.is-pwa-standalone .url-link-host,
    html.is-pwa-standalone .url-link-notes {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    html.is-pwa-standalone .url-link-top .card-actions,
    html.is-pwa-standalone .url-link-actions,
    html.is-pwa-standalone .url-client-actions,
    html.is-pwa-standalone .url-environment-picker {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    html.is-pwa-standalone .url-link-top .ghost-button,
    html.is-pwa-standalone .url-link-actions .ghost-button,
    html.is-pwa-standalone .url-client-actions .ghost-button,
    html.is-pwa-standalone .url-environment-button,
    html.is-pwa-standalone .url-environment-picker span {
        width: 100%;
        padding-inline: 0.7rem;
    }

    html.is-pwa-standalone input,
    html.is-pwa-standalone select,
    html.is-pwa-standalone textarea {
        min-height: 3rem;
        border-radius: 1rem;
        font-size: 1rem;
    }

    html.is-pwa-standalone .primary-button,
    html.is-pwa-standalone .ghost-button {
        min-height: 2.9rem;
        border-radius: 1rem;
        justify-content: center;
    }

    html.is-pwa-standalone .card-actions {
        gap: 0.6rem;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table {
        max-height: min(58dvh, 28rem);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-x pan-y;
        scrollbar-width: thin;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row {
        grid-template-columns:
            minmax(9rem, 1.45fr)
            minmax(4rem, 0.5fr)
            repeat(4, minmax(6.2rem, 0.85fr));
        width: 100%;
        min-width: 42rem;
        column-gap: 0;
        padding: 0.58rem 0.5rem;
        border-bottom: 0;
        box-sizing: border-box;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row > * {
        min-width: 0;
        box-sizing: border-box;
        padding: 0 0.36rem;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row:not(.is-head):not(.is-total) > * {
        padding-top: 0.24rem;
        padding-bottom: 0.24rem;
        border-bottom: 1px solid rgba(121, 168, 181, 0.1);
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row:not(.is-head) > :first-child {
        display: block;
        text-align: left;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row > span {
        font-size: 0.68rem;
        white-space: nowrap;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row strong {
        font-size: 0.7rem;
        line-height: 1.15;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-head {
        background: transparent;
        font-size: 0.56rem;
        letter-spacing: 0.05em;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-total {
        background: transparent;
        font-size: 0.58rem;
        letter-spacing: 0.04em;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-head > *,
    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-total > * {
        align-self: stretch;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-height: 2.15rem;
        background: rgba(255, 255, 255, 0.045);
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-head > :first-child,
    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-total > :first-child {
        justify-content: flex-start;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-head > * {
        color: var(--text);
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-total > * {
        color: #ffd166;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-head > :first-child,
    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-total > :first-child {
        border-radius: 0.9rem 0 0 0.9rem;
        padding-left: 0.42rem;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-head > :last-child,
    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-total > :last-child {
        border-radius: 0 0.9rem 0.9rem 0;
        padding-right: 0.42rem;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-total span {
        font-size: 0.62rem;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-head > span,
    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row:not(.is-head) > span {
        text-align: right;
    }

    html.is-pwa-standalone .invoice-fiscal-report-panel > .invoice-fiscal-report-table .invoice-fiscal-report-row.is-total > :first-child {
        color: #ffd166;
        font-size: 0.72rem;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-panel {
        gap: 0.85rem;
        padding: 0.8rem;
        border-radius: 1rem;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-panel .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-panel .section-head h3 {
        font-size: 1rem;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-panel .section-head > strong {
        white-space: normal;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-shell {
        min-height: 210px;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut {
        width: min(210px, 82vw);
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-core {
        padding: 0 2.4rem;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-core strong {
        font-size: clamp(1.35rem, 8vw, 1.9rem);
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-item {
        padding: 0.75rem 0.8rem;
        border-radius: 0.9rem;
    }

    html.is-pwa-standalone .invoice-fiscal-client-donut-item small {
        font-size: 0.82rem;
    }

    html.is-pwa-standalone .request-feedback-banner {
        top: calc(0.8rem + var(--safe-area-top));
        left: calc(0.8rem + var(--safe-area-left));
        right: calc(0.8rem + var(--safe-area-right));
        max-width: none;
        border-radius: 1rem;
        justify-content: center;
    }

    html.is-pwa-standalone .portal-reconnect-card {
        width: min(100%, 24rem);
        border-radius: 1.25rem;
    }
}

@media (min-width: 801px) {
    .portal-install-prompt {
        display: none;
    }
}

@keyframes pwa-prompt-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pwa-prompt-rise {
    from {
        opacity: 0;
        transform: translateY(1.25rem) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
