/* ================================================================
   OPEN MISSION CONTROL — v2 high-tech design system
   All original class selectors preserved; only visuals changed.
   ================================================================ */

:root {
    --mc-bg: #0a0f1e;
    --mc-card: #141b2d;
    --mc-border: rgba(255, 255, 255, 0.06);
    --mc-border-strong: rgba(255, 255, 255, 0.10);
    --mc-hover: #1a2236;
    --mc-text: #e6eaf2;
    --mc-text-dim: #8a93a6;
    --mc-text-mute: #5b6478;
    --mc-accent: #3ddbdb;
    --mc-accent-2: #60a5fa;
    --mc-success: #10b981;
    --mc-warning: #f59e0b;
    --mc-caution: #facc15;
    --mc-danger: #ef4444;
    --mc-special: #a78bfa;
    --mc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --mc-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --mc-shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* ========== BODY BACKGROUND MESH ========== */
html.dark body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 50% 40% at 15% 10%, rgba(61, 219, 219, 0.05), transparent 70%),
        radial-gradient(ellipse 60% 50% at 85% 30%, rgba(96, 165, 250, 0.04), transparent 70%),
        radial-gradient(ellipse 70% 60% at 50% 100%, rgba(167, 139, 250, 0.03), transparent 70%);
}
html.dark body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, #000 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 80%);
}

/* ========== LAYOUT ========== */
#mc-main {
    margin-left: 64px;
    padding-top: 56px;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

@media (max-width: 1023px) {
    #mc-main {
        margin-left: 0 !important;
    }
    #mc-header {
        left: 0 !important;
    }
    #mc-sidebar.-translate-x-full {
        transform: translateX(-100%) !important;
    }
}

/* ========== GLASS SURFACE UTILITY ========== */
.mc-glass {
    background: rgba(20, 27, 45, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--mc-border);
    border-radius: 12px;
    box-shadow: var(--mc-shadow-sm);
}

/* ========== SCROLLBAR ========== */
.mc-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.mc-scroll::-webkit-scrollbar-track { background: transparent; }
.mc-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    transition: background 0.2s;
}
.mc-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); }

html:not(.dark) .mc-scroll::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); }
html:not(.dark) .mc-scroll::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.22); }

* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.08) transparent; }
html:not(.dark) * { scrollbar-color: rgba(0, 0, 0, 0.14) transparent; }

/* ========== TABULAR NUMS ========== */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ========== REVEAL ANIMATION ========== */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== ACTIVITY ENTER ========== */
.activity-enter {
    animation: slideIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== SORTABLE (KANBAN) ========== */
.sortable-ghost { opacity: 0.3; }
.sortable-chosen {
    box-shadow: 0 0 0 1px rgba(61, 219, 219, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);
    border-radius: 10px;
}

/* ========== TYPING INDICATOR ========== */
.typing-dot {
    animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* ========== TIMELINE PULSE ========== */
.pulse-glow {
    animation: pulseGlow 2.4s infinite;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(61, 219, 219, 0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(61, 219, 219, 0); }
}

/* ========== STATUS HALOS ========== */
.glow-normal   { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22); }
.glow-critical { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25); }
.glow-standby  { box-shadow: 0 0 0 3px rgba(61, 219, 219, 0.22); }
.glow-serious  { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }
.glow-caution  { box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.22); }

/* ========== TOGGLE SWITCH ========== */
.mc-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    cursor: pointer;
    transition: background 0.22s ease;
    flex-shrink: 0;
    border: 1px solid var(--mc-border);
}
html:not(.dark) .mc-toggle {
    background: #d4d4d4;
    border-color: rgba(0, 0, 0, 0.08);
}
.mc-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.mc-toggle.active {
    background: linear-gradient(135deg, var(--mc-accent), var(--mc-accent-2));
    border-color: rgba(61, 219, 219, 0.5);
}
.mc-toggle.active::after {
    transform: translateX(16px);
}

/* ========== HEARTBEAT PULSE ========== */
.heartbeat-pulse {
    animation: heartbeatPulse 2s infinite;
}
@keyframes heartbeatPulse {
    0%, 100% { transform: scale(1);    opacity: 1;   }
    25%      { transform: scale(1.12); opacity: 0.85; }
    50%      { transform: scale(1);    opacity: 1;   }
    75%      { transform: scale(1.08); opacity: 0.9; }
}

/* ========== MODAL OVERLAY ========== */
.mc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 20, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.18s ease;
}
.mc-modal-overlay[hidden] { display: none; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mc-modal {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--mc-shadow-lg);
    animation: modalSlideUp 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .mc-modal {
    background: rgba(20, 27, 45, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: var(--mc-border-strong);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== FORM INPUTS ========== */
.mc-input {
    width: 100%;
    padding: 0.55rem 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f7f7f8;
    color: #171717;
    outline: none;
    transition: all 0.18s ease;
}
.mc-input:focus {
    border-color: rgba(61, 219, 219, 0.6);
    box-shadow: 0 0 0 3px rgba(61, 219, 219, 0.12);
    background: #ffffff;
}
.dark .mc-input {
    background: rgba(10, 15, 30, 0.6);
    border-color: var(--mc-border);
    color: var(--mc-text);
}
.dark .mc-input:focus {
    border-color: rgba(61, 219, 219, 0.6);
    box-shadow: 0 0 0 3px rgba(61, 219, 219, 0.10);
    background: rgba(10, 15, 30, 0.8);
}

.mc-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238a93a6' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.mc-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========== SLIDE PANEL (task detail) ========== */
.mc-slide-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: #ffffff;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 90;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.3);
}
.dark .mc-slide-panel {
    background: rgba(20, 27, 45, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: var(--mc-border-strong);
}
.mc-slide-panel.open {
    transform: translateX(0);
}

/* ========== TASK DETAIL MODAL ========== */
.task-detail-modal {
    position: relative;
    animation: modalSlideUp 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 768px) {
    .task-detail-modal {
        width: 95vw !important;
        max-height: 90vh !important;
    }
}

/* ========== ICON PICKER ========== */
.icon-picker-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
}
.icon-picker-item:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}
.dark .icon-picker-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.icon-picker-item.selected {
    border-color: var(--mc-accent);
    background: rgba(61, 219, 219, 0.1);
    box-shadow: 0 0 0 3px rgba(61, 219, 219, 0.12);
}

/* ========== COLOR PICKER ========== */
.color-picker-item {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
}
.color-picker-item:hover { transform: scale(1.08); }
.color-picker-item.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--mc-accent), 0 0 12px rgba(61, 219, 219, 0.35);
}

/* ========== CHAT LAYOUT ========== */
.chat-sidebar {
    width: 240px;
    flex-shrink: 0;
}
@media (max-width: 767px) {
    .chat-sidebar { width: 100%; }
}

/* ========== CONFIRM DIALOG ========== */
.mc-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 20, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ========== ROLE BADGES ========== */
.role-badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 16px;
    white-space: nowrap;
    text-transform: uppercase;
}
.role-badge-ceo {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.25);
}
.role-badge-head {
    background: rgba(61, 219, 219, 0.10);
    color: var(--mc-accent);
    border: 1px solid rgba(61, 219, 219, 0.25);
}
.role-badge-agent {
    background: rgba(138, 147, 166, 0.10);
    color: var(--mc-text-dim);
    border: 1px solid rgba(138, 147, 166, 0.22);
}

/* ========== DEPARTMENT HEADER ROW ========== */
.dept-header-row td {
    padding: 10px 16px 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--mc-text-mute);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
html:not(.dark) .dept-header-row td {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* ========== BOARD CHAT PANEL ========== */
.mc-board-chat {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 100vw;
    background: #ffffff;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 85;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.3);
}
.dark .mc-board-chat {
    background: rgba(20, 27, 45, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: var(--mc-border-strong);
}
.mc-board-chat.open {
    transform: translateX(0);
}
@media (max-width: 767px) {
    .mc-board-chat {
        width: 100vw;
        z-index: 95;
    }
}

/* Board chat messages */
.bc-message {
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.18s ease;
    border: 1px solid transparent;
}
.bc-message:hover {
    background: rgba(0, 0, 0, 0.03);
}
.dark .bc-message:hover {
    background: rgba(255, 255, 255, 0.03);
}
.bc-message-user {
    background: rgba(61, 219, 219, 0.06);
    border-color: rgba(61, 219, 219, 0.14);
}
.dark .bc-message-user {
    background: rgba(61, 219, 219, 0.06);
    border-color: rgba(61, 219, 219, 0.12);
}

/* @mention highlight */
.bc-mention {
    color: var(--mc-accent);
    font-weight: 600;
    background: rgba(61, 219, 219, 0.08);
    padding: 1px 4px;
    border-radius: 4px;
}

/* Board chat toggle button */
.bc-toggle-btn { position: relative; }
.bc-unread-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mc-accent);
    box-shadow: 0 0 0 3px rgba(61, 219, 219, 0.22);
    animation: pulseGlow 2s infinite;
}

/* ========== AGENT ICON CONTAINER ========== */
.agent-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border: 1px solid var(--mc-border);
}

/* ========== CARD / HOVER POLISH ON TAILWIND MC TOKENS ========== */
.dark [class*="bg-mc-card"] {
    background-color: rgba(20, 27, 45, 0.6) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--mc-border) !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.dark [class*="hover:bg-mc-hover"]:hover {
    background-color: rgba(26, 34, 54, 0.75) !important;
    border-color: rgba(61, 219, 219, 0.18) !important;
}

/* ========== BUTTON POLISH ========== */
.dark button, .dark [role="button"] {
    transition: all 0.18s ease;
}
