/* ===== OPERACOES PAGE CSS ===== */
/* Calendario, Tabs Preparo/Emprego, Quadro de Tarefas */

/* ===== CALENDAR SECTION ===== */

.ops-calendar-section {
    margin-bottom: 32px;
}

.ops-calendar-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.ops-calendar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.ops-calendar-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.ops-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.ops-calendar-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(70, 110, 150, 0.1);
    border: 1px solid rgba(70, 110, 150, 0.3);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ops-calendar-nav-btn:hover {
    background: rgba(70, 110, 150, 0.2);
    border-color: rgba(70, 110, 150, 0.5);
    color: var(--text-primary);
}

.ops-calendar-nav-btn svg {
    width: 18px;
    height: 18px;
}

.ops-calendar-today-btn {
    width: auto;
    padding: 0 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ops-calendar-month-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 220px;
    text-align: center;
    margin: 0;
}

/* Legend */
.ops-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(20, 24, 20, 0.3);
    border-radius: 8px;
}

.ops-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: default;
}

.ops-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Calendar Container */
.ops-calendar-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.ops-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: rgba(70, 110, 150, 0.08);
    border-bottom: 1px solid var(--border-color);
}

.ops-calendar-weekday {
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ops-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.ops-calendar-day {
    min-height: 130px;
    padding: 6px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.ops-calendar-day:nth-child(7n) {
    border-right: none;
}

.ops-calendar-day:hover:not(.other-month) {
    background: rgba(70, 110, 150, 0.05);
}

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

.ops-calendar-day.today {
    background: rgba(90, 136, 176, 0.08);
}

.ops-calendar-day.today .ops-day-number {
    background: #5a88b0;
    color: white;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ops-day-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-block;
    margin-bottom: 4px;
}

.ops-day-atividades {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    max-height: 100px;
}

.ops-day-atividades::-webkit-scrollbar {
    width: 3px;
}

.ops-day-atividades::-webkit-scrollbar-thumb {
    background: rgba(196, 184, 150, 0.3);
    border-radius: 2px;
}

/* Calendar Item (colored by category) */
.ops-calendar-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-calendar-item:hover {
    filter: brightness(1.3);
}

.ops-calendar-item-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ops-calendar-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.ops-calendar-item-time {
    font-size: 9px;
    opacity: 0.7;
    flex-shrink: 0;
}

/* Context Menu */
.ops-context-menu {
    position: fixed;
    z-index: 10000;
    background: var(--bg-secondary, #1a1f1a);
    border: 1px solid var(--border-color, rgba(70, 110, 150, 0.3));
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    min-width: 160px;
}

.ops-context-header {
    padding: 6px 10px 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-context-sub {
    padding: 0 10px 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.ops-context-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.ops-context-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.ops-context-menu button:hover {
    background: rgba(70, 110, 150, 0.15);
    color: var(--text-primary);
}

.ops-context-menu button.danger:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* ===== TABS (Preparo / Emprego) ===== */

.ops-tabs-container {
    margin-top: 40px;
}

.ops-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.ops-tab-btn {
    flex: 1;
    max-width: 200px;
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.ops-tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(70, 110, 150, 0.05);
}

.ops-tab-btn.active {
    color: var(--accent-gold, #b5a879);
    border-bottom-color: var(--accent-gold, #b5a879);
}

.ops-tab-content {
    display: none;
}

.ops-tab-content.active {
    display: block;
}

/* ===== QUADRO DE TAREFAS ===== */

.ops-tarefas-section {
    margin-bottom: 32px;
}

.ops-tarefas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ops-tarefas-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ops-tarefas-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent-gold);
}

/* Militar Card */
.ops-militar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.ops-militar-card:hover {
    border-color: rgba(181, 168, 121, 0.3);
}

.ops-militar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.ops-militar-header:hover {
    background: rgba(70, 110, 150, 0.05);
}

.ops-militar-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ops-militar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ops-militar-badge.chefia {
    background: rgba(181, 168, 121, 0.2);
    color: #b5a879;
    border: 1px solid rgba(181, 168, 121, 0.3);
}

.ops-militar-badge.emprego {
    background: rgba(201, 76, 76, 0.15);
    color: #c94c4c;
    border: 1px solid rgba(201, 76, 76, 0.25);
}

.ops-militar-badge.preparo {
    background: rgba(90, 136, 176, 0.15);
    color: #5a88b0;
    border: 1px solid rgba(90, 136, 176, 0.25);
}

.ops-militar-nome {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.ops-militar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ops-militar-count {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.ops-militar-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 4px;
}

.ops-militar-toggle:hover {
    background: rgba(70, 110, 150, 0.1);
}

.ops-militar-toggle.expanded {
    transform: rotate(180deg);
}

/* Tarefa List */
.ops-tarefa-list {
    display: none;
    padding: 0 16px 12px;
    border-top: 1px solid var(--border-color);
}

.ops-tarefa-list.expanded {
    display: block;
}

.ops-tarefa-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

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

.ops-tarefa-nr {
    font-weight: 700;
    color: var(--text-muted);
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
    font-size: 11px;
    padding-top: 1px;
}

.ops-tarefa-desc {
    flex: 1;
}

.ops-tarefa-actions {
    display: none;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ops-tarefa-item:hover .ops-tarefa-actions {
    display: flex;
}

.ops-tarefa-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.ops-tarefa-btn:hover {
    background: rgba(70, 110, 150, 0.15);
    color: var(--text-primary);
}

.ops-tarefa-btn.danger:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.ops-tarefa-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    background: transparent;
    border: none;
    color: var(--accent-gold, #b5a879);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.ops-tarefa-add:hover {
    opacity: 1;
}

.ops-tarefa-add svg {
    width: 14px;
    height: 14px;
}

/* Documents Section inside tab */
.ops-docs-section {
    margin-top: 32px;
    margin-bottom: 32px;
}

.ops-docs-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ops-docs-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent-gold);
}

.ops-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Instruction Section inside PREPARO tab */
.ops-instrucao-section {
    margin-top: 32px;
}

.ops-instrucao-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

/* ===== LOADING / EMPTY STATES ===== */

.ops-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== ADD MILITAR BUTTON ===== */

.ops-add-militar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.ops-add-militar-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(181, 168, 121, 0.05);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .ops-calendar-day {
        min-height: 70px;
        padding: 4px;
    }

    .ops-day-number {
        font-size: 10px;
    }

    .ops-calendar-item {
        font-size: 9px;
        padding: 2px 4px;
    }

    .ops-calendar-item-text {
        max-width: 40px;
    }

    .ops-calendar-item-time {
        display: none;
    }

    .ops-calendar-month-title {
        font-size: 14px;
        min-width: 150px;
    }

    .ops-day-atividades {
        max-height: 45px;
    }

    .ops-calendar-nav {
        gap: 8px;
    }

    .ops-calendar-legend {
        display: none;
    }

    .ops-tab-btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    .ops-militar-nome {
        font-size: 13px;
    }

    .ops-tarefa-actions {
        display: flex;
    }
}

@media (max-width: 480px) {
    .ops-calendar-day {
        min-height: 50px;
        padding: 2px;
    }

    .ops-calendar-item-text {
        display: none;
    }

    .ops-calendar-item {
        padding: 2px 3px;
        gap: 2px;
    }

    .ops-day-atividades {
        max-height: 30px;
    }

    .ops-tab-btn {
        padding: 10px 12px;
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    .ops-docs-grid {
        grid-template-columns: 1fr;
    }
}
