/* ============================================================================
   Mother Personal Assistant Panel Styles
   Updated: December 11, 2025 per CEO requirements
   ============================================================================ */

/* ── CSS Custom Properties (dark theme defaults) ─────────────────────────── */
:root {
    --bg-darker:           #1a1d23;
    --panel-bg:            #252930;
    --card-bg:             #374151;
    --card-hover-bg:       #4b5563;
    --surface-color:       #1f2937;
    --input-bg:            #374151;
    --bar-bg:              #4b5563;
    --border-color:        #4b5563;
    --text-primary:        #e8eaed;
    --text-secondary:      #9aa0a6;
    --text-tertiary:       #6b7280;
    --text-muted:          #9ca3af;
    --accent-primary:      #7c3aed;
    --accent-primary-hover:#9333ea;
    --accent-secondary:    #3b82f6;
    --accent-warning:      #f59e0b;
    --primary-color:       #6366f1;
    --primary-hover:       #4f46e5;
    --secondary-bg:        #4b5563;
    --hover-bg:            #6b7280;
    --success-color:       #22c55e;
    --danger-color:        #ef4444;
    --warning-color:       #f59e0b;
    --btn-secondary-bg:    #4b5563;
    --btn-secondary-hover: #6b7280;
    --message-bg:          rgba(124,58,237,0.13);
    --message-user-bg:     rgba(59,130,246,0.13);
}

/* ============================================================================
   KAAI CEO Dashboard — Redesign (2026-03-25)
   New components: Status Bar, 3-Column Layout, Command Center, KAAI Pulse
   ============================================================================ */

/* ── 3-Column Layout ─────────────────────────────────────────────────────── */
.pa-three-columns {
    display: grid;
    grid-template-columns: 30% 24% 1fr;
    grid-template-rows: 1fr;
    gap: 1rem;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.pa-col-left,
.pa-col-center,
.pa-col-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    min-height: 0;
}

/* ── Live Status Bar ─────────────────────────────────────────────────────── */
.pa-status-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.55rem 1rem;
    background: var(--panel-bg, #1e2128);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.sc {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 20px;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s;
}
.sc:hover { background: rgba(255,255,255,0.08); }

.sc-icon  { font-size: 0.85em; }
.sc-lbl   { color: var(--text-secondary, #9aa0a6); font-size: 0.76em; }
.sc-val   { font-weight: 600; font-size: 0.82em; color: var(--text-primary, #e8eaed); }
.sc-val.sc-ok   { color: #10b981; }
.sc-val.sc-warn { color: #f59e0b; }
.sc-val.sc-err  { color: #ef4444; }
.sc-val.sc-muted{ color: #6b7280; }

/* ── Command Center (Quick Actions) ─────────────────────────────────────── */
.kaai-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

@media (max-width: 1200px) {
    .kaai-actions-grid { grid-template-columns: repeat(4, 1fr); }
    .pa-three-columns  { grid-template-columns: 34% 22% 1fr; }
}
@media (max-width: 900px) {
    .kaai-actions-grid { grid-template-columns: repeat(2, 1fr); }
    .pa-three-columns  { grid-template-columns: 1fr; }
}

.qa-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
    text-align: left;
    color: var(--text-primary, #e8eaed);
    min-height: 70px;
}
.qa-card:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-1px);
}
.qa-card:active { transform: translateY(0); }

.qa-card.qa-primary {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.35);
}
.qa-card.qa-primary:hover {
    background: rgba(99,102,241,0.25);
    border-color: rgba(99,102,241,0.55);
}
.qa-card.qa-dev {
    background: rgba(16,185,129,0.08);
    border-color: rgba(16,185,129,0.2);
}
.qa-card.qa-dev:hover {
    background: rgba(16,185,129,0.16);
    border-color: rgba(16,185,129,0.4);
}
.qa-card.qa-alert {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.4);
    animation: pulse-alert 2s ease-in-out infinite;
}
@keyframes pulse-alert {
    0%,100% { border-color: rgba(239,68,68,0.4); }
    50%      { border-color: rgba(239,68,68,0.8); }
}

.qa-icon  { font-size: 1.2em; line-height: 1; }
.qa-label { font-size: 0.85em; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.qa-desc  { font-size: 0.73em; opacity: 0.55; }
.qa-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    border-radius: 9px;
    font-size: 0.72em;
    font-weight: 700;
    line-height: 1;
}

/* ── KAAI Pulse Center Column ────────────────────────────────────────────── */
.pa-kaai-pulse { flex: 1; overflow-y: auto; }

.pulse-loading {
    font-size: 0.82em;
    opacity: 0.45;
    padding: 16px 0;
    text-align: center;
}

.pulse-section {
    margin-bottom: 1.1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pulse-section:last-child { border-bottom: none; margin-bottom: 0; }

.pulse-stitle {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #9aa0a6);
    margin-bottom: 8px;
}

/* Agent signal chips — 4-state grid */
.pulse-agents {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}
.pulse-agent {
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    transition: background 0.3s;
}
.pa-agent-name   { font-weight: 600; font-size: 10px; color: var(--text-primary, #e8eaed); }
.pa-agent-status { font-weight: 700; font-size: 10px; }
.pa-agent-lat    { font-size: 9px; opacity: 0.45; }

/* Pulsing animation for WORKING state */
@keyframes signal-pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.pulse-working { animation: signal-pulse 1.4s ease-in-out infinite; }

/* VRAM bar */
.pulse-vram-track {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 6px 0 4px;
}
.pulse-vram-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.pulse-vram-lbl { font-size: 0.75em; opacity: 0.5; }

/* Ticket breakdown grid */
.pulse-tickets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 4px;
}
.pt-cell {
    text-align: center;
    padding: 6px 4px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    border-top: 2px solid rgba(255,255,255,0.08);
}
.pt-num { font-size: 1.2em; font-weight: 700; color: var(--text-primary, #e8eaed); }
.pt-lbl { font-size: 0.65em; opacity: 0.5; margin-top: 2px; }

/* Sentinel verdict */
.pulse-sentinel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}
.sent-score {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25em;
    font-weight: 800;
    flex-shrink: 0;
    border: 3px solid currentColor;
}
.sent-score.sent-pass { color: #10b981; }
.sent-score.sent-warn { color: #f59e0b; }
.sent-score.sent-fail { color: #ef4444; }
.sent-meta { font-size: 0.82em; color: var(--text-primary, #e8eaed); }

/* ── Modal Helpers (shared across action handlers) ───────────────────────── */
.modal-loading { text-align: center; padding: 24px; opacity: 0.55; font-size: 0.88em; }
.modal-empty   { text-align: center; padding: 24px; opacity: 0.45; font-size: 0.88em; }
.modal-warn    { color: #f59e0b; padding: 16px; font-size: 0.88em; border-radius: 6px; background: rgba(245,158,11,0.1); }
.modal-err     { color: #ef4444; padding: 16px; font-size: 0.88em; border-radius: 6px; background: rgba(239,68,68,0.1); }
.modal-more    { text-align: center; opacity: 0.45; font-size: 0.8em; padding: 8px; }

/* ── Inbox Modal ─────────────────────────────────────────────────────────── */
.inbox-count   { font-size: 0.8em; opacity: 0.5; margin-bottom: 10px; }
.inbox-item    { padding: 10px 2px; }
.inbox-from    { font-weight: 600; font-size: 0.9em; color: #e8eaed; }
.inbox-subject { font-size: 0.92em; color: #a5b4fc; margin: 3px 0; }
.inbox-snippet { font-size: 0.8em; opacity: 0.55; line-height: 1.4; }
.inbox-date    { font-size: 0.72em; opacity: 0.35; margin-top: 3px; }
.inbox-divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 4px 0; }

/* ── Calendar Modal ──────────────────────────────────────────────────────── */
.cal-event {
    background: rgba(99,102,241,0.1);
    border-left: 3px solid #6366f1;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.cal-time  { font-weight: 700; color: #a5b4fc; font-size: 0.9em; }
.cal-title { color: #e8eaed; margin-top: 2px; }
.cal-dur   { font-size: 0.78em; opacity: 0.5; margin-top: 3px; }
.cal-loc   { font-size: 0.78em; opacity: 0.5; }

/* ── Ticket Modal ────────────────────────────────────────────────────────── */
.ticket-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.ts-cell {
    text-align: center;
    background: rgba(0,0,0,0.18);
    border-radius: 8px;
    padding: 10px 6px;
}
.ts-num  { font-size: 1.3em; font-weight: 700; }
.ts-lbl  { font-size: 0.7em; opacity: 0.5; margin-top: 3px; }
.ticket-row {
    background: rgba(0,0,0,0.14);
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.tr-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tr-title  { font-size: 0.86em; font-weight: 600; color: #e8eaed; flex: 1; }
.tr-status { font-size: 0.7em; padding: 2px 6px; border-radius: 3px; background: rgba(255,255,255,0.08); color: #9ca3af; white-space: nowrap; }
.tr-meta   { font-size: 0.73em; opacity: 0.45; margin-top: 3px; }

/* ── Memory Search Modal ─────────────────────────────────────────────────── */
.mem-search-bar { display: flex; gap: 8px; margin-bottom: 2px; }
.mem-search-bar .form-control { flex: 1; }
.mem-count   { font-size: 0.78em; opacity: 0.45; margin-bottom: 8px; }
.mem-result  { background: rgba(99,102,241,0.1); border-left: 3px solid #6366f1; border-radius: 5px; padding: 9px 12px; margin-bottom: 6px; }
.mem-summary { font-size: 0.84em; color: #e8eaed; }
.mem-meta    { font-size: 0.72em; opacity: 0.4; margin-top: 4px; }

/* ── WS disconnect banner ────────────────────────────────────────────────── */
.ws-disconnect-banner {
    background: rgba(217,119,6,0.15);
    border: 1px solid rgba(217,119,6,0.4);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.82em;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

/* ── Core layout (updated 2026-03-25) ──────────────────────────────────── */
.personal-assistant-layout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: calc(100vh - 160px);
    padding: 0.75rem 1rem 1rem;
    overflow: hidden;
}

/* Legacy 2-col wrapper hidden — .pa-three-columns replaces it */
.pa-columns-wrapper {
    display: none;
}

.pa-left-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

.pa-right-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    height: 100%;
}

/* Section Cards */
.pa-section {
    background: var(--panel-bg, #252930);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #e8eaed);
}

.section-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Chat Section */
.pa-chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-darker, #1a1d23);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.chat-empty {
    text-align: center;
    color: var(--text-secondary, #9aa0a6);
    padding: 2rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeInMessage 0.3s ease-out;
}

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

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--accent-secondary, #3b82f6);
}

.message-content {
    flex: 1;
    max-width: 75%;
}

.user-message .message-content {
    text-align: right;
}

.message-text {
    background: var(--message-bg, #7c3aed20);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-primary, #e8eaed);
    line-height: 1.5;
}

.user-message .message-text {
    background: var(--message-user-bg, #3b82f620);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary, #9aa0a6);
    margin-top: 0.25rem;
}

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

.chat-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--input-bg, #374151);
    border: 1px solid var(--border-color, #4b5563);
    border-radius: 8px;
    color: var(--text-primary, #e8eaed);
    font-size: 0.95rem;
    resize: none;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary, #7c3aed);
}

.chat-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Connection Status */
.connection-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.connection-status.connected {
    color: #10b981;
    background: #10b98120;
}

.connection-status.disconnected {
    color: #ef4444;
    background: #ef444420;
}

/* Command Center section wrapper — flex-shrink keeps it from collapsing */
.pa-quick-actions {
    background: var(--panel-bg, #252930);
    flex-shrink: 0;
}


/* Insights Panel */
.pa-insights {
    background: var(--panel-bg, #252930);
}

.insight-block {
    margin-bottom: 1.5rem;
}

.insight-title {
    font-weight: 600;
    color: var(--text-primary, #e8eaed);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.insight-empty {
    color: var(--text-secondary, #9aa0a6);
    font-size: 0.9rem;
    padding: 0.5rem;
}

.insight-loading {
    color: var(--text-secondary, #9aa0a6);
    font-size: 0.9rem;
    padding: 0.5rem;
    animation: pulse 1.5s infinite;
}

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

/* Agent Tasks List */
.agent-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agent-task-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--card-bg, #374151);
    border-radius: 6px;
    font-size: 0.85rem;
}

.task-agent {
    font-weight: 600;
    color: var(--accent-primary, #7c3aed);
    min-width: 100px;
}

.task-title {
    flex: 1;
    color: var(--text-primary, #e8eaed);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-status {
    font-size: 1.1rem;
}

.view-more {
    text-align: center;
    color: var(--accent-primary, #7c3aed);
    font-size: 0.85rem;
    padding: 0.5rem;
    cursor: pointer;
}

/* Health Metrics */
.health-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.health-metric {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.metric-label {
    min-width: 60px;
    color: var(--text-secondary, #9aa0a6);
}

.metric-value {
    min-width: 50px;
    font-weight: 600;
    color: var(--text-primary, #e8eaed);
}

.metric-bar {
    flex: 1;
    height: 6px;
    background: var(--bar-bg, #4b5563);
    border-radius: 3px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #7c3aed);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Approvals Panel */
.pa-approvals {
    background: var(--panel-bg, #252930);
}

.approvals-empty {
    color: var(--text-secondary, #9aa0a6);
    text-align: center;
    padding: 1rem;
}

.approvals-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.approval-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card-bg, #374151);
    border-radius: 8px;
    border-left: 3px solid var(--accent-warning, #f59e0b);
}

.approval-icon {
    font-size: 1.5rem;
}

.approval-content {
    flex: 1;
}

.approval-title {
    font-weight: 600;
    color: var(--text-primary, #e8eaed);
    font-size: 0.9rem;
}

.approval-meta {
    font-size: 0.75rem;
    color: var(--text-secondary, #9aa0a6);
    margin-top: 0.25rem;
}

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

/* Buttons */
.btn-success {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background: #059669;
    transform: scale(1.05);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-warning:hover {
    background: #d97706;
    transform: scale(1.05);
}

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

.btn-block {
    width: 100%;
}

.btn-secondary {
    background: var(--btn-secondary-bg, #4b5563);
    color: var(--text-primary, #e8eaed);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover, #6b7280);
}

.btn-primary {
    background: var(--accent-primary, #7c3aed);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-primary-hover, #9333ea);
    transform: scale(1.05);
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* Modal */
.pa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-dialog {
    background: var(--panel-bg, #252930);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #4b5563);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary, #e8eaed);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary, #9aa0a6);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--card-bg, #374151);
    color: var(--text-primary, #e8eaed);
}

.modal-body {
    padding: 1.5rem;
}

.modal-description {
    color: var(--text-secondary, #9aa0a6);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color, #4b5563);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #e8eaed);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--input-bg, #374151);
    border: 1px solid var(--border-color, #4b5563);
    border-radius: 6px;
    color: var(--text-primary, #e8eaed);
    font-size: 0.95rem;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary, #7c3aed);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary, #e8eaed);
    font-weight: normal;
    cursor: pointer;
}

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

/* Google Services Grid */
.google-services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.service-card {
    background: var(--card-bg, #374151);
    border: 1px solid var(--border-color, #4b5563);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.service-card:hover {
    background: var(--card-hover-bg, #4b5563);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    border-color: var(--accent-primary, #7c3aed);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.service-name {
    font-weight: 600;
    color: var(--text-primary, #e8eaed);
    margin-bottom: 0.25rem;
}

.service-desc {
    font-size: 0.85rem;
    color: var(--text-secondary, #9aa0a6);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--text-secondary, #9aa0a6);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Responsive — larger breakpoints handled by new rules at top of file */
@media (max-width: 768px) {

    .google-services-grid {
        grid-template-columns: 1fr;
    }

    .message-content {
        max-width: 85%;
    }
}

/* ============================================================================
   PROJECT MANAGEMENT STYLES
   ============================================================================ */
/* Projects Section */
.pa-projects {
    background: var(--panel-bg, #252930);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.projects-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted, #9ca3af);
    font-style: italic;
}
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
/* Project Item Card */
.project-item {
    background: var(--surface-color, #1f2937);
    border: 1px solid var(--border-color, #374151);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}
.project-item:hover {
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.project-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #e8eaed);
}
.project-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}
.project-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color, #374151);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}
.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    min-width: 3rem;
    text-align: right;
}
.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 0.75rem;
}
.project-blockers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
}
.blocker-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ef4444;
}
.blocker-tag {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #ef4444;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #ef4444;
}
.blocker-more {
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 600;
}
.project-actions {
    display: flex;
    gap: 0.5rem;
}
.project-actions button {
    flex: 1;
    font-size: 0.85rem;
}
.project-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color, #374151);
}
.detail-label {
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
}
.detail-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color, #374151);
}
.detail-section h4 {
    margin-bottom: 0.75rem;
    color: var(--text-primary, #e8eaed);
}
.detail-section li {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: var(--surface-color, #1f2937);
    border-left: 3px solid #ef4444;
    border-radius: 4px;
}
/* ── Real-time badge flash (fires when new approval arrives) ── */
@keyframes badge-flash-anim {
    0%   { background: #00ff88; color: #000; transform: scale(1.25); }
    100% { background: unset;   color: unset; transform: scale(1); }
}
.badge-flash {
    animation: badge-flash-anim 0.6s ease-out;
}

/* ── Mother Management Board (full-width below 3-column layout) ─────────── */
.pa-mgmt-board {
    margin-top: 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px 24px;
}
.mgmt-board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.mgmt-board-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-primary, #e8eaed);
    margin: 0;
}
.mgmt-board-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82em;
}
.mgmt-badge-crit {
    background: rgba(239,68,68,0.18);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.35);
    border-radius: 12px;
    padding: 2px 10px;
    font-weight: 600;
    animation: mgmt-crit-pulse 2s ease-in-out infinite;
}
@keyframes mgmt-crit-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0.25); }
}
.mgmt-badge-ok {
    background: rgba(16,185,129,0.12);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 12px;
    padding: 2px 10px;
}
/* 4-column grid — only collapses on very narrow screens */
.mgmt-board-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 900px) {
    .mgmt-board-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .mgmt-board-grid { grid-template-columns: 1fr; }
}
.mgmt-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.mgmt-card-title {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-secondary, #9aa0a6);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
/* Stat row at top of task/flag cards */
.mgmt-task-stats {
    display: flex;
    gap: 10px;
}
.mgmt-stat {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 6px 8px;
    text-align: center;
}
.mgmt-stat-num {
    display: block;
    font-size: 1.4em;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary, #e8eaed);
}
.mgmt-stat-lbl {
    font-size: 0.7em;
    opacity: 0.5;
    text-transform: uppercase;
}
/* Scrollable item list inside each card */
.mgmt-task-list {
    flex: 1;
    overflow-y: auto;
    max-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.mgmt-task-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 5px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
    font-size: 0.82em;
    line-height: 1.35;
}
.mgmt-task-done { opacity: 0.4; text-decoration: line-through; }
.mgmt-task-hi   { border-left: 2px solid #f59e0b; padding-left: 6px; }
.mgmt-task-ico  { flex-shrink: 0; font-size: 0.95em; margin-top: 1px; }
.mgmt-task-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary, #e8eaed); }
.mgmt-task-cat  { flex-shrink: 0; font-size: 0.75em; opacity: 0.4; text-transform: capitalize; }
/* Process dot indicator */
.mgmt-proc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
/* Progress bar */
.mgmt-bar-track {
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    overflow: hidden;
}
.mgmt-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.mgmt-empty {
    font-size: 0.8em;
    opacity: 0.4;
    padding: 8px 4px;
    text-align: center;
}
