.categories-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.categories-grid {
    display: grid;
    gap: 20px;
}

.category-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

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

.category-info h3 {
    margin: 0 0 5px 0;
    color: #374151;
    font-size: 18px;
}

.category-info p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

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

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

.category-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 14px;
}

.stat-number {
    font-weight: 600;
    color: #374151;
}

.fields-section {
    margin-top: 20px;
}

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

.fields-header h4 {
    margin: 0;
    color: #374151;
    font-size: 16px;
}

.fields-list {
    display: grid;
    gap: 10px;
}

.field-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.field-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-type {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.field-required {
    background: #fecaca;
    color: #dc2626;
}

.field-actions {
    display: flex;
    gap: 6px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    color: #374151;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #374151;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.dropdown-options {
    margin-top: 10px;
}

.dropdown-option {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.dropdown-option input {
    flex: 1;
}

.remove-option {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.add-option {
    background: #059669;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

.loading {
    text-align: center;
    color: #6b7280;
    padding: 40px;
}

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

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

.error-message {
    background-color: #fecaca;
    color: #dc2626;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: none;
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: none;
}

.global-fields-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    background: #f9fafb;
}

.global-field-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-field-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.global-field-item label {
    margin: 0;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    flex: 1;
}

.global-field-item.disabled {
    opacity: 0.6;
}

.global-field-item.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.global-field-item.disabled label {
    cursor: not-allowed;
}

/* Custom Fields List Styles */
.custom-fields-list {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    background: #f9fafb;
    margin-bottom: 15px;
    min-height: 60px;
}

.custom-field-item {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
}

.custom-field-item:last-child {
    margin-bottom: 0;
}

.custom-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.custom-field-title {
    font-weight: 600;
    color: #374151;
}

.remove-custom-field {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.remove-custom-field:hover {
    background: #b91c1c;
}

.custom-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr 100px;
    gap: 15px;
    align-items: end;
}

.add-field-btn {
    background: #059669;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.add-field-btn:hover {
    background: #047857;
}

.empty-fields-message {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
}

/* Existing Field Styles */
.existing-field {
    border: 2px solid #f3f4f6;
    background: #f9fafb;
}

.existing-field .custom-field-title {
    color: #6b7280;
    font-style: italic;
}

.existing-field-info {
    display: grid;
    gap: 10px;
    padding: 15px 0;
}

.field-detail {
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-detail label {
    font-weight: 600;
    color: #374151;
    min-width: 80px;
    margin: 0;
}

.field-value {
    color: #6b7280;
    flex: 1;
}

.field-type-badge {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.warning-message {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 10px;
    margin-top: 15px;
    color: #92400e;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.warning-message i {
    font-size: 14px;
}

/* Status Badges */
.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.published {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-badge.draft {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

/* Category Card Styling by Status */
.category-card.published-category {
    border-left: 4px solid #10b981;
    background: linear-gradient(to right, #f0fdf4, #ffffff);
}

.category-card.draft-category {
    border-left: 4px solid #fbbf24;
    background: linear-gradient(to right, #fffbeb, #ffffff);
}

.category-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.category-title-row h3 {
    margin: 0;
    flex: 1;
}

/* Published category styling adjustments */
.published-category .category-info {
    opacity: 0.9;
}

.published-category .btn-edit {
    display: none;
}

/* Fields Sections */
.standard-fields-section,
.custom-fields-section {
    margin: 15px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
}

.section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.standard-fields-list {
    padding: 12px 16px;
    min-height: 40px;
}

.field-item-simple {
    padding: 4px 0;
    color: #4b5563;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
}

.field-item-simple:last-child {
    border-bottom: none;
}

.no-fields {
    color: #9ca3af;
    font-style: italic;
    font-size: 13px;
}

.fields-list {
    padding: 12px 16px;
    min-height: 40px;
}

/* Section Management Styles */
.sections-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    padding: 16px;
    margin-bottom: 16px;
}

.section-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.section-item:last-child {
    margin-bottom: 0;
}

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

.section-title {
    font-weight: 600;
    font-size: 16px;
    color: #374151;
}

.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.section-move-btn {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-move-btn:hover {
    background: #374151;
}

.section-remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.section-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.standard-fields-section,
.custom-fields-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
}

.section-field-title {
    font-weight: 500;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.add-section-btn {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-section-btn:hover {
    background: #059669;
}

.section-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-right: 12px;
}

.section-description-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
    resize: vertical;
    min-height: 60px;
}

.standard-fields-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-size: 14px;
    cursor: pointer;
}

.custom-field-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.field-name-input,
.field-type-select {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.field-remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.field-options {
    display: flex;
    gap: 12px;
    align-items: center;
}

.add-field-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.add-field-btn:hover {
    background: #2563eb;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

.loading-icon {
    animation: spin 2s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}