:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.badge {
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 99px;
    vertical-align: middle;
    margin-left: 5px;
    text-transform: uppercase;
}

nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s;
}

nav a.active {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 3rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f1f5f9;
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-light);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: #eff6ff;
    color: var(--primary);
}

.btn-sm:hover {
    background: var(--primary);
    color: white;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.open {
    background: #dcfce7;
    color: #166534;
}

.status-badge.closed {
    background: #f1f5f9;
    color: #475569;
}

/* Progress Bars */
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    position: relative;
    width: 100px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

.progress {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
}

/* Advisory Page Specifics */
.advisory-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.chat-container {
    height: 60vh;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #fdfdfd;
}

.message {
    margin-bottom: 1rem;
    max-width: 80%;
}

.message.ai {
    align-self: flex-start;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 0 12px 12px 12px;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    padding: 1rem;
    border-radius: 12px 12px 0 12px;
    margin-left: auto;
}

.chat-input {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.voice-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 44px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-btn.recording {
    background: #ef4444;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Sidebar Fields */
.field-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.field-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 700;
}

.field-value {
    font-weight: 600;
}

.field-status {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.field-status.proposed {
    background: #fef3c7;
    color: #92400e;
}

.actions {
    margin-top: 5px;
    display: flex;
    gap: 5px;
}

.score-widget {
    text-align: center;
    padding: 2rem;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 8px solid var(--success);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
}

/* UI Enhancements */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, .1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.field-item.editing .field-value {
    display: none;
}

.edit-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    margin-top: 0.5rem;
}

.field-value {
    cursor: pointer;
    padding: 2px 4px;
    transition: background 0.2s;
}

.field-value:hover {
    background: #f1f5f9;
    border-radius: 4px;
}