/* --- FILE: static/css/style.css --- */
/* Work Hub Design System */

/* =========================================================
   CSS Custom Properties
   ========================================================= */
:root {
    --brand-50: #f0f4ff;
    --brand-100: #dbe4ff;
    --brand-200: #bac8ff;
    --brand-500: #5c7cfa;
    --brand-600: #4c6ef5;
    --brand-700: #4263eb;

    --surface-0: #ffffff;
    --surface-1: #f8f9fa;
    --surface-2: #f1f3f5;
    --surface-3: #e9ecef;

    --rag-green: #40c057;
    --rag-amber: #fab005;
    --rag-red: #fa5252;

    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #868e96;

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* =========================================================
   Base
   ========================================================= */
body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   Card Component
   ========================================================= */
.card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--surface-2);
}

.card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 0.75rem 1rem;
}

/* =========================================================
   Badges
   ========================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-red {
    background: #fff5f5;
    color: var(--rag-red);
}

.badge-amber {
    background: #fff9db;
    color: #e67700;
}

.badge-green {
    background: #ebfbee;
    color: #2b8a3e;
}

.badge-brand {
    background: var(--brand-50);
    color: var(--brand-700);
}

.badge-gray {
    background: var(--surface-2);
    color: var(--text-secondary);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn-sm {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    background: var(--brand-600);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-sm:hover {
    background: var(--brand-700);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--surface-3);
}

.btn-outline:hover {
    background: var(--surface-2);
}

/* =========================================================
   RAG Status Indicators
   ========================================================= */
.rag-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.rag-dot.green { background: var(--rag-green); }
.rag-dot.amber { background: var(--rag-amber); }
.rag-dot.red { background: var(--rag-red); }

.rag-bar {
    height: 3px;
    border-radius: 2px;
    width: 100%;
}

.rag-bar.green { background: var(--rag-green); }
.rag-bar.amber { background: var(--rag-amber); }
.rag-bar.red { background: var(--rag-red); }

/* =========================================================
   Priority Matrix
   ========================================================= */
.matrix-quadrant {
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-height: 5rem;
}

.matrix-quadrant.q1 { background: #fff5f5; border: 1px solid #ffc9c9; }
.matrix-quadrant.q2 { background: #f0f4ff; border: 1px solid #bac8ff; }
.matrix-quadrant.q3 { background: #fff9db; border: 1px solid #ffe066; }
.matrix-quadrant.q4 { background: var(--surface-1); border: 1px solid var(--surface-3); }

.matrix-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.matrix-item {
    font-size: 0.75rem;
    padding: 0.25rem 0.375rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* =========================================================
   Work Item Row
   ========================================================= */
.work-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--surface-2);
    font-size: 0.75rem;
}

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

.work-item-id {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--brand-600);
    white-space: nowrap;
}

.work-item-title {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-item-deadline {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* =========================================================
   Alert Item
   ========================================================= */
.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    font-size: 0.75rem;
}

.alert-item.acknowledged {
    background: var(--surface-1);
    border-color: var(--surface-3);
    opacity: 0.7;
}

/* =========================================================
   Insight Card
   ========================================================= */
.insight-item {
    padding: 0.625rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-3);
    transition: border-color 0.15s ease;
}

.insight-item:hover {
    border-color: var(--brand-200);
}

.insight-headline {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.insight-rationale {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.insight-actions {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

/* =========================================================
   Chat Messages
   ========================================================= */
.chat-msg {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.chat-msg.user {
    margin-left: auto;
    background: var(--brand-600);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.chat-msg.assistant {
    background: var(--surface-2);
    color: var(--text-primary);
    border-bottom-left-radius: var(--radius-sm);
}

/* =========================================================
   Follow-up Item
   ========================================================= */
.followup-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--surface-2);
    font-size: 0.75rem;
}

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

.followup-date {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* =========================================================
   Meeting Item
   ========================================================= */
.meeting-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--surface-2);
    font-size: 0.75rem;
}

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

.meeting-time {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--brand-600);
    white-space: nowrap;
    min-width: 3.5rem;
}

/* =========================================================
   Goal Progress
   ========================================================= */
.goal-item {
    margin-bottom: 0.5rem;
}

.goal-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.goal-bar {
    height: 6px;
    background: var(--surface-2);
    border-radius: 3px;
    overflow: hidden;
}

.goal-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--brand-500);
    transition: width 0.3s ease;
}

/* =========================================================
   Loading & Empty States
   ========================================================= */
.loading-placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 1rem 0;
    text-align: center;
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 1.5rem 0;
    text-align: center;
}

/* =========================================================
   Payroll Card
   ========================================================= */
.payroll-stat {
    text-align: center;
}

.payroll-stat .label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.payroll-stat .value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* =========================================================
   Responsive: Mobile
   ========================================================= */
@media (max-width: 640px) {
    .card-header {
        padding: 0.625rem 0.75rem;
    }

    .card-body {
        padding: 0.625rem 0.75rem;
    }

    #chat-panel {
        width: 100%;
    }

    .matrix-quadrant {
        padding: 0.375rem;
    }
}

/* =========================================================
   Scrollbar
   ========================================================= */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ced4da;
}

/* =========================================================
   Transitions
   ========================================================= */
.fade-in {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
