/* Command Center — Page-specific styles */

/* ============================================
   STATUS GRID (6 cards)
   ============================================ */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.status-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-icon { font-size: 1.5rem; }
.card-value { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.card-subtitle { font-size: 13px; color: var(--text-secondary); }

/* ============================================
   ALERTS
   ============================================ */
.alerts-section { margin-bottom: 24px; }

.alert {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

.alert-critical { border-left-color: var(--danger); }

.alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.alert-body {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 28px;
}

/* ============================================
   COMMAND CENTER GRID
   ============================================ */
.command-center-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.live-feed-container,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   LIVE MESSAGE FEED
   ============================================ */
.live-feed-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    height: 550px;
    display: flex;
    flex-direction: column;
}

.live-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s;
}

.message-item:hover { background: rgba(0, 122, 255, 0.06); }
.message-item.incoming { border-left-color: var(--secondary); }
.message-item.outgoing { border-left-color: var(--primary); }

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.message-user { font-weight: 600; font-size: 14px; }
.message-time { font-size: 12px; color: var(--text-muted); }
.message-channel { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.message-body { font-size: 14px; line-height: 1.5; word-wrap: break-word; }

.auto-scroll-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.auto-scroll-toggle input { cursor: pointer; }

/* ============================================
   CHANNEL STATUS
   ============================================ */
.channel-status-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
}

.channel-status-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s;
}

.channel-card:hover {
    background: rgba(0, 122, 255, 0.06);
    border-color: rgba(0, 122, 255, 0.2);
}

.channel-info { display: flex; align-items: center; gap: 12px; }
.channel-icon { font-size: 1.5rem; }
.channel-details { display: flex; flex-direction: column; }
.channel-name { font-weight: 600; font-size: 14px; }
.channel-last-sync { font-size: 12px; color: var(--text-muted); }

.channel-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.channel-status-dot.online { background: var(--secondary); box-shadow: 0 0 8px var(--secondary); }
.channel-status-dot.offline { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.channel-status-dot.degraded { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ============================================
   PENDING APPROVALS
   ============================================ */
.pending-approvals-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
}

.approval-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
}

.pending-approvals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.approval-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s;
}

.approval-item:hover { background: rgba(0, 122, 255, 0.06); }
.approval-info { display: flex; flex-direction: column; gap: 2px; }
.approval-name { font-weight: 600; font-size: 14px; }
.approval-phone { font-size: 12px; color: var(--text-muted); }
.approval-actions { display: flex; gap: 6px; }

.btn-approve, .btn-reject {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
}

.btn-approve { background: var(--secondary); color: white; }
.btn-approve:hover { opacity: 0.9; }
.btn-reject { background: var(--danger); color: white; }
.btn-reject:hover { opacity: 0.9; }

/* ============================================
   ACTIVITY TIMELINE
   ============================================ */
.activity-timeline-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.timeline-info { font-size: 12px; color: var(--text-muted); }

.activity-timeline {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.activity-timeline::-webkit-scrollbar { height: 4px; }

.timeline-event {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.timeline-event:hover {
    background: rgba(0, 122, 255, 0.06);
    transform: translateY(-2px);
}

.timeline-icon { font-size: 1.5rem; margin-bottom: 6px; }
.timeline-type { font-size: 12px; font-weight: 600; text-align: center; margin-bottom: 2px; }
.timeline-time { font-size: 11px; color: var(--text-muted); text-align: center; }

/* ============================================
   CHARTS
   ============================================ */
.charts-section { margin-bottom: 24px; }

.chart-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

.chart-header { margin-bottom: 16px; }
.chart-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.chart-subtitle { font-size: 13px; color: var(--text-secondary); }

canvas { max-height: 280px; }

/* ============================================
   INTEGRATIONS TABLE
   ============================================ */
.integrations-table {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.table-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.integrations-table table { width: 100%; border-collapse: collapse; }

.integrations-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

.integrations-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.integrations-table tr:last-child td { border-bottom: none; }
.integrations-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.integration-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.status-ok { background: rgba(52, 199, 89, 0.12); color: var(--secondary); }
.status-warning { background: rgba(255, 149, 0, 0.12); color: var(--accent); }
.status-error { background: rgba(255, 59, 48, 0.12); color: var(--danger); }

/* ============================================
   LOGS
   ============================================ */
.logs-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.logs-content {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 14px;
    height: 280px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.log-line { margin-bottom: 2px; }
.log-error { color: var(--danger); }
.log-warning { color: var(--accent); }
.log-info { color: var(--primary); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .command-center-grid { grid-template-columns: 1fr; }
    .live-feed-container { height: 400px; }
}

@media (max-width: 600px) {
    .status-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .status-card { padding: 14px; }
    .card-value { font-size: 20px; }
    .command-center-grid { gap: 12px; }
    .activity-timeline { gap: 4px; }
    .timeline-event { min-width: 90px; padding: 10px; }
    .chart-container { padding: 16px; }
    .btn-approve, .btn-reject { padding: 6px 10px; font-size: 11px; min-height: 44px; }
}

@media (max-width: 480px) {
    .status-grid { grid-template-columns: 1fr 1fr; }
    .card-value { font-size: 18px; }
    .card-title { font-size: 11px; }
}
