:root {
    /* Premium Dark Theme Palette */
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.1);

    /* Accents */
    --accent-gold: #fbbf24;
    --accent-gold-grad: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    --accent-cyan: #22d3ee;
    --accent-cyan-grad: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
    --accent-green: #34d399;
    --accent-green-grad: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --accent-orange: #fb923c;

    /* Spacing */
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* === LIGHT THEME OVERRIDES === */
body.light-theme {
    /* Main Backgrounds - Premium White Theme */
    --bg-dark: #ffffff;
    /* Pure white base */
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    /* Subtle gradient */

    /* Typography - High Contrast */
    --text-primary: #0f172a;
    /* Deep slate for readability */
    --text-secondary: #475569;
    /* Medium slate */

    /* Borders & Shadows - Stronger definition */
    --border-glass: rgba(0, 0, 0, 0.12);
    /* More visible borders */

    /* Specific overrides for visibility on white */
    --input-bg: #fff;
    --input-border: #cbd5e1;
}

/* In light theme, glass panels need strong shadows */
body.light-theme .glass-panel {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    background: #ffffff;
    /* Solid white panels */
    border: 1px solid var(--border-glass);
}

/* SETTINGS MENU STYLES */
.settings-dropdown {
    min-width: 250px;
    padding: 15px;
}

.settings-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.theme-switcher,
.lang-switcher {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 10px;
}

body.light-theme .theme-switcher,
body.light-theme .lang-switcher {
    background: #e2e8f0;
}

.theme-btn,
.lang-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.theme-btn.active,
.lang-btn.active {
    background: var(--accent-gold);
    /* Gold active state */
    color: #000;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-btn:hover:not(.active),
.lang-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

body.light-theme .theme-btn:hover:not(.active),
body.light-theme .lang-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

/* Adjust inputs for light theme */
body.light-theme .table-input {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body.light-theme .nav-btn {
    color: #475569;
}

body.light-theme .nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}


body {
    background-color: var(--bg-dark);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
    padding-bottom: 50px;
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove Spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* === STANDARD SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #64748b rgba(15, 23, 42, 0.5);
}

/* === BACKGROUND FX === */
.bg-glow-1 {
    position: fixed;
    top: -100px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.bg-glow-2 {
    position: fixed;
    bottom: -100px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* === HEADER === */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: auto;
    height: 40px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-family: 'Unbounded', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.highlight {
    color: var(--accent-gold);
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-btn {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: 0.2s;
}

.nav-btn:hover {
    color: white;
}

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

/* Settings gear icon - colored to match theme */
#settingsBtn svg {
    stroke: var(--accent-gold);
    /* Gold color matching theme */
}

body.light-theme #settingsBtn svg {
    stroke: #f59e0b;
    /* Brighter gold for light theme */
}

.user-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.logout-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* === GRID LAYOUT === */
.app-container {
    max-width: 1800px;
    /* Wider container */
    margin: 0 auto;
}

.calculator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    /* FIX: minmax(0, 1fr) prevents expansion */
    gap: 20px;
    padding: 20px;
    align-items: start;
    width: 100%;
}

@media (max-width: 992px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

/* === GLASS PANELS === */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    padding: 20px;
}

/* === FORM INPUTS (PROJECT DETAILS GRID) === */
.project-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    /* Allow columns to shrink */
    gap: 8px;
    margin-bottom: 12px;
}

.details-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.details-right {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    /* Allow flex children to shrink */
}

.info-group.full-height {
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.info-group label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- DYNAMIC CUSTOM INPUTS (for Project name etc) --- */
/* --- PREMIUM MINIMAL INPUTS (Polished Project Fields) --- */
.input-minimal-wrapper {
    position: relative;
    width: 100%;
    min-height: 36px;
    /* Compact height */
    display: flex;
    align-items: center;
}

.input-minimal-wrapper.full-height {
    /* Legacy removed, now handled by notes-field-container */
    height: auto;
    align-items: flex-start;
}

/* Container for Notes field to handle absolute expansion */
.notes-field-container {
    width: 100%;
    position: relative;
    display: block;
    min-width: 0;
    /* Allow shrinking */
}

/* Flex row: text + icon */
.notes-display-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

/* --- NOTES VIEW MODE (Truncated Text) --- */
.notes-view-mode {
    flex: 1;
    /* Take available space */
    min-width: 0;
    /* CRITICAL: Allow text to shrink */
    min-height: 36px;
    padding: 8px 12px;
    color: white;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
    border-radius: 8px;
    transition: background 0.2s;
    border: 1px solid transparent;
    display: block;
}

.notes-view-mode:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.notes-view-mode.placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Info Icon (i) - Fixed width on right */
.notes-view-mode-icon {
    flex-shrink: 0;
    /* Never shrink */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 21;
    border-radius: 4px;
    transition: all 0.2s;
}

.notes-view-mode-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
}

.notes-view-mode-icon svg {
    width: 16px;
    height: 16px;
}

.input-minimal {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    padding: 8px 12px;
    /* Compact padding */
    transition: all 0.2s ease;
    outline: none;
    line-height: 1.4;
    /* Compact line-height */
}

.input-minimal:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.input-minimal:focus {
    background: rgba(13, 17, 23, 0.95);
    /* Opaque background for overlay */
    border-color: var(--accent-gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(234, 179, 8, 0.2);
}

.input-minimal::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}

/* Textarea specific - Auto Expand logic */
textarea.input-minimal {
    resize: none;
    overflow: hidden;
    height: 44px;
    /* Matches min-height of wrapper */
    min-height: 44px;
    padding: 10px 40px 10px 12px;
    /* Right padding increased to 40px for icon */
    /* Explicitly match input padding */
    line-height: 1.5;
    /* Match input line-height */
    white-space: nowrap;
    /* Force single line visual in idle */
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
    display: block;
    /* Remove inline-block vertical-align issues */
}

textarea.input-minimal:focus {
    /* Standard focus state, no expansion */
    background: rgba(13, 17, 23, 0.95);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.2);
    z-index: 2;
    /* Slight lift to show border over neighbors if needed */
}

/* Notes Info Icon & Tooltip */
.notes-info-icon {
    position: absolute;
    right: 12px;
    /* Move inside the field area or just outside */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: help;
    opacity: 0.6;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    /* Above input */
    pointer-events: auto;
    /* Allow hover */
    background: transparent;
}



.notes-info-icon:hover {
    opacity: 1;
    color: var(--accent-gold);
}

.notes-info-icon svg {
    width: 16px;
    height: 16px;
}

.notes-tooltip {
    position: absolute;
    right: 30px;
    top: 0;
    width: 250px;
    background: #1e293b;
    border: 1px solid var(--border-glass);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    line-height: 1.4;
    color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: 0.2s;
    pointer-events: none;
    z-index: 101;
    white-space: pre-wrap;
    word-break: break-word;
}

.notes-info-icon:hover .notes-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* SAVED INDICATOR */
/* SAVED INDICATOR (Compact) */
.saved-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-green);
    font-size: 10px;
    /* Compact size */
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    /* Compact padding */
    border-radius: 8px;
    border: 1px solid rgba(74, 222, 128, 0.2);
    z-index: 20;
}

/* --- NOTES OVERLAY EDITOR --- */


.notes-editor-overlay {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    min-height: 60px;
    background: #0d1117;
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    padding: 8px;
    z-index: 100;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes-editor-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    resize: none;
    min-height: 40px;
    padding: 4px;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
}

.checkmark-btn {
    background: rgba(74, 222, 128, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.checkmark-btn:hover {
    background: var(--accent-green);
    color: black;
}

/* Info Icon in View Mode */
.notes-view-mode-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 21;
    /* Above saved indicator */
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-view-mode-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.input-minimal-wrapper.full-height .saved-indicator {
    top: 10px;
    /* Top right for textarea */
    transform: none;
}

.saved-indicator.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.input-minimal-wrapper.full-height .saved-indicator.visible {
    transform: scale(1.05);
}

.saved-indicator svg {
    width: 12px;
    height: 12px;
    stroke-width: 3px;
}



.sticky-pencil {
    opacity: 0;
    transition: 0.2s;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.sticky-pencil:hover {
    color: var(--accent-cyan);
}

.field-edit-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-edit-wrapper.col-flex {
    flex-direction: column;
    align-items: stretch;
    height: 100%;
}

.field-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-cyan);
    color: white;
    padding: 0;
    border-radius: 0;
    width: 100%;
    height: 100%;
    flex: 1;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.field-input.textarea {
    resize: none;
    min-height: 100%;
    height: 100%;
}

.field-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* === PREMIUM TABLES (COMPACT MODE) === */
.premium-table-wrapper {
    overflow: visible;
    /* Was auto - caused clipping and scrollbars */
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

/* HEADER ALIGNMENT FIX */
.premium-table th {
    padding: 8px 10px;
    text-align: left;
    color: #f1f5f9;
    /* ИСПРАВЛЕНО! Светлый текст вместо темного */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    /* CENTERED VERTICALLY */
    white-space: normal;
    word-break: break-word;
    /* Ensure wrapping */
    height: 60px;
    /* Fixed height symmetry */
}

.sub-header {
    display: block;
    font-size: 9px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Gradients for Headers */
.header-gradient-gold {
    background: var(--accent-gold-grad);
}

.header-gradient-cyan {
    background: var(--accent-cyan-grad);
}

.premium-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-secondary);
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    font-size: 13px;
}

.premium-table td:first-child {
    white-space: normal;
    line-height: 1.3;
}

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

.premium-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Table Inputs */
.table-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
    color: white;
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    text-align: center;
    transition: all 0.2s;
}

.table-input:focus {
    outline: none;
    /* Removed blue override here to prevent conflicts */
    /* border-color: var(--accent-cyan); */
    /* background: rgba(6, 182, 212, 0.1); */
    /* box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1); */
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.bold {
    font-weight: 700;
    color: white;
}



.price-cell {
    font-family: 'Unbounded', sans-serif;
    font-size: 13px;
}

.spacer {
    display: none;
}


/* Footer Totals inside Table */
.footer-row td {
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent-cyan);
    font-weight: 700;
    border-top: 2px solid var(--accent-cyan);
}

.footer-row-pre td {
    border: none;
    padding-bottom: 0;
}

/* === SECTION 2: RULES === */
.rules-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rule-link {
    flex: 1;
    min-width: 250px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 12px;
    border-radius: 8px;
    color: var(--accent-green);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.rule-link:hover {
    background: var(--accent-green-grad);
    color: #0f172a;
    border-color: transparent;
}

.rule-link svg {
    width: 16px;
    height: 16px;
}

.divider-text {
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent-cyan);
    padding: 10px;
    border-radius: 6px;
    font-size: 11px;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.4;
}

.spacer {
    height: 20px;
}

.highlight-cyan {
    color: var(--accent-cyan);
    font-weight: 700;
    font-family: 'Unbounded';
}

/* === FINAL TOTALS CARD === */
/* === FINAL TOTALS CARD - PREMIUM REDESIGN === */
.final-totals-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.total-card {
    padding: 15px;
    border-radius: 20px;
    position: relative;
    /* overflow: hidden; REMOVED to fix clipping on minimal */
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ... existing hover ... */
.total-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* ... existing minimal/recommended colors ... */
.total-card.minimal {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.6) 0%, rgba(16, 185, 129, 0.15) 100%);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-left: 6px solid #10b981;
    overflow: visible;
    /* Ensure visible */
}

/* Recommended Price - Premium Mint/Neon Green (Distinct from Minimal) */
.total-card.recommended {
    /* Richer, deeper green gradient with a slight teal tint for premium feel */
    background: linear-gradient(135deg, rgba(21, 128, 61, 0.8) 0%, rgba(4, 120, 87, 0.6) 100%);
    border: 1px solid rgba(110, 231, 183, 0.3);
    /* Emerald-300 border */
    border-left: 6px solid #34d399;
    /* Emerald-400 accent */
    position: relative;
    box-shadow: 0 10px 30px rgba(6, 95, 70, 0.3);
}

/* Shimmer removed for performance */
/* .total-card.recommended::before { ... } */
/* .total-card.recommended:hover::before { ... } */

/* ... padding adjusted ... */
.card-value {
    font-family: 'Unbounded', sans-serif;
    font-size: 30px;
    font-weight: 800;
    color: white;
    line-height: 1.4;
    /* Increased from 1.3 */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding-bottom: 12px;
    /* Increased padding */
    padding-right: 15px;
    position: relative;
    z-index: 2;
}

.minimal .card-value {
    background: linear-gradient(180deg, #ffffff 0%, #a7f3d0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.3));
}

.recommended .card-value {
    /* White to Bright Mint/Neon Green */
    background: linear-gradient(180deg, #ffffff 20%, #6ee7b7 60%, #10b981 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.4));
    font-size: 36px;
}

/* === PREMIUM WARNING TEXT === */
.total-card.warning-sell {
    background: linear-gradient(90deg, rgba(234, 88, 12, 0.1), rgba(251, 146, 60, 0.05), rgba(234, 88, 12, 0.1));
    background-size: 100% 100%;
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    text-align: center;
    padding: 15px;
    margin-top: 0px;
    /* Reduced margin-top (was 5px) to pull closer to top panel */
    margin-bottom: 5px;
    animation: panelPulse 3s ease-in-out infinite;
    /* Gentle breathing effect */
}

@keyframes panelPulse {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(249, 115, 22, 0);
        border-color: rgba(249, 115, 22, 0.2);
    }

    50% {
        box-shadow: 0 0 15px rgba(249, 115, 22, 0.15);
        /* Soft glow */
        border-color: rgba(249, 115, 22, 0.4);
    }
}

/* @keyframes gradientMove removed */

.card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.card-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
    /* Reduced from 8px */
    font-style: italic;
}



/* Updated Warning Text Style - Faster Pulse */
.warning-text {
    color: #fb923c;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(249, 115, 22, 0.6);
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(249, 115, 22, 0.8);
    }
}

/* === ACTION BUTTONS === */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.action-btn {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.action-btn.primary {
    background: var(--accent-green-grad);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.action-btn.outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.action-btn.outline:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* === TOASTS === */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    border-left: 4px solid var(--accent-cyan);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.toast.success {
    border-color: var(--accent-green);
}

.toast.error {
    border-color: #ef4444;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

/* === DYNAMIC EDITING STYLES (REFINED v2) === */

.premium-table tr:hover .edit-icon-btn,
.premium-table tr:hover .delete-row-btn {
    opacity: 1;
    pointer-events: all;
}

.editable-cell-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    position: relative;
}

.value-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.suffix {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 13px;
    opacity: 0.8;
}

.edit-icon-btn {
    opacity: 0;
    pointer-events: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
}

.edit-icon-btn:hover {
    color: var(--accent-cyan);
}

.edit-icon-btn svg {
    width: 12px;
    height: 12px;
}

.editable-text {
    cursor: text;
    border-bottom: 1px dashed transparent;
    transition: 0.2s;
}

.editable-text:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.inline-edit-container {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    overflow: visible;
    position: relative;
    z-index: 10;
}

.prefix-edit {
    color: var(--text-primary);
    font-weight: 400;
}

.inline-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-cyan);
    color: white;
    font-size: 13px;
    padding: 2px 5px;
    border-radius: 4px;
    width: auto;
    min-width: 40px;
    flex: 1;
    font-family: inherit;
}

.save-btn,
.cancel-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: 0.2s;
    flex-shrink: 0;
    min-width: 20px;
}

.save-btn {
    color: var(--accent-green);
}

.cancel-btn {
    color: #ef4444;
}

.save-btn:hover {
    transform: scale(1.1);
}

.cancel-btn:hover {
    transform: scale(1.1);
}

.save-btn svg,
.cancel-btn svg {
    width: 16px;
    height: 16px;
}

/* Add Row & Reset Controls */
.table-controls {
    display: flex;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.3);
    border-top: 1px solid var(--border-glass);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    overflow: hidden;
    /* Round corners for children */
}

.add-row-wrapper {
    flex: 1;
    /* Takes up most space */
    padding: 8px;
    display: flex;
    justify-content: center;
    border-right: 1px solid var(--border-glass);
}

.add-row-btn-styled {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 20px;
    border-radius: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
}

/* Specific Orange Hover for Catalog Button */
/* Default Hover (Cyan) - Restored for Right Table */
.add-row-btn-styled:hover {
    color: var(--accent-cyan);
    opacity: 1;
}

/* Specific Orange Hover for Left Table Catalog Button */
.btn-catalog-orange:hover {
    color: #f97316 !important;
    /* ORANGE */
    opacity: 1;
}


/* Reset Section Button */
.reset-section-btn {
    background: rgba(239, 68, 68, 0.05);
    /* Very subtle red tint */
    border: none;
    color: var(--text-secondary);
    padding: 0 15px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    opacity: 0.6;
}

.reset-section-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    opacity: 1;
}

/* Delete Row Button */
.delete-placeholder {
    width: 20px;
    display: inline-flex;
    justify-content: center;
    margin-right: 4px;
}

.delete-row-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: 0.2s;
}

.delete-row-btn:hover {
    transform: scale(1.1);
}

.delete-row-btn svg {
    width: 14px;
    height: 14px;
}

.cell-flex {
    display: flex;
    align-items: center;
}

/* Delete Icon Styling */
.delete-icon-btn {
    opacity: 0;
    transition: opacity 0.2s;
    color: #ef4444;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hover-row:hover .delete-icon-btn {
    opacity: 1;
}

.name-cell-wrapper {
    position: relative;
}

/* === INFO ICON & TOOLTIPS === */
.position-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-icon-wrapper {
    position: relative;
    display: inline-flex;
    cursor: help;
}

.info-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: serif;
    font-style: italic;
    font-weight: 700;
    transition: 0.2s;
}

.info-icon-wrapper:hover .info-icon {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.1);
}

.info-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: translateY(-5px);
    width: max-content;
    max-width: 300px;
    background: #0f172a;
    border: 1px solid #f97316;
    /* Thin solid orange border */
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4), 0 4px 20px rgba(0, 0, 0, 0.8);
    /* Stronger neon glow */
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.5;
    font-weight: 400;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    z-index: 9999;
    /* Force top layer */
    text-align: left;
    white-space: normal;
    left: 0;
    transform: none;
    background: rgba(15, 23, 42, 0.98);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    max-width: 300px;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    word-wrap: break-word;
}

/* Tooltip Arrow */
.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 10px;
    /* Align arrow to left */
    margin-left: 0;
    border-width: 6px;
    border-style: solid;
    border-color: #f97316 transparent transparent transparent;
}

.info-icon-wrapper:hover .info-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-5px);
}

/* === MENU DROPDOWN === */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 8px 0;
    margin-top: 8px;
    flex-direction: column;
}

.dropdown-content.show {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-item {
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--accent-gold);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 6px 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* === MODAL STYLES === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.search-bar {
    margin-bottom: 15px;
}

.search-bar input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
}

.catalog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.catalog-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.catalog-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-glass);
}


.catalog-item.selected {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.catalog-item.selected::after {
    content: '✓';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #22c55e;
    font-weight: bold;
}

.item-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: white;
}

.item-info p {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
}

/* Rename to item-price to match JS */
.item-price {
    margin-top: 6px;
    font-size: 11px;
    font-family: monospace;
    color: #f97316;
    /* ORANGE for prices */
    text-shadow: 0 0 5px rgba(249, 115, 22, 0.2);
}

/* Override for Expense Modal - Cyan/Blue Prices */
#expenseModal .item-price {
    color: #22d3ee !important;
    text-shadow: 0 0 5px rgba(34, 211, 238, 0.3);
}

.catalog-item.selected .item-price {
    color: #fdba74;
}

/* Override for Expense Modal Selection Text */
#expenseModal .catalog-item.selected .item-price {
    color: #67e8f9 !important;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-confirm {
    padding: 8px 16px;
    background: var(--accent-green);
    border: none;
    color: black;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* === INFO MENU BUTTON === */
#infoMenuBtn {
    background: rgba(52, 211, 153, 0.1);
    /* Subtle green tint */
    color: var(--accent-green);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 6px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    /* Reset defaults */
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

#infoMenuBtn:hover {
    background: var(--accent-green-grad);
    color: #0f172a;
    /* Dark text for contrast on bright green */
    border-color: transparent;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.3);
    transform: translateY(-1px);
}

#infoMenuBtn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

/* === NEON GLOW STYLES === */
.footer-neon {
    background: rgba(6, 182, 212, 0.15);
    /* Cyan tint */
    border-top: 1px solid var(--accent-cyan);
    box-shadow: 0 -2px 10px rgba(6, 182, 212, 0.2);
}

.footer-neon td {
    color: var(--accent-cyan) !important;
    font-weight: 800;
    font-size: 1.1em;
    text-shadow: 0 0 5px rgba(6, 182, 212, 0.4);
}

/* Orange neon footer for positions table - Unified Design */
.footer-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    /* Same gradient family as header */
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
    box-shadow: 0 -4px 20px rgba(249, 115, 22, 0.3);
    /* Integrated glow */
    transition: all 0.2s ease;
}

.footer-orange:hover {
    background: linear-gradient(135deg, #f5b02e 0%, #ea580c 100%) !important;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.5) !important;
}

/* Apply neon to cells for better rendering */
.footer-orange td {
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1.1em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-bottom: none;
    /* Clean bottom */
}

.footer-orange:hover {
    filter: brightness(1.1);
    box-shadow: 0 -4px 25px rgba(249, 115, 22, 0.5);
    /* Brightens on hover */
}


/* Orange border for positions table inputs */
#specialistsTableBody input.table-input,
#specialistsTableBody input[type="number"] {
    border: 1px solid rgba(249, 115, 22, 0.4) !important;
    background: rgba(0, 0, 0, 0.3) !important;
    color: #fff !important;
    font-size: 15px !important;
    width: 70px !important;
    transition: all 0.2s ease;
}

#specialistsTableBody input.table-input:focus,
#specialistsTableBody input[type="number"]:focus {
    border-color: rgba(249, 115, 22, 0.8) !important;
    background: rgba(249, 115, 22, 0.05) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25) !important;
}

/* Cyan border for expenses table inputs - SUBTLE */
#customExpensesTableBody input.table-input,
#customExpensesTableBody input[type="number"] {
    border: 1px solid rgba(34, 211, 238, 0.4) !important;
    background: rgba(0, 0, 0, 0.3) !important;
    color: #fff !important;
    font-size: 15px !important;
    width: 70px !important;
    transition: all 0.2s ease;
}

#customExpensesTableBody input.table-input:focus,
#customExpensesTableBody input[type="number"]:focus {
    border-color: rgba(34, 211, 238, 0.8) !important;
    background: rgba(34, 211, 238, 0.05) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2) !important;
}

.premium-table th {
    text-align: center;
}


/* Specific left align for first column if needed */
.premium-table th:first-child {
    text-align: left;
    padding-left: 15px;
}

/* =========================================
   UNIFIED TOTALS PANEL (New Premium Design)
   ========================================= */

.unified-total-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    /* Dark premium glass background with subtle green undertone */
    background: linear-gradient(135deg, rgba(6, 20, 30, 0.85) 0%, rgba(6, 40, 30, 0.8) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 24px;
    padding: 25px 0;
    margin-bottom: 5px;
    /* Reduced from 20px for tighter layout */
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.total-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px;
    position: relative;
    z-index: 2;
    min-width: 0;
    /* CRITICAL FIX: Allows text shrinking instead of container expanding */
}

.section-left {
    text-align: left;
    align-items: flex-start;
}

.section-right {
    text-align: right;
    align-items: flex-end;
}

/* Stylish Vertical Divider */
.total-divider {
    width: 1px;
    height: 70px;
    background: linear-gradient(180deg,
            rgba(52, 211, 153, 0) 0%,
            rgba(52, 211, 153, 0.4) 50%,
            rgba(52, 211, 153, 0) 100%);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

/* Left: Minimal (Platinum/Silver - Base Value) */
.section-left .card-label {
    color: #cbd5e1;
    /* Slate-300 / Silver */
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.section-left .card-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    margin-bottom: 8px;
}

.section-left .card-value {
    font-family: 'Unbounded', sans-serif;
    font-size: 36px;
    font-weight: 800;
    /* White to Silver Gradient */
    background: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(148, 163, 184, 0.3));
    line-height: 1.2;
    white-space: nowrap;
    /* Essential for width calculation */
    width: fit-content;
    /* FIX: Allows precise text width measurement */
}


/* Right: Recommended (Premium Sharp Green) */
.section-right .card-label {
    color: #34d399;
    /* Brighter accent */
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
    /* text-shadow: removed for sharpness */
}

.section-right .card-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    margin-bottom: 8px;
}

.section-right .card-value {
    font-family: 'Unbounded', sans-serif;
    font-size: 42px;
    /* Prominent size */
    font-weight: 800;
    /* Solid Green Color (No Gradient) */
    background: none !important;
    -webkit-text-fill-color: initial !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
    color: #4ade80 !important;
    /* Bright Emerald Green */
    filter: drop-shadow(0 2px 0px rgba(0, 0, 0, 0.25));
    /* Hard shadow only */
    line-height: 1.2;
    white-space: nowrap;
    /* Essential for width calculation */
    width: fit-content;
    /* FIX: Allows precise text width measurement */
}

/* Hover Effect */
.unified-total-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.unified-total-card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.3);
    transform: translateY(-2px);
}

/* === IMPROVED INPUTS (Project Name & Notes) === */
.input-wrapper {
    width: 100%;
    position: relative;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.input-wrapper:hover .edit-icon-overlay {
    opacity: 1;
}

.premium-input-transparent {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: inherit;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.premium-input-transparent:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-glass);
}

.premium-input-transparent:focus {
    background: rgba(15, 23, 42, 0.3);
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.2);
}

.edit-icon-overlay {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--accent-orange);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    padding: 2px;
    display: flex;
}

/* Specific fix for textarea wrapper */
.input-wrapper.full-height .edit-icon-overlay {
    top: 12px;
    transform: none;
}