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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.sidebar-header h2 i {
    font-size: 1.3rem;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-info-sidebar span {
    font-weight: 600;
    font-size: 14px;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: #f5f7fa;
}

.main-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    display: none;
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    color: #333;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #e9ecef;
}

.main-header h1 {
    color: #333;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

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

.content-section {
    display: none;
    padding: 30px;
}

.content-section.active {
    display: block;
}

.section-header {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: flex-end;
}


.upload-section {
    position: relative;
}

.file-input {
    display: none;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.toolbar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.selection-info {
    font-weight: 600;
    color: #555;
    font-size: 16px;
}

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

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

.btn:hover {
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-height: 400px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr.selected {
    background: #e7edff;
    border-left: 3px solid #667eea;
}

.data-table td {
    padding: 15px 20px;
    vertical-align: middle;
}

.checkbox-col {
    width: 50px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.image-col {
    width: 100px;
}

.table-image-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

.table-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-col {
    width: 80px;
}

.table-icon-wrapper {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.images-count-col {
    width: 120px;
}

.actions-col {
    width: 150px;
}

.table-cell-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-name-table {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.image-name-table.unnamed {
    color: #6c757d;
    font-style: italic;
}

.name-input-table {
    flex: 1;
    padding: 6px 10px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.name-input-table:focus {
    outline: none;
    border-color: #764ba2;
}

.table-description {
    color: #6c757d;
    line-height: 1.5;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.icon-btn.btn-edit {
    background: #e7f3ff;
    color: #0066cc;
}

.icon-btn.btn-edit:hover {
    background: #cce7ff;
    transform: translateY(-1px);
}

.icon-btn.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.icon-btn.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.icon-btn.btn-delete {
    background: #ffe7e7;
    color: #cc0000;
}

.icon-btn.btn-delete:hover {
    background: #ffcccc;
    transform: translateY(-1px);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #e7f3ff;
    color: #0066cc;
}

.badge-info {
    background: #e7f0ff;
    color: #667eea;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    display: none;
}

.empty-state.show {
    display: block;
}

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

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

.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: #f8f9fa;
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-body p {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.5;
}

.warning {
    color: #dc3545;
    font-weight: 600;
    font-size: 14px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }
    
    .sidebar-header h2 span,
    .nav-item span,
    .user-info-sidebar span {
        display: none;
    }
    
    .sidebar-header {
        padding: 20px 10px;
        text-align: center;
    }
    
    .sidebar-header h2 {
        justify-content: center;
    }
    
    .nav-item {
        justify-content: center;
        padding: 15px 10px;
    }
    
    .sidebar-footer {
        padding: 15px 10px;
    }
    
    .btn-logout {
        padding: 8px;
    }
    
    .btn-logout span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .main-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .main-header h1 {
        font-size: 1.5rem;
    }
    
    .content-section {
        padding: 20px 15px;
    }
    
    .toolbar {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .toolbar-actions {
        justify-content: center;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 15px;
    }
    
    .table-image-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .table-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .modal-content {
        margin: 20px;
        width: auto;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 15px;
    }
}


/* Service Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.required {
    color: #dc3545;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

.icon-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-input-group .form-input {
    flex: 1;
}

.icon-preview {
    width: 50px;
    height: 50px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #667eea;
    flex-shrink: 0;
}

.service-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.service-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.service-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.no-images-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
}

/* Image Selection Modal */
.image-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.image-selection-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-selection-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.image-selection-item.in-service {
    opacity: 0.6;
    cursor: not-allowed;
}

.image-selection-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    z-index: 2;
    cursor: pointer;
}

.image-selection-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-selection-label {
    padding: 8px;
    font-size: 12px;
    color: #333;
    background: white;
    text-align: center;
    word-break: break-word;
}

.in-service-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-header {
        padding: 15px;
    }
    
    .header-left {
        gap: 10px;
    }
    
    .main-header h1 {
        font-size: 1.25rem;
    }
    
    .content-section {
        padding: 15px 10px;
    }
    
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .toolbar-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}
