:root {
    --bg-color: #0b0e14;
    --card-bg: rgba(18, 24, 38, 0.85);
    --glass-border: rgba(255, 255, 255, 0.06);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --highlight-color: #bef264;
    --danger-color: #ef4444;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 8px;
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    /* No main scroll */
}

.app-container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 2px 0;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header h1 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #bef264);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-btn-share {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn-share:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-1px);
}

#reset-btn:hover {
    background: var(--danger-color);
}

.icon-btn-share.success {
    background: var(--highlight-color);
    color: var(--bg-color);
}

.subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* --- GRID DASHBOARD --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    /* Narrower left side */
    gap: 8px;
    flex: 1;
    overflow: hidden;
    margin-top: 4px;
}

.column-left,
.column-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* --- CARDS --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    backdrop-filter: blur(10px);
}

.card h2 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}

/* --- INPUTS --- */
.input-group {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.checkbox-group {
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.checkbox-group input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-size: 0.7rem;
}

label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
    white-space: nowrap;
    min-height: 14px;
}

input,
select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 6px 8px;
    color: white;
    font-size: 0.85rem;
    width: 100%;
}

.row {
    display: flex;
    gap: 8px;
}

.row .input-group {
    flex: 1;
}

.currency-input {
    display: flex;
    position: relative;
}

.currency-input input {
    padding-right: 35px;
}

.currency-input .currency {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.micro-note {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.1;
}

/* --- COSTS --- */
.costs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.cost-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 8px;
}

.cost-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.cost-name {
    font-size: 0.8rem;
    font-weight: 600;
    border: none !important;
    background: transparent !important;
    color: var(--text-primary);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2) !important;
    padding: 0;
    width: auto;
    max-width: 85%;
    cursor: text;
    transition: border-color 0.2s;
}

.cost-name:hover,
.cost-name:focus {
    border-bottom-color: var(--highlight-color) !important;
    outline: none;
}

.remove-btn {
    border: none;
    background: transparent;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    line-height: 1;
    transition: transform 0.2s, filter 0.2s;
}

.remove-btn:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
}

.cost-bottom {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    /* Keep on one line but give more space to input */
}

.cost-input-wrapper {
    flex: 1.5;
    min-width: 110px;
    position: relative;
}

.cost-value {
    padding-right: 32px !important;
    font-size: 0.85rem !important;
    font-weight: 700;
}

.unit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.cost-freq {
    flex: 1.8;
    min-width: 125px;
    font-size: 0.75rem !important;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2) !important;
}

.summary-row {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--glass-border);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: right;
}

/* --- SUMMARY CARD (TOP RIGHT) --- */
.highlight-card {
    border: 1px solid rgba(190, 242, 100, 0.15);
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item .label {
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.summary-item .val {
    font-size: 0.85rem;
    font-weight: 700;
}

.result-display-final {
    grid-column: span 3;
    background: linear-gradient(135deg, rgba(132, 204, 22, 0.1), rgba(132, 204, 22, 0.05));
    border: 1px solid rgba(190, 242, 100, 0.2);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    margin-top: 6px;
}

.hourly-breakdown {
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--highlight-color);
    display: flex;
    justify-content: center;
    gap: 16px;
    font-weight: 600;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.breakdown-item i {
    font-size: 0.8rem;
    opacity: 0.8;
}

#final-net-hand {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--highlight-color);
}

.currency-lg {
    font-size: 0.8rem;
    margin-left: 4px;
}

/* --- ICON BTNS --- */
.icon-btn {
    background: var(--accent-color);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.header-row h2 {
    margin: 0;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 2.5rem;
    color: var(--danger-color);
    margin-bottom: 15px;
}

.modal-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger-lg {
    flex: 1.5;
    background: var(--danger-color);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: filter 0.2s, transform 0.1s;
}

.btn-danger-lg:hover {
    filter: brightness(1.1);
}

.btn-danger-lg:active {
    transform: scale(0.98);
}

/* Desktop Force Columns */
@media (min-width: 901px) {
    .dashboard-grid {
        grid-template-columns: 310px 1fr;
    }
}

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

    body {
        overflow-y: auto;
        height: auto;
    }

    .modal-content {
        padding: 20px;
    }
}