* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

.navbar {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(203, 213, 225, 0.1);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: #fbbf24;
}

.nav-links {
    display: flex;
    gap: 12px;
}

.nav-button {
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(203, 213, 225, 0.15);
    border-radius: 8px;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background: rgba(217, 119, 6, 0.2);
    border-color: rgba(217, 119, 6, 0.5);
    color: #f1f5f9;
}

.nav-button.active {
    background: rgba(217, 119, 6, 0.3);
    border-color: rgba(217, 119, 6, 0.5);
    color: #fcd34d;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.header {
    margin-bottom: 40px;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(217, 119, 6, 0.15) 0%, transparent 50%);
    border-radius: 20px;
    filter: blur(30px);
}

.header-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon-box {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.3);
    flex-shrink: 0;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.header-title-row h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    background: rgba(217, 119, 6, 0.3);
    border: 1px solid rgba(217, 119, 6, 0.5);
    color: #fcd34d;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.header-subtitle {
    color: #94a3b8;
    font-size: 14px;
}

.top-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(203, 213, 225, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.card:hover {
    border-color: rgba(203, 213, 225, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.card-icon {
    font-size: 24px;
}

.card-purchase {
    border-top: 3px solid #d97706;
}

.card-profit {
    border-top: 3px solid #10b981;
    grid-column: span 2;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="number"] {
    width: 100%;
    padding: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(203, 213, 225, 0.15);
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 14px;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: rgba(217, 119, 6, 0.5);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}
.profit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.profit-box {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(203, 213, 225, 0.1);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.profit-box:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(203, 213, 225, 0.2);
}

.profit-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profit-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profit-icon {
    font-size: 18px;
}

.profit-value {
    font-size: 22px;
    font-weight: 700;
}

.profit-value.cost {
    color: #60a5fa;
}

.profit-value.revenue {
    color: #10b981;
}

.profit-unit {
    font-size: 12px;
    color: #64748b;
}

.profit-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.profit-badge.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.resale-section {
    margin-bottom: 32px;
}

.resale-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 700;
}

.resale-icon {
    font-size: 28px;
}

.resale-subtitle {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 24px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.item-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(203, 213, 225, 0.1);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
}

.item-card:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(203, 213, 225, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.item-icon {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
}

.item-card:hover .item-icon {
    transform: scale(1.2) rotate(5deg);
}

.item-info h3 {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 13px;
    margin-bottom: 3px;
}

.item-info p {
    font-size: 11px;
    color: #94a3b8;
}

.item-label {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.item-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.item-input-wrapper input {
    width: 100%;
    padding: 10px;
    padding-right: 60px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(203, 213, 225, 0.15);
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 13px;
    transition: all 0.3s ease;
}

.item-input-wrapper input:focus {
    outline: none;
    border-color: rgba(217, 119, 6, 0.5);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.unit-text {
    position: absolute;
    right: 12px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
}

.unit-text:hover {
    color: #f1f5f9;
    background: rgba(217, 119, 6, 0.15);
}

.unit-arrow {
    font-size: 8px;
    transition: transform 0.3s ease;
}

.unit-text:hover .unit-arrow {
    transform: scaleY(1.2);
}

@media (max-width: 1024px) {
    .top-section {
        grid-template-columns: 1fr;
    }

    .card-profit {
        grid-column: span 1;
    }

    .profit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .header-title-row h1 {
        font-size: 24px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .profit-grid {
        grid-template-columns: 1fr;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        flex-wrap: wrap;
    }
}

.watermark {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #fbbf24;
    pointer-events: none;
    z-index: 50;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.2) 0%, rgba(217, 119, 6, 0.1) 100%);
    border: 1px solid rgba(217, 119, 6, 0.4);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(217, 119, 6, 0.2);
    animation: watermarkGlow 3s ease-in-out infinite;
}

@keyframes watermarkGlow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(217, 119, 6, 0.2);
        border-color: rgba(217, 119, 6, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(217, 119, 6, 0.4);
        border-color: rgba(217, 119, 6, 0.6);
    }
}