:root {
    --bg: #0f0f13;
    --bg-card: #1a1a24;
    --bg-input: #252536;
    --text: #e4e4ed;
    --text-muted: #8b8b9e;
    --accent: #7c5cfc;
    --accent-hover: #6a4deb;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --border: #2a2a3a;
    --radius: 8px;
}

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

body.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-input);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-name {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--bg-input);
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: white;
}

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

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

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

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
}

/* Forms */
.input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.input:focus {
    border-color: var(--accent);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Landing page */
.hero {
    text-align: center;
    max-width: 600px;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 1rem;
}

.hero-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 800px;
}

.feature {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.feature h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Auth */
.auth-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
}

.auth-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-form {
    margin-bottom: 1rem;
}

.auth-link {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
}

.error-message {
    color: var(--danger);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

/* App */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.app-welcome h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.app-welcome > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.app-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.app-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.app-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Chat Layout */
.chat-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    height: calc(100vh - 120px);
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.chat-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.chat-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    max-width: 85%;
}

.chat-user {
    background: var(--accent);
    margin-left: auto;
}

.chat-user .msg-content {
    color: white;
}

.chat-assistant {
    background: var(--bg-input);
    margin-right: auto;
}

.chat-note {
    text-align: center;
    color: var(--accent);
    font-size: 0.75rem;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-textarea {
    flex: 1;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    outline: none;
    resize: none;
    font-family: inherit;
    min-height: 44px;
}

.chat-textarea:focus {
    border-color: var(--accent);
}

.chat-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-y: auto;
}

.chat-sidebar h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.sidebar-empty {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem 0;
}

.claims-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.claim-mini {
    background: var(--bg-input);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.claim-cat {
    color: var(--accent);
    font-weight: 600;
    display: block;
    margin-bottom: 0.125rem;
}

.claim-text {
    color: var(--text);
    display: block;
    margin-bottom: 0.125rem;
}

.claim-conf {
    color: var(--text-muted);
    font-size: 0.65rem;
}

/* Dashboard */
.dashboard h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.dashboard > p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.dashboard-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-filters select {
    padding: 0.4rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

.claims-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.claim-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

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

.claim-category {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.claim-confidence {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.claim-statement {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.claim-meta {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.claim-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-muted);
}

.badge-personal { color: var(--success); }
.badge-sensitive { color: var(--warning); }
.badge-highly_sensitive { color: var(--danger); }
.badge-confirmed { color: var(--success); }
.badge-inferred { color: var(--warning); }
.badge-candidate { color: var(--text-muted); }
.badge-obsolete { color: var(--danger); text-decoration: line-through; }

.claim-actions {
    display: flex;
    gap: 0.25rem;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 3rem 1rem;
    grid-column: 1 / -1;
}

.dashboard-actions {
    display: flex;
    gap: 0.5rem;
}

/* Scenario page */
.scenario-page h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.scenario-page > p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.scenario-form {
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* Output Library */
.output-library h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.output-library > p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.artifacts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.artifact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

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

.artifact-header h3 {
    font-size: 1rem;
    color: var(--text);
}

.artifact-type {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: capitalize;
}

.artifact-version, .artifact-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.artifact-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

/* Settings */
.settings-page h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.settings-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.settings-section p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.settings-acitions {
    display: flex;
    gap: 0.5rem;
}

.settings-danger {
    border-color: var(--danger);
}

.settings-danger h3 {
    color: var(--danger);
}

.streaming {
    color: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

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

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

/* History items */
.history-item {
    padding: 0.4rem 0;
    font-size: 0.8rem;
}

.history-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.history-item a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .features {
        grid-template-columns: 1fr;
    }
    .chat-layout {
        grid-template-columns: 1fr;
    }
    .chat-sidebar {
        display: none;
    }
    .nav-links {
        display: none;
    }
}
