@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --surface-glass: rgba(15, 23, 42, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.3);
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #10b981 50%, #34d399 100%);
    --gradient-text: linear-gradient(to right, #34d399, #38bdf8);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; 
}

html, body { 
    width: 100%; 
    max-width: 100vw;
    height: 100%;
    overflow-x: hidden; 
    overscroll-behavior-x: none;
    position: relative; 
    -webkit-text-size-adjust: 100%; 
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    background-color: #05070a;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overscroll-behavior-y: none;
}

input, textarea, [contenteditable] {
    user-select: auto;
    -webkit-user-select: auto;
}

:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background-image: radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.15) 0, transparent 40%), 
                      radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.1) 0, transparent 40%), 
                      radial-gradient(at 50% 100%, rgba(52, 211, 153, 0.05) 0, transparent 50%);
    background-repeat: no-repeat;
    background-size: cover;
    z-index: -10;
    will-change: background-image;
}

input[type="text"], 
input[type="number"], 
input[type="date"], 
input[type="file"], 
input[type="email"], 
input[type="password"], 
select, 
textarea, 
.glass-input { 
    font-size: 16px !important; 
}

select option {
    background-color: #0f172a;
    color: #f8fafc;
}

#left-color-bar { 
    position: fixed; 
    top: 0; 
    left: 0; 
    bottom: 0; 
    width: 4px; 
    background: var(--gradient-primary); 
    z-index: 200; 
    box-shadow: 2px 0 15px rgba(16, 185, 129, 0.5); 
}

nav { 
    padding: calc(20px + env(safe-area-inset-top)) 40px 20px 40px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: rgba(15, 23, 42, 0.3); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    width: 100%; 
}

.logo-container { display: flex; align-items: center; gap: 12px; cursor: pointer; text-decoration: none; }
.logo-text { font-size: 1.6rem; font-weight: 800; background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; user-select: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 50px 20px; flex: 1; width: 100%; align-self: center; }

h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.1; letter-spacing: -1.5px; }

.control-panel { background: linear-gradient(145deg, rgba(30, 41, 59, 0.15) 0%, rgba(15, 23, 42, 0.4) 100%); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); text-align: left; padding: 40px; border-radius: 32px; border: 1px solid var(--border-glass); box-shadow: 0 30px 60px rgba(0,0,0,0.5); width: 100%; margin: 0 auto; box-sizing: border-box; }

.toggles-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cat-label { position: relative; background: rgba(255,255,255,0.03); padding: 12px 24px; border-radius: 30px; cursor: pointer; font-size: 0.95rem; font-weight: 600; border: 1px solid rgba(255,255,255,0.05); transition: 0.3s; color: var(--text-muted); }
.cat-checkbox { display: none; }
.cat-checkbox:checked + .cat-label { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border-color: #38bdf8; box-shadow: 0 0 15px rgba(56, 189, 248, 0.2); }

.cat-label::after { content: attr(data-tooltip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(7, 9, 15, 0.98) 100%); color: #f8fafc; padding: 10px 14px; border-radius: 8px; font-size: 0.75rem; font-weight: 500; text-transform: none; letter-spacing: normal; white-space: normal; width: max-content; max-width: 250px; text-align: center; opacity: 0; pointer-events: none; transition: 0.2s; border: 1px solid rgba(56, 189, 248, 0.4); z-index: 1000; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.cat-label:hover::after { opacity: 1; transform: translateX(-50%) translateY(-5px); }

.slider-container { background: rgba(0,0,0,0.3); padding: 20px; border-radius: 20px; border: 1px solid var(--border-glass); box-shadow: inset 0 5px 15px rgba(0,0,0,0.5); margin: 0 auto 20px; max-width: 100%; width: 100%; }
.budget-display { font-size: 3.5rem; font-weight: 800; margin-bottom: 5px; letter-spacing: -2px; text-align: center; background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.slider-wrapper { position: relative; margin: 15px 0 5px; width: 100%; }

input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 0; outline: none; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 8px; cursor: pointer; background: #1e293b; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); }
input[type=range]::-moz-range-track { width: 100%; height: 8px; cursor: pointer; background: #1e293b; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 28px; width: 28px; border-radius: 50%; background: #ffffff; cursor: pointer; margin-top: -10px; border: 3px solid #10b981; box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }
input[type=range]::-moz-range-thumb { height: 28px; width: 28px; border-radius: 50%; background: #ffffff; cursor: pointer; border: 3px solid #10b981; box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }

.slider-notch-row { position: relative; height: 6px; margin-top: 4px; pointer-events: none; user-select: none; }
.slider-notch-row span { position: absolute; top: 0; width: 2px; height: 6px; background: rgba(56, 189, 248, 0.45); border-radius: 1px; transform: translateX(-50%); }
.slider-notch-row span:nth-child(1) { left: calc(0 * (100% - 28px) / 6 + 14px); }
.slider-notch-row span:nth-child(2) { left: calc(1 * (100% - 28px) / 6 + 14px); }
.slider-notch-row span:nth-child(3) { left: calc(2 * (100% - 28px) / 6 + 14px); }
.slider-notch-row span:nth-child(4) { left: calc(3 * (100% - 28px) / 6 + 14px); }
.slider-notch-row span:nth-child(5) { left: calc(4 * (100% - 28px) / 6 + 14px); }
.slider-notch-row span:nth-child(6) { left: calc(5 * (100% - 28px) / 6 + 14px); }
.slider-notch-row span:nth-child(7) { left: calc(6 * (100% - 28px) / 6 + 14px); }

.slider-label-row { position: relative; height: 18px; margin-top: 2px; pointer-events: none; user-select: none; }
.slider-label-row span { position: absolute; font-size: 0.7rem; color: var(--text-muted); transform: translateX(-50%); white-space: nowrap; }
.slider-label-row span:nth-child(1) { left: calc(0 * (100% - 28px) / 6 + 14px); }
.slider-label-row span:nth-child(2) { left: calc(1 * (100% - 28px) / 6 + 14px); }
.slider-label-row span:nth-child(3) { left: calc(2 * (100% - 28px) / 6 + 14px); }
.slider-label-row span:nth-child(4) { left: calc(3 * (100% - 28px) / 6 + 14px); }
.slider-label-row span:nth-child(5) { left: calc(4 * (100% - 28px) / 6 + 14px); }
.slider-label-row span:nth-child(6) { left: calc(5 * (100% - 28px) / 6 + 14px); }
.slider-label-row span:nth-child(7) { left: calc(6 * (100% - 28px) / 6 + 14px); }

.cmd-invalid { color: #ef4444; cursor: help; text-decoration: underline; text-decoration-style: wavy; text-decoration-color: rgba(239, 68, 68, 0.55); position: relative; }
.cmd-invalid::after { content: attr(data-tooltip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(7, 9, 15, 0.98) 100%); color: #f8fafc; padding: 10px 14px; border-radius: 8px; font-size: 0.75rem; font-weight: 500; font-family: 'Plus Jakarta Sans', sans-serif; text-transform: none; letter-spacing: normal; white-space: normal; width: max-content; max-width: 300px; text-align: left; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; border: 1px solid rgba(239, 68, 68, 0.45); z-index: 1000; box-shadow: 0 10px 25px rgba(0,0,0,0.6); text-decoration: none; }
.cmd-invalid:hover::after { opacity: 1; transform: translateX(-50%) translateY(-5px); }

.calc-row { background: rgba(255,255,255,0.02); padding: 20px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); margin-bottom: 15px; position: relative; width: 100%; box-sizing: border-box; }
.input-row { display: flex; gap: 15px; flex-wrap: wrap; align-items: flex-end; width: 100%; box-sizing: border-box; }

.input-group { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; width: 100%; box-sizing: border-box; }
.input-group label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.glass-input { position: relative; z-index: 10; background: linear-gradient(145deg, rgba(14, 165, 233, 0.03) 0%, rgba(15, 23, 42, 0.3) 100%); border: 1px solid var(--border-highlight); color: var(--text-main); padding: 14px 15px; border-radius: 10px; outline: none; transition: 0.3s; width: 100%; box-shadow: inset 0 2px 10px rgba(0,0,0,0.2); box-sizing: border-box; }
.glass-input:focus { border-color: #38bdf8; background: linear-gradient(145deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.5) 100%); box-shadow: 0 0 15px rgba(56, 189, 248, 0.2); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 40px; }
.dash-card { background: linear-gradient(145deg, rgba(30, 41, 59, 0.2) 0%, rgba(15, 23, 42, 0.4) 100%); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.1); border-radius: 32px; padding: 35px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.gt-label { font-size: 0.95rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
.gt-value { font-size: 3.5rem; font-weight: 800; margin-bottom: 10px; word-break: break-word; }
.line-items { background: rgba(0,0,0,0.3); border-radius: 16px; padding: 20px; border: 1px solid rgba(255,255,255,0.05); }

.item-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-glass); font-size: 1.05rem; flex-wrap: nowrap; gap: 12px; }
.item-row span:first-child { flex: 1 1 auto; word-break: break-word; }
.item-row span:last-child { flex: 0 0 auto; white-space: nowrap; }

.muted-row { color: rgba(255, 255, 255, 0.4); }

.vram-bar-bg { position: relative; width: 100%; height: 12px; background: rgba(255, 255, 255, 0.05); border-radius: 6px; display: flex; overflow: visible; border: 1px solid var(--border-glass); }
.vram-bar-bg::after { content: attr(data-tooltip); position: absolute; bottom: 180%; left: 50%; transform: translateX(-50%); background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(7, 9, 15, 0.98) 100%); color: #f8fafc; padding: 10px 14px; border-radius: 8px; font-size: 0.75rem; font-weight: 500; text-transform: none; letter-spacing: normal; white-space: normal; width: max-content; max-width: 250px; text-align: center; opacity: 0; pointer-events: none; transition: 0.2s; border: 1px solid rgba(56, 189, 248, 0.4); z-index: 1000; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.vram-bar-bg:hover::after { opacity: 1; transform: translateX(-50%) translateY(-5px); }

.vram-segment { position: relative; height: 100%; transition: width 0.4s ease, background 0.4s ease; }
.vram-segment::after { content: attr(data-tooltip); position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, 0.9); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 0.75rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: 0.2s; border: 1px solid rgba(255,255,255,0.1); z-index: 1001; }
.vram-segment:hover::after { opacity: 1; transform: translateX(-50%) translateY(-5px); }
.vram-segment:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.vram-segment:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }

.copy-button { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 600; font-family: inherit; transition: 0.2s; }
.copy-button:hover { background: #38bdf8; color: #0f172a; }

.tooltip-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(56, 189, 248, 0.15); color: #38bdf8; font-size: 0.65rem; margin-left: 8px; cursor: help; position: relative; border: 1px solid rgba(56, 189, 248, 0.3); }
.tooltip-icon::after { content: attr(data-tooltip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(7, 9, 15, 0.98) 100%); color: #f8fafc; padding: 10px 14px; border-radius: 8px; font-size: 0.75rem; font-weight: 500; text-transform: none; letter-spacing: normal; white-space: normal; width: max-content; max-width: 250px; text-align: left; opacity: 0; pointer-events: none; transition: 0.2s; border: 1px solid rgba(56, 189, 248, 0.4); z-index: 1000; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.tooltip-icon:hover::after { opacity: 1; transform: translateX(-50%) translateY(-5px); }

.app-toast { position: fixed; bottom: 20px; right: 20px; padding: 15px 25px; background: #10b981; color: #fff; font-weight: 600; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); opacity: 0; transform: translateY(20px); transition: 0.3s; z-index: 9999; }
.app-toast--visible { opacity: 1; transform: translateY(0); }

.editable-table-input {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    width: 80px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: 0.2s;
    max-width: 100%;
}

.editable-table-input:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(14, 165, 233, 0.1);
}

.editable-table-input:focus {
    outline: none;
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.15);
}

@media (max-width: 768px) { 
    body { padding-left: 0; padding-top: 4px; }
    #left-color-bar { width: 100%; height: 4px; bottom: auto; }
    nav { padding: calc(15px + env(safe-area-inset-top)) 15px 15px 15px; flex-wrap: wrap; justify-content: space-between; gap: 15px; }
    .logo-text { font-size: 1.4rem; }
    .container { padding: 20px 10px; }
    h1 { font-size: 2.2rem; overflow-wrap: break-word; word-wrap: break-word; hyphens: auto; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 20px; } 
    .control-panel { padding: 20px 15px 120px 15px; border-radius: 20px; }
    .calc-row { padding: 15px; border-radius: 12px; }
    .input-row { flex-direction: column; align-items: stretch; width: 100%; gap: 12px; } 
    .budget-display { font-size: 2.8rem; }
    .slider-container { padding: 15px; }
    .toggles-grid { display: flex !important; flex-wrap: wrap !important; justify-content: center !important; gap: 10px !important; width: 100% !important; }
}