/* CFD Gestao - Estilos Principais */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --accent: #00d9ff;
    --accent-hover: #00b8d4;
    --success: #00ff88;
    --warning: #ffc107;
    --danger: #ff4757;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --border-color: #2d3748;
}

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

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.sidebar-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 30px;
    text-align: center;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav a i {
    margin-right: 10px;
    width: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    overflow-x: hidden;
    max-width: calc(100% - 260px);
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 28px;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--bg-primary);
}

.btn-success {
    background: var(--success);
    color: var(--bg-primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-primary);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    max-width: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
}

.table tr:hover {
    background: rgba(0, 217, 255, 0.05);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pendente {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning);
}

.badge-em_andamento {
    background: rgba(0, 217, 255, 0.2);
    color: var(--accent);
}

.badge-concluido {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.badge-cancelado {
    background: rgba(255, 71, 87, 0.2);
    color: var(--danger);
}

/* Timer */
.timer {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    padding: 8px 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.timer-display {
    color: var(--accent);
}

.timer-btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* Project Cards */
.project-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

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

.project-card h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.project-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Stages */
.stages-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.stage-card {
    min-width: 250px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid var(--border-color);
}

.stage-card.backend {
    border-color: #9b59b6;
}

.stage-card.uxui {
    border-color: #e74c3c;
}

.stage-card.tutoriais {
    border-color: #f39c12;
}

.stage-card.frontend {
    border-color: #3498db;
}

.stage-card.qa {
    border-color: #2ecc71;
}

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

.stage-title {
    font-weight: 600;
    font-size: 16px;
}

/* Core Items (Checkboxes) */
.core-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 10px;
}

.core-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

.core-item-content {
    flex: 1;
}

.core-item-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.core-item-details {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Sketch Map */
.sketch-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.sketch-image {
    max-width: 100%;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
}

.sketch-tag {
    position: absolute;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.sketch-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.sketch-tag:active,
.sketch-tag.dragging {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0.9;
}

/* Color Picker */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-picker-input {
    width: 50px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-input::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.color-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-preset:hover {
    transform: scale(1.2);
    border-color: var(--text-primary);
}

/* API Calls */
.api-call {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    overflow: hidden;
    max-width: 100%;
}

.api-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.api-method {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.api-method.get { background: #00d9ff; color: #000; }
.api-method.post { background: #00ff88; color: #000; }
.api-method.put { background: #ffc107; color: #000; }
.api-method.delete { background: #ff4757; color: #fff; }
.api-method.patch { background: #9b59b6; color: #fff; }

.code-block {
    background: #0d1117;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin-top: 10px;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Questions */
.question-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 3px solid var(--warning);
}

.question-item.answered {
    border-left-color: var(--success);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

/* Modal Fullscreen para Esbocos */
.modal-fullscreen {
    z-index: 1050;
}

.modal-fullscreen .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
}

.modal-esboco-content {
    max-width: 1200px !important;
    width: 95vw !important;
}

.sketch-fullscreen {
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
}

.sketch-fullscreen .sketch-image {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
}

/* Thumbnail do Esboco com hover */
.sketch-thumbnail {
    position: relative;
    display: inline-block;
}

.sketch-thumbnail:hover .sketch-overlay {
    opacity: 1 !important;
}

.sketch-thumbnail:hover img {
    opacity: 0.8;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-box {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.login-logo {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 30px;
}

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .stages-container {
        flex-direction: column;
    }

    .stage-card {
        min-width: 100%;
    }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
}

.tab:hover,
.tab.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Approval Badge */
.approval-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.approval-badge.approved {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.approval-badge.pending {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning);
}

/* ==================== DEMANDA DETALHE - Novo Layout ==================== */

/* Cabecalho da Demanda */
.demanda-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.demanda-title {
    font-size: 28px;
    margin-bottom: 10px;
}

.demanda-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.demanda-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tabs de navegacao destacadas */
.demanda-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 12px;
}

.demanda-tab {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
}

.demanda-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.demanda-tab.active {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    color: var(--text-primary);
}

.demanda-tab i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.demanda-tab-title {
    font-weight: 600;
    font-size: 16px;
}

.demanda-tab-count {
    font-size: 12px;
    color: var(--accent);
    margin-top: 5px;
}

/* ==================== Secao CORE Destacada ==================== */
.core-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px solid var(--accent);
    overflow: hidden;
}

.core-section-header {
    background: linear-gradient(90deg, var(--accent), #0099cc);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.core-section-header h2 {
    color: var(--bg-primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.core-section-body {
    padding: 25px;
}

/* Card de Item CORE */
.core-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent);
    transition: all 0.3s;
}

.core-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.1);
}

.core-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.core-card-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.core-card-actions {
    display: flex;
    gap: 5px;
}

.core-card-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.core-card-content h4 {
    color: var(--text-primary);
    font-size: 13px;
    margin: 15px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.core-card-content .formatted-text {
    background: var(--bg-secondary);
    padding: 12px 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: inherit;
}

/* ==================== Secao Esboco Destacada ==================== */
.esboco-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px solid #9b59b6;
    overflow: hidden;
}

.esboco-section-header {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.esboco-section-header h2 {
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.esboco-section-body {
    padding: 25px;
}

/* ==================== Filtro de Tags por Tipo ==================== */
.esboco-filter-bar {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.esboco-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: 2px solid var(--filter-color, #888);
    color: var(--filter-color, #888);
    opacity: 0.5;
}

.esboco-filter-btn.active {
    background: var(--filter-color, #888);
    color: #000;
    opacity: 1;
}

.esboco-filter-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* ==================== Workspace do Esboco ==================== */
.esboco-workspace {
    display: block;
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
}

.esboco-canvas {
    padding: 20px;
    position: relative;
    overflow: auto;
}

/* ==================== Painel de detalhes da tag (abaixo do esboco) ==================== */
.esboco-detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent);
    border-radius: 0 0 12px 12px;
}

.esboco-detail-panel.open {
    max-height: 2000px;
    padding: 0;
}

.esboco-detail-panel-inner {
    padding: 25px;
}

.esboco-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.esboco-sidebar-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.esboco-sidebar-close:hover {
    color: var(--danger);
}

/* ==================== Formularios em Tela Cheia ==================== */
.form-fullscreen {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.form-fullscreen h3 {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-full {
    grid-column: 1 / -1;
}

/* Textarea estilizado */
.styled-textarea {
    min-height: 150px;
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.6;
    resize: vertical;
}

.styled-textarea.code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    background: #0d1117;
    border-color: #30363d;
    line-height: 1.5;
}

/* ==================== Tags do Esboco Melhoradas ==================== */
.esboco-tag {
    position: absolute;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: grab;
    user-select: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.esboco-tag:hover {
    transform: scale(1.05);
}

.esboco-tag.active {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.esboco-tag-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}

.esboco-tag-indicator.has-api {
    background: #00ff88;
    animation: pulse 2s infinite;
}

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

/* ==================== Informacoes da Tag na Sidebar ==================== */
.tag-info-section {
    margin-bottom: 20px;
}

.tag-info-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-info-content {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.tag-info-code {
    background: #0d1117;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre;
    border: 1px solid #30363d;
}

/* ==================== Role Badges ==================== */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.role-badge.uxui {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.role-badge.backend {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.role-badge.frontend {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.role-badge.qa {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

/* ==================== Editor Rico (Quill) ==================== */
.editor-container {
    margin-bottom: 20px;
}

.editor-container .ql-toolbar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
}

.editor-container .ql-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    min-height: 150px;
    font-size: 14px;
}

.editor-container .ql-editor {
    color: var(--text-primary);
    min-height: 150px;
}

.editor-container .ql-editor.ql-blank::before {
    color: var(--text-secondary);
    font-style: normal;
}

.editor-container .ql-snow .ql-stroke {
    stroke: var(--text-secondary);
}

.editor-container .ql-snow .ql-fill {
    fill: var(--text-secondary);
}

.editor-container .ql-snow .ql-picker {
    color: var(--text-secondary);
}

.editor-container .ql-snow .ql-picker-options {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.editor-container .ql-snow .ql-picker-item:hover {
    color: var(--accent);
}

.editor-container .ql-toolbar button:hover,
.editor-container .ql-toolbar button.ql-active {
    color: var(--accent);
}

.editor-container .ql-toolbar button:hover .ql-stroke,
.editor-container .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent);
}

.editor-container .ql-toolbar button:hover .ql-fill,
.editor-container .ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent);
}

/* Editor de codigo (para CURL e Response) */
.editor-container.code-editor .ql-container {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #0d1117;
}

.editor-container.code-editor .ql-editor {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* Conteudo HTML renderizado do editor */
.rich-content {
    line-height: 1.6;
}

.rich-content h1, .rich-content h2, .rich-content h3 {
    margin-top: 15px;
    margin-bottom: 10px;
}

.rich-content p {
    margin-bottom: 10px;
}

.rich-content ul, .rich-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.rich-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
}

.rich-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 15px;
    margin: 10px 0;
    color: var(--text-secondary);
}

/* ==================== Responsivo para novo layout ==================== */
@media (max-width: 992px) {
    .demanda-tabs {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .esboco-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .esboco-detail-panel-inner {
        padding: 15px;
    }
}

/* ==================== ANOTACOES DE CHAMADAS ==================== */

/* Bloco de codigo interativo */
.code-block-interactive {
    background: #0d1117;
    border-radius: 8px;
    padding: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--border-color);
    max-width: 100%;
    width: 100%;
}

.code-line {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: relative;
    transition: background 0.2s;
    min-width: 0;
    max-width: 100%;
}

.code-line:last-child {
    border-bottom: none;
}

.code-line:hover {
    background: rgba(0, 217, 255, 0.05);
}

.code-line:hover .line-action {
    opacity: 1;
}

.code-line.has-annotation {
    background: rgba(0, 217, 255, 0.1);
    border-left: 3px solid var(--accent);
}

.code-line.has-question {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid var(--warning);
}

.code-line.is-fixed {
    background: rgba(0, 255, 136, 0.1);
    border-left: 3px solid var(--success);
}

.line-number {
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
    user-select: none;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.line-content {
    flex: 1;
    padding: 8px 12px;
    white-space: pre;
    color: #e6edf3;
    overflow-x: auto;
    min-width: 0;
}

.line-action {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 5px;
}

.line-action:hover {
    color: var(--accent-hover);
}

/* Container de anotacoes */
.anotacoes-container {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-width: 100%;
    overflow: hidden;
}

.anotacoes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.anotacoes-header h4 {
    font-size: 14px;
    color: var(--accent);
}

.anotacao-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent);
    overflow: hidden;
    max-width: 100%;
}

.anotacao-item.duvida {
    border-left-color: var(--warning);
}

.anotacao-item.duvida.respondida {
    border-left-color: var(--success);
}

.anotacao-item.fixo {
    border-left-color: var(--success);
}

.anotacao-linha-ref {
    font-family: 'Consolas', monospace;
    font-size: 12px;
    background: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    max-width: 100%;
}

.anotacao-linha-ref span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.anotacao-linha-ref .linha-num {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

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

.anotacao-autor {
    font-weight: 600;
    color: var(--accent);
}

.anotacao-badges {
    display: flex;
    gap: 5px;
}

.anotacao-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: bold;
}

.anotacao-badge.duvida {
    background: var(--warning);
    color: #000;
}

.anotacao-badge.fixo {
    background: var(--success);
    color: #000;
}

.anotacao-badge.respondida {
    background: var(--accent);
    color: var(--bg-primary);
}

.anotacao-texto {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.anotacao-resposta {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--success);
}

.anotacao-resposta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--success);
}

.anotacao-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Modal de anotacao */
.modal-anotacao {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-anotacao.active {
    opacity: 1;
    visibility: visible;
}

.modal-anotacao-content {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal-anotacao.active .modal-anotacao-content {
    transform: translateY(0);
}

.modal-anotacao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-anotacao-header h3 {
    font-size: 18px;
    color: var(--accent);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-linha-preview {
    background: #0d1117;
    padding: 12px 15px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    white-space: pre;
    color: #e6edf3;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

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

.form-check label {
    cursor: pointer;
    color: var(--text-secondary);
}

/* Lista de anotacoes vazia */
.anotacoes-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

.anotacoes-empty i {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Indicador de anotacoes na linha */
.line-indicators {
    display: flex;
    gap: 3px;
    padding: 0 5px;
    align-items: center;
}

.line-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.line-indicator.duvida {
    background: var(--warning);
}

.line-indicator.fixo {
    background: var(--success);
}

.line-indicator.anotacao {
    background: var(--accent);
}

/* Responsividade para blocos de codigo interativo */
@media (max-width: 768px) {
    .code-block-interactive {
        font-size: 11px;
    }

    .code-line {
        flex-wrap: nowrap;
    }

    .line-number {
        min-width: 35px;
        padding: 6px 8px;
        font-size: 10px;
    }

    .line-content {
        padding: 6px 8px;
        font-size: 11px;
        overflow-x: auto;
    }

    .line-action {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        opacity: 1;
        padding: 6px;
        flex-shrink: 0;
    }

    .anotacoes-container {
        padding: 10px;
    }

    .anotacao-item {
        padding: 10px;
    }

    .anotacao-linha-ref {
        flex-wrap: wrap;
        font-size: 10px;
    }

    .anotacao-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .anotacao-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .modal-anotacao-content {
        width: 95%;
        padding: 15px;
        max-height: 90vh;
    }

    .modal-linha-preview {
        font-size: 10px;
        padding: 8px 10px;
    }

    .form-check {
        flex-wrap: wrap;
    }

    .form-check label {
        font-size: 13px;
    }
}

/* ==================== FLOW EDITOR ==================== */

.fluxo-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px solid #e67e22;
    overflow: hidden;
}

.fluxo-section-header {
    background: linear-gradient(90deg, #e67e22, #d35400);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fluxo-section-header h2 {
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fluxo-toolbar {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--bg-tertiary);
}

.fluxo-toolbar .separator {
    width: 1px;
    height: 30px;
    background: var(--border-color);
    margin: 0 5px;
}

.fluxo-mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.fluxo-mode-indicator.normal {
    background: rgba(0, 217, 255, 0.15);
    color: var(--accent);
}

.fluxo-mode-indicator.connecting {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    animation: pulse 1.5s infinite;
}

.fluxo-container {
    display: flex;
    gap: 0;
    height: calc(100vh - 280px);
    min-height: 500px;
}

.fluxo-canvas-wrapper {
    flex: 1;
    overflow: auto;
    position: relative;
    background-color: #0f1923;
    background-image: radial-gradient(circle, #1e2a3a 1px, transparent 1px);
    background-size: 25px 25px;
}

.fluxo-canvas {
    position: relative;
    min-width: 3000px;
    min-height: 2000px;
    transform-origin: 0 0;
}

.fluxo-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.fluxo-svg path {
    fill: none;
    stroke-width: 2.5;
    pointer-events: stroke;
    cursor: pointer;
}

.fluxo-svg path:hover {
    stroke-width: 4;
}

.fluxo-svg .conexao-label {
    fill: var(--text-secondary);
    font-size: 11px;
    pointer-events: none;
}

/* Nodes */
.fluxo-node {
    position: absolute;
    min-width: 180px;
    max-width: 280px;
    background: var(--bg-secondary);
    border: 2px solid;
    border-radius: 12px;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.2s;
    user-select: none;
}

.fluxo-node:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.fluxo-node.selected {
    box-shadow: 0 0 0 3px var(--accent), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.fluxo-node.dragging {
    z-index: 100;
    opacity: 0.9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.fluxo-node.anotacao {
    border-style: dashed;
}

.fluxo-node.demanda {
    border-style: solid;
}

.fluxo-node.connect-target {
    box-shadow: 0 0 0 3px #f39c12, 0 6px 20px rgba(0, 0, 0, 0.4);
}

.fluxo-node-header {
    padding: 10px 15px;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    font-size: 12px;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
}

.fluxo-node-header:active {
    cursor: grabbing;
}

.fluxo-node-tipo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fluxo-node-body {
    padding: 12px 15px;
}

.fluxo-node-body .node-titulo {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.fluxo-node-body .node-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fluxo-node-footer {
    padding: 8px 15px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Node Ports */
.fluxo-node-port {
    width: 14px;
    height: 14px;
    background: var(--bg-tertiary);
    border: 2px solid;
    border-radius: 50%;
    position: absolute;
    cursor: crosshair;
    z-index: 20;
    transition: transform 0.2s, background 0.2s;
}

.fluxo-node-port:hover {
    transform: translateX(-50%) scale(1.4);
    background: var(--accent);
}

.fluxo-node-port.input {
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
}

.fluxo-node-port.output {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
}

/* Sidebar */
.fluxo-sidebar {
    width: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    overflow: hidden;
    transition: width 0.3s ease;
}

.fluxo-sidebar.open {
    width: 380px;
}

.fluxo-sidebar-content {
    width: 380px;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.fluxo-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.fluxo-sidebar-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.fluxo-sidebar-close:hover {
    color: var(--danger);
}

/* Responsive */
@media (max-width: 992px) {
    .fluxo-container {
        flex-direction: column;
    }

    .fluxo-sidebar {
        width: 100% !important;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .fluxo-sidebar.open {
        width: 100%;
    }

    .fluxo-sidebar-content {
        width: 100%;
    }

    .fluxo-canvas {
        min-width: 1500px;
        min-height: 1000px;
    }
}

/* Temp connection line when connecting */
.fluxo-temp-line {
    stroke: #f39c12;
    stroke-width: 2;
    stroke-dasharray: 8, 4;
    fill: none;
    pointer-events: none;
}

/* ==================== PDF VIEWER MODAL ==================== */

.pdf-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
}

.pdf-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.pdf-viewer-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.pdf-viewer-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-viewer-body {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #2a2a2a;
}

.pdf-viewer-body canvas {
    max-width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* ==================== DOCUMENTOS ==================== */

.doc-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.doc-list-item:hover {
    background: var(--bg-tertiary);
}

.doc-list-item:last-child {
    border-bottom: none;
}

.doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-info-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-info-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.doc-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.doc-hierarchy-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.doc-hierarchy-header i {
    color: var(--accent);
}

.doc-upload-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    flex-wrap: wrap;
}

/* ==================== SUGESTOES ==================== */

/* Notification bell no header */
.notification-bell {
    position: relative;
    color: var(--text-secondary);
    font-size: 18px;
    text-decoration: none;
    transition: color 0.2s;
}

.notification-bell:hover {
    color: var(--accent);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Badge na sidebar */
.notification-badge-sidebar {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Cards de sugestao */
.sugestao-card {
    border-left: 4px solid var(--border-color);
    transition: border-color 0.2s;
}

.sugestao-card.sugestao-pendente {
    border-left-color: var(--warning);
}

.sugestao-card.sugestao-aprovado {
    border-left-color: var(--success);
}

.sugestao-card.sugestao-rejeitado {
    border-left-color: var(--danger);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
}

.toast-info {
    background: var(--accent);
    color: var(--bg-primary);
}

.toast-success {
    background: var(--success);
    color: var(--bg-primary);
}

.toast-warning {
    background: var(--warning);
    color: var(--bg-primary);
}

.toast-error {
    background: var(--danger);
}

/* Alert info */
.alert-info {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
}
