:root {
    --sys-bg: #050914;
    --sys-panel: rgba(13, 19, 33, 0.85);
    --sys-blue-neon: #00E5FF;
    --sys-green-neon: #39FF14;
    --sys-text: #E2E8F0;
    --sys-text-dim: #64748B;
    --sys-border: rgba(0, 229, 255, 0.2);
    --sys-glow: 0 0 10px rgba(0, 229, 255, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--sys-bg);
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--sys-text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 300px;
    background-color: rgba(5, 9, 20, 0.95);
    border-right: 1px solid var(--sys-border);
    box-shadow: 2px 0 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    transition: left 0.3s ease-in-out;
}

.sidebar-header {
    padding: 0 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--sys-border);
    margin-bottom: 20px;
}

.hamburger-btn {
    font-size: 24px;
    color: var(--sys-blue-neon);
    cursor: pointer;
    transition: text-shadow 0.3s;
}

.hamburger-btn:hover { text-shadow: var(--sys-glow); }

.sys-title {
    color: var(--sys-text-dim);
    font-size: 12px;
    letter-spacing: 3px;
}

.menu-section {
    padding: 0 20px;
    margin-bottom: 25px;
}

.menu-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--sys-blue-neon);
    letter-spacing: 2px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--sys-border);
    padding-bottom: 5px;
}

.add-btn {
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.add-btn:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--sys-blue-neon);
    transform: scale(1.2);
}

.menu-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }

.menu-list li {
    width: fit-content;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--sys-text);
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.menu-list li:hover {
    background: rgba(0, 229, 255, 0.1);
    border-left: 2px solid var(--sys-blue-neon);
    color: #fff;
    text-shadow: 0 0 5px var(--sys-blue-neon);
    box-shadow: 15px 0 20px -10px rgba(0, 229, 255, 0.2) inset;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.profile-header {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
    height: 120px;
    border-bottom: 1px solid var(--sys-border);
}

.profile-avatar {
    position: absolute;
    bottom: -30px;
    left: 40px;
    width: 90px;
    height: 90px;
    background-color: #1a1a1a;
    border: 2px solid var(--sys-blue-neon);
    box-shadow: var(--sys-glow);
    clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%);
    background-image: url('https://via.placeholder.com/90');
    background-size: cover;
}

.user-info {
    padding: 40px 40px 20px 40px;
    background-color: var(--sys-panel);
    border-bottom: 1px solid var(--sys-border);
    backdrop-filter: blur(10px);
}

.user-info h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 20px;
    font-size: 12px;
    color: var(--sys-blue-neon);
}

.info-grid span strong {
    color: #fff;
    margin-left: 5px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    padding: 30px 40px;
}

.panel {
    background-color: var(--sys-panel);
    border: 1px solid var(--sys-border);
    position: relative;
    padding: 25px;
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, transparent 10px, var(--sys-panel) 0) top left;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.panel::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20px;
    width: 30%;
    height: 2px;
    background-color: var(--sys-blue-neon);
    box-shadow: var(--sys-glow);
}

.panel-title {
    text-align: left;
    font-size: 14px;
    letter-spacing: 3px;
    margin-bottom: 25px;
    color: var(--sys-text-dim);
}

.radar-container {
    position: relative;
    height: 280px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.mission-item {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.mission-label {
    width: 150px;
    font-size: 12px;
    letter-spacing: 1px;
}

.segments-container {
    flex: 1;
    display: flex;
    gap: 3px;
    background-color: rgba(0,0,0,0.5);
    padding: 3px;
    border: 1px solid var(--sys-border);
    margin: 0 15px;
    transform: skewX(-15deg);
}

.segment {
    height: 14px;
    flex: 1;
    background-color: rgba(255,255,255,0.03);
    border-right: 1px solid rgba(0, 0, 0, 0.5);
}

.segment.filled {
    background-color: var(--sys-green-neon);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.mission-percent {
    width: 50px;
    text-align: right;
    font-size: 14px;
    color: var(--sys-blue-neon);
    text-shadow: var(--sys-glow);
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid #FFD700;
    position: relative;
}

.reward-item::after {
    content: '[ PENDENTE ]';
    position: absolute;
    right: 20px;
    font-size: 10px;
    color: var(--sys-text-dim);
    letter-spacing: 1px;
}

.reward-icon { font-size: 20px; }

.reward-details h4 {
    font-size: 13px;
    color: #FFD700;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.reward-details p {
    font-size: 12px;
    color: var(--sys-text);
    font-family: 'Inter', sans-serif;
}

/* --- ESTILOS DO MODAL (NOVA MISSÃO) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background-color: var(--sys-panel);
    border: 1px solid var(--sys-blue-neon);
    width: 450px;
    max-width: 90%;
    padding: 30px;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--sys-border);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 16px;
    color: var(--sys-blue-neon);
    letter-spacing: 2px;
}

.close-btn {
    color: var(--sys-text-dim);
    font-size: 28px;
    cursor: pointer;
}
.close-btn:hover { color: #FF003C; text-shadow: 0 0 10px #FF003C; }

.modal-form { display: flex; flex-direction: column; gap: 20px; }

.input-group label {
    font-size: 11px;
    color: var(--sys-text-dim);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--sys-border);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    outline: none;
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--sys-blue-neon);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2) inset;
}

.sys-btn {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--sys-blue-neon);
    color: var(--sys-blue-neon);
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.sys-btn:hover {
    background: var(--sys-blue-neon);
    color: #000;
    box-shadow: 0 0 15px var(--sys-blue-neon);
}

/* --- ESTILOS DO QUADRO HORÁRIO --- */
.sys-table-container {
    width: 100%;
    overflow-x: auto; 
    margin-bottom: 20px;
}

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

.sys-table th, .sys-table td {
    border: 1px solid var(--sys-border);
    padding: 8px 5px;
    text-align: center;
}

.sys-table th {
    background: rgba(0, 229, 255, 0.1);
    color: var(--sys-blue-neon);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sys-table input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--sys-text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-align: center;
    outline: none;
    padding: 5px;
    transition: background 0.3s;
}

.sys-table input:focus {
    background: rgba(0, 229, 255, 0.1);
    color: #fff;
}

.sys-table input.time-input {
    color: #FFD700; 
    font-weight: bold;
}

.sys-textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--sys-border);
    color: var(--sys-blue-neon);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 15px;
    resize: vertical;
    outline: none;
}

.sys-textarea:focus {
    border-color: var(--sys-blue-neon);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2) inset;
}

.note-actions { display: flex; gap: 10px; }
.action-btn {
    background: transparent;
    border: none;
    color: var(--sys-text-dim);
    cursor: pointer;
    font-size: 18px;
    transition: 0.3s;
    text-decoration: none;
}
.action-btn.edit:hover { color: #FFD700; text-shadow: 0 0 8px #FFD700; }
.action-btn.delete:hover { color: #FF003C; text-shadow: 0 0 8px #FF003C; }

/* --- ESTILOS DO CALENDÁRIO --- */
.calendar-wrapper {
    background-color: var(--sys-panel);
    border: 1px solid var(--sys-border);
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: var(--sys-blue-neon);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(40px, 1fr));
    gap: 5px;
}

.calendar-day-head {
    text-align: center;
    font-size: 10px;
    color: var(--sys-text-dim);
    padding: 10px 0;
    border-bottom: 1px solid var(--sys-border);
}

.calendar-day {
    min-height: 90px;
    border: 1px solid rgba(0, 229, 255, 0.05);
    padding: 5px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-day.today {
    border: 1px solid var(--sys-blue-neon);
    background: rgba(0, 229, 255, 0.05);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.event-tag {
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(0, 229, 255, 0.2);
    border-left: 2px solid var(--sys-blue-neon);
    color: #fff;
    cursor: pointer;
    transition: filter 0.2s;
}

.event-tag.missao { border-left-color: var(--sys-green-neon); background: rgba(57, 255, 20, 0.1); }
.event-tag.viagem { border-left-color: #FFD700; background: rgba(255, 215, 0, 0.1); }
.event-tag:hover { filter: brightness(1.3); }

.day-number {
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    color: var(--sys-text-dim);
}


/* ========================================================= */
/* --- RESPONSIVIDADE TÁTICA (OPERAÇÃO MOBILE) --- */
/* ========================================================= */

/* Barra de Topo exclusiva para Mobile (Para ancorar o Menu Hambúrguer) */
.mobile-topbar {
    display: none;
    background: rgba(5, 9, 20, 0.95);
    border-bottom: 1px solid var(--sys-border);
    padding: 15px 20px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 998;
    backdrop-filter: blur(10px);
}

.mobile-topbar .sys-title {
    color: var(--sys-blue-neon);
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 4px;
}

/* Overlay Escuro para focar no Menu no Celular */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9998;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .mobile-topbar {
        display: flex; /* Revela a barra de topo no celular */
    }

    /* A Sidebar vira um painel retrátil flutuante */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        z-index: 9999;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 10px 0 30px rgba(0,0,0,0.8);
    }

    /* O botão hambúrguer original de dentro da sidebar é ocultado */
    .sidebar-header .hamburger-btn {
        display: none; 
    }

    .dashboard-grid {
        grid-template-columns: 1fr; /* Empilha os painéis */
        padding: 15px;
        gap: 15px;
    }

    .profile-header {
        height: 100px;
    }

    .profile-avatar {
        left: 20px;
        bottom: -25px;
        width: 70px;
        height: 70px;
    }

    .user-info {
        padding: 35px 20px 20px 20px;
    }

    .user-info h1 {
        font-size: 18px;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr; /* 2 colunas de info no celular */
    }

    .radar-container {
        height: 240px; /* Gráfico de radar menor para caber na tela */
    }

    .modal-box {
        padding: 20px;
    }

    .calendar-day {
        min-height: 60px;
        font-size: 10px;
    }
    /* ========================================== */
    /* PATCH UNIVERSAL DE CORREÇÃO DE ESCALA      */
    /* ========================================== */

    /* 1. Layouts de Missões e Finanças */
    .war-header > div:first-child { 
        flex-direction: column; 
        gap: 15px; 
    }
    .war-header > div:first-child > div { 
        text-align: left !important; 
        width: 100%; 
    }
    .war-header button { 
        width: 100%; 
        margin-top: 10px; 
    }
    .grid-estagios, .loot-grid, .config-grid { 
        padding: 15px; 
        grid-template-columns: 1fr !important; 
    }
    .header-trilha { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 15px; 
    }

    /* 2. O Nexus de Projetos (Layout Duplo) */
    .layout-duplo { 
        flex-direction: column; 
        height: auto; 
    }
    .workspace-sidebar { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid var(--sys-border); 
        max-height: 40vh; 
    }
    .workspace-canvas { 
        padding: 20px; 
    }
    .editor-title { 
        font-size: 24px; 
    }
    .floating-toolbar { 
        flex-wrap: wrap; 
        width: 100%; 
    }

    /* 3. Forçar rolagem horizontal segura (Tabelas e Calendários) */
    .sys-table-container, .calendar-wrapper { 
        width: 100%; 
        max-width: 100vw; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
    }

    /* 4. Modais (Garantir que não vazem da tela) */
    .modal-box { 
        width: 95% !important; 
        padding: 20px; 
    }
    .fase-header { 
        flex-direction: column; 
        align-items: flex-start; 
    }
    .fase-title-area { 
        width: 100%; 
    }

    /* ========================================================= */
    /* BOMBA NUCLEAR CSS - FORÇA RESPONSIVIDADE EM ESTILOS INLINE*/
    /* ========================================================= */

    /* 1. Trava de Segurança Máxima (Impede qualquer rolagem lateral) */
    html, body {
        width: 100%;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* 2. Força TODOS os Grids e Flexboxes inline do sistema a se empilharem */
    .main-content div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .main-content div[style*="display: flex"] {
        flex-wrap: wrap !important;
    }

    /* 3. Força os Cabeçalhos (Headers) a ficarem compactos */
    header, .page-header, .profile-header, .war-header {
        padding: 20px 15px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        height: auto !important;
        width: 100% !important;
    }

    header > div {
        width: 100% !important;
        text-align: left !important;
    }

    /* 4. Corta os espaçamentos gigantes (paddings de 40px viram 15px) */
    section {
        padding: 15px !important;
    }

    .panel {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }

    /* 5. Padroniza Botões para não empurrarem a tela */
    button.sys-btn, .sys-btn {
        width: 100% !important;
        margin-top: 10px !important;
        box-sizing: border-box !important;
    }

    /* 6. Evita que Tabelas ou Calendários quebrem a tela */
    table, .calendar-wrapper, .sys-table-container {
        max-width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
    }
}