/* Tool-specific styles only - base styles are in tool-layout.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0a;
    color: #e5e7eb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #141414;
    border-bottom: 1px solid #374151;
    z-index: 100;
}

    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

    margin-top: 60px;
    padding: 48px 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    max-width: 720px;
    margin: 0 auto;
}

.tool-main {
    flex: 1;
    padding: 32px 24px 120px;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.section-subtitle {
    font-size: 16px;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 16px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.text-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.text-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-input::placeholder {
    color: #6b7280;
}

.currency-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 16px;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    pointer-events: none;
    z-index: 1;
}

.currency-input {
    padding-left: 32px;
    width: 100%;
}

.currency-input::-webkit-outer-spin-button,
.currency-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

.select-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.select-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.select-input option {
    background-color: #1a1a1a;
}

input[type="date"].text-input {
    color-scheme: dark;
}

.input-error {
    font-size: 13px;
    color: #ef4444;
    min-height: 0;
}

.input-error:empty {
    display: none;
}

.button-row {
    display: flex;
    gap: 12px;
}

.button-primary {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    flex: 1;
}

.button-secondary {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #374151;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.modal-hidden {
    display: none;
}

.output-section {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.month-nav-btn {
    background-color: #2a2a2a;
    border: 1px solid #374151;
    color: #e5e7eb;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 150ms ease;
}

.month-nav-btn:hover {
    background-color: #3a3a3a;
}

.month-label {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    min-width: 180px;
    text-align: center;
}

.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 16px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    transition: background-color 150ms ease;
}

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}

.budget-summary {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.budget-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.budget-summary-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #d1d5db;
}

.budget-summary-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.budget-bar-track {
    width: 100%;
    height: 6px;
    background-color: #374151;
    border-radius: 3px;
    overflow: hidden;
}

.budget-bar-fill {
    height: 100%;
    border-radius: 3px;
    background-color: #10b981;
    transition: width 300ms ease, background-color 300ms ease;
    width: 0%;
}

.budget-bar-fill.warning {
}

.budget-bar-fill.over {
    background-color: #ef4444;
}

.budget-summary-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #9ca3af;
}

.budget-category-alerts {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.budget-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.budget-alert.warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.budget-alert.over {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chart-container .section-subtitle {
    align-self: flex-start;
}

#pie-chart {
    max-width: 100%;
    width: 300px;
    height: 300px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #d1d5db;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-amount {
    font-weight: 600;
    color: #ffffff;
}

.legend-percent {
    color: #6b7280;
}

.legend-item-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 8px 0;
}

.legend-item-detail .legend-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-budget-bar {
    width: 100%;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    overflow: hidden;
}

.legend-budget-fill {
    height: 100%;
    border-radius: 2px;
    background-color: #10b981;
    transition: width 300ms ease;
}

.legend-budget-fill.warning {
}

.legend-budget-fill.over {
    background-color: #ef4444;
}

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

.expense-list {
    display: flex;
    flex-direction: column;
    max-height: 480px;
    overflow-y: auto;
}

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

.expense-list::-webkit-scrollbar-track {
    background: transparent;
}

.expense-list::-webkit-scrollbar-thumb {
    background-color: #374151;
    border-radius: 3px;
}

.expense-entry {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #2a2a2a;
    transition: background-color 150ms ease;
}

.expense-entry:last-child {
    border-bottom: none;
}

.expense-entry:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.expense-entry-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.expense-entry-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.expense-date {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    flex-shrink: 0;
}

.expense-category-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    color: #ffffff;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.expense-notes {
    font-size: 13px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

.expense-entry-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.expense-amount {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.expense-delete-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 150ms ease;
    font-family: inherit;
}

.expense-delete-btn:hover {
    color: #ef4444;
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: #6b7280;
    font-size: 14px;
}

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

.pro-features-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid #374151;
}

.pro-feature-panel {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pro-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pro-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #d1d5db;
}

.pro-badge {
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.pro-panel-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pro-panel-toggle {
    background-color: #2a2a2a;
    border: 1px solid #374151;
    color: #d1d5db;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.pro-panel-toggle:hover {
    background-color: #374151;
}

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

.budget-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
}

.budget-item-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.budget-item-name {
    font-size: 14px;
    color: #e5e7eb;
    flex: 1;
}

.budget-item-input {
    width: 100px;
}

.budget-item-input .currency-input-wrapper {
    width: 100%;
}

.budget-item-input .text-input {
    padding: 8px 8px 8px 24px;
    font-size: 13px;
    width: 100%;
}

.budget-item-input .currency-symbol {
    left: 8px;
    font-size: 13px;
}

.budget-item-status {
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

.budget-item-status.ok {
    color: #10b981;
}

.budget-item-status.warning {
    color: #f59e0b;
}

.budget-item-status.over {
    color: #ef4444;
}

.recurring-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2a2a;
}

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

.recurring-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    border-left: 3px solid #646cff;
}

.recurring-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recurring-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.recurring-item-actions {
    display: flex;
    gap: 8px;
}

.recurring-item-actions button {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    padding: 2px 4px;
    transition: color 150ms ease;
}

.recurring-item-actions button:hover {
    color: #e5e7eb;
}

.recurring-item-actions button.delete-btn:hover {
    color: #ef4444;
}

.recurring-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #9ca3af;
}

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

.recurring-item-detail strong {
    color: #d1d5db;
    font-weight: 500;
}

.yoy-toggle-row {
    display: flex;
    gap: 8px;
}

.yoy-toggle-btn {
    background-color: #141414;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    flex: 1;
    text-align: center;
}

.yoy-toggle-btn:hover {
    background-color: #2a2a2a;
}

.yoy-toggle-btn.active {
    background-color: #646cff;
    border-color: #646cff;
    color: #ffffff;
}

#yoy-chart {
    max-width: 100%;
    width: 100%;
    height: auto;
}

.yoy-table-container {
    margin-top: 16px;
}

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

.yoy-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    border-bottom: 1px solid #374151;
}

.yoy-table td {
    padding: 10px 12px;
    color: #e5e7eb;
    border-bottom: 1px solid #2a2a2a;
}

.yoy-table .change-positive {
    color: #ef4444;
}

.yoy-table .change-negative {
    color: #10b981;
}

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pro-cta-text {
    font-size: 14px;
    color: #d1d5db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-overlay.modal-hidden {
    display: none;
}

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

.modal {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-content {
    padding: 24px;
}

.pro-features-list {
    margin-bottom: 24px;
}

.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.feature-check {
    width: 20px;
    height: 20px;
    background-color: #059669;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.feature-text {
    font-size: 15px;
    color: #e5e7eb;
}

.modal-cta {
    width: 100%;
    display: block;
}

.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: toastIn 200ms ease, toastOut 200ms ease 1.8s forwards;
    pointer-events: auto;
}

.toast.success {
    border-color: #059669;
}

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.footer {
    background-color: #0a0a0a;
    border-top: 1px solid #374151;
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

.error-message {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

.success-message {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

@media (max-width: 768px) {
        padding: 32px 16px;
    }

        font-size: 28px;
        line-height: 36px;
    }

        font-size: 14px;
    }

    .tool-main {
        padding: 24px 16px 100px;
    }

    .tool-container {
        gap: 32px;
    }

    .output-section {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 18px;
    }

    .month-label {
        font-size: 16px;
        min-width: 150px;
    }

    .expense-notes {
        max-width: 200px;
    }

    .pro-cta-content {
        flex-direction: column;
        gap: 10px;
    }

        padding: 0 16px;
    }

    .button-row {
        flex-direction: column;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

    .yoy-toggle-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stat-cards-grid {
        grid-template-columns: 1fr;
    }

    .chart-legend {
        flex-direction: column;
        align-items: flex-start;
    }

    .expense-entry-top {
        flex-wrap: wrap;
    }

    .recurring-item-details {
        flex-direction: column;
        gap: 4px;
    }
}