@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #070913;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #aab4be;
    --accent-green: #00e676;
    --accent-red: #ff1744;
    --accent-blue: #00d4ff;
    --accent-scheduled: #c77dff;
    --font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Orbs */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: drift 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.6), rgba(76, 29, 149, 0));
    top: -10%;
    left: -10%;
    animation-duration: 25s;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.6), rgba(15, 23, 42, 0));
    bottom: -20%;
    right: -10%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4), rgba(6, 78, 59, 0));
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 40px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Container */
.app-container {
    max-width: 1800px;
    width: min(95%, 100%);
    margin: 20px auto 40px auto;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    min-width: 0;
    overflow-x: clip;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 40px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.dashboard-grid > .card[id^="widget-"] {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.dashboard-density-compact .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 28px;
}

body.dashboard-density-compact .dashboard-grid > .card[id^="widget-"] {
    padding: 24px;
}

body.dashboard-density-comfortable .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

body.dashboard-density-comfortable .dashboard-grid > .card[id^="widget-"] {
    padding: 32px;
}

body.dashboard-density-spacious .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
    gap: 52px;
}

body.dashboard-density-spacious .dashboard-grid > .card[id^="widget-"] {
    padding: 40px;
}

body.dashboard-density-spacious .dashboard-grid > .card[id^="widget-"] .widget-title {
    margin-bottom: 24px;
}

body.dashboard-density-spacious .stats-grid,
body.dashboard-density-spacious .money-counter-stage,
body.dashboard-density-spacious .cut-stats,
body.dashboard-density-spacious .history-list {
    gap: 20px;
}

body.dashboard-density-spacious .stat-item,
body.dashboard-density-spacious .history-item,
body.dashboard-density-spacious .cut-stat-layer {
    padding: 24px;
}

@media (max-width: 768px) {
    .app-container {
        width: 100%;
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    .dashboard-grid,
    body.dashboard-density-compact .dashboard-grid,
    body.dashboard-density-comfortable .dashboard-grid,
    body.dashboard-density-spacious .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
    }

    .dashboard-grid > .card[id^="widget-"],
    .card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

.hide-widget-titles .widget-title {
    display: none !important;
}

/* Removed antigravity floating animation for cards */
@keyframes antigravity {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Glassmorphism Card Style */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.4s ease, border-color 0.4s ease, filter 0.4s ease;
}

.card:hover {
    animation-play-state: paused;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: var(--card-border);
}

.hidden {
    display: none !important;
}

/* Auth Section */
#auth-section {
    text-align: center;
    margin-top: 50px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#auth-section h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a0aab2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

#auth-section p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Header */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 25px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.user-header span {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Controls */
.controls {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.input-group label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input:not([type="range"]),
.input-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 15px;
    border-radius: 12px;
    text-align: center;
    font-size: 1rem;
    width: 180px;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.input-group input[type="date"],
.tc-date-bought-input {
    color-scheme: dark;
}

.input-group input[type="date"]::-webkit-calendar-picker-indicator,
.tc-date-bought-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(1) opacity(0.7);
}

.input-group input[type="date"]::-webkit-calendar-picker-indicator:hover,
.tc-date-bought-input::-webkit-calendar-picker-indicator:hover {
    filter: invert(1) opacity(1);
}

.input-group input:not([type="range"]):focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.time-range-preview {
    margin: 6px 0 0;
    color: #fcd34d;
    font-size: 0.88rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}

.time-range-preview.hidden {
    display: none;
}

.timer-preview-banner {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(252, 211, 77, 0.35);
    background: rgba(252, 211, 77, 0.08);
    color: #fcd34d;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.timer-preview-banner.hidden {
    display: none;
}

.timer-widget.timer-widget-pending .timer-display {
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px 12px 12px;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.02);
}

.timer-widget.timer-widget-pending #timer {
    color: var(--text-secondary);
    text-shadow: none;
}

.timer-widget.timer-widget-pending .highlight-text.is-preview {
    flex-wrap: wrap;
    gap: 8px 12px;
    opacity: 0.92;
}

.timer-widget.timer-widget-pending .highlight-text.is-preview .after-cut {
    color: var(--text-secondary);
    font-weight: 600;
}

.timer-preview-earnings-note {
    flex: 1 1 100%;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fcd34d;
    text-align: center;
}

.preview-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fcd34d;
    background: rgba(252, 211, 77, 0.12);
    border: 1px solid rgba(252, 211, 77, 0.35);
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-family);
    vertical-align: middle;
}

.preview-indicator.hidden {
    display: none !important;
}

.touch-picker {
    font-size: 0.85rem !important;
    padding: 6px 10px !important;
    background: rgba(0, 212, 255, 0.1) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    cursor: pointer;
    color: var(--accent-blue) !important;
}

.touch-picker:hover {
    background: rgba(0, 212, 255, 0.15) !important;
}

.timer-display {
    margin: 30px 0;
    position: relative;
}

.timer-shift-remaining {
    display: block;
    margin-top: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.timer-shift-remaining.is-over-target {
    color: var(--accent-red);
}

#timer {
    font-size: 4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    display: block;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.highlight-text {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.highlight-text .before-cut {
    color: var(--text-primary);
    font-weight: 500;
}

.highlight-text .after-cut {
    color: var(--accent-green);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.35);
}

.highlight-text .after-personal-cut {
    color: var(--accent-blue);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.32);
}

.highlight-text .cut-divider {
    color: rgba(255, 255, 255, 0.15);
    font-weight: 300;
}

.money-counter-widget {
    position: relative;
    overflow: hidden;
}

.money-counter-widget::after {
    content: "";
    position: absolute;
    inset: auto -20% -35% -20%;
    height: 55%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 230, 118, 0.18), transparent 62%);
    pointer-events: none;
}

.money-counter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
}

.money-counter-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.money-counter-gap-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.money-counter-gap-control label {
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.money-counter-gap-control span {
    color: var(--accent-green, #00e676);
    font-variant-numeric: tabular-nums;
}

.money-counter-gap-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 20px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    cursor: pointer;
}

.money-counter-gap-slider:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.money-counter-gap-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    transition: background 0.2s;
}

.money-counter-gap-slider:hover::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.25);
}

.money-counter-gap-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--accent-green, #00e676);
    box-shadow: 0 0 6px rgba(0, 230, 118, 0.5);
    transition: transform 0.1s, box-shadow 0.1s;
}

.money-counter-gap-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.8);
}

.money-counter-gap-slider::-moz-range-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    border: none;
}

.money-counter-gap-slider:hover::-moz-range-track {
    background: rgba(255, 255, 255, 0.25);
}

.money-counter-gap-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: var(--accent-green, #00e676);
    box-shadow: 0 0 6px rgba(0, 230, 118, 0.5);
    transition: transform 0.1s, box-shadow 0.1s;
    cursor: pointer;
}

.money-counter-gap-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.8);
}

.money-counter-mode-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.money-counter-mode-field-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.money-counter-mode-select {
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    max-width: 100%;
    width: 13.5rem;
    padding: 8px 34px 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-color: rgba(0, 0, 0, 0.35);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23aab4be' d='M1.2 1.2 6 6.1 10.8 1.2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 7px;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.2;
    color-scheme: dark;
    cursor: pointer;
}

.money-counter-mode-select:hover,
.money-counter-mode-select:focus {
    border-color: rgba(0, 212, 255, 0.45);
    outline: none;
}

.money-counter-mode-select:focus-visible {
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.28);
}

.money-counter-status {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 6px 10px;
    text-transform: uppercase;
}

.money-counter-active .money-counter-status {
    background: rgba(0, 230, 118, 0.14);
    border-color: rgba(0, 230, 118, 0.38);
    color: var(--accent-green);
    box-shadow: 0 0 18px rgba(0, 230, 118, 0.22);
}

.money-counter-total {
    color: var(--accent-green);
    font-size: clamp(2.1rem, 7vw, 4.3rem);
    font-weight: 800;
    line-height: 0.95;
    margin: 6px 0 10px;
    text-shadow: 0 0 22px rgba(0, 230, 118, 0.28);
}

.money-counter-time {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 10px;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}

.money-counter-session {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 12px;
}

.money-counter-session-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 650;
}

.money-counter-session-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    min-width: 4.4rem;
}

.money-counter-session-value {
    font-variant-numeric: tabular-nums;
}

.money-counter-session-remaining {
    color: var(--accent-scheduled);
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.money-counter-active .money-counter-session-remaining {
    color: var(--accent-green);
}

.neighbor-day-widget {
    position: relative;
    overflow: hidden;
}

.neighbor-day-yesterday::after,
.neighbor-day-tomorrow::after {
    content: "";
    position: absolute;
    inset: auto -24% -40% -24%;
    height: 58%;
    pointer-events: none;
}

.neighbor-day-yesterday::after {
    background: radial-gradient(circle at 50% 50%, rgba(0, 230, 118, 0.16), transparent 64%);
}

.neighbor-day-tomorrow::after {
    background: radial-gradient(circle at 50% 50%, rgba(199, 125, 255, 0.16), transparent 64%);
}

.neighbor-day-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.neighbor-day-header-copy {
    min-width: 0;
}

.neighbor-day-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.4;
}

.neighbor-day-badge {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.neighbor-day-yesterday .neighbor-day-badge {
    color: var(--accent-green);
    border-color: rgba(0, 230, 118, 0.28);
}

.neighbor-day-tomorrow .neighbor-day-badge {
    color: var(--accent-scheduled);
    border-color: rgba(199, 125, 255, 0.28);
}

.neighbor-day-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.neighbor-day-date {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.neighbor-day-session {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

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

.neighbor-day-money-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 16px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.neighbor-day-money-card .label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.neighbor-day-money-card .value {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.neighbor-day-money-card.is-before .value {
    color: var(--accent-blue);
}

.neighbor-day-money-card.is-after .value {
    color: var(--accent-green);
}

.neighbor-day-tomorrow .neighbor-day-money-card.is-after .value {
    color: var(--accent-scheduled);
}

.neighbor-day-money-note {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 650;
}

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

.neighbor-day-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.neighbor-day-stat .label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.neighbor-day-stat .value {
    font-size: 0.98rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.neighbor-day-hint {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.neighbor-day-empty {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .neighbor-day-money,
    .neighbor-day-stats {
        grid-template-columns: 1fr;
    }

    .neighbor-day-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.money-counter-mode-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 18px;
    text-transform: uppercase;
}

.money-counter-stage {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    min-height: 420px;
    perspective: 900px;
}

.money-stack {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 420px;
    align-items: flex-end;
    justify-content: center;
    transform-style: preserve-3d;
    cursor: pointer;
    --active-gap-scale: var(--stack-gap-scale, 1.0);
}

.money-stack:hover {
    --active-gap-scale: calc(var(--stack-gap-scale, 1.0) * 1.8) !important;
}

.money-counter-widget:active .money-stack {
    --active-gap-scale: calc(var(--stack-gap-scale, 1.0) * 1.8) !important;
}

.money-stack-pieces {
    position: absolute;
    bottom: 80px;
    left: 50%;
    width: 160px;
    height: 280px;
    transform: translateX(-50%) rotateX(62deg);
    transform-origin: center bottom;
    transform-style: preserve-3d;
}

.money-stack-coin-small .money-stack-pieces {
    width: 110px;
}

.money-stack-coin-large .money-stack-pieces {
    width: 130px;
}

.money-stack-note .money-stack-pieces {
    width: 200px;
}

.money-piece {
    position: absolute;
    left: 50%;
    display: grid;
    place-items: center;
    transform-origin: center;
    will-change: transform;
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), bottom 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.money-piece em {
    display: none;
}

@keyframes coinDrop {
    0% {
        transform: translate(calc(-50% + var(--dx, 0px)), -180px) translateZ(calc((var(--i) * var(--piece-gap-z) + 120px) * var(--active-gap-scale, 1))) rotateZ(calc(var(--rot, 0deg) - 25deg)) rotateY(-30deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px)) translateZ(calc(var(--i) * var(--piece-gap-z) * var(--active-gap-scale, 1))) rotateZ(var(--rot, 0deg));
        opacity: 1;
    }
}

@keyframes noteDrop {
    0% {
        transform: translate(calc(-50% + var(--dx, 0px)), -220px) translateZ(calc((var(--i) * var(--piece-gap-z) + 140px) * var(--active-gap-scale, 1))) rotateZ(calc(var(--rot, 0deg) + 35deg)) rotateX(-15deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px)) translateZ(calc(var(--i) * var(--piece-gap-z) * var(--active-gap-scale, 1))) rotateZ(var(--rot, 0deg));
        opacity: 1;
    }
}

@keyframes wobblePiece {
    0% {
        transform: translateZ(6px) rotateZ(-4deg) rotateY(-7deg) rotateX(-3.5deg);
    }
    50% {
        transform: translateZ(0px) rotateZ(0deg) rotateY(0deg) rotateX(0deg);
    }
    100% {
        transform: translateZ(6px) rotateZ(4deg) rotateY(7deg) rotateX(3.5deg);
    }
}

.money-piece.coin {
    --piece-gap-z: calc(2.2px * var(--coin-scale, 1.2));
    border-radius: 50%;
    bottom: calc(var(--i) * 5px * var(--coin-scale, 1.2) * var(--active-gap-scale, 1));
    transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px)) translateZ(calc(var(--i) * var(--piece-gap-z) * var(--active-gap-scale, 1))) rotateZ(var(--rot, 0deg));
    animation: coinDrop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.2) both;
}

.money-stack-pieces .money-piece.coin:last-child {
    animation: 
        coinDrop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.2) both, 
        wobblePiece 4s ease-in-out infinite alternate 0.5s;
    animation-composition: replace, add;
}

.money-piece.coin-small {
    --coin-scale: 1.2;
    width: 92px;
    height: 92px;
    background: url('/assets/images/Cash-Images/20p.webp') no-repeat center/contain;
    background-color: transparent;
}

.money-piece.coin-large {
    --coin-scale: 1.7;
    width: 116px;
    height: 116px;
    background: url('/assets/images/Cash-Images/1_Pound.webp') no-repeat center/contain;
    background-color: transparent;
}

.money-piece.note {
    --piece-gap-z: calc(1.4px * 2);
    width: 184px;
    height: 88px;
    bottom: calc(var(--i) * 3px * 2 * var(--active-gap-scale, 1));
    transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px)) translateZ(calc(var(--i) * var(--piece-gap-z) * var(--active-gap-scale, 1))) rotateZ(var(--rot, 0deg));
    background: url('/assets/images/Cash-Images/10_Pound_Single_Note.webp') no-repeat center/contain;
    background-color: transparent;
    border: none;
    animation: noteDrop 0.55s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.money-stack-pieces .money-piece.note:last-child {
    animation: 
        noteDrop 0.55s cubic-bezier(0.23, 1, 0.32, 1) both, 
        wobblePiece 4s ease-in-out infinite alternate 0.6s;
    animation-composition: replace, add;
}

.money-stack-base {
    display: none;
}

.money-stack-coin-small .money-stack-base {
    width: 120px;
    height: 30px;
}

.money-stack-coin-large .money-stack-base {
    width: 145px;
    height: 35px;
}

.money-stack-note .money-stack-base {
    width: 220px;
    height: 40px;
}

.money-stack-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 5;
}

.money-stack-label span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.money-stack-label strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-top: 4px;
}

.money-stack-more {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 800;
    padding: 4px 8px;
    transform: translateX(45px) rotateX(-62deg);
}

.money-stack-coin-large .money-stack-more {
    transform: translateX(58px) rotateX(-62deg);
}

.money-stack-note .money-stack-more {
    transform: translateX(92px) rotateX(-62deg);
}

@media (max-width: 640px) {
    .money-counter-header {
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 8px;
    }

    .money-counter-header-actions {
        justify-content: flex-end;
        width: auto;
    }

    .money-counter-mode-field {
        width: 100%;
        justify-content: flex-end;
    }

    .money-counter-mode-select {
        width: min(13.5rem, 100%);
        font-size: 0.8rem;
        padding: 7px 32px 7px 10px;
    }

    .money-counter-total {
        font-size: clamp(1.75rem, 9vw, 2.35rem);
        margin: 2px 0 4px;
    }

    .money-counter-time {
        font-size: 0.92rem;
        margin: 0 0 6px;
    }

    .money-counter-session {
        margin: 0 0 8px;
    }

    .money-counter-session-row {
        font-size: 0.84rem;
    }

    .money-counter-mode-label {
        font-size: 0.65rem;
        margin: 0 0 8px;
    }

    .money-counter-stage {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        min-height: 118px;
    }

    .money-stack {
        min-height: 118px;
    }

    .money-stack-pieces {
        width: 72px;
        height: 84px;
        bottom: 34px;
        transform: translateX(-50%) rotateX(56deg);
    }

    .money-stack-coin-small .money-stack-pieces {
        width: 54px;
    }

    .money-stack-coin-large .money-stack-pieces {
        width: 62px;
    }

    .money-stack-note .money-stack-pieces {
        width: 78px;
    }

    .money-piece.coin-small {
        --coin-scale: 0.55;
        width: 48px;
        height: 48px;
    }

    .money-piece.coin-large {
        --coin-scale: 0.75;
        width: 58px;
        height: 58px;
    }

    .money-piece.note {
        width: 72px;
        height: 34px;
    }

    .money-piece.coin {
        bottom: calc(var(--i) * 3px * var(--coin-scale, 1.2) * var(--active-gap-scale, 1));
    }

    .money-piece.note {
        bottom: calc(var(--i) * 2px * 2 * var(--active-gap-scale, 1));
    }

    .money-stack-label span {
        font-size: 0.56rem;
        letter-spacing: 0.3px;
    }

    .money-stack-label strong {
        font-size: 0.82rem;
        margin-top: 2px;
    }

    .money-stack-more {
        bottom: 8px;
        font-size: 0.62rem;
        padding: 2px 5px;
        transform: translateX(18px) rotateX(-56deg);
    }

    .money-stack-coin-large .money-stack-more {
        transform: translateX(22px) rotateX(-56deg);
    }

    .money-stack-note .money-stack-more {
        transform: translateX(28px) rotateX(-56deg);
    }

    .money-stack:hover,
    .money-counter-widget:active .money-stack {
        --active-gap-scale: var(--stack-gap-scale, 1.0) !important;
    }
}

@media (max-width: 420px) {
    .money-counter-stage {
        gap: 4px;
        min-height: 102px;
    }

    .money-stack {
        min-height: 102px;
    }

    .money-stack-pieces {
        width: 62px;
        height: 72px;
        bottom: 30px;
    }

    .money-stack-coin-small .money-stack-pieces {
        width: 46px;
    }

    .money-stack-coin-large .money-stack-pieces {
        width: 52px;
    }

    .money-stack-note .money-stack-pieces {
        width: 66px;
    }

    .money-piece.coin-small {
        --coin-scale: 0.48;
        width: 40px;
        height: 40px;
    }

    .money-piece.coin-large {
        --coin-scale: 0.65;
        width: 48px;
        height: 48px;
    }

    .money-piece.note {
        width: 62px;
        height: 30px;
    }

    .money-stack-label span {
        font-size: 0.52rem;
    }

    .money-stack-label strong {
        font-size: 0.76rem;
    }
}

/* Condensed Light Buttons */
button {
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    padding: 14px 28px;
    border-radius: 14px;
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    z-index: -1;
    opacity: 0.8;
}

button:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, #005bea 0%, #00c6fb 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 198, 251, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 12px 25px rgba(0, 198, 251, 0.5), 0 0 20px rgba(0, 198, 251, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    color: white;
    width: 100%;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(150, 201, 61, 0.3);
}

.btn-success:hover {
    box-shadow: 0 12px 25px rgba(150, 201, 61, 0.5), 0 0 20px rgba(150, 201, 61, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
    color: white;
    width: 100%;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(255, 8, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 12px 25px rgba(255, 8, 68, 0.5), 0 0 20px rgba(255, 8, 68, 0.4);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 0.95rem;
}

.btn-text::before {
    display: none;
}

.btn-text:hover {
    color: white;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 8px 18px;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.btn-outline::before {
    display: none;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Stats Grid */
.stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stats h2 {
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: 500;
    letter-spacing: 1px;
}

.stats-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats-header-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.stats-period-mode-hint {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
    max-width: 34rem;
}

.stats-period-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
}

.stats-period-mode-btn {
    min-height: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    padding: 7px 10px;
    text-transform: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
}

.stats-period-mode-btn::before {
    display: none;
}

.stats-period-mode-btn.active {
    background: rgba(0, 212, 255, 0.18);
    color: var(--accent-blue);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.16);
}

.work-pattern-widget {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.work-pattern-header-row {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.work-pattern-header-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.work-pattern-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.work-pattern-scroll::-webkit-scrollbar {
    width: 8px;
}

.work-pattern-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
}

.work-pattern-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.work-pattern-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

.work-pattern-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 12px;
}

.work-pattern-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 96px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    box-sizing: border-box;
}

.work-pattern-stat .label {
    font-size: 0.76rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.25;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-pattern-stat .value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.24);
    line-height: 1.15;
}

.work-pattern-stat .value.work-pattern-time {
    font-size: 1.35rem;
}

.work-pattern-subtext {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.25;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top: auto;
    width: 100%;
}

.work-pattern-subtext:empty {
    display: none;
}

@media (max-width: 640px) {
    .work-pattern-header-row {
        gap: 10px;
        margin-bottom: 10px;
    }

    .work-pattern-scroll {
        padding-right: 0;
    }

    .work-pattern-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .work-pattern-stat {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 2px 12px;
        min-height: 0;
        padding: 10px 12px;
        border-radius: 12px;
        text-align: left;
    }

    .work-pattern-stat .label {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        justify-content: flex-start;
        text-align: left;
        font-size: 0.72rem;
        letter-spacing: 0.35px;
        line-height: 1.25;
        text-transform: none;
    }

    .work-pattern-stat .value,
    .work-pattern-stat .value.work-pattern-time {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        text-align: right;
        font-size: 1.5rem;
        line-height: 1.1;
        white-space: nowrap;
    }

    .work-pattern-subtext:not(:empty) {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 0;
        justify-content: flex-start;
        text-align: left;
        font-size: 0.64rem;
        line-height: 1.2;
    }
}

@media (max-width: 420px) {
    .work-pattern-grid {
        gap: 5px;
    }

    .work-pattern-stat {
        padding: 9px 10px;
        gap: 2px 10px;
    }

    .work-pattern-stat .label {
        font-size: 0.68rem;
    }

    .work-pattern-stat .value,
    .work-pattern-stat .value.work-pattern-time {
        font-size: 1.38rem;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    text-align: center;
}

.stats-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.stats-grid-defaults {
    flex: 0 0 auto;
}

.stats-custom-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: clamp(180px, 32vh, 320px);
    overflow-y: auto;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-custom-scroll.hidden {
    display: none;
}

.stats-custom-scroll::-webkit-scrollbar {
    width: 8px;
}

.stats-custom-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
}

.stats-custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.stats-custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

.stat-item-custom {
    border-color: rgba(255, 255, 255, 0.08);
}

.settings-help-text {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
}

#widget-order-list .sortable-item {
    gap: 12px;
}

.widget-order-label {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.widget-visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.widget-visibility-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.widget-visibility-slider {
    display: none;
}

.custom-stats-periods-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-stats-period-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

.custom-stats-period-label {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
}

.custom-stats-period-meta {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-top: 2px;
}

.custom-stats-period-empty {
    margin: 0 0 14px;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

.custom-stats-period-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

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

.custom-stats-period-field label {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.custom-stats-period-field input,
.custom-stats-period-field select {
    width: 100%;
    box-sizing: border-box;
}

.stat-item {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.stat-item .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.stats-earnings-after,
.stats-earnings-before,
.stats-earnings-external {
    display: block;
}

.stat-item .value .stats-earnings-after {
    color: var(--accent-green);
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.24);
}

.stat-item .value .stats-earnings-after.stats-earnings-personal {
    color: var(--accent-blue);
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.24);
}

.stat-item .value .stats-earnings-before,
.stat-item .value .stats-earnings-external {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 6px;
    text-shadow: none;
}

.stats-hours-effective {
    display: block;
}

.stats-hours-gross,
.history-gross-duration {
    display: block;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 6px;
    text-shadow: none;
}

/* Breaks Widget */
.breaks-widget {
    border-color: rgba(255, 152, 0, 0.25);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.breaks-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.breaks-day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 152, 0, 0.06);
    border: 1px solid rgba(255, 152, 0, 0.16);
}

.breaks-day-nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.breaks-day-nav-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.breaks-day-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    flex-shrink: 0;
    border-color: rgba(255, 152, 0, 0.35) !important;
    color: #ff9800 !important;
}

.breaks-day-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.breaks-today-btn {
    padding: 0;
    font-size: 0.78rem;
    color: #ff9800 !important;
}

.breaks-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.breaks-summary-item {
    flex: 1;
    background: rgba(255, 152, 0, 0.08);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
}

.breaks-summary-item .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.breaks-summary-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff9800;
}

.breaks-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0 0 16px;
    line-height: 1.45;
}

.btn-break,
.btn-break-save {
    border-color: rgba(255, 152, 0, 0.45) !important;
    color: #ff9800 !important;
}

.btn-break-save {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
    color: #fff !important;
    border: none !important;
}

.break-history-item {
    border-color: rgba(255, 152, 0, 0.18);
    background: rgba(255, 152, 0, 0.04);
}

.break-history-item strong {
    color: #ff9800 !important;
}

.history-badge-break {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.35);
    color: #ffb74d;
}

.gantt-block.gantt-break {
    z-index: 3;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.08) 6px,
        transparent 6px,
        transparent 12px
    );
}

.gantt-block.gantt-pay {
    z-index: 1;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.1) 6px,
        transparent 6px,
        transparent 12px
    );
}

.gantt-block.gantt-scheduled {
    z-index: 1;
    opacity: 0.78;
    border: 1px dashed rgba(199, 125, 255, 0.55);
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.14),
        rgba(255, 255, 255, 0.14) 4px,
        transparent 4px,
        transparent 10px
    );
}

.break-modal-content {
    border-color: rgba(255, 152, 0, 0.25);
}

.cut-stats {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 0;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.cut-stats::-webkit-scrollbar {
    width: 6px;
}

.cut-stats::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.cut-stats::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.cut-stats::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.cut-stats-widget {
    display: flex;
    flex-direction: column;
    max-height: clamp(420px, 72vh, 780px);
    overflow: hidden;
}

.cut-stats-header-row {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0;
    margin-bottom: 18px;
    padding-bottom: 10px;
    gap: 15px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cut-stats-header-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cut-stats-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
}

.cut-stats-widget .widget-title {
    margin: 0;
}

.period-toggle-group {
    display: flex;
    gap: 8px;
}

.period-toggle-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-family: var(--font-family);
}

.period-toggle-btn::before {
    content: none;
    display: none;
}

.period-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.period-toggle-btn.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.cut-stats-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0 0 2px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.cut-stat-layer {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    padding: 14px;
    overflow: visible;
}

.cut-stat-header {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.cut-stat-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cut-stat-rate {
    color: var(--accent-red);
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255, 23, 68, 0.12);
    border: 1px solid rgba(255, 23, 68, 0.24);
    border-radius: 8px;
    padding: 4px 8px;
    white-space: nowrap;
}

.cut-stat-basis {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

.cut-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 10px;
}

.cut-stat-item {
    container-type: inline-size;
    min-width: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    padding: clamp(8px, 4cqw, 10px);
}

.cut-stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-size: clamp(0.58rem, 5cqw, 0.72rem);
    text-transform: uppercase;
    letter-spacing: 1px;
    letter-spacing: clamp(0.3px, 0.55cqw, 1px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cut-stat-money {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 48%);
    gap: 6px;
    align-items: baseline;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-size: clamp(0.58rem, 5.2cqw, 0.78rem);
    margin-top: 6px;
    margin-top: clamp(4px, 2.8cqw, 6px);
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.cut-stat-money span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cut-stat-money strong {
    color: var(--text-primary);
    min-width: 0;
    max-width: 100%;
    font-size: 0.9rem;
    font-size: clamp(0.54rem, calc(70cqw / var(--value-chars, 8)), 0.9rem);
    font-weight: 700;
    justify-self: end;
    line-height: 1;
    text-align: right;
    white-space: nowrap;
}

.cut-stat-after {
    margin-top: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cut-stat-after strong {
    color: var(--accent-green);
    font-size: 1.18rem;
    font-size: clamp(0.66rem, calc(76cqw / var(--value-chars, 8)), 1.18rem);
}

.cut-stat-source strong {
    color: var(--accent-blue);
}

.cut-stat-difference strong {
    color: var(--accent-red);
}

/* History List */
.history {
    display: flex;
    flex-direction: column;
}

.history h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 500;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 10px;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.history-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.history-pagination-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-family: var(--font-family);
}

.history-pagination-btn::before {
    content: none;
    display: none;
}

.history-pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.history-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.history-pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.05) 100%);
    padding: 15px;
    border-radius: 14px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.history-item:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.08) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.history-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 4px;
}

.history-date span {
    display: block;
    line-height: 1.35;
}

.history-relative-age {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.22);
    color: var(--accent-blue);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.history-details {
    text-align: right;
    font-weight: 500;
}

.history-details small {
    color: var(--text-secondary);
    font-weight: normal;
}

.history-after-cuts {
    color: var(--accent-green) !important;
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
}

.history-after-personal {
    color: var(--accent-blue) !important;
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
}

.history-badges {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.history-badge {
    font-size: 0.70rem;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100px;
}

.history-badge-project {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
}

.history-badge-company {
    background: rgba(0, 230, 118, 0.15);
    border-color: rgba(0, 230, 118, 0.3);
}

.history-badge-focus {
    background: rgba(156, 39, 176, 0.15);
    border-color: rgba(156, 39, 176, 0.3);
    color: #e1bee7;
}

.history-badge-multitasking {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.3);
    color: #ffe0b2;
}

/* View Switcher */
.view-switcher {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.view-switcher button {
    min-width: 150px;
    background: rgba(255, 255, 255, 0.05);
}

.view-switcher button.active {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

/* Time Cost View */
.time-cost-widget {
    max-width: 100%;
    margin: 0 auto;
}

.tc-settings-row {
    display: flex;
    gap: 20px;
}

.tc-settings-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.tc-saved-items-filters {
    align-items: end;
    display: grid;
    grid-template-columns: minmax(190px, 1.4fr) minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
    gap: 12px;
    margin: 6px 0 18px;
}

.sp-summary {
    margin: 4px 0 8px;
}

.sp-summary-hint {
    margin: 0 0 16px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.sp-summary-warning {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    color: var(--text-primary);
    font-size: 0.88rem;
}

.sp-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sp-summary-item {
    padding: 14px 16px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.sp-summary-item-highlight .sp-summary-value {
    color: var(--accent-green);
}

.sp-summary-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sp-summary-value {
    display: block;
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.sp-summary-meta {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.sp-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
}

.sp-progress {
    overflow: hidden;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.sp-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
}

.sp-progress-fill-complete {
    background: var(--accent-green);
}

.sp-progress-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.sp-funded-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sp-funded-badge-inline {
    margin-left: 0;
    vertical-align: middle;
}

.sp-item-col-header {
    min-width: 280px;
}

.sp-item-cell {
    min-width: 280px;
    max-width: 360px;
    vertical-align: top;
    white-space: normal;
}

.sp-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.sp-item-name {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
}

.sp-item-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.sp-item-actions .btn-small {
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.72rem;
    line-height: 1.2;
}

.sp-item-actions .sp-full-fund-btn {
    font-weight: 700;
}

.sp-item-actions .btn-small:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sp-item-pot-panel {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.sp-item-pot-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.sp-item-pot-panel-title {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sp-item-pot-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin-bottom: 10px;
}

.sp-item-pot-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sp-item-pot-stat-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
}

.sp-item-pot-stat-value {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-item-pot-panel .sp-progress-wrap {
    margin-top: 0;
}

.tc-saved-items-layout {
    width: 100%;
}

.tc-saved-items-mobile {
    display: block;
}

.tc-saved-items-desktop {
    display: block;
}

.tc-saved-items-desktop .tc-saved-items-table {
    min-width: 1060px;
}

.tc-saved-item-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.tc-saved-item-card + .tc-saved-item-card {
    margin-top: 12px;
}

.tc-saved-item-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tc-saved-item-card .sp-item-name {
    font-size: 1.05rem;
}

.tc-saved-item-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tc-saved-item-meta-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tc-saved-item-meta-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tc-saved-item-meta-value {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.tc-saved-item-card .sp-item-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
}

.tc-saved-item-card .sp-item-actions .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.84rem;
}

.tc-saved-item-time-details {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
}

.tc-saved-item-time-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.tc-saved-item-time-details summary::-webkit-details-marker {
    display: none;
}

.tc-saved-item-time-details summary::after {
    content: 'Show';
    color: var(--accent-blue);
    font-weight: 600;
}

.tc-saved-item-time-details[open] summary::after {
    content: 'Hide';
}

.tc-saved-item-time-grid {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.tc-saved-item-time-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tc-saved-item-time-group-title {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tc-saved-item-time-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.tc-saved-item-time-values span {
    display: block;
    padding: 8px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-green);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.sp-row-icon-actions .btn-edit,
.sp-row-icon-actions .btn-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    line-height: 0;
}

.sp-row-icon-actions .btn-edit:hover,
.sp-row-icon-actions .btn-delete:hover {
    color: var(--text-primary);
}

@media (max-width: 900px) {
    .tc-saved-item-card .sp-item-actions {
        grid-template-columns: 1fr 1fr;
    }

    .tc-saved-item-card .sp-item-actions .sp-withdraw-btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .tc-saved-item-card {
        padding: 12px;
    }

    .tc-saved-item-card-meta {
        grid-template-columns: 1fr;
    }

    .tc-saved-item-card .sp-item-actions {
        grid-template-columns: 1fr;
    }

    .tc-saved-item-card .sp-item-actions .sp-withdraw-btn {
        grid-column: auto;
    }

    .tc-saved-item-time-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.sp-row-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.sp-row-icon-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.sp-row-actions .btn-small {
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.72rem;
    line-height: 1.2;
}

.sp-row-actions .sp-full-fund-btn {
    font-weight: 700;
}

.sp-row-actions .btn-small:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sp-progress-cell {
    min-width: 140px;
}

.sp-action-item-label {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.sp-action-hint {
    margin: 0 0 16px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.sp-partial-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-partial-amount-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.sp-partial-amount-row label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
}

.sp-partial-amount-display {
    color: var(--accent-green);
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-partial-fund-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 20px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sp-partial-fund-slider:focus {
    outline: none;
}

.sp-partial-fund-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.sp-partial-fund-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -5px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.sp-partial-fund-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.sp-partial-fund-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.sp-partial-range-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.sp-partial-amount-input {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .sp-summary-grid {
        grid-template-columns: 1fr;
    }
}

.pay-widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.work-schedule-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.work-schedule-header-copy {
    min-width: 0;
}

.work-schedule-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.4;
}

.work-schedule-summary {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(199, 125, 255, 0.12);
    border: 1px solid rgba(199, 125, 255, 0.28);
    color: var(--accent-scheduled);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.work-schedule-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.work-schedule-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "day hours"
        "times times";
    align-items: center;
    gap: 10px 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.work-schedule-row.is-disabled .work-schedule-times,
.work-schedule-row.is-disabled .work-schedule-hours {
    opacity: 0.45;
}

.work-schedule-day {
    grid-area: day;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text-primary);
    font-weight: 650;
    cursor: pointer;
}

.work-schedule-day input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.work-schedule-check {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.work-schedule-day:hover .work-schedule-check {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(0, 0, 0, 0.62);
}

.work-schedule-day input:focus-visible + .work-schedule-check {
    outline: 2px solid rgba(199, 125, 255, 0.7);
    outline-offset: 2px;
}

.work-schedule-day input:checked + .work-schedule-check {
    background-color: rgba(0, 0, 0, 0.55);
    border-color: rgba(199, 125, 255, 0.55);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2 6.4 11.1 12.5 4.8' stroke='%23c77dff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px 13px;
}

.work-schedule-row.is-disabled .work-schedule-day {
    color: var(--text-secondary);
}

.work-schedule-times {
    grid-area: times;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.work-schedule-times input[type="time"],
.work-schedule-times .work-schedule-time-display {
    min-width: 0;
    flex: 1;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    font: inherit;
    font-variant-numeric: tabular-nums;
    color-scheme: dark;
}

.work-schedule-times .clock-time-field {
    flex: 1;
    min-width: 0;
}

.work-schedule-times .work-schedule-time-display:disabled {
    opacity: 0.55;
}

.work-schedule-times span {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.work-schedule-hours {
    grid-area: hours;
    color: var(--accent-scheduled);
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 3.2rem;
    text-align: right;
}

.pay-widget-header-copy {
    min-width: 0;
}

.pay-widget-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.4;
}

.pay-widget-summary {
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 16px;
}

.pay-widget-summary.is-empty {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.pay-summary-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pay-summary-col {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
}

.pay-summary-col-accrued {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.14), rgba(0, 230, 118, 0.05));
    border: 1px solid rgba(0, 230, 118, 0.24);
}

.pay-summary-col-scheduled {
    background: linear-gradient(135deg, rgba(199, 125, 255, 0.14), rgba(199, 125, 255, 0.05));
    border: 1px solid rgba(199, 125, 255, 0.28);
}

.pay-summary-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.pay-summary-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--accent-green);
    line-height: 1.15;
}

.pay-summary-scheduled-value {
    color: var(--accent-scheduled);
}

.pay-summary-caption {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.3;
}

.pay-progress {
    display: flex;
    height: 8px;
    margin-top: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.pay-progress-accrued,
.pay-progress-scheduled {
    display: block;
    height: 100%;
    min-width: 0;
}

.pay-progress-accrued {
    background: var(--accent-green);
}

.pay-progress-scheduled {
    background: var(--accent-scheduled);
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.22),
        rgba(255, 255, 255, 0.22) 3px,
        transparent 3px,
        transparent 7px
    );
}

.pay-summary-meta {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
}

.pay-widget-summary .pay-status-legend {
    margin: 12px 0 0;
    justify-content: flex-start;
}

.pay-accrued-text {
    color: var(--accent-green);
    font-weight: 700;
}

.pay-scheduled-text {
    color: var(--accent-scheduled);
    font-weight: 700;
}

.pay-overlap-widget {
    border-color: rgba(255, 152, 0, 0.35);
    background: linear-gradient(180deg, rgba(255, 152, 0, 0.12), rgba(255, 255, 255, 0.03));
}

.pay-overlap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pay-overlap-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffb74d;
    background: rgba(255, 152, 0, 0.16);
    border: 1px solid rgba(255, 152, 0, 0.35);
}

.pay-overlap-headline {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.pay-overlap-copy,
.pay-overlap-hint {
    margin: 0 0 14px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.pay-overlap-steps {
    margin: 0 0 14px;
    padding-left: 1.2rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.pay-overlap-steps li + li {
    margin-top: 6px;
}

.pay-overlap-hint {
    margin-bottom: 16px;
}

#pay-overlap-batch-btn {
    align-self: flex-start;
}

.pay-period-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pay-period-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.pay-period-item.is-ended {
    opacity: 0.7;
}

.pay-period-copy {
    min-width: 0;
}

.pay-period-name {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.pay-period-rate {
    display: block;
    color: var(--accent-green);
    font-weight: 700;
}

.pay-period-meta {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.pay-period-actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.tc-pay-derived-hint {
    display: block;
    margin-top: 10px;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.tc-pay-derived-hint .btn-small {
    margin-left: 8px;
}

.calendar-day.has-pay:not(.has-work):not(.has-break) {
    background: rgba(0, 230, 118, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(0, 230, 118, 0.16);
}

.calendar-day.has-scheduled-pay:not(.has-work):not(.has-break) {
    background: rgba(199, 125, 255, 0.08);
    color: var(--text-primary);
    border: 1px dashed rgba(199, 125, 255, 0.32);
}

.assumed-hours-indicator {
    font-size: clamp(0.52rem, 2vw, 0.68rem);
    color: var(--accent-green);
    margin-top: 4px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.scheduled-hours-indicator {
    font-size: clamp(0.52rem, 2vw, 0.68rem);
    color: var(--accent-scheduled);
    margin-top: 4px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.calendar-week-total.has-pay-total:not(.has-work-total) {
    background: rgba(0, 230, 118, 0.1);
    border-color: rgba(0, 230, 118, 0.22);
    color: var(--accent-green);
}

.calendar-week-total.has-scheduled-total {
    background: rgba(199, 125, 255, 0.1);
    border-color: rgba(199, 125, 255, 0.28);
    color: var(--accent-scheduled);
}

.calendar-week-total.has-mixed-schedule {
    gap: 3px;
}

.calendar-week-counted {
    display: block;
}

.calendar-week-due {
    display: block;
    color: var(--accent-scheduled);
    font-size: 0.85em;
    font-weight: 800;
}

.calendar-week-total.has-work-total .calendar-week-counted {
    color: var(--accent-blue);
}

.calendar-week-total.has-pay-total:not(.has-work-total) .calendar-week-counted {
    color: var(--accent-green);
}

.widget-pay-hint {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.4;
}

.history-badge-pay {
    background: rgba(0, 230, 118, 0.14);
    border-color: rgba(0, 230, 118, 0.32);
    color: var(--accent-green);
}

.history-badge-scheduled {
    background: rgba(199, 125, 255, 0.14);
    border-color: rgba(199, 125, 255, 0.38);
    color: var(--accent-scheduled);
}

.history-pay-covered-note {
    display: block;
    margin-top: 4px;
    color: var(--accent-green);
    font-size: 0.72rem;
    line-height: 1.3;
}

.history-pay-scheduled-note {
    display: block;
    margin-top: 4px;
    color: var(--accent-scheduled);
    font-size: 0.72rem;
    line-height: 1.3;
}

.saving-pots-widget {
    position: relative;
    overflow: hidden;
}

.saving-pots-widget::after {
    content: "";
    position: absolute;
    inset: auto -25% -40% -25%;
    height: 60%;
    background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.14), transparent 62%);
    pointer-events: none;
}

.saving-pots-widget.sp-widget-over-assigned::after {
    background: radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.12), transparent 62%);
}

.sp-widget-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sp-widget-header-copy {
    min-width: 0;
}

.sp-widget-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.4;
}

.sp-widget-scope-badge {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sp-widget-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sp-widget-hero {
    padding: 18px 18px 16px;
    border: 1px solid rgba(0, 230, 118, 0.22);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.12), rgba(56, 189, 248, 0.08));
}

.sp-widget-over-assigned .sp-widget-hero {
    border-color: rgba(239, 68, 68, 0.28);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(255, 255, 255, 0.03));
}

.sp-widget-hero-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sp-widget-hero-value {
    display: block;
    color: var(--text-primary);
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.sp-widget-over-assigned .sp-widget-hero-value {
    color: #fca5a5;
}

.sp-widget-hero-meta {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.sp-widget-allocation {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-widget-allocation-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.sp-progress-widget {
    height: 10px;
}

.sp-progress-allocation .sp-progress-fill-assigned {
    background: linear-gradient(90deg, var(--accent-blue), rgba(56, 189, 248, 0.75));
}

.sp-widget-goal-card {
    padding: 14px 16px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.sp-widget-goal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.sp-widget-goal-label {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sp-widget-goal-percent {
    color: var(--accent-green);
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-widget-goal-name {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.3;
}

.sp-widget-goal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.sp-widget-all-funded {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(34, 197, 94, 0.22);
    border-radius: 14px;
    background: rgba(34, 197, 94, 0.08);
}

.sp-widget-all-funded p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.sp-widget-empty {
    padding: 8px 2px 4px;
    text-align: center;
}

.sp-widget-empty-compact {
    padding-top: 0;
    text-align: left;
}

.sp-widget-empty-title {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.sp-widget-empty-copy {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.sp-widget-manage-btn {
    width: 100%;
    margin-top: 2px;
}

body.dashboard-density-compact .sp-widget-hero {
    padding: 14px 14px 12px;
}

body.dashboard-density-compact .sp-widget-hero-value {
    font-size: 1.7rem;
}

body.dashboard-density-spacious .sp-widget-content {
    gap: 18px;
}

body.dashboard-density-spacious .sp-widget-hero {
    padding: 22px 20px 18px;
}

.tc-saved-items-filters .input-group {
    margin-bottom: 0;
}

.tc-saved-items-filters .btn-small {
    min-height: 43px;
    white-space: nowrap;
}

.tc-saved-chart-section {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--card-border);
}

.tc-saved-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.tc-saved-chart-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}

.tc-saved-chart-hint {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
    text-align: right;
}

.tc-saved-chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tc-saved-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tc-chart-swatch {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 3px;
}

.tc-chart-swatch-base {
    background: var(--accent-blue);
}

.tc-chart-swatch-after {
    background: var(--accent-green);
}

.tc-saved-items-chart {
    min-height: 90px;
}

.tc-comparison-chart {
    display: grid;
    gap: 14px;
}

.tc-comparison-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.32fr) minmax(220px, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.tc-comparison-item {
    min-width: 0;
}

.tc-comparison-item strong,
.tc-comparison-item span {
    display: block;
}

.tc-comparison-item strong {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-comparison-item span {
    margin-top: 4px;
    color: var(--accent-blue);
    font-size: 0.86rem;
    font-weight: 700;
}

.tc-comparison-bars {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.tc-comparison-bar-line {
    display: grid;
    grid-template-columns: 44px minmax(120px, 1fr) 54px;
    gap: 10px;
    align-items: center;
}

.tc-comparison-bar-label,
.tc-comparison-value {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 800;
}

.tc-comparison-value {
    color: var(--text-primary);
    text-align: right;
}

.tc-comparison-track {
    position: relative;
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.tc-comparison-bar {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}

.tc-comparison-bar-base {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.72), rgba(0, 91, 234, 0.92));
}

.tc-comparison-bar-after {
    background: linear-gradient(90deg, rgba(0, 230, 118, 0.72), rgba(0, 179, 92, 0.94));
}

.tc-saved-items-matrix {
    min-height: 90px;
}

.tc-matrix-selector {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.tc-matrix-selector-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.tc-matrix-selector-header strong {
    color: var(--accent-blue);
    font-weight: 900;
}

.tc-matrix-limit-note {
    color: var(--text-secondary);
}

.tc-matrix-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    max-height: 210px;
    overflow: auto;
    padding: 2px 4px 2px 2px;
}

.tc-matrix-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.tc-matrix-option.selected {
    border-color: rgba(0, 212, 255, 0.36);
    background: rgba(0, 212, 255, 0.08);
}

.tc-matrix-option.disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.tc-matrix-option input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent-blue);
}

.tc-matrix-option span {
    min-width: 0;
}

.tc-matrix-option strong,
.tc-matrix-option em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-matrix-option strong {
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 800;
}

.tc-matrix-option em {
    margin-top: 3px;
    color: var(--accent-blue);
    font-style: normal;
    font-size: 0.74rem;
    font-weight: 800;
}

.tc-matrix-scroll {
    max-width: 100%;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.tc-matrix-scroll:focus {
    outline: 2px solid rgba(0, 212, 255, 0.45);
    outline-offset: 3px;
}

.tc-matrix-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.tc-matrix-table th,
.tc-matrix-table td {
    min-width: 128px;
    padding: 13px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center;
    vertical-align: middle;
}

.tc-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(10, 14, 28, 0.96);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.tc-matrix-table tbody th,
.tc-matrix-corner {
    left: 0;
    min-width: 170px;
    max-width: 210px;
    text-align: left;
}

.tc-matrix-table tbody th {
    position: sticky;
    z-index: 1;
    background: rgba(12, 17, 32, 0.96);
}

.tc-matrix-corner {
    z-index: 3 !important;
}

.tc-matrix-table th span,
.tc-matrix-table th em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-matrix-table th span {
    color: var(--text-primary);
    font-weight: 800;
}

.tc-matrix-table th em {
    margin-top: 4px;
    color: var(--accent-blue);
    font-style: normal;
    font-size: 0.76rem;
    font-weight: 700;
}

.tc-matrix-corner span {
    color: var(--text-secondary) !important;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tc-matrix-corner strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.tc-matrix-table td strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-blue);
    font-size: 0.86rem;
    font-weight: 900;
}

.tc-matrix-table td.tc-matrix-self strong {
    background: rgba(0, 230, 118, 0.12);
    color: var(--accent-green);
}

@media (max-width: 480px) {
    .tc-settings-row {
        flex-direction: column;
        gap: 15px;
    }

    .tc-saved-items-filters {
        grid-template-columns: 1fr;
    }

    .tc-comparison-row {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .tc-saved-chart-header {
        align-items: stretch;
        flex-direction: column;
    }

    .tc-saved-chart-hint {
        text-align: left;
    }

    .tc-matrix-table th,
    .tc-matrix-table td {
        min-width: 112px;
        padding: 11px 10px;
    }

    .tc-matrix-table tbody th,
    .tc-matrix-corner {
        min-width: 145px;
        max-width: 165px;
    }
}

.tc-checkbox-group {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
    justify-content: flex-start;
}

/* Custom switch toggle */
.tc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.tc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.tc-slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3.5px;
    bottom: 3.5px;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tc-switch input:checked + .tc-slider {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.tc-switch input:checked + .tc-slider::before {
    transform: translateX(20px);
}

.tc-switch input:focus-visible + .tc-slider {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.tc-switch-label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.tc-checkbox-group:hover .tc-switch-label {
    color: var(--text-primary);
}

.tc-rate-breakdown {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}

.tc-section-title {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}

.tc-subsection-title {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
}

.tc-target-breakdown {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--card-border);
}

.tc-custom-scale-form {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) auto;
    gap: 12px;
    align-items: end;
    margin: 14px 0 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

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

.tc-custom-scale-field label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.tc-custom-scale-field input,
.tc-custom-scale-field select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.tc-custom-scale-field input {
    text-align: right;
}

.tc-custom-scale-field select {
    appearance: none;
    cursor: pointer;
    padding-right: 34px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 12px) 18px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.tc-custom-scale-field input:focus,
.tc-custom-scale-field select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.25);
}

.tc-custom-scale-form .btn-small {
    min-height: 42px;
    padding: 10px 16px;
    white-space: nowrap;
}

.tc-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.tc-table-scroll .tc-breakdown-table {
    min-width: 860px;
}

.tc-table-scroll .tc-target-table {
    min-width: 720px;
}

.tc-breakdown-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}

.tc-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.tc-breakdown-table th,
.tc-breakdown-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tc-breakdown-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tc-breakdown-table tr:last-child td {
    border-bottom: none;
}

.tc-breakdown-table td {
    font-size: 1.05rem;
}

.tc-breakdown-table .tc-amount {
    color: var(--accent-blue);
    font-weight: 700;
}

.tc-breakdown-table .tc-time {
    color: var(--accent-green);
    font-weight: 700;
}

.tc-date-bought-input {
    box-sizing: border-box;
    min-height: 40px;
    min-width: 140px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.92rem;
    padding: 8px 10px;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    width: 100%;
}

.tc-date-bought-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.25);
}

.tc-date-bought-display {
    color: var(--text-primary);
    white-space: nowrap;
}

.tc-breakdown-table tr.tc-total-row {
    background: rgba(0, 212, 255, 0.05);
}

.tc-breakdown-table tr.tc-total-row td {
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.tc-breakdown-table tr.tc-custom-scale-row {
    background: rgba(255, 255, 255, 0.025);
}

.tc-scale-actions {
    text-align: right;
    white-space: nowrap;
}

.tc-muted-action {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.tc-remove-scale-btn {
    vertical-align: middle;
}

/* Freeze first column in Saved Items table */
.tc-breakdown-table th.tc-sticky-col,
.tc-breakdown-table td.tc-sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #0e101c !important; /* opaque backdrop match for glass card */
    border-right: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

.tc-breakdown-table th.tc-sticky-col {
    z-index: 3;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .tc-custom-scale-form {
        grid-template-columns: 1fr;
    }

    .tc-custom-scale-form .btn-small {
        width: 100%;
    }

    .app-container {
        margin-top: 60px;
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    .card {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }

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

    .stats-header-row,
    .cut-stats-header-row,
    .work-pattern-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-period-mode-toggle,
    .cut-stats-header-actions {
        align-self: stretch;
    }

    .stats-period-mode-toggle {
        justify-content: center;
    }

    .cut-stats-header-actions {
        align-items: stretch;
    }

    .period-toggle-group {
        justify-content: center;
        flex-wrap: wrap;
    }

    .custom-stats-period-form {
        grid-template-columns: 1fr;
    }

    .cut-stat-grid {
        grid-template-columns: 1fr;
    }

    .cut-stats-widget {
        max-height: min(560px, 68vh);
    }

    .cut-widget-header,
    .pay-widget-header,
    .work-schedule-header {
        align-items: stretch;
        flex-direction: column;
    }

    .work-schedule-summary {
        align-self: flex-start;
        white-space: normal;
    }

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

    .work-schedule-times {
        grid-column: 1 / -1;
    }

    .pay-period-item {
        flex-direction: column;
    }

    .pay-summary-split {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(36px, 44px);
        gap: 3px;
    }

    .day-label {
        font-size: 0.68rem;
        letter-spacing: 0.4px;
        padding-bottom: 10px;
    }

    .calendar-week-total-header {
        font-size: 0.72rem;
        padding-bottom: 10px;
    }

    .calendar-week-total {
        padding: 4px 2px;
        border-radius: 10px;
    }

    .calendar-day {
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .work-hours-indicator,
    .assumed-hours-indicator,
    .scheduled-hours-indicator,
    .break-hours-indicator {
        font-size: 0.62rem;
    }

    #timer {
        font-size: 3rem;
    }
}

@media (max-width: 360px) {
    .app-container {
        gap: 24px;
        padding: 10px;
    }

    .dashboard-grid {
        gap: 20px;
    }

    .card {
        border-radius: 18px;
        padding: 14px;
    }

    .widget-title {
        font-size: 1.15rem;
        line-height: 1.15;
    }

    .cut-stats-widget {
        max-height: min(620px, 74vh);
    }

    .cut-stats-widget .widget-title {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .cut-stats {
        gap: 10px;
    }

    .cut-stat-layer {
        border-radius: 12px;
        padding: 10px;
    }

    .cut-stat-header {
        gap: 8px;
        margin-bottom: 10px;
    }

    .cut-stat-name {
        flex-basis: 100%;
        font-size: 0.95rem;
    }

    .cut-stat-rate,
    .cut-stat-basis {
        font-size: 0.68rem;
    }

    .cut-stat-basis {
        margin-left: 0;
    }

    .cut-stat-grid {
        gap: 8px;
    }

    .cut-stat-money {
        grid-template-columns: minmax(0, 46%) minmax(0, 54%);
        gap: 4px;
    }

    .cut-stat-after strong {
        font-size: clamp(0.72rem, calc(82cqw / var(--value-chars, 8)), 1.05rem);
    }

    .cut-widget-header {
        gap: 10px;
    }

    #timer {
        font-size: 2.55rem;
    }
}

/* Delete & Edit Buttons */
.btn-delete,
.btn-edit {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 8px;
    transition: color 0.3s, background 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete::before,
.btn-edit::before {
    display: none;
}

.btn-delete:hover {
    color: var(--accent-red);
    background: rgba(255, 23, 68, 0.15);
}

.btn-edit:hover {
    color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.15);
}

.history-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
    margin-right: 10px;
}

/* Calendar Styling */
.calendar-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
}

.calendar-widget-header .widget-title {
    min-width: 0;
    flex: 1 1 auto;
}

.calendar-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.calendar-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
}

.calendar-mode-btn {
    min-height: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    padding: 7px 10px;
    text-transform: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
}

.calendar-mode-btn::before {
    display: none;
}

.calendar-mode-btn.active {
    background: rgba(0, 212, 255, 0.18);
    color: var(--accent-blue);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.16);
}

.calendar-mode-break .calendar-mode-btn[data-calendar-mode="break"].active {
    background: rgba(255, 152, 0, 0.18);
    color: #ff9800;
    box-shadow: 0 0 14px rgba(255, 152, 0, 0.16);
}

.calendar-mode-break .calendar-mode-btn[data-calendar-mode="work"].active {
    background: rgba(0, 212, 255, 0.18);
    color: var(--accent-blue);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.16);
}

.batch-mode-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.18);
    flex-wrap: wrap;
}

.batch-mode-controls.batch-mode-break {
    background: rgba(255, 152, 0, 0.06);
    border-color: rgba(255, 152, 0, 0.18);
}

.batch-selected-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.batch-mode-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar {
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.calendar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
}

.pay-status-legend,
.calendar-legend {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.25;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.chart-widget .pay-status-legend,
.gantt-widget .pay-status-legend {
    margin: 12px 0 0;
    justify-content: flex-start;
}

.pay-status-legend.is-hidden,
.calendar-legend.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.pay-status-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pay-status-legend-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pay-status-legend-copy strong {
    color: var(--text-primary);
    font-weight: 650;
    font-size: 0.8rem;
}

.pay-status-legend-copy small {
    color: var(--text-secondary);
    font-size: 0.68rem;
}

.pay-status-swatch,
.calendar-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.pay-status-swatch-logged,
.calendar-legend-swatch-logged {
    background: var(--accent-blue);
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.45);
}

.pay-status-swatch-accrued,
.calendar-legend-swatch-assumed {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(0, 230, 118, 0.45);
}

.pay-status-swatch-scheduled {
    background: var(--accent-scheduled);
    box-shadow: 0 0 6px rgba(199, 125, 255, 0.45);
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.25),
        rgba(255, 255, 255, 0.25) 2px,
        transparent 2px,
        transparent 5px
    );
}

.calendar-legend-dot,
.calendar-break-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.55);
    flex-shrink: 0;
}

.calendar-break-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    pointer-events: none;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(42px, 54px);
    gap: 4px;
    text-align: center;
}

.day-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 15px;
}

.calendar-week-total-header {
    padding-bottom: 15px;
    font-size: 0.82rem;
    letter-spacing: 0;
    color: var(--accent-blue);
}

.calendar-week-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 6px 4px;
    border-radius: 12px;
    font-size: clamp(0.62rem, 2.4vw, 0.78rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.18);
    color: var(--accent-blue);
    word-break: break-word;
}

.calendar-week-total.has-work-total,
.calendar-week-total.has-break-total {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.28);
    color: var(--accent-blue);
}

.calendar-week-total.is-empty {
    opacity: 0.45;
    color: var(--accent-blue);
}

.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.02);
    min-width: 0;
    min-height: 0;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    pointer-events: none;
}

.calendar-day.outside-month {
    opacity: 0.45;
    background: rgba(255, 255, 255, 0.015);
    border-color: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: default;
    pointer-events: none;
}

.calendar-day.outside-month.has-work,
.calendar-day.outside-month.has-break {
    opacity: 0.62;
}

.calendar-day.outside-month.today {
    opacity: 0.72;
    border-color: rgba(0, 212, 255, 0.28);
    box-shadow: inset 0 0 8px rgba(0, 212, 255, 0.12);
}

.calendar-day.outside-month .work-hours-indicator,
.calendar-day.outside-month .assumed-hours-indicator,
.calendar-day.outside-month .scheduled-hours-indicator,
.calendar-day.outside-month .break-hours-indicator {
    opacity: 0.85;
}

.calendar-day.today {
    border: 1px solid rgba(0, 212, 255, 0.5);
    background: rgba(0, 212, 255, 0.05);
    color: var(--text-primary);
    box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.2);
}

.calendar-day.today:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.8);
    box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.3), 0 5px 15px rgba(0, 212, 255, 0.1);
    z-index: 2;
}

.calendar-day:not(.empty) {
    cursor: pointer;
}

.calendar-day.has-pay:not(.has-work):not(.has-break):hover {
    background: rgba(0, 230, 118, 0.16);
    box-shadow: 0 5px 15px rgba(0, 230, 118, 0.16);
    border-color: rgba(0, 230, 118, 0.32);
    z-index: 2;
}

.calendar-day.has-scheduled-pay:not(.has-work):not(.has-break):hover {
    background: rgba(199, 125, 255, 0.16);
    box-shadow: 0 5px 15px rgba(199, 125, 255, 0.16);
    border-color: rgba(199, 125, 255, 0.42);
    z-index: 2;
}

.calendar-day:not(.empty):not(.has-work):not(.has-break):not(.has-pay):not(.has-scheduled-pay):hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    z-index: 2;
}

.calendar-day.has-break {
    background: rgba(255, 152, 0, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 152, 0, 0.2);
    cursor: pointer;
}

.calendar-day.has-break:hover {
    background: rgba(255, 152, 0, 0.2);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
    z-index: 2;
}

.break-hours-indicator {
    font-size: clamp(0.58rem, 2.2vw, 0.72rem);
    color: #ff9800;
    margin-top: 4px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.calendar-day.has-work {
    background: rgba(0, 212, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(0, 212, 255, 0.22);
    cursor: pointer;
}

.calendar-day.has-work:hover {
    background: rgba(0, 212, 255, 0.18);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.18);
    border-color: rgba(0, 212, 255, 0.4);
    z-index: 2;
}

.work-hours-indicator {
    font-size: clamp(0.58rem, 2.2vw, 0.72rem);
    color: var(--accent-blue);
    margin-top: 4px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: rgba(15, 18, 30, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 420px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    margin: 0;
    font-weight: 500;
}

#close-settings {
    font-size: 1.8rem;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

#close-settings:hover {
    background: rgba(255, 255, 255, 0.15);
}

.currency-dropdown {
    width: 100%;
}

#settings-view {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-bottom: 96px;
}

.settings-card {
    max-width: 560px;
    width: 100%;
    margin: 0 auto 30px;
    box-sizing: border-box;
}

.settings-section {
    padding-top: 22px;
    margin-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-section:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.settings-section-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.settings-section-desc {
    margin: 0 0 16px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.45;
}

.settings-toggle-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.settings-toggle-row label {
    margin-bottom: 0;
}

.settings-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.settings-default-field {
    margin-top: -4px;
    padding-left: 12px;
    border-left: 2px solid rgba(0, 212, 255, 0.28);
}

.settings-collapse-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 8px;
    cursor: pointer;
}

.settings-chevron {
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
}

.settings-collapse-panel {
    transition: all 0.3s ease;
    width: 100%;
}

.settings-export-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

.csv-export-settings {
    margin-bottom: 4px;
}

.csv-export-period-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

@media (max-width: 640px) {
    .csv-export-period-row {
        grid-template-columns: 1fr;
    }
}

.settings-export-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
}

.settings-section .input-group {
    align-items: stretch;
}

.settings-section .input-group label {
    align-self: flex-start;
}

.settings-section .money-counter-gap-slider {
    align-self: stretch;
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 35px;
}

.settings-footer-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    justify-content: center;
    margin-top: 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(7, 9, 19, 0) 0%, rgba(7, 9, 19, 0.88) 28%, rgba(7, 9, 19, 0.96) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    pointer-events: none;
}

.settings-footer-sticky #save-settings {
    width: min(560px, 100%);
    max-width: 100%;
    pointer-events: auto;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.settings-tabs,
.settings-segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
}

.settings-tabs {
    margin: -8px 0 8px;
}

.settings-tab-btn,
.settings-segment-btn {
    flex: 1;
    min-height: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
}

.settings-tab-btn::before,
.settings-segment-btn::before {
    display: none;
}

.settings-tab-btn.active,
.settings-segment-btn.active {
    background: rgba(0, 212, 255, 0.18);
    color: var(--accent-blue);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.16);
}

#settings-view.settings-tab-batch-edit {
    padding-bottom: 24px;
}

#settings-view.settings-tab-batch-edit .settings-footer-sticky {
    display: none;
}

.batch-delete-preview {
    margin: 4px 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.batch-delete-open-btn {
    font-size: 1rem;
    margin-top: 4px;
}

.batch-delete-open-btn:disabled,
#batch-delete-confirm-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.batch-delete-modal-content {
    text-align: left;
}

.batch-delete-modal-message {
    margin: 0 0 18px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
}

.batch-delete-modal-actions {
    justify-content: stretch;
    gap: 12px;
    margin-top: 22px;
}

.batch-delete-modal-actions .btn-outline,
.batch-delete-modal-actions .btn-danger {
    width: auto;
    flex: 1;
    font-size: 1rem;
}

.btn-small {
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
}

.widget-export-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.widget-export-format {
    width: auto;
    min-width: 82px;
    height: 36px;
    padding: 0 30px 0 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.widget-export-button {
    min-height: 36px;
}

.widget-export-capturing .widget-export-footer {
    display: none !important;
}

/* Chart Widget */
.chart-widget {
    display: flex;
    flex-direction: column;
}

.chart-week-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chart-week-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.chart-week-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.chart-week-range {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.chart-week-total {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-green);
    text-align: center;
    white-space: normal;
}

.chart-week-counted {
    color: var(--accent-green);
}

.chart-week-scheduled {
    color: var(--accent-scheduled);
}

.chart-week-total-sep {
    color: var(--text-secondary);
    font-weight: 600;
}

.chart-widget h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 500;
}

.chart-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    flex-grow: 1;
    min-height: 220px;
    margin-top: 20px;
    padding-left: 35px;
    padding-bottom: 30px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-y-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 30px;
    /* Aligns with padding-bottom of container */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding-right: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    width: 25px;
}

.chart-grid-lines {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 30px;
    left: 35px;
    z-index: 0;
    pointer-events: none;
}

.chart-grid-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.055);
}

.chart-grid-line-major {
    background: rgba(255, 255, 255, 0.11);
}

.chart-avg-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 0;
    border-top: 2px dashed rgba(255, 193, 7, 0.9);
    z-index: 2;
    pointer-events: none;
}

.chart-avg-label {
    position: absolute;
    right: 6px;
    top: 0;
    transform: translateY(-50%);
    font-size: 0.68rem;
    font-weight: 600;
    color: #ffc107;
    background: rgba(18, 18, 22, 0.92);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 193, 7, 0.35);
    white-space: nowrap;
    line-height: 1.2;
}

.chart-day-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 12%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.chart-bar-area {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    height: 100%;
    justify-content: flex-start;
}

.chart-sub-session {
    width: 100%;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.8) 0%, rgba(0, 91, 234, 0.8) 100%);
    border-radius: 6px;
    margin-top: 3px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.chart-bar-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 90%;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.chart-sub-session:hover {
    filter: brightness(1.3);
}

.chart-sub-session-live {
    background: rgba(255, 60, 60, 0.82) !important;
    box-shadow: 0 0 12px rgba(255, 60, 60, 0.45);
    animation: pulsate-live 2s infinite ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.chart-sub-session-pay {
    background: var(--accent-green);
    box-shadow: none;
}

.chart-sub-session-scheduled {
    background: var(--accent-scheduled);
    box-shadow: none;
    opacity: 1;
    border: 1px dashed rgba(255, 255, 255, 0.35);
}

.chart-bar-label-live {
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.chart-day-label {
    position: absolute;
    bottom: -26px;
    width: 100%;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

/* Sortable List Styles */
.sortable-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sortable-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    cursor: grab;
    transition: background 0.2s, box-shadow 0.2s;
    user-select: none;
}

.sortable-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sortable-item:active {
    cursor: grabbing;
}

.sortable-item.dragging {
    opacity: 0.5;
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
}

.gantt-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gantt-container {
    position: relative;
    width: 100%;
    min-height: 80px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    /* Extra padding at bottom for hour labels if desired, or keep them inside */
}

/* Vertical lines for hours */
.gantt-hour-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.gantt-hour-marker span {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* The actual session blocks */
.gantt-block {
    position: absolute;
    top: 10px;
    height: 40px;
    border-radius: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: width 1s linear;
    /* Smooth growth for live block */
}

.gantt-block-label {
    font-size: 0.7rem;
    color: #fff;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    padding: 0 4px;
}

/* Live pulsating effect */
@keyframes pulsate-live {
    0% {
        opacity: 0.8;
        box-shadow: 0 0 8px rgba(255, 60, 60, 0.8);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 15px rgba(255, 60, 60, 1);
    }

    100% {
        opacity: 0.8;
        box-shadow: 0 0 8px rgba(255, 60, 60, 0.8);
    }
}

.gantt-live {
    background: rgba(255, 60, 60, 0.8) !important;
    animation: pulsate-live 2s infinite ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sortable-item .drag-handle {
    margin-right: 15px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    cursor: grab;
}

.cut-settings-group {
    align-items: stretch;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    max-width: 100%;
    padding-right: 8px;
}

.cut-settings-group::-webkit-scrollbar {
    width: 6px;
}

.cut-settings-group::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.cut-settings-group::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.cut-settings-group::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.cut-widget-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.cut-widget-hint {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
}

.percentage-cuts-widget {
    display: flex;
    flex-direction: column;
    max-height: clamp(420px, 72vh, 780px);
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.cut-widget-footer {
    margin-top: auto;
}

.percentage-cut-list {
    margin-top: 12px;
}

.percentage-cut-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-areas:
        "handle fields"
        ". actions";
    column-gap: 12px;
    row-gap: 10px;
    align-items: center;
    cursor: grab;
    padding: 12px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.percentage-cut-item .drag-handle {
    grid-area: handle;
    justify-content: center;
    margin-right: 0;
    width: 24px;
}

.percentage-cut-fields {
    grid-area: fields;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 4.5rem);
    grid-template-areas:
        "name percent"
        "basis basis";
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.percentage-cut-fields input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: left;
}

.cut-name-input {
    grid-area: name;
}

.cut-percent-field {
    grid-area: percent;
    position: relative;
    min-width: 0;
    max-width: 4.5rem;
    width: 100%;
    overflow: hidden;
}

.cut-percent-field .cut-percentage-input {
    padding-right: 24px;
    text-align: right;
    width: 100%;
    max-width: 100%;
}

.cut-percent-symbol {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
}

.cut-basis-toggle {
    grid-area: basis;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: clamp(0.68rem, 1.8vw, 0.82rem);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.1;
    text-transform: uppercase;
    white-space: nowrap;
}

.cut-basis-toggle[data-basis="accumulative"] {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.24);
    color: var(--accent-blue);
}

.cut-basis-toggle[data-basis="original"] {
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.24);
    color: var(--accent-green);
}

.cut-basis-toggle::before {
    display: none;
}

.cut-basis-toggle:hover {
    filter: brightness(1.15);
}

.percentage-cut-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-end;
    min-width: 0;
}

.cut-icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.cut-icon-btn::before {
    display: none;
}

.cut-icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
}

.cut-icon-btn:disabled {
    cursor: default;
    opacity: 0.35;
    transform: none;
}

.cut-remove-btn:hover {
    color: var(--accent-red);
    background: rgba(255, 23, 68, 0.12);
}

@media (max-width: 600px) {
    .percentage-cuts-widget .cut-widget-header .btn-small {
        width: 100%;
    }

    .percentage-cut-list {
        min-width: 0;
        max-width: 100%;
    }

    .percentage-cut-item {
        align-items: stretch;
        grid-template-columns: 1fr;
        grid-template-areas:
            "handle"
            "fields"
            "actions";
        gap: 8px;
        padding: 10px;
    }

    .percentage-cut-item .drag-handle {
        justify-content: center;
        margin-right: 0;
        width: 100%;
    }

    .percentage-cut-fields {
        width: 100%;
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "percent"
            "basis";
    }

    .percentage-cut-actions {
        margin-left: 0;
        width: 100%;
        justify-content: stretch;
    }

    .cut-icon-btn {
        flex: 1 1 0;
        min-width: 0;
    }

    .cut-basis-toggle {
        font-size: 0.68rem;
        padding: 8px;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }

    .cut-stats-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cut-stats-header-copy,
    .cut-stats-header-actions {
        width: 100%;
        min-width: 0;
    }

    .cut-stats-header-actions {
        align-items: stretch;
    }

    .stats-period-mode-toggle,
    .period-toggle-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .cut-stat-basis {
        margin-left: 0;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .cut-stat-grid {
        grid-template-columns: 1fr;
    }

    .cut-stats-widget {
        max-height: min(560px, 68vh);
    }
}

@media (max-width: 360px) {
    .widget-export-footer {
        align-items: stretch;
        justify-content: stretch;
    }

    .widget-export-format,
    .widget-export-button {
        flex: 1 1 120px;
        min-width: 0;
    }
}

/* Print / Export Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .bg-orbs,
    .user-header,
    #auth-section,
    .timer-widget .btn-group,
    .timer-widget .input-group,
    .modal-overlay,
    #active-filters-container {
        display: none !important;
    }

    .app-container {
        margin: 0 !important;
        padding: 0 !important;
    }

    .dashboard-grid {
        gap: 20px !important;
    }

    .card {
        background: transparent !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 20px !important;
        page-break-inside: avoid;
    }

    .card:hover {
        transform: none !important;
        box-shadow: none !important;
        border-color: #000 !important;
    }

    .widget-title {
        color: black !important;
    }

    .text-secondary,
    .input-group label,
    .day-label,
    .stat-item .label,
    .history-date,
    .history-details small {
        color: #000 !important;
    }

    .stat-item {
        background: transparent !important;
        border: 1px solid #000 !important;
        color: black !important;
    }

    .calendar-day {
        border-color: #000 !important;
        color: #000 !important;
    }

    .calendar-day.today {
        background: rgba(0, 0, 0, 0.05) !important;
        border-color: #000 !important;
        box-shadow: none !important;
        color: black !important;
    }

    .calendar-day.has-work {
        background: rgba(0, 0, 0, 0.1) !important;
        border-color: #000 !important;
        color: black !important;
    }

    .calendar-day.has-pay:not(.has-work) {
        background: rgba(0, 0, 0, 0.05) !important;
        border: 1px solid #000 !important;
        color: black !important;
    }

    .calendar-day.has-scheduled-pay:not(.has-work) {
        background: transparent !important;
        border: 1px dashed #000 !important;
        color: black !important;
    }

    .work-hours-indicator,
    .assumed-hours-indicator,
    .scheduled-hours-indicator,
    .calendar-week-counted,
    .calendar-week-due {
        color: #000 !important;
    }

    .btn-delete {
        display: none !important;
    }

    .history-item {
        background: transparent !important;
        border: none !important;
        border-bottom: 1px solid #000 !important;
        border-radius: 0 !important;
        padding: 10px 0 !important;
    }

    .chart-y-axis div,
    .chart-day-label {
        color: #000 !important;
    }

    #timer {
        color: black !important;
        text-shadow: none !important;
    }

    .highlight-text,
    .stat-item .value {
        color: #000 !important;
        text-shadow: none !important;
    }

    .cut-stats-heading,
    .cut-stat-name,
    .cut-stat-rate,
    .cut-stat-basis,
    .cut-stat-label,
    .cut-stat-money,
    .cut-stat-money strong {
        color: #000 !important;
        text-shadow: none !important;
    }

    .cut-stat-layer,
    .cut-stat-item {
        background: transparent !important;
        border: 1px solid #000 !important;
    }

    /* Ensure colors print correctly */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .gantt-hour-marker {
        border-left: 1px dashed #000 !important;
    }

    .gantt-hour-marker span {
        color: #000 !important;
        background: white !important;
    }

    /* Make inline-styled and text elements darker for readability on white background */
    .gantt-block,
    .chart-sub-session {
        filter: brightness(0.6) contrast(1.5) !important;
        border: 1px solid #000 !important;
    }

    .work-hours-indicator {
        color: #000 !important;
        font-weight: 800 !important;
    }

    .history-badge {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #666 !important;
    }
}

/* Batch Selected Day Styling */
.calendar-day.batch-selected {
    border: 2px solid var(--accent-blue) !important;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4), inset 0 0 8px rgba(0, 212, 255, 0.2) !important;
    transform: scale(1.05);
    z-index: 3;
}

.calendar-day.batch-selected.batch-selected-break {
    border-color: #ff9800 !important;
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.4), inset 0 0 8px rgba(255, 152, 0, 0.2) !important;
}

/* Drag to Confirm Slider */
.drag-slider-track {
    position: relative;
    width: 100%;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 25px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
}

.drag-slider-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.2), rgba(0, 230, 118, 0.4));
    transition: width 0.05s linear;
}

.drag-slider-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: grab;
    z-index: 10;
    transition: background 0.3s;
}

.drag-slider-handle:active {
    cursor: grabbing;
}

.handle-arrow {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
}

.drag-slider-text {
    position: relative;
    font-size: 0.95rem;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 5;
    letter-spacing: 0.5px;
}

/* Add Session Modal Styling Override */
#session-modal.modal-mode-add .modal-content {
    border: 1px solid rgba(0, 212, 255, 0.25);
    background: linear-gradient(145deg, rgba(20, 26, 38, 0.95), rgba(15, 23, 42, 0.98));
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.08), 0 0 15px rgba(0, 212, 255, 0.05);
}

/* Edit Session Modal Styling Override */
#session-modal.modal-mode-edit .modal-content {
    border: 1px solid rgba(0, 230, 118, 0.25);
    background: linear-gradient(145deg, rgba(16, 32, 26, 0.95), rgba(15, 23, 42, 0.98));
    box-shadow: 0 20px 40px rgba(0, 230, 118, 0.08), 0 0 15px rgba(0, 230, 118, 0.05);
}

/* Modal Mode Visibility for Delete Button */
#session-modal.modal-mode-add #delete-session-btn {
    display: none !important;
}

#session-modal.modal-mode-edit #delete-session-btn {
    display: block !important;
}

/* Elevate Alert & Confirm Modals Z-Index to avoid overlap issues */
#confirm-modal, #alert-modal {
    z-index: 3000 !important;
}

/* Weekly Gantt Layout Styles */
.gantt-weekly-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
    flex: 1;
}

.gantt-header-row {
    position: relative;
    height: 18px;
    margin-left: 60px;
    margin-bottom: 6px;
}

.gantt-header-hour {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.gantt-days-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: space-between;
}

.gantt-day-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex: 1;
}

.gantt-day-row-label {
    width: 50px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.gantt-day-row .gantt-container {
    flex: 1;
    min-height: 36px;
    margin-top: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.gantt-day-row .gantt-block {
    top: 4px;
    bottom: 4px;
    height: auto;
    border-radius: 4px;
}

.gantt-day-row .gantt-block-label {
    font-size: 0.65rem;
}

.gantt-day-row .gantt-hour-marker-minor {
    background: rgba(255, 255, 255, 0.015);
}

.gantt-day-row .gantt-hour-marker-major {
    background: rgba(255, 255, 255, 0.07);
}

/* Live Indicator Styles */
@media (max-width: 600px) {
  .view-switcher {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  .view-switcher button {
    flex: 1 1 45%;
    min-width: 0;
    margin: 4px 0;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 auto 16px;
    padding: 24px;
    box-sizing: border-box;
  }
  .input-group {
    flex-direction: column;
    width: 100%;
    margin-bottom: 12px;
  }
  .input-group label,
  .input-group input,
  .input-group select {
    width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-red);
    background: rgba(255, 23, 68, 0.12);
    border: 1px solid rgba(255, 23, 68, 0.3);
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-family);
    vertical-align: middle;
}

.live-indicator.hidden {
    display: none !important;
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-red);
    animation: live-pulse 1.5s infinite ease-in-out;
}

@keyframes live-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(255, 23, 68, 0.7);
    }
    70% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 0 6px rgba(255, 23, 68, 0);
    }
    100% {
        transform: scale(0.8);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(255, 23, 68, 0);
    }
}

/* Live Calendar Day Pulse */
.calendar-live-label {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-red);
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

.calendar-day.live-session-active {
    animation: calendar-live-pulse 2.5s infinite ease-in-out;
    border: 1px solid rgba(255, 23, 68, 0.6) !important;
}

@keyframes calendar-live-pulse {
    0% {
        background-color: rgba(255, 23, 68, 0.04);
        box-shadow: inset 0 0 8px rgba(255, 23, 68, 0.1);
        border-color: rgba(255, 23, 68, 0.4);
    }
    50% {
        background-color: rgba(255, 255, 255, 0.08);
        box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
    }
    100% {
        background-color: rgba(255, 23, 68, 0.04);
        box-shadow: inset 0 0 8px rgba(255, 23, 68, 0.1);
        border-color: rgba(255, 23, 68, 0.4);
    }
}

/* Custom Icon SVGs styling */
.icon-svg {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
}

/* Budgeting View */
.budgeting-widget {
    max-width: 1100px;
    margin: 0 auto;
}

.budgeting-intro {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.budgeting-total-group {
    max-width: 320px;
}

.budgeting-total-group input {
    width: min(100%, 220px);
}

.budgeting-layout {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr);
    gap: 28px;
    align-items: start;
    margin-top: 10px;
}

.budgeting-pie-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.budget-pie-host {
    width: min(100%, 360px);
    aspect-ratio: 1;
    touch-action: none;
    user-select: none;
}

.budget-pie-host.is-dragging {
    cursor: grabbing;
}

.budget-pie-svg {
    display: block;
    overflow: visible;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.budget-pie-handle {
    stroke-width: 2.5;
    cursor: grab;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.35));
    transition: stroke 0.15s ease, filter 0.15s ease;
}

.budget-pie-handle:hover {
    stroke: var(--accent-blue);
    filter: drop-shadow(0 0 14px rgba(0, 212, 255, 0.55));
}

.budget-pie-handle:focus {
    outline: none;
    stroke: var(--accent-blue);
    stroke-width: 3.5;
    filter: drop-shadow(0 0 16px rgba(0, 212, 255, 0.7));
}

.budget-pie-host.is-dragging .budget-pie-handle {
    cursor: grabbing;
}

.budgeting-snap-control {
    margin-top: 14px;
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.budgeting-snap-control .budget-field-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.budget-snap-modes {
    display: inline-flex;
    gap: 0;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.budget-snap-mode-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 14px;
    min-width: 56px;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.budget-snap-mode-btn + .budget-snap-mode-btn {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.budget-snap-mode-btn.active {
    background: rgba(0, 212, 255, 0.18);
    color: var(--accent-blue);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.16);
}

.budget-snap-mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.budgeting-pie-hint,
.budgeting-sum-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 12px;
}

.budgeting-bar-section {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}

.budgeting-bar-section .budgeting-list-title {
    margin-bottom: 14px;
}

.budget-bar-chart {
    width: 100%;
    min-height: 220px;
}

.budget-bar-chart-inner {
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    gap: 10px;
    min-height: 220px;
    padding: 8px 4px 0;
    overflow-x: auto;
}

.budget-bar-col {
    flex: 1 1 0;
    min-width: 56px;
    max-width: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.budget-bar-track {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px 12px 6px 6px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.budget-bar-fill {
    width: 72%;
    min-height: 4px;
    border-radius: 10px 10px 3px 3px;
    transition: height 0.12s ease-out;
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.12);
}

.budget-bar-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.budget-bar-amount {
    font-size: 0.72rem;
    color: var(--accent-green);
    font-weight: 600;
    text-align: center;
    word-break: break-all;
}

.budget-bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.budgeting-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}

.budgeting-actions .btn-outline {
    min-width: 200px;
}

.budget-export-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.budget-export-group .budget-field-label {
    text-align: center;
}

.budget-export-controls {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.budget-export-formats {
    display: inline-flex;
    gap: 0;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.budget-export-format-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 16px;
    min-width: 64px;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.budget-export-format-btn + .budget-export-format-btn {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.budget-export-format-btn.active {
    background: rgba(0, 212, 255, 0.18);
    color: var(--accent-blue);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.16);
}

.budget-export-format-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.budget-export-controls #budget-export-btn {
    min-width: 0;
    margin: 0;
    padding: 10px 18px;
}

.budget-export-controls #budget-export-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.budgeting-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.budgeting-list-title {
    margin: 0;
    font-size: 1.05rem;
}

.budget-division-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.budget-division-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.budget-division-row:focus-within {
    border-color: rgba(0, 212, 255, 0.45);
    background: rgba(255, 255, 255, 0.05);
}

.budget-division-swatch {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    margin-top: 30px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.25);
}

.budget-division-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(5.5rem, 6.5rem);
    grid-template-areas:
        "name percent"
        "amount amount";
    gap: 10px 12px;
    min-width: 0;
}

.budget-name-field {
    grid-area: name;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.budget-pct-field {
    grid-area: percent;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.budget-field-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.budget-name-input,
.budget-pct-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-family);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.budget-name-input {
    text-align: left;
}

.budget-pct-input {
    text-align: center;
    padding-right: 28px;
    -moz-appearance: textfield;
}

.budget-pct-input::-webkit-outer-spin-button,
.budget-pct-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.budget-name-input::placeholder {
    color: rgba(170, 180, 190, 0.65);
}

.budget-name-input:focus,
.budget-pct-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.budget-pct-row {
    position: relative;
    display: flex;
    align-items: center;
}

.budget-pct-suffix {
    position: absolute;
    right: 12px;
    color: var(--text-secondary);
    pointer-events: none;
    font-weight: 600;
}

.budget-division-amount {
    grid-area: amount;
    margin: 0;
    font-weight: 700;
    color: var(--accent-green);
    font-size: 0.95rem;
}

.budget-delete-btn {
    font-size: 1.35rem;
    line-height: 1;
    padding: 6px 10px;
    margin-top: 22px;
    color: var(--text-secondary);
    border-radius: 10px;
}

.budget-delete-btn:hover:not(:disabled) {
    color: var(--accent-red);
    background: rgba(255, 23, 68, 0.1);
}

.budget-delete-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 800px) {
    .budgeting-layout {
        grid-template-columns: 1fr;
    }

    .budget-division-fields {
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "percent"
            "amount";
    }

    .view-switcher {
        flex-wrap: wrap;
    }

    .view-switcher button {
        min-width: 120px;
        flex: 1 1 40%;
    }
}

