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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f0f23;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.header-content {
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2d3748, #4a5568);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.progress-bar {
    display: flex;
    gap: 20px;
    align-items: center;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: scale(1.1);
}

.progress-step span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.progress-step.active span {
    color: #2d3748;
}

.step {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.6s ease-out;
}

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

.hidden {
    display: none;
}

.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.step-header h2 i {
    color: #667eea;
}

.step-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.field-categories {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.category {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.category h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category h3 i {
    color: #667eea;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.field-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.field-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.field-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: relative;
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    margin-right: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkmark:after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.field-card input:checked ~ .checkmark {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.field-card input:checked ~ .checkmark:after {
    display: block;
}

.field-card input:checked {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.field-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #2d3748;
}

.field-info i {
    color: #667eea;
    width: 20px;
    text-align: center;
}

.form-container {
    display: grid;
    gap: 30px;
}

.form-section {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: #667eea;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.items-section {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin: 20px 0;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.remove-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.add-item-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.add-item-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.custom-field-creator {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.custom-input,
.custom-select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.custom-input:focus,
.custom-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-add-custom {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-add-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.custom-field-item {
    position: relative;
}

.remove-custom-field {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-custom-field:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-outline {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 160px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.btn-header {
    background: rgba(255, 255, 255, 0.2);
    color: #2d3748;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-header:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.search-section {
    margin-bottom: 30px;
}

.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-bar i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.invoices-list {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.invoice-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.invoice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.invoice-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.invoice-card-date {
    color: #64748b;
    font-size: 0.875rem;
}

.invoice-card-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.invoice-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.invoice-card-detail {
    display: flex;
    flex-direction: column;
}

.invoice-card-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.invoice-card-detail-value {
    color: #2d3748;
    font-weight: 500;
}

.invoice-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-view {
    background: #667eea;
    color: white;
}

.btn-view:hover {
    background: #5a67d8;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 16px;
    flex-wrap: wrap;
}

.invoice {
    background: white;
    padding: 50px;
    margin: 30px auto;
    max-width: 900px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    font-family: 'Inter', sans-serif;
    border: 1px solid #e5e7eb;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 20px;
}

.company-info h3 {
    color: #2d3748;
    font-size: 24px;
    margin-bottom: 10px;
}

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

.invoice-details h2 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 10px;
}

.client-info {
    margin: 30px 0;
    padding: 20px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
}

.client-info h4 {
    color: #2d3748;
    margin-bottom: 10px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.items-table th,
.items-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.items-table th {
    background: #667eea;
    color: white;
}

.items-table tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

.totals {
    margin-left: auto;
    width: 300px;
    margin-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.total-row.final {
    font-weight: bold;
    font-size: 18px;
    border-bottom: 2px solid #667eea;
    color: #2d3748;
}

.invoice-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.logo-preview {
    max-width: 150px;
    max-height: 80px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .custom-field-creator .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-add-custom {
        width: 100%;
        justify-content: center;
    }
    
    .invoice-card-details {
        grid-template-columns: 1fr;
    }
    
    .invoice-card-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .invoice-card-actions {
        justify-content: center;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }
    
    .progress-bar {
        order: -1;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .step {
        padding: 25px;
    }
    
    .field-grid {
        grid-template-columns: 1fr;
    }
    
    .custom-input,
    .custom-select {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .item-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        width: 100%;
        max-width: 300px;
    }
    
    .invoice {
        padding: 30px 20px;
        margin: 20px 10px;
    }
    
    .invoice-header {
        flex-direction: column;
    }
    
    .invoice-details {
        text-align: left;
        margin-top: 20px;
    }
}
