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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Header */
h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #e94560, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Back button */
.back-btn {
    background: none;
    border: none;
    color: #e94560;
    font-size: 1rem;
    cursor: pointer;
    padding: 10px 0;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #f39c12;
}

/* Categories */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.category-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: #e94560;
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.category-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.category-stats {
    color: #888;
    font-size: 0.9rem;
}

/* Mode selection */
.mode-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-card:hover {
    background: rgba(233, 69, 96, 0.1);
    border-color: #e94560;
    transform: scale(1.02);
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.mode-card h2 {
    margin-bottom: 15px;
}

.mode-card p {
    color: #888;
}

/* Progress bar */
.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 30px;
    position: relative;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #e94560, #f39c12);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Product card large */
.product-card-large {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 20px;
}

.product-info {
    margin-bottom: 30px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row label {
    color: #888;
    font-size: 0.9rem;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 500;
}

.info-value.suggested {
    color: #f39c12;
}

.info-value.price {
    color: #27ae60;
    font-family: 'Courier New', monospace;
}

/* Edit section */
.edit-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
}

.edit-section label {
    display: block;
    margin-bottom: 10px;
    color: #888;
    font-size: 0.9rem;
}

.name-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.name-input:focus {
    outline: none;
    border-color: #e94560;
}

.name-input::placeholder {
    color: #666;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 25px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(90deg, #e94560, #f39c12);
    color: #fff;
    flex: 1;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.btn-outline {
    background: transparent;
    color: #888;
    border: 1px solid #888;
}

.btn-outline:hover {
    color: #fff;
    border-color: #fff;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-save {
    background: #27ae60;
    color: #fff;
}

.btn-save:hover {
    background: #2ecc71;
}

.btn-delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
    margin-top: 15px;
    width: 100%;
}

.btn-delete:hover {
    background: #e74c3c;
    color: #fff;
}

.btn-delete.is-deleted {
    background: #e74c3c;
    color: #fff;
}

.btn-restore {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.btn-restore:hover {
    background: #2ecc71;
    color: #fff;
}

.delete-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.delete-icon {
    margin-right: 5px;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* Table */
.table-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 20px;
}

#products-table {
    width: 100%;
    border-collapse: collapse;
}

#products-table th {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#products-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

#products-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

#products-table tr.deleted {
    opacity: 0.5;
    background: rgba(231, 76, 60, 0.1);
}

#products-table tr.deleted td {
    text-decoration: line-through;
}

#products-table tr.deleted td:last-child {
    text-decoration: none;
}

.product-card-large.is-deleted {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.product-card-large.is-deleted .info-value {
    text-decoration: line-through;
    opacity: 0.6;
}

.deleted-badge {
    background: #e74c3c;
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 15px;
}

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

#products-table input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#products-table button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-delete.btn-small,
.btn-restore.btn-small {
    padding: 8px 12px;
}

#products-table .name-col {
    font-weight: 500;
}

#products-table .suggested-col {
    color: #f39c12;
}

#products-table .price-col {
    color: #27ae60;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

#products-table input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
}

#products-table input:focus {
    outline: none;
    border-color: #e94560;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #27ae60;
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .product-card-large {
        padding: 20px;
    }

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

    .table-container {
        overflow-x: auto;
    }

    #products-table {
        min-width: 700px;
    }
}
