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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: #e2e8f0;
    padding: 20px;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.app-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.app-header h1 i {
    color: #3b82f6;
    margin-right: 10px;
}

.app-header p {
    color: #94a3b8;
    font-size: 0.9rem;
}

.db-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
}

.db-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.db-offline {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Progress */
.wizard-progress {
    margin-bottom: 30px;
}

.progress-bar {
    height: 4px;
    background: #334155;
    border-radius: 2px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 16.66%;
}

.steps {
    display: flex;
    justify-content: space-between;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.step.active, .step.completed {
    opacity: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
}

.step.active .step-circle {
    background: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.step.completed .step-circle {
    background: #10b981;
}

.step span {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Wizard Content */
.wizard-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    min-height: 300px;
}

.wizard-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-step.active {
    display: block;
}

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

.wizard-step h2 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #f1f5f9;
}

.wizard-step h2 i {
    color: #3b82f6;
    margin-right: 8px;
}

.sub-section-title {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #334155;
}

.sub-section-title i {
    color: #8b5cf6;
    margin-right: 6px;
}

/* Form */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #475569;
}

.form-row {
    display: flex;
    gap: 15px;
}

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

.form-row .flex-2 {
    flex: 2;
}

.form-row .flex-1 {
    flex: 1;
}

/* Searchable Dropdown */
.dropdown-wrapper {
    position: relative;
}

.dropdown-input {
    width: 100%;
    padding: 12px 15px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.dropdown-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dropdown-input::placeholder {
    color: #475569;
}

.dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid #3b82f6;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dropdown-list.open {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #cbd5e1;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #334155;
    color: #fff;
}

.dropdown-custom {
    border-top: 1px solid #334155;
    color: #3b82f6;
    font-style: italic;
}

.dropdown-custom i {
    margin-right: 5px;
}

/* Scan input */
.scan-input {
    display: flex;
    gap: 10px;
}

.scan-input input {
    flex: 1;
    padding: 12px 15px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.scan-input input:focus {
    outline: none;
    border-color: #3b82f6;
}

.btn-scan {
    padding: 12px 18px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s;
    font-size: 0.85rem;
}

.btn-scan:hover {
    transform: scale(1.05);
}

/* Software */
.software-entry {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.software-entry .form-row {
    align-items: flex-end;
}

.btn-remove-sw {
    padding: 12px 14px;
    background: #ef4444;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    margin-bottom: 18px;
    transition: background 0.2s;
}

.btn-remove-sw:hover {
    background: #dc2626;
}

.btn-add-sw {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px dashed #334155;
    border-radius: 10px;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 5px;
}

.btn-add-sw:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Buttons */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: #334155;
    color: #e2e8f0;
}

.btn-prev:hover {
    background: #475569;
}

.btn-next {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    margin-left: auto;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.btn-save {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.btn-export {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

/* Summary */
.summary-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 12px;
}

.summary-card h3 {
    font-size: 0.9rem;
    color: #3b82f6;
    margin-bottom: 10px;
}

.summary-card p {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.summary-card p strong {
    color: #f1f5f9;
}

/* Entries Table */
.entries-section {
    margin-top: 40px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 25px;
}

.entries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.entries-header h2 {
    font-size: 1.1rem;
    color: #f1f5f9;
}

.entries-header h2 i {
    color: #10b981;
    margin-right: 8px;
}

.entries-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.last-saved {
    font-size: 0.75rem;
    color: #64748b;
}

.btn-danger-sm {
    padding: 6px 12px;
    background: #7f1d1d;
    border: none;
    border-radius: 6px;
    color: #fca5a5;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-danger-sm:hover {
    background: #991b1b;
}

.entries-table-wrapper {
    overflow-x: auto;
}

#entriesTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

#entriesTable th {
    background: #0f172a;
    padding: 10px 12px;
    text-align: left;
    color: #94a3b8;
    font-weight: 600;
}

#entriesTable td {
    padding: 10px 12px;
    border-top: 1px solid #334155;
    color: #cbd5e1;
}

#entriesTable tr:hover td {
    background: #263548;
}

.text-muted {
    color: #64748b;
}

.btn-edit-entry, .btn-delete-entry {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 4px;
}

.btn-edit-entry {
    background: #3b82f6;
}

.btn-edit-entry:hover {
    background: #2563eb;
}

.btn-delete-entry {
    background: #ef4444;
}

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

/* Scanner Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1e293b;
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
}

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

.modal-header h3 {
    color: #f1f5f9;
}

.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
}

#scannerContainer {
    width: 100%;
    min-height: 350px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

#scannerContainer video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 10px;
}

.scan-divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
    color: #64748b;
    font-size: 0.8rem;
}

.scan-divider::before,
.scan-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #334155;
}

.scan-divider::before { left: 0; }
.scan-divider::after { right: 0; }

.btn-photo-scan {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-photo-scan:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.scan-hint {
    text-align: center;
    margin-top: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 22px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: #065f46;
    color: #a7f3d0;
    border: 1px solid #10b981;
}

.toast-error {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #ef4444;
}

.toast-info {
    background: #1e3a5f;
    color: #bfdbfe;
    border: 1px solid #3b82f6;
}

/* Responsive */
@media (max-width: 600px) {
    body { padding: 10px; }
    .wizard-content { padding: 15px; }
    .steps { gap: 5px; }
    .step span { display: none; }
    .form-row { flex-direction: column; gap: 0; }
    .scan-input { flex-direction: column; }
    .btn-scan { width: 100%; justify-content: center; }
    .entries-header { flex-direction: column; align-items: flex-start; }
    .toast { left: 10px; right: 10px; bottom: 10px; }

    /* Software entries mobile layout */
    .software-entry { padding: 12px; }
    .software-entry .form-row {
        flex-direction: column;
        gap: 0;
        position: relative;
    }
    .software-entry .form-row .form-group.flex-2,
    .software-entry .form-row .form-group.flex-1 {
        flex: unset;
        width: 100%;
    }
    .software-entry .btn-remove-sw {
        position: absolute;
        top: 0;
        right: 0;
        margin: 0;
        padding: 8px 10px;
        border-radius: 0 8px 0 8px;
    }

    /* Dropdown on mobile */
    .dropdown-list {
        max-height: 150px;
    }
}
