/* ==================== Dashboard Layout ==================== */

.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
    overflow-x: hidden;
}

/* ==================== Sidebar ==================== */
.sidebar {
    width: 280px;
    background: var(--dark-color);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    margin: 0;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.sidebar-user {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.user-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.user-info p {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: var(--gradient-1);
    color: white;
    font-weight: 600;
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* ==================== Main Content ==================== */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

.page-title {
    font-size: 1.5rem;
    margin: 0;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-notification {
    position: relative;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--dark-color);
    padding: 0.5rem;
}

.btn-notification .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.btn-back-home {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gradient-1);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.3s;
}

.btn-back-home:hover {
    transform: translateY(-2px);
}

/* ==================== Content Wrapper ==================== */
.content-wrapper {
    flex: 1;
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ==================== Welcome Card ==================== */
.welcome-card {
    background: var(--gradient-1);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.welcome-card p {
    opacity: 0.9;
    margin: 0;
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    margin: 0 0 0.25rem 0;
}

.stat-info p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* ==================== Dashboard Grid ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

/* ==================== Activity List ==================== */
.activity-list {
    padding: 1.5rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon i {
    font-size: 1.5rem;
}

.activity-info p {
    margin: 0 0 0.25rem 0;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-color);
}

/* ==================== Tips List ==================== */
.tips-list {
    padding: 1.5rem;
}

.tip-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.tip-item:last-child {
    border-bottom: none;
}

.tip-item i {
    color: #f59e0b;
    font-size: 1.2rem;
    margin-top: 0.2rem;
}

.tip-item p {
    margin: 0;
    line-height: 1.6;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* ==================== Section Header ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    margin: 0;
}

/* ==================== Product Form ==================== */
.product-form {
    padding: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    margin-top: 0.5rem;
    color: var(--text-color);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ==================== Products Container ==================== */
.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card-dashboard {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.product-card-dashboard img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card-dashboard .content {
    padding: 1.5rem;
}

.product-card-dashboard h4 {
    margin: 0 0 0.5rem 0;
}

.product-card-dashboard .price {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.product-card-dashboard .stock {
    font-size: 0.9rem;
    color: var(--text-color);
}

.product-card-dashboard .actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ==================== Profile Info ==================== */
.profile-info {
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    flex-shrink: 0;
}

.profile-details {
    flex: 1;
}

.profile-detail-item {
    display: flex;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-detail-item:last-child {
    border-bottom: none;
}

.profile-detail-item strong {
    width: 150px;
    color: var(--text-color);
}

/* ==================== Settings ==================== */
.settings-list {
    padding: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h4 {
    margin: 0 0 0.25rem 0;
}

.setting-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Switch Toggle */
.switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 26px;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.4s;
}

input:checked + .slider {
    background: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* ==================== Buttons ==================== */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--dark-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }

    .topbar {
        padding: 1rem;
    }

    .welcome-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .products-container {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .profile-info {
        flex-direction: column;
        text-align: center;
    }

    .profile-detail-item {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ==================== Advanced Product Form Styles ==================== */
.product-form-advanced {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

.form-control-modern {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control-modern:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.required::after {
    content: ' *';
    color: #ef4444;
}

.form-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 0.5rem 0 1rem 0;
}

/* Image Upload Grid */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 1rem;
}

.image-upload-box {
    aspect-ratio: 1;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9fafb;
}

.image-upload-box:hover {
    border-color: #667eea;
    background: #f3f4f6;
}

.image-upload-box.main-upload {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    background: white;
}

.image-upload-box i {
    font-size: 24px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.image-upload-box p {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    padding: 0 10px;
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.editor-btn {
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4b5563;
}

.editor-btn:hover {
    background: #f3f4f6;
    border-color: #667eea;
    color: #667eea;
}

.editor-divider {
    width: 1px;
    background: #d1d5db;
    margin: 0 4px;
}

.editor-area {
    border-radius: 0 0 6px 6px !important;
    border-top: none !important;
    min-height: 150px;
    resize: vertical;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-form .form-group {
    margin-bottom: 0;
}

.profile-form .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.profile-form .form-group label i {
    color: var(--primary-color);
    font-size: 1rem;
}

.profile-form .form-group input,
.profile-form .form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.profile-form .form-group input:focus,
.profile-form .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.profile-form .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 2px solid #f3f4f6;
}

.profile-form .btn-primary {
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.profile-form .btn-secondary {
    padding: 0.875rem 2rem;
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-form .btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Placeholder Box */
.placeholder-box {
    text-align: center;
    padding: 3rem 1rem;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    color: #9ca3af;
}

.placeholder-box i {
    font-size: 48px;
    margin-bottom: 1rem;
}

.placeholder-box p {
    margin: 0;
    font-size: 14px;
}

/* Form Actions Bottom */
.form-actions-bottom {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 2px solid #f3f4f6;
}

.btn-primary-large {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    padding: 14px 32px;
    background: white;
    color: #6b7280;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Responsive untuk Form Advanced */
@media (max-width: 768px) {
    .image-upload-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .image-upload-box.main-upload {
        grid-column: 1 / 4;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions-bottom {
        flex-direction: column-reverse;
    }
    
    .btn-primary-large,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
