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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f3f4f6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

header p {
    opacity: 0.9;
}

.header-links {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.header-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.header-link:hover {
    background: rgba(255,255,255,0.3);
}

.logout-link {
    background: rgba(220, 38, 38, 0.3);
}

.logout-link:hover {
    background: rgba(220, 38, 38, 0.5);
}

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

.section-header h2 {
    color: #374151;
}

.filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar .search-box {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-group select {
    padding: 12px 16px;
    font-size: 0.875rem;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.filter-group select:focus {
    outline: none;
}

.bulk-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bulk-actions-bar .bulk-label {
    font-weight: 600;
    color: #0369a1;
    font-size: 0.875rem;
}

.bulk-actions-bar select {
    padding: 8px 12px;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    min-width: 180px;
}

.btn-sm {
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
    border-color: #4f46e5;
}

.bulk-selection-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-action-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.bulk-chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-count {
    font-weight: 600;
    color: #4f46e5;
    font-size: 0.875rem;
    min-width: 80px;
}

.btn-success {
    background: #22c55e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-toggle {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.agent-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-bulk-select {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.agent-disabled {
    opacity: 0.6;
    border-left: 4px solid #f59e0b;
}

.agent-disabled .agent-card-header h3 {
    color: #6b7280;
}

.agents-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
}

.agents-stats span {
    font-size: 0.875rem;
    color: #6b7280;
}

.agents-stats strong {
    color: #374151;
}

.search-box {
    margin-bottom: 24px;
}

.search-box input {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.search-box input:hover {
    border-color: #9ca3af;
}

.search-box input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-box input::placeholder {
    color: #9ca3af;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

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

.btn-edit {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-right: 8px;
}

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

.agents-list {
    display: grid;
    gap: 16px;
}

.agent-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.agent-card-header {
    margin-bottom: 12px;
}

.agent-card h3 {
    color: #1f2937;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.agent-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.agent-actions-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.agent-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #6b7280;
}

.agent-meta span {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.agent-meta .status-active {
    background: #d1fae5;
    color: #065f46;
}

.agent-meta .status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.agent-meta .status-placeholder {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.agent-meta .usage-count {
    background: #e0e7ff;
    color: #3730a3;
}

.agent-meta .status-profile-placeholder {
    background: #f3f4f6;
    color: #6b7280;
    font-style: italic;
}

.agent-meta .status-profile-generated {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.agent-meta .status-profile-updated {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.agent-meta .status-tool-function {
    background: #f3e8ff;
    color: #7c3aed;
    font-weight: 600;
}

.agent-meta .status-interface-form {
    background: #fef9c3;
    color: #854d0e;
}

.agent-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.agent-badges .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.agent-badges .badge-category {
    background: #e0e7ff;
    color: #3730a3;
}

.agent-badges .badge-tool-suite {
    background: #fef3c7;
    color: #92400e;
}

.agent-badges .badge-chatbot {
    background: #cffafe;
    color: #0891b2;
    font-weight: 600;
}

.agent-badges .badge-form {
    background: #fef9c3;
    color: #854d0e;
    font-weight: 600;
}

.agent-badges .badge-auth {
    background: #fce7f3;
    color: #be185d;
}

.agent-badges .badge-active {
    background: #d1fae5;
    color: #065f46;
}

.agent-badges .badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.agent-badges .badge-prompts {
    background: #d1fae5;
    color: #047857;
    font-weight: 600;
}

.agent-badges .badge-no-prompts {
    background: #fef3c7;
    color: #92400e;
}

.agent-badges .badge-usage {
    background: #f3f4f6;
    color: #6b7280;
}

.agent-badges .badge-credit-cost {
    background: #fef3c7;
    color: #d97706;
    font-weight: 600;
}

.credit-cost-badge {
    background: #fef3c7;
    color: #d97706;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

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

.btn-generate {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-generate:hover {
    background: #6d28d9;
}

.btn-generate:disabled {
    background: #a78bfa;
    cursor: wait;
}

.btn-duplicate {
    background: #059669;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-duplicate:hover {
    background: #047857;
}

.agent-description {
    color: #4b5563;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.agent-prompt-preview {
    background: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #6b7280;
    white-space: pre-wrap;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.agent-prompt-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #f9fafb);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 1.25rem;
    color: #1f2937;
}

#modal-profile-status {
    margin-left: 12px;
    flex: 1;
}

#modal-profile-status .status-profile-placeholder {
    display: inline-block;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #6b7280;
    font-style: italic;
}

#modal-profile-status .status-profile-generated {
    display: inline-block;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

#modal-profile-status .status-profile-updated {
    display: inline-block;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
}

.close-btn:hover {
    color: #6b7280;
}

#agent-form,
#chatbot-form {
    padding: 20px;
    box-sizing: border-box;
}

#chatbot-modal-overlay .modal {
    overflow-x: hidden;
}

#chatbot-modal-overlay .modal-header,
#chatbot-modal-overlay #chatbot-form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

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

.assessment-toggle {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 6px;
}

.toggle-label input[type="checkbox"] {
    width: auto;
    pointer-events: auto !important;
    cursor: pointer !important;
}

#agent-include-charts {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.toggle-text {
    font-weight: 600;
    color: #0369a1;
}

.assessment-toggle small {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-left: 24px;
}

.assessment-section {
    margin-top: 20px;
    padding: 20px;
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
}

.assessment-section h3 {
    color: #854d0e;
    margin-bottom: 8px;
}

.profile-section {
    margin-top: 20px;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    overflow: hidden;
}

.profile-section summary {
    padding: 16px 20px;
    background: #e0e7ff;
    cursor: pointer;
    font-weight: 600;
    color: #3730a3;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-section summary::-webkit-details-marker {
    display: none;
}

.profile-section summary::before {
    content: '+';
    width: 20px;
    height: 20px;
    background: #4f46e5;
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.profile-section[open] summary::before {
    content: '-';
}

.profile-fields {
    padding: 20px;
}

.prompt-library-section {
    margin-top: 20px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    overflow: hidden;
}

.prompt-library-section summary {
    padding: 16px 20px;
    background: #dcfce7;
    cursor: pointer;
    font-weight: 600;
    color: #166534;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-library-section summary::-webkit-details-marker {
    display: none;
}

.prompt-library-section summary::before {
    content: '+';
    width: 20px;
    height: 20px;
    background: #22c55e;
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.prompt-library-section[open] summary::before {
    content: '-';
}

.prompt-library-builder {
    padding: 20px;
}

.prompt-library-builder .builder-description {
    color: #4b5563;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.prompt-add-form {
    margin-bottom: 16px;
}

.prompt-input-row {
    display: flex;
    gap: 10px;
}

.prompt-input-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

.prompt-library-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.prompt-library-list .empty-message {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 6px;
}

.prompt-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.prompt-item .prompt-text {
    flex: 1;
    font-size: 0.9rem;
    color: #374151;
}

.prompt-item .prompt-text.editing {
    padding: 6px 10px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    outline: none;
}

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

.btn-edit-prompt,
.btn-save-prompt {
    background: #dbeafe;
    color: #1d4ed8;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-edit-prompt:hover,
.btn-save-prompt:hover {
    background: #bfdbfe;
}

.btn-delete-prompt {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-delete-prompt:hover {
    background: #fecaca;
}

.how-it-works-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group-inline label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.form-group-inline input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.section-help {
    color: #a16207;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.no-fields {
    color: #a16207;
    font-style: italic;
    padding: 16px;
    background: white;
    border-radius: 6px;
    text-align: center;
}

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

.field-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    color: #374151;
}

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

.btn-duplicate-field {
    background: #dbeafe;
    color: #1d4ed8;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-duplicate-field:hover {
    background: #bfdbfe;
}

.btn-remove-field {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-remove-field:hover {
    background: #fecaca;
}

.field-builder-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.field-builder-row input,
.field-builder-row select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.field-builder-row input:focus,
.field-builder-row select:focus {
    outline: none;
    border-color: #4f46e5;
}

.field-required-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #374151;
    white-space: nowrap;
}

.field-required-toggle input {
    width: auto !important;
    flex: 0 !important;
}

.field-description-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.options-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    min-height: 80px;
    resize: vertical;
}

.btn-add-field {
    background: #059669;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    width: 100%;
}

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

.status-assessment {
    background: #dbeafe !important;
    color: #1e40af !important;
}

.status-requires-auth {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.agent-fields-count {
    color: #1e40af;
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 8px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    background: #f9fafb;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.checkbox-label:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

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

.form-group small {
    display: block;
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 4px;
}

.agent-meta .tier-badge {
    background: #fef3c7;
    color: #92400e;
}

.agent-meta .role-badge {
    background: #dbeafe;
    color: #1e40af;
}

.agent-meta .suite-badge {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    background: #f3f4f6;
    padding: 8px;
    border-radius: 12px;
    max-width: 100%;
}

.tab-btn {
    padding: 10px 16px;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.08);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.tab-content {
    display: none;
}

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

.section-description {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Templates Section */
.templates-list {
    display: grid;
    gap: 16px;
}

.template-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.template-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.template-category {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
}

.template-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.template-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #374151;
    max-height: 100px;
    overflow: hidden;
    position: relative;
    white-space: pre-wrap;
    word-break: break-word;
}

.template-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #f9fafb);
}

.template-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.template-category-header {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.template-category-header:first-child {
    margin-top: 0;
}

.template-insert-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.template-insert-wrapper select {
    flex: 1;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.template-insert-wrapper button {
    padding: 8px 16px;
}

/* Analytics Section */
.analytics-content {
    display: grid;
    gap: 24px;
}

.analytics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4f46e5;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 4px;
}

.analytics-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.top-agents-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.top-agents-list .list-header {
    display: grid;
    grid-template-columns: 80px 2fr 1.5fr 80px;
    padding: 12px 16px;
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.85rem;
    color: #6b7280;
}

.top-agents-list .list-item {
    display: grid;
    grid-template-columns: 80px 2fr 1.5fr 80px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.9rem;
    align-items: center;
}

.top-agents-list .list-item:hover {
    background: #f9fafb;
}

.top-agents-list .list-item.clickable-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.top-agents-list .list-item.clickable-row:hover {
    background: #eef2ff;
}

.agent-link {
    color: #4f46e5;
    font-weight: 500;
}

.category-cell {
    color: #6b7280;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-hint {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-bottom: 12px;
    font-style: italic;
}

.usage-bar.clickable-bar {
    cursor: pointer;
    padding: 8px 12px;
    margin: -8px -12px;
    margin-bottom: 4px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.usage-bar.clickable-bar:hover {
    background: #eef2ff;
}

.usage-bar.clickable-bar:hover .usage-bar-label {
    color: #4f46e5;
}

/* Attention categories list */
.attention-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.attention-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 4px solid #f59e0b;
}

.attention-category-item:hover {
    background: #fffbeb;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.attention-category-item.inactive-category {
    border-left-color: #ef4444;
}

.attention-category-item.inactive-category:hover {
    background: #fef2f2;
}

.attention-category-item .category-name {
    font-weight: 500;
    color: #374151;
}

.attention-category-item .category-count {
    font-size: 0.85rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Category Overview Grid */
.category-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.category-overview-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #e5e7eb;
}

.category-overview-card:hover {
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

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

.category-card-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.category-card-usage {
    font-size: 0.8rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}

.category-card-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.category-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-stat .stat-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.category-stat .stat-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
}

.text-green { color: #059669; }

.form-agent-card {
    border-left: 4px solid #4f46e5;
}

.chatbot-card {
    border-left: 4px solid #10b981;
}

.chatbot-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
.text-yellow { color: #d97706; }
.text-red { color: #dc2626; }

.category-card-alert {
    font-size: 0.75rem;
    color: #d97706;
    background: #fef3c7;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 8px;
    text-align: center;
}

.usage-bar-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.usage-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.usage-bar-label {
    width: 200px;
    font-size: 0.85rem;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usage-bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 4px;
}

.usage-bar-value {
    width: 60px;
    text-align: right;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Attention status badges */
.attention-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.attention-inactive {
    background: #fee2e2;
    color: #dc2626;
}

.attention-needs-prompt {
    background: #fef3c7;
    color: #d97706;
}

.attention-low-usage {
    background: #dbeafe;
    color: #2563eb;
}

/* Admin Cards */
.admin-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.admin-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

/* Advertising Section */
.settings-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.settings-panel h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: #374151;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

.setting-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-info strong {
    display: block;
    color: #1f2937;
    margin-bottom: 4px;
}

.setting-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Ads List */
.ads-list {
    display: grid;
    gap: 16px;
}

.ad-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.ad-card-preview {
    width: 120px;
    min-width: 120px;
    height: 80px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-size: 0.75rem;
    overflow: hidden;
}

.ad-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-card-content {
    flex: 1;
}

.ad-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.ad-card-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.ad-card-badges {
    display: flex;
    gap: 6px;
}

.ad-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.ad-badge-house {
    background: #dbeafe;
    color: #2563eb;
}

.ad-badge-partner {
    background: #d1fae5;
    color: #059669;
}

.ad-badge-paid {
    background: #fef3c7;
    color: #d97706;
}

.ad-badge-active {
    background: #d1fae5;
    color: #059669;
}

.ad-badge-inactive {
    background: #fee2e2;
    color: #dc2626;
}

.ad-card-description {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.ad-card-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 12px;
}

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

.ad-card-actions button {
    padding: 6px 12px;
    font-size: 0.8rem;
}

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

.no-ads-message p {
    margin-bottom: 16px;
}

/* Image Upload Styles */
.image-upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.image-upload-row input[type="text"] {
    flex: 1;
}

.upload-btn {
    display: inline-block;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.image-preview {
    margin-top: 12px;
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 200px;
    max-height: 120px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

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

.remove-image-btn:hover {
    background: #dc2626;
}

/* Blog Section */
.blog-section {
    padding: 20px 0;
}

.blog-list {
    display: grid;
    gap: 16px;
}

.blog-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.blog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.blog-card-header h3 {
    font-size: 1.1rem;
    color: #374151;
    margin: 0;
}

.blog-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.blog-card-meta .slug {
    font-family: monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

.blog-excerpt {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.blog-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.no-items {
    color: #6b7280;
    font-style: italic;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
}

/* Community Section */
.community-section .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.community-section .stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.community-section .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #6366f1;
}

.community-section .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.community-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.community-post-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.community-post-card.pinned {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, white 50%);
}

.community-post-card.announcement {
    border-left: 4px solid #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, white 50%);
}

.community-post-card .post-header {
    margin-bottom: 8px;
}

.community-post-card .post-header h3 {
    font-size: 1.1rem;
    color: #374151;
    margin: 8px 0 0 0;
}

.community-post-card .post-badges {
    display: flex;
    gap: 8px;
}

.community-post-card .post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.community-post-card .category-badge {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    color: #6366f1;
    font-weight: 500;
}

.community-post-card .post-content-preview {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.community-post-card .post-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-info {
    background: #3b82f6;
    color: white;
    border: none;
}

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

@media (max-width: 1024px) {
    .container {
        padding: 16px;
    }
    
    header {
        padding: 24px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .header-links {
        position: static;
        margin-top: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .agents-stats {
        justify-content: center;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
    
    .tab-btn {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .admin-container {
        padding: 15px;
    }
    
    .modal-large {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }
    
    .settings-panel {
        padding: 16px;
    }
    
    .setting-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-card-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    header {
        padding: 20px;
        border-radius: 10px;
    }
    
    header h1 {
        font-size: 1.3rem;
        margin-top: 0;
    }
    
    .header-links {
        gap: 6px;
    }
    
    .header-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .agents-stats {
        gap: 12px;
        padding: 10px;
    }
    
    .agents-stats span {
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .agent-card-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .field-builder-row {
        flex-direction: column;
    }
    
    .checkbox-group {
        flex-direction: column;
    }

    .admin-tabs {
        flex-wrap: wrap;
        width: 100%;
        gap: 4px;
        padding: 6px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
        flex: 0 0 auto;
        text-align: center;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
    }
    
    .agent-card-actions {
        flex-wrap: wrap;
    }
    
    .btn-small {
        flex: 1;
        min-width: 80px;
    }
}

/* Partners Section */
.partners-list {
    margin-top: 20px;
}

.partner-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.partner-logo-small {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    background: #f0f0f0;
}

.tier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.tier-badge.community {
    background: #e5e7eb;
    color: #374151;
}

.filters-bar {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.filters-bar select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
}

.no-items {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    background: #f9fafb;
    border-radius: 8px;
}

/* Users & Credits Section */
.users-section .section-description {
    color: #6b7280;
    margin-bottom: 24px;
}

.credit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.credit-stats-grid .stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.credit-stats-grid .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.credit-stats-grid .stat-label {
    font-size: 0.85rem;
    color: #6b7280;
}

.users-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.users-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.users-table td {
    font-size: 0.9rem;
    color: #1f2937;
}

.users-table .actions,
.data-table .actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

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

.btn-small.btn-primary:hover {
    background: #2563eb;
}

.btn-small.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-small.btn-secondary:hover {
    background: #d1d5db;
}

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

.btn-small.btn-danger:hover {
    background: #fecaca;
}

.btn-small.btn-preview {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

.btn-small.btn-preview:hover {
    background: #fde68a;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #d1fae5;
    color: #059669;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.expired, .status-expired, .status-badge.status-expired {
    background: #fecaca;
    color: #991b1b;
}

.case-expired-row {
    background: #fef2f2 !important;
    opacity: 0.85;
}

.case-expired-row td {
    color: #666;
}

.has-community {
    color: #059669;
    font-weight: 600;
}

.form-static {
    padding: 8px 0;
    font-weight: 600;
    color: #1f2937;
}

.users-list .empty-state {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    background: white;
    border-radius: 12px;
}

.users-list .error {
    text-align: center;
    color: #dc2626;
    padding: 40px;
    background: #fee2e2;
    border-radius: 12px;
}

/* Categories & Tool Suites Manager */
.categories-manager {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.category-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.category-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.category-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.category-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.status-pill {
    background: rgba(255,255,255,0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pill.inactive {
    background: rgba(239,68,68,0.4);
}

.category-card-body {
    padding: 16px 20px;
}

.category-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 16px 0;
}

.tool-suites-section {
    margin-top: 8px;
}

.tool-suites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.tool-suites-header h4 {
    margin: 0;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 600;
}

.tool-suites-count {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.suites-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.suite-item:hover {
    background: #f3f4f6;
}

.suite-item.inactive {
    opacity: 0.6;
    background: #fef2f2;
}

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

.suite-icon {
    width: 28px;
    height: 28px;
    background: #8b5cf6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.suite-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.875rem;
}

.suite-order {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-left: 8px;
}

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

.empty-suites {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.875rem;
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.category-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-sm.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-sm.btn-secondary:hover {
    background: #d1d5db;
}

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

.btn-sm.btn-danger:hover {
    background: #fecaca;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: #e5e7eb;
    color: #374151;
    transition: background 0.2s;
}

.btn-xs:hover {
    background: #d1d5db;
}

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

.btn-xs.btn-danger:hover {
    background: #fecaca;
}

.modal-sm .modal {
    max-width: 500px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    background: white;
    border-radius: 12px;
}


/* Beta Testers Section */
.beta-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.beta-testers-list {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tester-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.tester-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.tester-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tester-card.sent {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.tester-card.pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.tester-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.tester-select {
    flex-shrink: 0;
}

.tester-name {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
}

.tester-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.tester-field {
    display: flex;
    gap: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.tester-field .field-label {
    font-weight: 500;
    color: #6b7280;
    min-width: 90px;
    flex-shrink: 0;
}

.tester-field a {
    color: #4f46e5;
    text-decoration: none;
    word-break: break-all;
}

.tester-field a:hover {
    text-decoration: underline;
}

.tester-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.data-table a {
    color: #667eea;
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.empty-message {
    color: #64748b;
    text-align: center;
    padding: 40px 20px;
}

.empty-message a {
    color: #667eea;
}

@media (max-width: 900px) {
    .data-table {
        display: block;
        overflow-x: auto;
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .data-table .actions {
        flex-direction: row;
        gap: 4px;
    }
    
    .bulk-actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch !important;
    }
    
    .bulk-actions button {
        width: 100%;
    }
    
    .bulk-actions #selected-count {
        text-align: center;
        margin-left: 0 !important;
    }
}

/* Beta Sub-tabs */
.sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
}

.sub-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.sub-tab-btn:hover {
    color: #4f46e5;
}

.sub-tab-btn.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.beta-subtab-content {
    padding-top: 10px;
}

/* Analytics Cards */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.analytics-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.analytics-card.highlight {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: white;
}

.analytics-card .analytics-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.analytics-card .analytics-value {
    font-size: 2rem;
    font-weight: 700;
}

.analytics-card.highlight .analytics-value {
    color: white;
}

.analytics-card .analytics-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
}

.analytics-card.highlight .analytics-label {
    color: rgba(255,255,255,0.9);
}

/* Conversion Funnel */
.conversion-funnel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.conversion-funnel h3 {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    color: #374151;
}

.funnel-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.funnel-step {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    gap: 16px;
    align-items: center;
}

.funnel-step .step-name {
    font-size: 0.9rem;
    color: #4b5563;
}

.funnel-step .step-bar {
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.funnel-step .step-fill {
    height: 100%;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.funnel-step .step-count {
    font-weight: 600;
    color: #374151;
    text-align: right;
}

/* Feedback List */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feedback-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.feedback-user-info h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #1f2937;
}

.feedback-user-info span {
    font-size: 0.85rem;
    color: #6b7280;
}

.feedback-rating {
    display: flex;
    gap: 4px;
    font-size: 1.25rem;
}

.feedback-rating .star {
    color: #fbbf24;
}

.feedback-rating .star.empty {
    color: #d1d5db;
}

.feedback-section {
    margin-bottom: 12px;
}

.feedback-section strong {
    display: block;
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 4px;
}

.feedback-section p {
    margin: 0;
    color: #374151;
    font-size: 0.9rem;
}

.feedback-badges {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.feedback-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.feedback-badge.recommend {
    background: #d1fae5;
    color: #065f46;
}

.feedback-badge.not-recommend {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 768px) {
    .sub-tabs {
        flex-wrap: wrap;
    }
    
    .sub-tab-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .funnel-step {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Quick Edit Section - Compact Layout */
.quick-edit-section {
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
}

.quick-edit-top-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.quick-edit-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-edit-field label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.quick-edit-select {
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: white;
    color: #334155;
    cursor: pointer;
}

.quick-edit-select:hover {
    border-color: #94a3b8;
}

.quick-edit-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.quick-edit-field-credits .quick-edit-select {
    width: 85px;
}

.quick-edit-field-roles {
    flex: 1;
}

.quick-edit-save-btn {
    padding: 6px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

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

.quick-edit-save-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.quick-edit-save-btn.saved {
    background: #22c55e;
}

.quick-roles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 10px;
}

.quick-role-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #4b5563;
    white-space: nowrap;
    cursor: pointer;
}

.quick-role-checkbox input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin: 0;
    cursor: pointer;
}

.quick-role-checkbox span {
    line-height: 1.2;
}

@media (max-width: 768px) {
    .quick-edit-section {
        flex-direction: column;
    }
    
    .quick-edit-row {
        min-width: 100%;
    }
    
    .quick-edit-save-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .quick-roles-container {
        max-width: 100%;
    }
}

/* ===== Intervention Case Modal Styles ===== */
#create-case-modal .modal,
#case-details-modal .modal,
#case-credentials-modal .modal {
    max-width: 650px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#create-case-modal .modal-header,
#case-details-modal .modal-header,
#case-credentials-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 24px 28px;
    border-bottom: none;
}

#create-case-modal .modal-header h3,
#case-details-modal .modal-header h3,
#case-credentials-modal .modal-header h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

#create-case-modal .close-btn,
#case-details-modal .close-btn,
#case-credentials-modal .close-btn {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.2s;
}

#create-case-modal .close-btn:hover,
#case-details-modal .close-btn:hover,
#case-credentials-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#create-case-modal .modal-body,
#case-details-modal .modal-body,
#case-credentials-modal .modal-body {
    padding: 28px;
}

#create-case-modal .form-group,
#case-details-modal .form-group {
    margin-bottom: 20px;
}

#create-case-modal .form-group label,
#case-details-modal .form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
    font-size: 0.9rem;
}

#create-case-modal .form-group input,
#create-case-modal .form-group select,
#create-case-modal .form-group textarea,
#case-details-modal .form-group input,
#case-details-modal .form-group select,
#case-details-modal .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

#create-case-modal .form-group input:focus,
#create-case-modal .form-group select:focus,
#create-case-modal .form-group textarea:focus,
#case-details-modal .form-group input:focus,
#case-details-modal .form-group select:focus,
#case-details-modal .form-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: white;
    outline: none;
}

#create-case-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#create-case-modal .modal-footer,
#case-details-modal .modal-footer,
#case-credentials-modal .modal-footer {
    padding: 20px 28px;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

#create-case-modal .modal-footer .btn-secondary,
#case-details-modal .modal-footer .btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
}

#create-case-modal .modal-footer .btn-primary,
#case-details-modal .modal-footer .btn-primary,
#case-credentials-modal .modal-footer .btn-primary {
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

#create-case-modal .modal-footer .btn-primary:hover,
#case-details-modal .modal-footer .btn-primary:hover,
#case-credentials-modal .modal-footer .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* AI Import Section */
#create-case-modal [style*="border-top"] {
    border-top: 2px dashed #e5e7eb !important;
    margin-top: 24px !important;
    padding-top: 24px !important;
    background: linear-gradient(180deg, #f0f9ff 0%, transparent 100%);
    margin-left: -28px;
    margin-right: -28px;
    padding-left: 28px;
    padding-right: 28px;
}

#extracted-goals-container {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

#extracted-goals-list {
    max-height: 200px;
    overflow-y: auto;
}

.extracted-goal-item {
    background: white;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

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

/* Case Credentials Modal */
#case-credentials-modal .success-message {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    text-align: center;
}

#case-credentials-modal .credential-box {
    background: #f3f4f6;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

#case-credentials-modal .credential-box label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

#case-credentials-modal .credential-box code {
    font-size: 1.1rem;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    display: block;
    border: 1px solid #e5e7eb;
}
