/**
 * SOW Generator Enterprise v4.0 - Complete Stylesheet
 */

/* =============================================================================
   CSS VARIABLES & RESET
   ============================================================================= */
:root {
    /* Colors */
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #e6f0fa;
    --secondary: #6c757d;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --black: #000000;
    
    /* Status Colors */
    --status-draft: #6c757d;
    --status-in-review: #17a2b8;
    --status-pending: #ffc107;
    --status-approved: #28a745;
    --status-signed: #6f42c1;
    
    /* Layout */
    --header-height: 60px;
    --sidebar-width: 260px;
    --panel-width: 320px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Borders */
    --border-radius-sm: 4px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-color: var(--gray-300);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-100);
    min-height: 100vh;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* =============================================================================
   LAYOUT
   ============================================================================= */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--primary);
}

.logo i {
    font-size: var(--font-size-xl);
}

.interface-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--border-radius);
    padding: 3px;
}

.toggle-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.toggle-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.toggle-btn:hover:not(.active) {
    color: var(--gray-900);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: var(--font-size-lg);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.notification-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

#notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--border-radius);
    cursor: pointer;
    position: relative;
}

.user-menu:hover {
    background: var(--gray-100);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.15s;
}

.user-dropdown .dropdown-item:hover {
    background: var(--gray-50);
}

.user-dropdown .dropdown-item:first-child {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.user-dropdown .dropdown-item:last-child {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.user-dropdown .dropdown-item i {
    width: 16px;
    color: var(--gray-500);
}

.user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

#user-name {
    font-weight: 500;
    font-size: var(--font-size-sm);
}

/* Main Layout */
.app-body {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 900;
}

.sidebar-nav {
    padding: var(--spacing-md);
}

.sidebar-nav.hidden {
    display: none;
}

.nav-section {
    margin-bottom: var(--spacing-lg);
}

.nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: var(--font-size-base);
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Main Content */
.app-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--spacing-lg);
    min-width: 0;
}

/* =============================================================================
   COMPONENTS - BUTTONS
   ============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.btn-sm {
    padding: 4px 8px;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-base);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--gray-600);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-icon.danger:hover {
    background: #fee2e2;
    color: var(--danger);
}

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

.btn-icon.success:hover {
    background: #d1fae5;
    color: var(--success);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* =============================================================================
   COMPONENTS - CARDS
   ============================================================================= */
.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-weight: 600;
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-link {
    font-size: var(--font-size-sm);
}

.card-body {
    padding: var(--spacing-lg);
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--primary-light);
    border-color: var(--primary);
}

.info-card i {
    color: var(--primary);
    font-size: var(--font-size-lg);
    margin-top: 2px;
}

.info-card p {
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    margin: 0;
}

/* =============================================================================
   COMPONENTS - FORMS
   ============================================================================= */
.form-section {
    margin-bottom: var(--spacing-xl);
}

.form-section h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--spacing-xs);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: inherit;
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--white);
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

input[readonly] {
    background: var(--gray-50);
}

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

.help-text {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: var(--spacing-xs);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* LLM Connection Test Status Banner */
.connection-test-section {
    margin-top: var(--spacing-md);
}

.test-status-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    font-weight: 500;
}

.test-status-banner.test-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.test-status-banner.test-failed {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.test-status-icon {
    font-size: 1.5rem;
}

.test-status-icon i {
    animation: pulse-icon 1.5s ease-in-out infinite;
}

.test-success .test-status-icon i {
    animation: none;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.test-status-text {
    flex: 1;
}

/* Info button style */
.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* LLM Authentication Help Panel */
.auth-help-panel {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

[data-theme="dark"] .auth-help-panel {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    border-color: #0284c7;
}

.auth-help-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    color: #0369a1;
    font-weight: 600;
    font-size: 1rem;
}

[data-theme="dark"] .auth-help-header {
    color: #7dd3fc;
}

.auth-help-header i {
    font-size: 1.2rem;
}

.auth-help-content {
    font-size: 0.9rem;
}

.auth-steps-list {
    margin: 0 0 var(--spacing-md) var(--spacing-md);
    padding-left: var(--spacing-md);
    color: #334155;
}

[data-theme="dark"] .auth-steps-list {
    color: #e2e8f0;
}

.auth-steps-list li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.5;
}

.auth-help-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.auth-detail {
    background: rgba(255, 255, 255, 0.6);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    color: #475569;
}

[data-theme="dark"] .auth-detail {
    background: rgba(0, 0, 0, 0.2);
    color: #cbd5e1;
}

.auth-detail code {
    background: #1e293b;
    color: #22d3ee;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
}

.auth-detail i {
    margin-right: 4px;
    color: #0ea5e9;
}

.auth-docs-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: white;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

[data-theme="dark"] .auth-docs-link {
    background: #0c4a6e;
    color: #7dd3fc;
}

.auth-docs-link:hover {
    background: #0284c7;
    color: white;
}

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

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

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

.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.toggle-switch-inline {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: var(--gray-300);
    border-radius: 20px;
    position: relative;
    vertical-align: middle;
    transition: var(--transition);
}

.toggle-switch-inline::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--white);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

input:checked + .toggle-switch-inline {
    background: var(--primary);
}

input:checked + .toggle-switch-inline::before {
    transform: translateX(16px);
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-sm);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    padding-left: 36px;
}

.search-input-group {
    display: flex;
    gap: var(--spacing-sm);
}

.search-input-group input {
    flex: 1;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item.servicenow {
    background: #f0f7ff;
}

.search-result-item.servicenow i {
    color: var(--primary);
    margin-right: var(--spacing-sm);
}

.search-result-empty {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--gray-500);
}
/* =============================================================================
   COMPONENTS - TABLES
   ============================================================================= */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.data-table th,
.data-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--gray-700);
    background: var(--gray-50);
    white-space: nowrap;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background: var(--gray-100);
}

.data-table th.sortable i {
    margin-left: var(--spacing-xs);
    color: var(--gray-400);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr.invalid-row {
    background: #fef2f2;
}

.data-table .truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table .actions-cell {
    white-space: nowrap;
    text-align: right;
}

.data-table .text-right {
    text-align: right;
}

.data-table .totals-row {
    background: var(--gray-50);
    font-weight: 600;
}

/* Editable Table */
.data-table.editable .table-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid transparent;
    background: transparent;
    font-size: var(--font-size-sm);
    border-radius: var(--border-radius-sm);
}

.data-table.editable .table-input:focus {
    border-color: var(--primary);
    background: var(--white);
    outline: none;
}

.data-table.editable .table-input.qty,
.data-table.editable .table-input.money {
    width: 80px;
    text-align: right;
}

.data-table.editable .table-input.wide {
    min-width: 200px;
}

.mini-table {
    width: 100%;
    font-size: var(--font-size-sm);
    border-collapse: collapse;
}

.mini-table th,
.mini-table td {
    padding: var(--spacing-xs) var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.mini-table th {
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
}

/* =============================================================================
   COMPONENTS - STATS CARDS
   ============================================================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: var(--transition);
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
}

.stat-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.green {
    background: #d1fae5;
    color: #059669;
}

.stat-icon.yellow {
    background: #fef3c7;
    color: #d97706;
}

.stat-icon.orange {
    background: #ffedd5;
    color: #ea580c;
}

.stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-icon.cyan {
    background: #cffafe;
    color: #0891b2;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* =============================================================================
   COMPONENTS - BADGES
   ============================================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: 12px;
    text-transform: capitalize;
}

.badge.draft {
    background: #e5e7eb;
    color: #4b5563;
}

.badge.in_review,
.badge.in-review {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.pending_approval,
.badge.pending {
    background: #fef3c7;
    color: #b45309;
}

.badge.approved {
    background: #d1fae5;
    color: #047857;
}

.badge.sent_signature {
    background: #ede9fe;
    color: #6d28d9;
}

.badge.signed {
    background: #c7d2fe;
    color: #4338ca;
}

.badge.expired,
.badge.cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.badge.admin {
    background: #fce7f3;
    color: #be185d;
}

.badge.manager {
    background: #ede9fe;
    color: #7c3aed;
}

.badge.architect {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.creator {
    background: #d1fae5;
    color: #047857;
}

.badge.viewer {
    background: #e5e7eb;
    color: #4b5563;
}

.badge.create {
    background: #d1fae5;
    color: #047857;
}

.badge.update {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.delete {
    background: #fee2e2;
    color: #b91c1c;
}

/* =============================================================================
   VIEW HEADER & FILTERS
   ============================================================================= */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.view-header h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.view-header h2 i {
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.breadcrumb {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: var(--spacing-xs);
}

.breadcrumb a {
    color: var(--gray-500);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.filters-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 6px 10px;
    font-size: var(--font-size-sm);
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-left: auto;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
}

#selected-count {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

/* =============================================================================
   DASHBOARD GRID
   ============================================================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    min-width: 100px;
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.quick-action-btn i {
    font-size: var(--font-size-xl);
    color: var(--primary);
}

.quick-action-btn span {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-700);
}

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.list-item.clickable {
    cursor: pointer;
}

.list-item.clickable:hover {
    background: var(--gray-50);
}

.list-item.unread {
    background: var(--primary-light);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-md);
    background: var(--gray-100);
    color: var(--gray-600);
}

.list-item-icon.approval {
    background: #d1fae5;
    color: #059669;
}

.list-item-icon.signature {
    background: #ede9fe;
    color: #7c3aed;
}

.list-item-icon.review {
    background: #dbeafe;
    color: #2563eb;
}

.list-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.meta-date {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

/* Activity Feed */
.activity-list,
.activity-feed {
    padding: var(--spacing-md);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    font-size: var(--font-size-sm);
}

.activity-user {
    font-weight: 600;
}

.activity-text {
    color: var(--gray-600);
}

.activity-time {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    margin-top: 2px;
}

/* =============================================================================
   PAGINATION
   ============================================================================= */
.pagination {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.pagination-ellipsis {
    padding: 0 var(--spacing-sm);
    color: var(--gray-400);
}

.pagination-info {
    margin-left: auto;
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* =============================================================================
   LOADING & EMPTY STATES
   ============================================================================= */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--gray-300);
}

.empty-state.small {
    padding: var(--spacing-lg);
}

.empty-state.small i {
    font-size: 32px;
}

.empty-state p {
    margin-bottom: var(--spacing-md);
}

.error-state {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--danger);
}

.error-text {
    color: var(--danger);
    font-size: var(--font-size-sm);
}

.text-muted {
    color: var(--gray-500);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: #d97706;
}
/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */
#toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--spacing-md));
    right: var(--spacing-md);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--gray-400);
    opacity: 0;
    transform: translateX(100%);
    transition: var(--transition-slow);
    pointer-events: auto;
    min-width: 300px;
    max-width: 450px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.success i {
    color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.error i {
    color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.warning i {
    color: #d97706;
}

.toast.info {
    border-left-color: var(--info);
}

.toast.info i {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: var(--font-size-sm);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
}

.toast-close:hover {
    color: var(--gray-600);
}

/* =============================================================================
   MODAL
   ============================================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--spacing-lg);
    opacity: 0;
    transition: opacity var(--transition);
}

.modal-overlay.show {
    opacity: 1;
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform var(--transition);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-small {
    width: 400px;
}

.modal-medium {
    width: 600px;
}

.modal-large {
    width: 800px;
}

/* Modal content container for inline modals */
.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.modal-content .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 120px);
    padding: var(--spacing-lg);
}

/* LLM Config Modal specific styling */
#llm-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#llm-config-modal .modal-content {
    margin: 20px;
}

#llm-config-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--gray-50);
    flex-shrink: 0;
}

#llm-config-modal .modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
}

#llm-config-modal .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0;
    line-height: 1;
}

#llm-config-modal .close-btn:hover {
    color: var(--gray-700);
}

[data-theme="dark"] #llm-config-modal .modal-content {
    background: var(--gray-800);
}

[data-theme="dark"] #llm-config-modal .modal-header {
    background: var(--gray-900);
    border-color: var(--gray-700);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

/* =============================================================================
   WIZARD
   ============================================================================= */
.wizard-container {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.wizard-steps {
    display: flex;
    padding: var(--spacing-lg);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
}

.wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.wizard-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: calc(50% + 24px);
    right: calc(-50% + 24px);
    height: 2px;
    background: var(--gray-300);
}

.wizard-step.completed::after {
    background: var(--primary);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.wizard-step.active .step-number {
    background: var(--primary);
    color: var(--white);
}

.wizard-step.completed .step-number {
    background: var(--success);
    color: var(--white);
}

.step-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-500);
}

.wizard-step.active .step-label {
    color: var(--primary);
}

.wizard-step.completed .step-label {
    color: var(--gray-700);
}

.wizard-content {
    padding: var(--spacing-xl);
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
}

.wizard-panel h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
}

.wizard-panel h3 i {
    color: var(--primary);
}

.step-description {
    color: var(--gray-500);
    margin-bottom: var(--spacing-lg);
}

.wizard-footer {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

.wizard-footer-spacer {
    flex: 1;
}

/* Solutions Grid */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.solution-card {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: var(--transition);
}

.solution-card:hover {
    border-color: var(--gray-400);
}

.solution-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.solution-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.solution-checkbox {
    margin-top: 2px;
}

.solution-name {
    font-weight: 600;
    flex: 1;
}

.solution-vendor {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.solution-category {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-bottom: var(--spacing-xs);
}

.solution-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-bottom: var(--spacing-sm);
}

.solution-config {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-sm);
}

.solution-config.hidden {
    display: none;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.team-member-card {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
}

.member-role {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

/* Review Section */
.review-container {
    display: grid;
    gap: var(--spacing-lg);
}

.review-section {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
}

.review-section h4 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
}

.review-section h4 i {
    color: var(--primary);
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.review-item {
    font-size: var(--font-size-sm);
}

.review-item.full {
    grid-column: span 2;
}

.review-item label {
    font-weight: 500;
    color: var(--gray-500);
}

.review-solution-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.review-solution-item:last-child {
    border-bottom: none;
}

.review-validation {
    background: var(--white);
}

.validation-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size-sm);
}

.validation-item.success i {
    color: var(--success);
}

.validation-item.warning i {
    color: #d97706;
}

.validation-item.error i {
    color: var(--danger);
}

/* =============================================================================
   SOW EDITOR
   ============================================================================= */
.sow-editor-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--panel-width);
    gap: 0;
    margin: calc(-1 * var(--spacing-lg));
    min-height: calc(100vh - var(--header-height));
}

/* Editor Sidebar */
.editor-sidebar {
    background: var(--white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: 0;
}

.sow-header-info {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--gray-50);
}

.sow-number {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--primary);
}

.sow-customer {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-bottom: var(--spacing-xs);
}

.section-nav h4 {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
}

.section-list {
    list-style: none;
    padding: 0 var(--spacing-sm);
}

.section-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
}

.section-item:hover {
    background: var(--gray-100);
}

.section-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.section-number {
    min-width: 24px;
    font-weight: 600;
    color: var(--gray-500);
}

.section-item.active .section-number {
    color: var(--primary);
}

.section-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-status-icon {
    display: flex;
    gap: 4px;
}

.section-status-icon .required {
    color: var(--danger);
    font-size: 8px;
}

.sidebar-progress {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

.progress-label {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-bottom: var(--spacing-sm);
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    transition: width var(--transition);
}

/* Editor Main */
.editor-main {
    display: flex;
    flex-direction: column;
    background: var(--gray-100);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.current-section-title {
    font-weight: 600;
    padding: 0 var(--spacing-md);
}

.autosave-status {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.autosave-status i {
    font-size: 12px;
}

.editor-content {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

/* Section Editor */
.section-editor {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.static-content-notice {
    padding: var(--spacing-sm) var(--spacing-md);
    background: #fef3c7;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.static-content-notice i {
    color: #d97706;
}

.ai-assist-bar {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
}

.rich-text-editor {
    border-top: 1px solid var(--border-color);
}

.editor-toolbar-mini {
    display: flex;
    gap: 2px;
    padding: var(--spacing-sm);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
}

.editor-toolbar-mini button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.editor-toolbar-mini button:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.editor-toolbar-mini .divider {
    width: 1px;
    background: var(--gray-300);
    margin: 0 var(--spacing-sm);
}

.editor-content-area {
    min-height: 300px;
    padding: var(--spacing-md);
    outline: none;
}

.editor-content-area:focus {
    background: #fffef7;
}

.section-meta {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-50);
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
}

.ai-reviewed {
    color: var(--primary);
}

/* Table Section */
.table-section {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
}

.validation-inline {
    margin-left: auto;
    font-size: var(--font-size-sm);
}

/* Generateable Section */
.generateable-section {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    text-align: center;
}

.generate-header h4 {
    margin-bottom: var(--spacing-sm);
}

.generate-header p {
    color: var(--gray-500);
    margin-bottom: var(--spacing-lg);
}

.generate-actions {
    margin-bottom: var(--spacing-lg);
}

.generated-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: #d1fae5;
    border-radius: var(--border-radius-sm);
}

/* Editor Panel */
.editor-panel {
    background: var(--white);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: 0;
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.panel-tab {
    flex: 1;
    padding: var(--spacing-sm);
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.panel-tab:hover {
    background: var(--gray-50);
}

.panel-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.panel-content {
    padding: var(--spacing-md);
}

.panel-content.hidden {
    display: none;
}

.panel-content h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
}

.panel-content h5 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
}

.ai-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.ai-scores {
    margin-bottom: var(--spacing-lg);
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.score-item {
    background: var(--gray-50);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.score-item.overall {
    grid-column: span 2;
    background: var(--primary-light);
}

.score-label {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.score-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--gray-900);
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.suggestion-item {
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.suggestion-item.error {
    background: #fef2f2;
    border-left: 3px solid var(--danger);
}

.suggestion-item.warning {
    background: #fffbeb;
    border-left: 3px solid var(--warning);
}

.suggestion-item.info {
    border-left: 3px solid var(--info);
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.suggestion-message {
    color: var(--gray-600);
    margin-bottom: var(--spacing-xs);
}

.suggestion-fix {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.validation-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.validation-result {
    margin-bottom: var(--spacing-sm);
}

.error-list {
    margin: var(--spacing-sm) 0 0 var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.checklist {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.check-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.action-group {
    margin-bottom: var(--spacing-lg);
}

.action-group h5 {
    margin-bottom: var(--spacing-sm);
}
/* =============================================================================
   TOOLS & FEATURES
   ============================================================================= */
.tool-description {
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.feature-item {
    text-align: center;
}

.feature-item i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.feature-item h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-xs);
}

.feature-item p {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* Research Results */
.research-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.research-section {
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
}

.research-section h4,
.research-section h6 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.research-section h4 i {
    color: var(--primary);
}

.research-sources {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.research-sources h4 {
    margin-bottom: var(--spacing-sm);
}

.research-sources ul {
    list-style: none;
    padding: 0;
}

.research-sources li {
    margin-bottom: var(--spacing-xs);
}

/* Notifications */
.notifications-list {
    padding: var(--spacing-md);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background: var(--gray-50);
}

.notification-item.unread {
    background: var(--primary-light);
}

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

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-message {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.notification-time {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    margin-top: var(--spacing-xs);
}

.notification-actions {
    flex-shrink: 0;
}

/* =============================================================================
   ADMIN - SETTINGS
   ============================================================================= */
.settings-container {
    display: grid;
    gap: var(--spacing-lg);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-info h4 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 2px;
}

.setting-info p {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.setting-control input[type="number"] {
    width: 80px;
    text-align: right;
}

.setting-control input[type="text"] {
    min-width: 150px;
}

/* Permissions Grid */
.permissions-grid {
    font-size: var(--font-size-sm);
}

.permission-row {
    display: grid;
    grid-template-columns: 2fr repeat(5, 1fr);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.permission-row.header {
    font-weight: 600;
    background: var(--gray-50);
    padding: var(--spacing-sm) var(--spacing-md);
}

.permission-row div {
    text-align: center;
}

.permission-row div:first-child {
    text-align: left;
}

/* =============================================================================
   ADMIN - INTEGRATIONS
   ============================================================================= */
.integration-status-grid {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    flex-wrap: wrap;
}

.integration-status-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
}

.integration-status-item i {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: var(--spacing-sm);
}

.status-indicator.loading {
    background: var(--gray-400);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.connected {
    background: var(--success);
}

.status-indicator.disconnected {
    background: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.integration-description {
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
}

.connection-log {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: var(--font-size-sm);
    max-height: 200px;
    overflow-y: auto;
}

.log-entry {
    padding: 2px 0;
}

.log-entry.success {
    color: #86efac;
}

.log-entry.error {
    color: #fca5a5;
}

/* =============================================================================
   ADMIN - TEMPLATES
   ============================================================================= */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.template-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.template-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.template-card.default {
    border-color: var(--primary);
}

.default-badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: var(--primary);
    color: var(--white);
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.template-icon {
    font-size: 48px;
    color: var(--gray-400);
    margin-bottom: var(--spacing-md);
}

.template-name {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.template-description {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: var(--spacing-sm);
}

.template-meta {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    margin-bottom: var(--spacing-md);
}

.template-meta span {
    margin: 0 var(--spacing-xs);
}

.template-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

/* =============================================================================
   ADMIN - REPORTS
   ============================================================================= */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.report-card {
    background: var(--white);
}

.report-card.full-width {
    grid-column: span 2;
}

.report-card h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-base);
}

.report-card h3 i {
    color: var(--primary);
}

.report-chart {
    padding: var(--spacing-lg);
    min-height: 200px;
}

.simple-bar-chart {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.bar-item {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    gap: var(--spacing-sm);
    align-items: center;
}

.bar-label {
    font-size: var(--font-size-sm);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-container {
    height: 24px;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--border-radius-sm);
    transition: width var(--transition);
}

.bar-value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
}

/* =============================================================================
   ADMIN - CONTENT EDITOR
   ============================================================================= */
.variable-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 16px;
    font-size: var(--font-size-xs);
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.content-preview {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
    min-height: 200px;
}

/* =============================================================================
   TIMELINE
   ============================================================================= */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--spacing-lg);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.timeline-content {
    background: var(--gray-50);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-text {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.timeline-meta {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    margin-top: var(--spacing-xs);
}

/* =============================================================================
   CUSTOMER DETAILS
   ============================================================================= */
.customer-details {
    margin-bottom: var(--spacing-lg);
}

.customer-details h4 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
}

.customer-details p {
    margin-bottom: var(--spacing-xs);
}

/* AI Research */
.ai-result {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
}

.ai-result.hidden {
    display: none;
}

.ai-research-content h5 {
    margin-bottom: var(--spacing-md);
    color: var(--primary);
}

.ai-research-content p {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

/* AI Result Panels */
.ai-result-panel {
    margin-top: var(--spacing-lg);
}

.ai-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary);
}

.ai-result-header h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--primary);
    margin: 0;
}

.ai-model-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.ai-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.ai-section h4 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--gray-700);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-200);
}

.ai-section h4 i {
    color: var(--primary);
}

.ai-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border: none;
}

.ai-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

/* Config Table */
.config-table {
    width: 100%;
    border-collapse: collapse;
}

.config-table td {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-100);
}

.config-table .config-key {
    font-weight: 600;
    color: var(--gray-600);
    width: 200px;
}

/* RACI Table */
.raci-phase {
    margin-bottom: var(--spacing-lg);
}

.raci-phase h5 {
    background: var(--gray-100);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    color: var(--gray-700);
}

.raci-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.raci-table th,
.raci-table td {
    padding: var(--spacing-sm);
    text-align: center;
    border: 1px solid var(--gray-200);
}

.raci-table th {
    background: var(--gray-50);
    font-weight: 600;
}

.raci-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.raci-cell.r { background: #fef3c7; color: #92400e; font-weight: 700; }
.raci-cell.a { background: #dbeafe; color: #1e40af; font-weight: 700; }
.raci-cell.c { background: #d1fae5; color: #065f46; font-weight: 700; }
.raci-cell.i { background: #f3e8ff; color: #6b21a8; font-weight: 700; }

/* Compliance and Recommendations Lists */
.compliance-list,
.recommendations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compliance-list li,
.recommendations-list li {
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--primary);
}

/* Solution Workbook Styles */
.workbook-content {
    line-height: 1.6;
}

.workbook-content p {
    margin-bottom: var(--spacing-sm);
}

.workbook-content ul {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
}

.workbook-content li {
    margin-bottom: var(--spacing-xs);
}

.mapping-table,
.integration-table,
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-sm);
}

.mapping-table th,
.mapping-table td,
.integration-table th,
.integration-table td,
.metrics-table th,
.metrics-table td {
    padding: var(--spacing-sm);
    text-align: left;
    border: 1px solid var(--gray-200);
}

.mapping-table th,
.integration-table th,
.metrics-table th {
    background: var(--gray-50);
    font-weight: 600;
}

/* Phases Timeline */
.phases-timeline {
    position: relative;
    padding-left: var(--spacing-xl);
}

.phases-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary);
}

.phase-item {
    position: relative;
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.phase-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.phase-content {
    flex: 1;
    background: var(--gray-50);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
}

.phase-content h5 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--primary);
}

.phase-content p {
    margin: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
}

/* Complexity Badge */
.complexity-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.complexity-badge.low { background: #d1fae5; color: #065f46; }
.complexity-badge.medium { background: #fef3c7; color: #92400e; }
.complexity-badge.high { background: #fee2e2; color: #991b1b; }

/* AI Result Actions */
.ai-result-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-200);
}

/* Error Message */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Status Display */
.status-display {
    text-align: center;
    padding: var(--spacing-xl);
}

.status-display .status-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
}

.status-display .status-icon.completed {
    color: var(--success);
}

.status-display .status-icon.sent {
    color: var(--info);
}

.status-display .status-label {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.status-display .status-date {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================= */
@media (max-width: 1400px) {
    .sow-editor-layout {
        grid-template-columns: 220px 1fr 280px;
    }
    
    :root {
        --sidebar-width: 220px;
        --panel-width: 280px;
    }
}

@media (max-width: 1200px) {
    .sow-editor-layout {
        grid-template-columns: 200px 1fr;
    }
    
    .editor-panel {
        display: none;
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .report-card.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }
    
    .app-sidebar.open {
        transform: translateX(0);
    }
    
    .app-content {
        margin-left: 0;
    }
    
    .sow-editor-layout {
        grid-template-columns: 1fr;
    }
    
    .editor-sidebar {
        display: none;
    }
    
    .interface-toggle {
        display: none;
    }
    
    .wizard-steps {
        flex-wrap: wrap;
    }
    
    .wizard-step:not(:last-child)::after {
        display: none;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   UTILITIES
   ============================================================================= */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sub-section {
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    margin-top: var(--spacing-md);
}

.sub-section.hidden {
    display: none;
}

/* Print Styles */
@media print {
    .app-header,
    .app-sidebar,
    .editor-panel,
    .editor-toolbar,
    .btn,
    .toast,
    .modal-overlay {
        display: none !important;
    }
    
    .app-content {
        margin: 0;
        padding: 0;
    }

    .sow-editor-layout {
        display: block;
    }
}

/* =====================================================================
   ENHANCED PRODUCT RESEARCH STYLES
   ===================================================================== */

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.use-case-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
}

.use-case-card h5 {
    color: var(--primary);
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.use-case-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
}

.feature-list {
    list-style: none;
    padding-left: 0;
}

.feature-list li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-lg);
    position: relative;
}

.feature-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.recommendation-list {
    list-style: none;
    padding-left: 0;
}

.recommendation-list li {
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: #f0fdf4;
    border-left: 3px solid var(--success);
    border-radius: var(--border-radius-sm);
}

.source-list {
    list-style: none;
    padding-left: 0;
}

.source-list li {
    padding: var(--spacing-xs) 0;
}

.source-list a {
    color: var(--primary);
    text-decoration: none;
}

.source-list a:hover {
    text-decoration: underline;
}

/* Product Research AI Result Header Actions */
.ai-result-header .ai-result-actions {
    border: none;
    padding: 0;
    margin: 0;
}

/* Section Review Step */
.section-review-container {
    max-width: 1200px;
    margin: 0 auto;
}

.sections-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.section-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

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

.section-card-header {
    padding: var(--spacing-md);
    background: var(--gray-50);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s;
}

.section-card-header:hover {
    background: var(--gray-100);
}

.section-card-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--gray-800);
}

.section-card-title i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.section-toggle-icon {
    color: var(--gray-500);
    transition: transform 0.3s ease;
}

.section-card-body {
    padding: var(--spacing-md);
    border-top: 1px solid var(--gray-200);
}

.section-editor {
    min-height: 150px;
    padding: var(--spacing-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: var(--white);
    line-height: 1.6;
    font-size: 14px;
    outline: none;
    overflow-y: auto;
    max-height: 500px;
}

.section-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 133, 254, 0.1);
}

.section-editor p {
    margin-bottom: var(--spacing-sm);
}

.section-editor ul,
.section-editor ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.section-editor h4 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    color: var(--gray-800);
}

.section-card-footer {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--gray-100);
}

.section-review-footer {
    margin-top: var(--spacing-lg);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* =============================================================================
   CONTACTS TABLE STYLES - v4.8.0
   ============================================================================= */

.contacts-table-wrapper {
    margin-top: var(--spacing-sm);
    overflow-x: auto;
}

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

.contacts-table thead th {
    background: var(--gray-100);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.contacts-table thead th:last-child {
    width: 50px;
    text-align: center;
}

.contacts-table tbody td {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.contacts-table .contact-row:hover {
    background: var(--gray-50);
}

.contacts-table input[type="text"],
.contacts-table input[type="email"],
.contacts-table input[type="tel"],
.contacts-table select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.contacts-table input:focus,
.contacts-table select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(45, 133, 254, 0.15);
    outline: none;
}

.contacts-table input::placeholder {
    color: var(--gray-400);
    font-style: italic;
}

.contacts-table .contact-role {
    min-width: 200px;
}

.contacts-table .contact-name {
    min-width: 150px;
}

.contacts-table .contact-email {
    min-width: 180px;
}

.contacts-table .contact-phone {
    min-width: 130px;
}

.contacts-actions {
    margin-top: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-sm);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
}

.btn-icon.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid transparent;
}

.btn-icon.btn-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: var(--danger);
}

/* Lookup Results Styles */
.lookup-results-grid {
    display: grid;
    gap: var(--spacing-md);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.lookup-result-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
}

.lookup-result-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.lookup-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.lookup-result-header strong {
    font-size: 15px;
    color: var(--gray-800);
}

.lookup-result-body {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: var(--spacing-sm);
}

.lookup-result-body div {
    margin-bottom: 4px;
}

.lookup-result-body i {
    width: 16px;
    margin-right: var(--spacing-xs);
    color: var(--gray-400);
}

.lookup-result-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.contact-chip {
    display: inline-block;
    padding: 2px 8px;
    background: var(--gray-100);
    border-radius: 12px;
    font-size: 11px;
    color: var(--gray-600);
}

/* Search Results Enhancement */
.search-result-item .result-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item .match-score {
    font-size: 11px;
    color: var(--success);
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}

.search-result-item .result-details {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.search-result-item mark {
    background: rgba(255, 193, 7, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* Checkbox List for Import Modal */
.checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
}

.checkbox-item:hover {
    background: var(--gray-100);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-200);
}

/* Small button variant */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* =============================================================================
   DATABASE MONITORING STYLES - v4.8.0
   ============================================================================= */

.db-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

.db-stat-item {
    background: var(--gray-50);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.db-stat-item.wide {
    grid-column: 1 / -1;
    text-align: left;
}

.db-stat-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.db-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
}

.disk-usage-bar {
    height: 24px;
    background: var(--gray-200);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-top: var(--spacing-sm);
}

.disk-usage-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease, background 0.3s;
}

.disk-usage-fill.healthy {
    background: linear-gradient(90deg, #28a745, #34ce57);
}

.disk-usage-fill.warning {
    background: linear-gradient(90deg, #ffc107, #ffdb4d);
}

.disk-usage-fill.danger {
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

.disk-usage-text {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}

.disk-alert-threshold {
    margin-top: var(--spacing-sm);
    font-size: 11px;
    color: var(--gray-500);
}

.disk-alert-threshold i {
    color: var(--warning);
    margin-right: 4px;
}

.disk-alert-banner {
    background: linear-gradient(90deg, #fff3cd, #ffeeba);
    border: 1px solid #ffc107;
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: #856404;
}

.disk-alert-banner i {
    font-size: 20px;
    color: #e0a800;
}

.disk-alert-banner.hidden {
    display: none;
}

/* =============================================================================
   SOLUTION DESIGN SECTION STYLES - v4.8.0
   ============================================================================= */

/* Selected Solutions List */
.selected-solutions-list {
    margin-bottom: var(--spacing-md);
}

.selected-solution-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.selected-solution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.solution-info strong {
    font-size: 15px;
    color: var(--gray-800);
}

.vendor-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    font-size: 11px;
    margin-left: var(--spacing-sm);
}

.selected-solution-config {
    background: var(--gray-50);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
}

.config-row {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.config-item {
    flex: 1;
    min-width: 120px;
}

.config-item label {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.config-item input,
.config-item select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
}

.radio-group {
    display: flex;
    gap: var(--spacing-md);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
}

/* Solution Add Row */
.solution-add-row {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.solution-add-row select {
    flex: 1;
}

/* Features Grid */
.solution-features-group {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-100);
}

.solution-features-group h5 {
    margin-bottom: var(--spacing-md);
    color: var(--gray-700);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.feature-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.feature-checkbox:hover {
    border-color: var(--primary-light);
    background: var(--white);
}

.feature-checkbox.checked {
    border-color: var(--primary);
    background: rgba(45, 133, 254, 0.05);
}

.feature-checkbox input[type="checkbox"] {
    margin-top: 3px;
}

.feature-content {
    flex: 1;
}

.feature-name {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.feature-category {
    display: inline-block;
    padding: 1px 6px;
    background: var(--gray-200);
    border-radius: 8px;
    font-size: 10px;
    color: var(--gray-600);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.feature-desc {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
}

/* Requirements List */
.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-xs);
}

.requirement-content {
    flex: 1;
}

.requirement-text {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
}

.requirement-source {
    display: block;
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* Solution Description Editor */
.solution-description-editor {
    min-height: 200px;
    padding: var(--spacing-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: var(--white);
    line-height: 1.6;
    font-size: 14px;
}

.solution-description-editor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 133, 254, 0.1);
}

.solution-description-actions {
    margin-top: var(--spacing-sm);
}

/* Pricing Table */
.pricing-table-wrapper {
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table thead th {
    background: var(--gray-100);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.pricing-table tbody td {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.pricing-table input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
}

.pricing-table input[type="number"] {
    text-align: right;
}

.pricing-table .pricing-ext {
    text-align: right;
    font-weight: 500;
    min-width: 100px;
}

.pricing-total-row {
    background: var(--gray-50);
    font-weight: 600;
}

.pricing-total-row td {
    padding: var(--spacing-md) !important;
}

.text-right {
    text-align: right;
}

.pricing-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Quote Preview */
.quote-preview {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    max-height: 300px;
    overflow-y: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.preview-table th,
.preview-table td {
    padding: 6px 8px;
    border: 1px solid var(--gray-200);
    text-align: left;
}

.preview-table th {
    background: var(--gray-100);
    font-weight: 600;
}

/* Skills Integration Styles */
.section-type-legend {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.section-type-legend .badge {
    font-size: 0.8rem;
    padding: 5px 10px;
}

.section-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: white;
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s;
}

.section-card-header:hover {
    background: #e9ecef;
}

.section-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.section-card-title i {
    color: #0066cc;
    width: 20px;
}

.section-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-toggle-icon {
    transition: transform 0.3s;
}

.section-card-body {
    padding: 15px;
    border-top: 1px solid #dee2e6;
}

.section-editor {
    min-height: 100px;
    padding: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
}

.section-editor[contenteditable="true"]:focus {
    outline: 2px solid #0066cc;
}

.section-editor[contenteditable="false"] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.section-card-footer {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* RACI Table Styles */
.raci-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.raci-table th, .raci-table td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    text-align: left;
}

.raci-table th {
    background: #0066cc;
    color: white;
    font-weight: 600;
}

.raci-table .phase-header td {
    background: #e9ecef;
    font-weight: 600;
    color: #333;
}

.raci-table .raci-cell {
    text-align: center;
    font-weight: 600;
}

/* Config Workbook Styles */
.config-workbook {
    padding: 15px;
}

.config-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.config-section h4 {
    color: #0066cc;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.config-section h5 {
    color: #333;
    margin-top: 15px;
    margin-bottom: 10px;
}

.config-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-option {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.config-option label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.config-subsection {
    padding-left: 20px;
    margin-bottom: 15px;
}

/* SOW Proofreader Styles */
#sow-proofreader-card {
    border: 2px solid #0066cc;
}

#proofreader-results {
    max-height: 400px;
    overflow-y: auto;
}

#proofreader-results h6 {
    margin-top: 15px;
    margin-bottom: 10px;
}

#proofreader-results li {
    padding: 5px 0;
}

/* Badge styles */
.badge-info {
    background-color: #17a2b8 !important;
}

.badge-warning {
    background-color: #ffc107 !important;
    color: #333 !important;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}


/* Enhanced Section Review Styles */

/* Variable Highlighting */
.variable-highlight {
    background-color: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px dashed #ffc107;
    color: #856404;
    font-family: monospace;
}

/* Draft Watermark */
.draft-watermark {
    position: relative;
}

.draft-watermark::before {
    content: 'DRAFT';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 150px;
    color: rgba(255, 0, 0, 0.1);
    pointer-events: none;
    z-index: 1000;
    font-weight: bold;
}

/* Global Formatting Panel */
#global-formatting-card {
    border: 2px solid #343a40;
}

#formatting-panel {
    background: #f8f9fa;
}

/* AI Controls */
.ai-controls {
    margin-right: 10px;
}

.ai-controls .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Upload Controls */
.upload-controls .btn {
    margin-right: 5px;
}

/* Image Upload Area */
.image-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
}

.image-upload-area:hover {
    border-color: #0066cc;
    background: #e9ecef;
}

/* Placeholder Text */
.placeholder-text {
    color: #6c757d;
    font-style: italic;
}

/* Enhanced Section Card */
.section-card .section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Loading Spinner in Section */
.section-editor .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* AI History Modal */
.ai-history-modal {
    max-height: 400px;
    overflow-y: auto;
}

/* Acceptance Table */
.acceptance-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.acceptance-table th,
.acceptance-table td {
    border: 1px solid #dee2e6;
    padding: 10px;
    text-align: left;
}

.acceptance-table th {
    background: #0066cc;
    color: white;
}

.acceptance-table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Support Table */
.support-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.support-table td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
}

.support-table td:first-child {
    background: #f8f9fa;
    width: 200px;
}

/* Support Flow Placeholder */
.support-flow-placeholder {
    border: 2px dashed #ccc;
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 15px 0;
}

/* Tone Mode Buttons */
.btn-group .btn-check:checked + .btn-outline-primary {
    background-color: #0066cc;
    color: white;
}

/* Form Controls in Formatting */
#formatting-panel .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

#formatting-panel .form-select,
#formatting-panel .form-control {
    font-size: 0.9rem;
}

/* Table styles in editor */
.section-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.section-editor table th,
.section-editor table td {
    border: 1px solid #dee2e6;
    padding: 8px;
}

.section-editor table th {
    background: #e9ecef;
    font-weight: 600;
}


/* =============================================================================
   Database Management Styles
   ============================================================================= */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.recommendation-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--card-bg);
}

.recommendation-card.priority-1 {
    border-left: 4px solid var(--danger);
}

.recommendation-card.priority-2 {
    border-left: 4px solid var(--warning);
}

.recommendation-card.priority-3 {
    border-left: 4px solid var(--info);
}

.recommendation-card.priority-4 {
    border-left: 4px solid var(--secondary);
}

.rec-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rec-status {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rec-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.badge.priority-1 { background: var(--danger); }
.badge.priority-2 { background: var(--warning); }
.badge.priority-3 { background: var(--info); }
.badge.priority-4 { background: var(--secondary); }

.badge.completed { background: var(--success); }
.badge.in_progress { background: var(--info); }
.badge.failed { background: var(--danger); }
.badge.partial { background: var(--warning); }

/* =============================================================================
   ADMIN AI LEARNING STYLES
   ============================================================================= */

.ai-status-section,
.action-section,
.patterns-section,
.profiles-section,
.insights-section,
.conversations-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.pattern-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.pattern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pattern-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 600;
}

.confidence-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
}

.pattern-key {
    font-weight: 600;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.pattern-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.pattern-stats i {
    margin-right: 4px;
}

.progress-bar-mini {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

.progress-bar-mini .progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.insights-summary {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.insights-summary h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary);
}

.recommendations-list h3 {
    margin-bottom: 1rem;
}

.rec-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.rec-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.category-badge {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.rec-description {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

.rec-actions {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.rec-actions ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.rec-actions li {
    margin-bottom: 0.25rem;
}

.rec-impact {
    font-size: 0.9rem;
    color: var(--success);
    padding: 0.5rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 4px;
}

.status-card.status-success {
    border-left: 4px solid var(--success);
}

.status-card.status-warning {
    border-left: 4px solid var(--warning);
}

.badge-info {
    background: var(--info);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: var(--gray-900);
}


/* =============================================================================
   USER PROFILE STYLES
   ============================================================================= */

.profile-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.profile-sidebar {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.profile-picture-section {
    margin-bottom: 1.5rem;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 3rem;
    color: white;
    overflow: hidden;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture .avatar-initials {
    font-size: 2.5rem;
    font-weight: 600;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.profile-main {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* =============================================================================
   USER AI SETTINGS STYLES
   ============================================================================= */

.ai-settings-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
    min-height: 600px;
}

.prompt-types-sidebar {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
}

.prompt-types-sidebar h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--gray-600);
}

.prompt-type-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.prompt-type-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-type-item:hover {
    background: var(--gray-100);
}

.prompt-type-item.active {
    background: var(--primary);
    color: white;
}

.prompt-type-item i {
    width: 20px;
    text-align: center;
}

.prompt-editor-main {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
}

.prompt-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.variant-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.variant-card.system-default {
    border-left: 4px solid var(--gray-400);
}

.variant-card.is-default {
    border-left: 4px solid var(--primary);
}

.variant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.variant-name {
    font-weight: 600;
}

.variant-description {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.variant-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.prompt-edit-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.edit-actions {
    display: flex;
    gap: 0.5rem;
}

.prompt-help {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: 4px;
}

.prompt-help ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.prompt-test-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.test-success {
    color: var(--success);
}

.test-error {
    color: var(--danger);
}

.test-response {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    margin: 0.5rem 0;
    white-space: pre-wrap;
    font-family: inherit;
    border: 1px solid var(--border-color);
}

.test-tokens {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}


/* LLM Configuration Styles */
.llm-providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.llm-provider-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.llm-provider-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.llm-provider-card.configured {
    border-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, white 100%);
}

.llm-provider-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
}

.provider-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.provider-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.provider-icon.openai { background: linear-gradient(135deg, #10a37f 0%, #1a7f64 100%); }
.provider-icon.azure { background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%); }
.provider-icon.anthropic { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }
.provider-icon.local { background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%); }

.provider-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #2d3748;
}

.provider-info p {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    color: #718096;
}

.provider-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.configured {
    background: #bee3f8;
    color: #2a4365;
}

.status-badge.not-configured {
    background: #fed7d7;
    color: #742a2a;
}

.provider-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.detail-row .label {
    color: #718096;
}

.detail-row .value {
    color: #2d3748;
    font-weight: 500;
}

.provider-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.llm-config-form {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i {
    color: var(--primary-color);
}

.form-section-title:first-child {
    margin-top: 0;
}

.certificate-upload {
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.certificate-upload:hover {
    border-color: var(--primary-color);
    background: #f7fafc;
}

.certificate-upload.has-file {
    border-color: #48bb78;
    background: #f0fff4;
}

.certificate-upload input[type=file] {
    display: none;
}

.certificate-upload label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.certificate-upload i {
    font-size: 2rem;
    color: #a0aec0;
}

.certificate-upload.has-file i {
    color: #48bb78;
}

.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.usage-stat-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.usage-stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.usage-stat-card .label {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 0.25rem;
}

.usage-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.usage-table th,
.usage-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.usage-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.usage-table tr:hover {
    background: #f7fafc;
}

.test-result {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.test-result.success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.test-result.error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #742a2a;
}

/* =============================================================================
   MODERN LLM CONFIGURATION - REDESIGNED UI
   ============================================================================= */

.llm-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.llm-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.llm-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
}

.llm-page-header p {
    color: var(--gray-600);
    margin: 0;
}

.llm-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Provider Cards - Modern Grid */
.llm-providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.llm-provider-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.llm-provider-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 102, 179, 0.12);
    transform: translateY(-2px);
}

.llm-provider-card.is-default {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 179, 0.1);
}

.llm-provider-card.inactive {
    opacity: 0.65;
}

.llm-card-header {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-bottom: 1px solid var(--gray-100);
}

.llm-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: white;
}

.llm-card-icon.openai { background: linear-gradient(135deg, #10a37f 0%, #0d8f6f 100%); }
.llm-card-icon.anthropic { background: linear-gradient(135deg, #d4a27f 0%, #c4936a 100%); }
.llm-card-icon.azure_openai { background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%); }
.llm-card-icon.google { background: linear-gradient(135deg, #4285f4 0%, #3367d6 100%); }
.llm-card-icon.local { background: linear-gradient(135deg, #718096 0%, #4a5568 100%); }

.llm-card-title-area {
    flex: 1;
    min-width: 0;
}

.llm-card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--gray-900);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.llm-card-subtitle {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0.125rem 0 0 0;
}

.llm-card-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.llm-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.llm-badge.default {
    background: var(--primary-color);
    color: white;
}

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

.llm-badge.inactive {
    background: var(--gray-100);
    color: var(--gray-600);
}

.llm-badge.live {
    background: #d1fae5;
    color: #065f46;
    animation: pulse-live 2s ease-in-out infinite;
}

.llm-badge.failed {
    background: #fee2e2;
    color: #991b1b;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.llm-card-body {
    padding: 1.25rem;
}

.llm-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.llm-info-item {
    display: flex;
    flex-direction: column;
}

.llm-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 0.125rem;
}

.llm-info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
}

.llm-card-footer {
    display: flex;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    gap: 0.5rem;
}

.llm-card-footer .btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.llm-card-footer .btn-icon {
    padding: 0.5rem;
    flex: 0;
    min-width: 36px;
}

/* Section Assignments Panel */
.llm-sections-panel {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
}

.llm-sections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.llm-sections-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.llm-sections-header h2 i {
    color: var(--primary-color);
}

.llm-apply-all-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.llm-apply-all-toggle label {
    font-size: 0.9rem;
    color: var(--gray-700);
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: 26px;
    transition: all 0.3s ease;
}

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

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

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

.llm-sections-body {
    padding: 0;
}

.llm-section-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
}

.llm-section-row:last-child {
    border-bottom: none;
}

.llm-section-row:hover {
    background: var(--gray-50);
}

.llm-section-row.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.llm-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1rem;
    background: var(--gray-100);
    color: var(--gray-600);
}

.llm-section-icon.customer-research { background: #dbeafe; color: #1d4ed8; }
.llm-section-icon.requirements { background: #fef3c7; color: #b45309; }
.llm-section-icon.solution-design { background: #d1fae5; color: #047857; }
.llm-section-icon.section-content { background: #e0e7ff; color: #4338ca; }
.llm-section-icon.raci-chart { background: #fce7f3; color: #be185d; }
.llm-section-icon.config-workbook { background: #f3e8ff; color: #7c3aed; }
.llm-section-icon.product-research { background: #fed7aa; color: #c2410c; }

.llm-section-info {
    flex: 1;
    min-width: 0;
}

.llm-section-name {
    font-weight: 500;
    color: var(--gray-800);
    margin: 0;
}

.llm-section-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0.125rem 0 0 0;
}

.llm-section-selector {
    min-width: 220px;
}

.llm-section-selector select {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.llm-section-selector select:hover {
    border-color: var(--gray-400);
}

.llm-section-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.1);
}

/* Modern Modal Redesign */
.llm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.llm-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modal-slide-in 0.25s ease;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.llm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.llm-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.llm-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: all 0.15s ease;
}

.llm-modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.llm-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.llm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 20px 20px;
}

/* Model Discovery Results */
.model-discovery-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.discovery-summary {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-radius: 12px;
    padding: 1.25rem;
}

.discovery-summary h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0369a1;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.discovery-summary-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #0c4a6e;
}

.discovery-errors {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 1.25rem;
}

.discovery-errors h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dc2626;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.discovery-errors ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #7f1d1d;
    font-size: 0.9rem;
}

.discovery-errors li {
    margin-bottom: 0.25rem;
}

.discovery-providers h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.discovery-provider-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.discovery-provider-card.has-new {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.discovery-provider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.discovery-provider-header .provider-name {
    font-weight: 600;
    color: var(--gray-800);
}

.discovery-provider-header .model-count {
    font-size: 0.85rem;
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.discovery-provider-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.discovery-provider-details .current-model {
    color: var(--gray-600);
}

.new-models {
    color: #15803d;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.deprecated-models {
    color: #b45309;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.badge-success {
    background: #22c55e;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning {
    background: #f59e0b;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.available-models-details {
    margin-top: 0.75rem;
}

.available-models-details summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.available-models-details summary:hover {
    text-decoration: underline;
}

.model-list {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.6;
    max-height: 150px;
    overflow-y: auto;
}

.discovery-empty {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
    font-size: 0.95rem;
}

.discovery-empty i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.discovery-updated-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #0369a1;
    margin-bottom: 1rem;
}

.discovery-updated-notice i {
    margin-right: 0.5rem;
}

.discovery-provider-card.is-configured {
    border-color: var(--primary);
    border-width: 2px;
}

.discovery-provider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.provider-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.provider-title .provider-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1rem;
}

.provider-title .provider-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.provider-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.badge-configured {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-live {
    background: #8b5cf6;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.recommended-model {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Quick Setup Flow */
.llm-quick-setup {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.llm-provider-option {
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.llm-provider-option:hover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 179, 0.03);
}

.llm-provider-option.selected {
    border-color: var(--primary-color);
    background: rgba(0, 102, 179, 0.08);
}

.llm-provider-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.llm-provider-option-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

/* Modern Form Fields */
.llm-form-group {
    margin-bottom: 1.25rem;
}

.llm-form-group:last-child {
    margin-bottom: 0;
}

.llm-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.llm-form-label .required {
    color: #dc2626;
    margin-left: 0.25rem;
}

.llm-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.llm-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.1);
}

.llm-form-input::placeholder {
    color: var(--gray-400);
}

.llm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.llm-form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

/* API Key Input with Toggle */
.llm-api-key-wrapper {
    position: relative;
}

.llm-api-key-wrapper input {
    padding-right: 3rem;
}

.llm-api-key-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
}

.llm-api-key-toggle:hover {
    color: var(--gray-600);
}

/* Collapsible Sections */
.llm-form-section {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.llm-form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.llm-form-section-header:hover {
    background: var(--gray-100);
}

.llm-form-section-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.llm-form-section-title i {
    color: var(--gray-500);
}

.llm-form-section-toggle {
    color: var(--gray-400);
    transition: transform 0.2s ease;
}

.llm-form-section.expanded .llm-form-section-toggle {
    transform: rotate(180deg);
}

.llm-form-section-body {
    padding: 1rem;
    display: none;
    border-top: 1px solid var(--gray-200);
}

.llm-form-section.expanded .llm-form-section-body {
    display: block;
}

/* Connection Status */
.llm-connection-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.llm-connection-status.testing {
    background: #fef3c7;
    color: #92400e;
}

.llm-connection-status.success {
    background: #d1fae5;
    color: #065f46;
}

.llm-connection-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.llm-connection-icon {
    font-size: 1.25rem;
}

.llm-connection-text {
    flex: 1;
}

.llm-connection-text strong {
    display: block;
    font-size: 0.9rem;
}

.llm-connection-text span {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Empty State */
.llm-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    border: 2px dashed var(--gray-200);
}

.llm-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--gray-400);
}

.llm-empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin: 0 0 0.5rem;
}

.llm-empty-state p {
    color: var(--gray-500);
    margin: 0 0 1.5rem;
}

/* Usage Stats Redesign */
.llm-usage-panel {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.llm-usage-panel h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.llm-usage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.llm-usage-stat {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.llm-usage-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.llm-usage-stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* =============================================================================
   PROMPT EDITOR MODAL STYLES
   ============================================================================= */

#prompt-editor-modal .modal-dialog {
    max-width: 800px;
    width: 90%;
}

.prompt-editor {
    padding: 10px;
}

.prompt-info {
    background: var(--light-bg, #f8f9fa);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.prompt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.prompt-name {
    font-weight: 600;
    font-size: 1.1em;
}

.prompt-description {
    color: var(--muted-text, #6c757d);
    margin: 0;
    font-size: 0.9em;
}

#prompt-system {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    resize: vertical;
    min-height: 150px;
}

#prompt-system:focus {
    background: #fff;
    border-color: var(--km-blue, #0066b3);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 179, 0.15);
}

.context-preview {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    font-size: 0.85em;
    max-height: 150px;
    overflow-y: auto;
}

.context-item {
    padding: 4px 0;
    border-bottom: 1px dashed #dee2e6;
}

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

.context-item strong {
    color: var(--km-blue, #0066b3);
    min-width: 100px;
    display: inline-block;
}

.prompt-options {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.checkbox-label input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--km-blue, #0066b3);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.badge-primary {
    background: var(--km-blue, #0066b3);
    color: white;
}

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

.badge-success {
    background: #28a745;
    color: white;
}

/* Dark mode support */
[data-theme=dark] .prompt-info,
[data-theme=dark] #prompt-system {
    background: var(--dark-card-bg, #2d2d2d);
    border-color: var(--dark-border, #404040);
    color: var(--dark-text, #e0e0e0);
}

[data-theme=dark] .context-preview {
    background: var(--dark-bg, #1e1e1e);
    border-color: var(--dark-border, #404040);
    color: var(--dark-text, #e0e0e0);
}

[data-theme=dark] .prompt-options {
    background: rgba(0, 102, 179, 0.2);
    border-color: rgba(0, 102, 179, 0.4);
}

[data-theme=dark] .form-actions {
    border-color: var(--dark-border, #404040);
}

/* =============================================================================
   AI HISTORY MODAL STYLES
   ============================================================================= */

#ai-history-modal .modal-dialog,
#ai-preview-modal .modal-dialog {
    max-width: 800px;
    width: 90%;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: var(--light-bg, #f8f9fa);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: var(--km-blue, #0066b3);
    box-shadow: 0 2px 8px rgba(0, 102, 179, 0.15);
}

.history-item.history-current {
    background: #e7f3ff;
    border-color: var(--km-blue, #0066b3);
}

.history-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.history-timestamp {
    color: var(--muted-text, #6c757d);
    font-size: 0.85em;
}

.history-timestamp i {
    margin-right: 5px;
}

.history-preview {
    color: #495057;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px dashed #dee2e6;
    max-height: 80px;
    overflow: hidden;
}

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

.preview-content {
    padding: 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

/* Dark mode support */
[data-theme="dark"] .history-item {
    background: var(--dark-card-bg, #2d2d2d);
    border-color: var(--dark-border, #404040);
}

[data-theme="dark"] .history-item.history-current {
    background: rgba(0, 102, 179, 0.2);
}

[data-theme="dark"] .history-preview,
[data-theme="dark"] .preview-content {
    background: var(--dark-bg, #1e1e1e);
    border-color: var(--dark-border, #404040);
    color: var(--dark-text, #e0e0e0);
}

[data-theme="dark"] .modal-footer {
    background: var(--dark-card-bg, #2d2d2d);
    border-color: var(--dark-border, #404040);
}

/* =============================================================================
   LOGIN MODAL STYLES
   ============================================================================= */

#login-modal {
    background: rgba(0, 0, 0, 0.7);
}

#login-modal .modal-dialog {
    margin-top: 15vh;
}

#login-modal .modal-header {
    background: var(--km-blue, #0066b3);
    color: white;
    border-radius: 8px 8px 0 0;
}

#login-modal .modal-body {
    padding: 30px;
}

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

#login-form label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

#login-form .form-control {
    padding: 12px;
    font-size: 16px;
}

#login-form .btn-block {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

#login-error {
    margin-top: 15px;
    margin-bottom: 0;
}

/* Microsoft SSO Button */
.btn-microsoft {
    background: #2f2f2f;
    color: #ffffff;
    border: 1px solid #8c8c8c;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.btn-microsoft:hover:not(:disabled) {
    background: #1a1a1a;
    border-color: #ffffff;
}

.btn-microsoft:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-microsoft svg {
    flex-shrink: 0;
}

/* Login divider */
.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--gray-500);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.login-divider span {
    padding: 0 15px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================================================
   STEP 4: FULL DOCUMENT PREVIEW WITH SIDEBAR
   ============================================================================= */

/* Step 4 Header */
.step4-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.step4-title h3 {
    margin-bottom: var(--spacing-xs);
}

.step4-title .step-description {
    margin-bottom: 0;
    color: var(--gray-600);
}

.step4-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Step 4 Layout - Document + Sidebar */
.step4-layout {
    display: flex;
    gap: var(--spacing-lg);
    min-height: 70vh;
}

/* Document Preview Container */
.document-preview-container {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    max-height: 75vh;
    padding-right: var(--spacing-md);
}

/* SOW Document Styles */
.sow-document {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    position: relative;
}

.sow-document.draft-watermark::before {
    content: 'DRAFT';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 120px;
    font-weight: bold;
    color: rgba(200, 200, 200, 0.2);
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
}

/* ============================================
   SOW COVER PAGE - Matching SOWTEMPLATE.docx
   ============================================ */
.sow-cover-page {
    min-height: 900px;
    position: relative;
    background: white;
    padding: 40px;
    page-break-after: always;
}

.cover-logo {
    position: absolute;
    top: 30px;
    left: 30px;
}

.km-logo-img {
    height: 50px;
    width: auto;
}

.cover-center {
    text-align: center;
    padding-top: 80px;
}

.cover-title {
    font-size: 42px;
    font-weight: normal;
    color: #333;
    margin-bottom: 10px;
}

.cover-for {
    font-size: 28px;
    color: #666;
    margin: 20px 0;
}

.cover-customer {
    font-size: 36px;
    color: #dc3545;
    font-weight: normal;
    margin: 20px 0 10px;
}

.cover-address,
.cover-city {
    font-size: 18px;
    color: #dc3545;
    margin: 5px 0;
}

.cover-image {
    margin: 40px auto;
    text-align: center;
}

.tech-graphic {
    width: 100%;
    max-width: 600px;
    height: 200px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a1a6c 0%, #4a4aaa 50%, #8a6aff 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.tech-graphic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="30" r="15" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="50" r="20" fill="rgba(255,255,255,0.08)"/><circle cx="40" cy="70" r="12" fill="rgba(255,255,255,0.12)"/><line x1="20" y1="30" x2="70" y2="50" stroke="rgba(255,255,255,0.2)" stroke-width="1"/><line x1="70" y1="50" x2="40" y2="70" stroke="rgba(255,255,255,0.2)" stroke-width="1"/></svg>');
    background-size: cover;
}

.cover-products {
    text-align: center;
    margin: 40px 0;
}

.products-label {
    font-size: 22px;
    color: #333;
    margin-bottom: 15px;
}

.products-list {
    font-size: 18px;
    color: #666;
}

.cover-info-table {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    font-size: 13px;
    margin-top: 60px;
}

.cover-info-table .info-left,
.cover-info-table .info-right {
    line-height: 1.8;
}

.cover-info-table .info-left {
    text-align: left;
}

.cover-info-table .info-right {
    text-align: right;
}

.cover-info-table .var-text {
    color: #dc3545;
}

.cover-footer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #103b5b;
}

.page-break {
    page-break-before: always;
    height: 1px;
    margin: 40px 0;
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.fullscreen-header {
    background: #1a1a6c;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.fullscreen-header h3 {
    margin: 0;
    font-size: 18px;
}

.fullscreen-close {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.fullscreen-close:hover {
    background: white;
    color: #1a1a6c;
}

.fullscreen-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.fullscreen-document {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #f0f0f0;
}

.fullscreen-document .sow-document {
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.fullscreen-sidebar {
    width: 320px;
    background: white;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    flex-shrink: 0;
}

/* Document Header - Professional SOW Template Style */
.document-header-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #1a1a6c 0%, #2d2d8a 100%);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    color: white;
}

.header-left {
    flex: 0 0 auto;
}

.header-center {
    flex: 1;
    text-align: center;
    padding: 0 var(--spacing-lg);
}

.header-right {
    flex: 0 0 auto;
    text-align: right;
    font-size: var(--font-size-sm);
}

.document-logo svg {
    max-height: 40px;
}

.document-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: white;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.document-subtitle {
    font-size: var(--font-size-sm);
    color: rgba(255,255,255,0.8);
    margin: var(--spacing-xs) 0 0 0;
}

.doc-info {
    margin: var(--spacing-xs) 0;
    color: rgba(255,255,255,0.9);
}

.doc-info strong {
    color: white;
}

/* Document Info Table */
.document-info-table {
    margin-bottom: var(--spacing-lg);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.info-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
}

.info-table .info-label {
    background: var(--gray-100);
    font-weight: 600;
    width: 120px;
    color: var(--gray-700);
}

.info-table .info-value {
    background: white;
}

/* Legacy header support */
.document-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.document-logo img {
    max-height: 60px;
    margin-bottom: var(--spacing-md);
}

.document-meta {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.document-meta p {
    margin: var(--spacing-xs) 0;
}

.document-divider {
    border: none;
    border-top: 2px solid var(--primary);
    margin: var(--spacing-lg) 0;
}

/* Content placeholder - minimal style */
.content-placeholder {
    min-height: 60px;
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    background: var(--gray-50);
}

.content-placeholder:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
}

/* Document Sections */
.document-section {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative;
    z-index: 2;
}

.document-section:hover {
    border-color: var(--gray-300);
}

.document-section.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.document-section.appendix {
    background: var(--gray-50);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-md);
}

.section-number {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

/* Section Type Badges */
.section-badge {
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.section-badge.badge-static {
    background: var(--gray-200);
    color: var(--gray-600);
}

.section-badge.badge-ai {
    background: #e3f2fd;
    color: #1976d2;
}

.section-badge.badge-user {
    background: #e8f5e9;
    color: #388e3c;
}

.section-badge.badge-conditional {
    background: #fff3e0;
    color: #f57c00;
}

.section-badge.badge-skill {
    background: #f3e5f5;
    color: #7b1fa2;
}

.section-badge.badge-upload {
    background: #e1f5fe;
    color: #0288d1;
}

/* Section Content */
.section-content {
    min-height: 60px;
    line-height: 1.6;
}

.section-content[contenteditable="true"] {
    outline: none;
    padding: var(--spacing-sm);
    border: 1px dashed transparent;
    border-radius: var(--border-radius-sm);
    transition: border-color var(--transition), background var(--transition);
}

.section-content[contenteditable="true"]:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.section-content[contenteditable="true"]:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--primary-light);
}

.placeholder-text {
    color: var(--gray-500);
    font-style: italic;
}

.unresolved-variable {
    background: #fff3cd;
    padding: 0 4px;
    border-radius: 3px;
    color: #856404;
    font-weight: 500;
}

/* Appendices Header */
.appendices-header {
    margin: var(--spacing-2xl) 0 var(--spacing-lg);
    padding: var(--spacing-md) 0;
    border-top: 2px solid var(--primary);
    border-bottom: 1px solid var(--gray-300);
}

.appendices-header h2 {
    font-size: var(--font-size-xl);
    color: var(--primary);
    margin: 0;
    text-align: center;
}

/* Tools Sidebar */
.tools-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    max-height: 75vh;
    overflow-y: auto;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Sidebar Panels */
.sidebar-panel {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-100);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--font-size-sm);
    user-select: none;
}

.panel-header:hover {
    background: var(--gray-200);
}

.panel-header span {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.panel-toggle {
    transition: transform var(--transition);
}

.sidebar-panel.collapsed .panel-toggle {
    transform: rotate(-90deg);
}

.sidebar-panel.collapsed .panel-body {
    display: none;
}

.panel-body {
    padding: var(--spacing-md);
}

.panel-body .form-group {
    margin-bottom: var(--spacing-sm);
}

.panel-body .form-group label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
    color: var(--gray-600);
}

/* Selected Section Info */
.selected-section-info {
    padding: var(--spacing-sm);
    background: var(--primary-light);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
}

.section-info-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.section-description {
    margin-top: 8px;
}

.description-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #664d03;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.description-box i {
    color: #997404;
    margin-top: 2px;
    flex-shrink: 0;
}

.description-box span {
    flex: 1;
}

/* Section Description Box - Top of Sidebar */
.section-description-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-description-box .description-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(33, 150, 243, 0.2);
}

.section-description-box .description-header i {
    color: #1976d2;
    font-size: 14px;
}

.section-description-box .description-header span {
    font-weight: 600;
    color: #1565c0;
    font-size: 13px;
}

.section-description-box .description-content {
    font-size: 12px;
    line-height: 1.6;
    color: #37474f;
}

.section-description-box .description-content p {
    margin: 0;
}

.section-description-box.no-section {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.section-description-box.no-section .description-header i,
.section-description-box.no-section .description-header span {
    color: #757575;
}

/* Proofreader Stats */
.proofreader-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

/* Navigation List */
.nav-panel-body {
    max-height: 250px;
    overflow-y: auto;
}

.section-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    transition: background var(--transition);
}

.nav-item:hover {
    background: var(--gray-100);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-number {
    font-weight: 600;
    min-width: 24px;
    color: var(--gray-500);
}

.nav-item.active .nav-number {
    color: var(--primary);
}

.nav-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-divider {
    padding: var(--spacing-sm);
    font-weight: 700;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--gray-200);
    margin-top: var(--spacing-sm);
}

/* Inline Tables */
.inline-table-container {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px dashed var(--gray-300);
}

.inline-table-container h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-700);
}

.sow-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.sow-table th,
.sow-table td {
    padding: var(--spacing-sm);
    border: 1px solid var(--gray-300);
    text-align: left;
}

.sow-table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
}

.sow-table td[contenteditable="true"] {
    outline: none;
    transition: background var(--transition);
}

.sow-table td[contenteditable="true"]:hover {
    background: var(--gray-50);
}

.sow-table td[contenteditable="true"]:focus {
    background: #fffef0;
    box-shadow: inset 0 0 0 2px var(--primary-light);
}

.sow-table .action-col {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
}

/* Financial Table */
.financial-table .qty-input,
.financial-table .unit-price-input {
    width: 100%;
    text-align: right;
}

.financial-table .ext-price {
    text-align: right;
    font-weight: 600;
}

.financial-total-row {
    background: var(--gray-100);
    font-weight: 700;
}

.financial-total {
    font-size: var(--font-size-lg);
    color: var(--primary);
}

/* Financial Math Error */
.financial-row.math-error {
    background: #fff0f0;
}

.financial-row.math-error .ext-price {
    color: var(--danger);
    position: relative;
}

.financial-row.math-error .ext-price::after {
    content: '!';
    position: absolute;
    right: -20px;
    color: var(--danger);
    font-weight: bold;
}

/* Proofreader Results */
.proofreader-section {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    background: var(--gray-50);
}

.proofreader-section.critical {
    background: #ffebee;
    border-left: 3px solid var(--danger);
}

.proofreader-section.warnings {
    background: #fff8e1;
    border-left: 3px solid var(--warning);
}

.proofreader-section.scores {
    background: var(--gray-100);
}

.proofreader-section h6 {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.proofreader-section ul {
    font-size: var(--font-size-sm);
    padding-left: var(--spacing-lg);
}

.proofreader-section ul li {
    margin-bottom: var(--spacing-xs);
}

.score-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.score-item {
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--gray-200);
}

.proofreader-status {
    font-size: var(--font-size-sm);
}

/* History Modal */
.history-item {
    background: var(--white);
}

.history-content {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    max-height: 100px;
    overflow: hidden;
}

/* Prompt Context */
.prompt-context {
    font-size: var(--font-size-sm);
}

.prompt-context h6 {
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

/* Scope Table */
.scope-table td {
    vertical-align: top;
}

.scope-list {
    list-style: disc;
    padding-left: var(--spacing-lg);
    margin: 0;
}

.scope-list li {
    margin-bottom: var(--spacing-xs);
    padding: 2px 4px;
}

.scope-list li[contenteditable="true"]:focus {
    outline: none;
    background: #fffef0;
}

/* Validation Info */
.validation-info {
    font-size: var(--font-size-sm);
}

/* Loading States */
.sidebar-loading {
    display: flex;
    justify-content: center;
    padding: var(--spacing-xl);
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Section Type Colors */
.section-type-static .section-header {
    border-bottom-color: var(--gray-400);
}

.section-type-ai_user .section-header,
.section-type-ai_generated .section-header,
.section-type-ai_research .section-header {
    border-bottom-color: #1976d2;
}

.section-type-user_input .section-header,
.section-type-static_user .section-header {
    border-bottom-color: #388e3c;
}

.section-type-skill_generated .section-header {
    border-bottom-color: #7b1fa2;
}

.section-type-user_upload .section-header {
    border-bottom-color: #0288d1;
}

/* Image Upload Area */
.image-upload-area {
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    text-align: center;
}

/* Print Preview Adjustments */
@media print {
    .step4-header,
    .tools-sidebar,
    .section-badge,
    .action-col,
    .btn {
        display: none !important;
    }

    .step4-layout {
        display: block;
    }

    .document-preview-container {
        max-height: none;
        overflow: visible;
    }

    .document-section {
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .section-content[contenteditable] {
        border: none !important;
    }
}

/* =============================================================================
   ENTRA ID USER MANAGEMENT
   ============================================================================= */
.entra-user-row {
    background-color: rgba(0, 120, 212, 0.03);
}

.entra-user-row:hover {
    background-color: rgba(0, 120, 212, 0.08);
}

.readonly-field {
    background-color: var(--gray-100) !important;
    color: var(--gray-700);
    cursor: not-allowed;
    border-color: var(--gray-300);
}

.entra-user-details .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.entra-user-details .form-group {
    margin-bottom: 0;
}

.entra-user-details .form-group label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--gray-600);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.badge.info {
    background-color: #0078d4;
    color: white;
}

.badge.info i {
    margin-right: 3px;
}

/* Alert styles */
.alert-info {
    background-color: #e7f3ff;
    border: 1px solid #b6daff;
    color: #0c5460;
    padding: 12px 15px;
    border-radius: var(--border-radius);
}

.alert-info i {
    margin-right: 8px;
    color: #0078d4;
}
