:root {
    --primary: #0066cc;
    --bg: #f5f7fa;
    --sidebar-bg: #fff;
    --border: #e1e4e8;
    --text: #333;
    --text-light: #666;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --diff-bg: #fff5f5;
    --diff-text: #990000;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header h1 { margin: 0; font-size: 1.2rem; }

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 1rem 0;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Tree Navigation */
.nav-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover { background: #f0f4f8; }
.nav-item.active { background: #e6f0ff; color: var(--primary); border-right: 3px solid var(--primary); }
.nav-item.has-children { font-weight: 600; color: #444; margin-top: 0.5rem; }
.nav-children { padding-left: 1rem; }

/* Test Case Cards */
.test-case-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.tc-title h3 { margin: 0 0 0.5rem 0; font-size: 1.1rem; }
.tc-meta { font-size: 0.85rem; color: var(--text-light); }

.tc-actions {
    display: flex;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-badge.pending { background: #eee; color: #666; }
.status-badge.approved { background: #d4edda; color: var(--success); }
.status-badge.flagged { background: #fff3cd; color: #856404; }

.tc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.tc-col h4 { font-size: 0.9rem; text-transform: uppercase; color: var(--text-light); margin-top: 0; }

.description-box {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.9rem;
    border: 1px solid #eee;
    min-height: 100px;
}

.original-box {
    background: var(--diff-bg);
    color: var(--diff-text);
    padding: 0.75rem;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.85rem;
    border: 1px dashed #ffcccc;
    margin-bottom: 0.5rem;
    display: none; /* Hidden by default */
}

.diff-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
}

.steps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.steps-table th { text-align: left; border-bottom: 2px solid #eee; padding: 0.5rem; color: var(--text-light); }
.steps-table td { border-bottom: 1px solid #eee; padding: 0.75rem 0.5rem; vertical-align: top; }
.step-num { width: 30px; font-weight: bold; color: var(--text-light); }

.btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn:hover { background: #f5f5f5; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: #0056b3; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #fff5f5; }
.btn-sm { padding: 0.2rem 0.5rem; font-size: 0.75rem; }

/* Chat Panel */
.chat-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-radius: 8px;
}

.chat-header {
    background: #333;
    color: #fff;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #f9f9f9;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
}

.chat-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.chat-msg {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
    max-width: 80%;
}

.chat-msg.user {
    background: #e6f0ff;
    align-self: flex-end;
    margin-left: auto;
}

.chat-msg.ai {
    background: #fff;
    border: 1px solid #eee;
    align-self: flex-start;
}
