* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f4f2;
    color: #1a1a1a;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #e8e6e2;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    border: 1px solid #d4d0ca;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #28334a;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #4a4a4a;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d4d0ca;
    border-radius: 8px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #28334a;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #28334a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #3a4a6e;
    transform: translateY(-2px);
}

.error-msg {
    color: #c0392b;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

.success-msg {
    color: #1e8449;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

.info-text {
    text-align: center;
    color: #7a7a7a;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* Admin Dashboard */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #d4d0ca;
    margin-bottom: 30px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: transparent;
    border: 1px solid #d4d0ca;
    padding: 8px 16px;
    border-radius: 6px;
    color: #4a4a4a;
    cursor: pointer;
}

.btn-logout:hover {
    background: #e8e6e2;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid #d4d0ca;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    border-color: #28334a;
}

.card-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.dashboard-card h2 {
    color: #28334a;
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.dashboard-card p {
    color: #7a7a7a;
    font-size: 0.85rem;
}

.btn-back {
    background: transparent;
    border: 1px solid #d4d0ca;
    padding: 8px 16px;
    border-radius: 6px;
    color: #4a4a4a;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-back:hover {
    background: #e8e6e2;
}

/* Products */
.products-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #d4d0ca;
    border-radius: 12px;
    padding: 16px;
}

.product-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.product-info {
    flex: 1;
}

.product-info h3 {
    margin-bottom: 4px;
    font-size: 1rem;
    color: #28334a;
}

.product-info p {
    font-size: 0.85rem;
    color: #7a7a7a;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-product {
    background: #28334a;
    color: white;
}

.btn-danger {
    background: #c0392b;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    border: 1px solid #d4d0ca;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #7a7a7a;
}

.modal-close:hover {
    color: #28334a;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #7a7a7a;
}

.no-data, .error {
    text-align: center;
    padding: 40px;
    color: #7a7a7a;
}

.error {
    color: #c0392b;
}

.full-width {
    width: 100%;
}

.editor-actions {
    margin-top: 20px;
}

textarea {
    resize: vertical;
}

.info-note {
    margin-top: 20px;
    padding: 16px;
    background: #e8e6e2;
    border-radius: 8px;
    border-left: 3px solid #28334a;
}

.info-note p {
    color: #4a4a4a;
    font-size: 0.85rem;
    margin: 0;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid #d4d0ca;
    padding-bottom: 10px;
}

.category-tabs .tab-btn {
    padding: 10px 24px;
    background: transparent;
    border: none;
    color: #4a4a4a;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.category-tabs .tab-btn:hover {
    color: #28334a;
}

.category-tabs .tab-btn.active {
    background: #28334a;
    color: white;
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #7a7a7a;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #d4d0ca;
}

.product-description {
    font-size: 0.8rem;
    color: #7a7a7a;
    margin-top: 4px;
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid #d4d0ca;
    border-radius: 8px;
    color: #4a4a4a;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: #e8e6e2;
}

/* Mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .admin-container {
        overflow-x: hidden;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .admin-user {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .category-tabs {
        flex-wrap: wrap;
        gap: 8px;
        overflow-x: visible;
        padding-bottom: 5px;
    }
    
    .category-tabs .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

.category-tabs-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.category-tabs {
    display: flex;
    gap: 10px;
    min-width: min-content;
}

.category-tabs .tab-btn {
    white-space: nowrap;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
}

/* Dark Mode */
[data-theme="dark"] body {
    background: #0a0c10;
    color: #ffffff;
}

[data-theme="dark"] .login-card,
[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .product-card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .section-editor {
    background: #111318;
    border-color: #2a2e38;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #1a1d24;
    border-color: #2a2e38;
    color: #ffffff;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .add-section-btn {
    background: #93827a;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .add-section-btn:hover {
    background: #b0a298;
}

[data-theme="dark"] .edit-product {
    background: #93827a;
}

[data-theme="dark"] .category-tabs .tab-btn.active {
    background: #93827a;
}

[data-theme="dark"] .category-tabs .tab-btn:hover {
    color: #93827a;
}

[data-theme="dark"] .btn-logout,
[data-theme="dark"] .btn-back,
[data-theme="dark"] .btn-cancel {
    color: #ffffff;
    border-color: #2a2e38;
}

[data-theme="dark"] .btn-logout:hover,
[data-theme="dark"] .btn-back:hover,
[data-theme="dark"] .btn-cancel:hover {
    background: #2a2e38;
}

[data-theme="dark"] .admin-header {
    border-bottom-color: #2a2e38;
}

[data-theme="dark"] .dashboard-card h2 {
    color: #ffffff;
}

[data-theme="dark"] .product-info h3 {
    color: #ffffff;
}

[data-theme="dark"] .info-note {
    background: #1a1d24;
    border-left-color: #93827a;
}

[data-theme="dark"] .info-note p {
    color: #c0c0c0;
}

[data-theme="dark"] .media-type-selector,
[data-theme="dark"] .upload-area,
[data-theme="dark"] .gallery-upload {
    background: #1a1d24;
    border-color: #2a2e38;
}

[data-theme="dark"] .content-block {
    background: #1a1d24;
}

[data-theme="dark"] .block-type-select,
[data-theme="dark"] .block-textarea,
[data-theme="dark"] .list-item-input,
[data-theme="dark"] .subheading-input,
[data-theme="dark"] .section-title-input {
    background: #0d0f14;
    border-color: #2a2e38;
    color: #ffffff;
}