* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 2000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    color: black;
    padding: 25px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 28px;
    margin: 0;
    text-align: center;
    flex: 1;
}

.header p {
    opacity: 0.9;
    font-size: 16px;
    text-align: center;
    margin: 5px 0 0 0;
    position: absolute;
    width: 100%;
    bottom: 10px;
    left: 0;
}

.logo {
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 60px;
}

.logo img {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
}

/* Nova seção de métricas avançadas */
.metrics-section {
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #4CAF50;
    transition: transform 0.3s;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-title {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #343a40;
    margin-bottom: 5px;
}

.metric-subtitle {
    font-size: 12px;
    color: #6c757d;
}

/* Gráfico de pizza simples */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #343a40;
}

.donut-chart {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    position: relative;
}

.donut-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip: rect(0, 60px, 120px, 0);
}

.controls {
    padding: 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.controls-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.control-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.control-group select,
.control-group input {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 25px;
    background: white;
}

.stat-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-color);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-concluidos { --accent-color: #2196F3; }
.stat-atribuidos { --accent-color: #4CAF50; }
.stat-pendentes { --accent-color: #FF9800; }
.stat-fechados { --accent-color: #9E9E9E; }
.stat-total-finalizados { --accent-color: #7C4DFF; }

/* Melhorias na tabela */
.table-container {
    padding: 25px;
    max-height: 800px;
    overflow-y: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-title {
    font-size: 20px;
    font-weight: 600;
    color: #343a40;
}

.table-info {
    font-size: 14px;
    color: #6c757d;
    display: flex;
    gap: 20px;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

th {
    background: linear-gradient(135deg, #495057, #343a40);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    transition: background 0.3s;
}

th:hover {
    background: linear-gradient(135deg, #343a40, #495057);
}

td {
    padding: 15px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    min-width: 80px;
}

.badge-concluido { background: #e3f2fd; color: #1976d2; }
.badge-atribuido { background: #e8f5e8; color: #388e3c; }
.badge-fechado { background: #f5f5f5; color: #616161; }
.badge-pendente { background: #fff3e0; color: #f57c00; }
.badge-novo { background: #fff9c4; color: #f57f17; }
.badge-planejado { background: #e1f5fe; color: #0277bd; }

.priority-alta { color: #d32f2f; font-weight: bold; }
.priority-media { color: #f57c00; font-weight: bold; }
.priority-baixa { color: #388e3c; font-weight: bold; }

/* Indicadores de performance */
.performance-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.indicator-excellent { background: #4CAF50; }
.indicator-good { background: #8BC34A; }
.indicator-warning { background: #FF9800; }
.indicator-critical { background: #F44336; }

.loading {
    text-align: center;
    padding: 60px;
    color: #6c757d;
}

.loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s;
}

.toast.show {
    transform: translateX(0);
}

.toast.success { background: #4CAF50; }
.toast.error { background: #F44336; }
.toast.info { background: #2196F3; }

/* Melhorias responsivas */

/* Tablets e telas menores */
@media (max-width: 1024px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header p {
        font-size: 14px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile - Smartphones */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .container {
        border-radius: 8px;
    }

    /* Header mobile */
    .header {
        flex-direction: column;
        padding: 15px;
        gap: 10px;
    }

    .header h1 {
        font-size: 20px;
    }

    .header p {
        position: static;
        font-size: 12px;
        margin-top: 5px;
    }

    .logo {
        min-width: 80px;
        height: 50px;
        padding: 5px;
    }

    .logo img {
        max-height: 60px;
        max-width: 150px;
    }

    /* Mode selector mobile */
    .mode-selector {
        flex-direction: column;
        padding: 0 15px;
    }

    .mode-btn {
        width: 100%;
        justify-content: center;
        padding: 15px;
        font-size: 14px;
    }

    .connection-status {
        margin-left: 5px;
    }

    /* Métricas mobile */
    .metrics-section {
        padding: 15px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .metric-card {
        padding: 15px;
    }

    .metric-value {
        font-size: 20px;
    }

    .chart-container canvas {
        max-width: 100px;
        max-height: 100px;
    }

    /* Controles mobile */
    .controls {
        padding: 15px;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .control-group {
        min-width: auto;
        width: 100%;
    }

    .control-group select,
    .control-group input {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    /* Botões mobile - touch friendly */
    .buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }

    /* Cards de status mobile */
    .status {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-number {
        font-size: 28px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* Tabela mobile */
    .table-container {
        padding: 15px;
        max-height: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .table-title {
        font-size: 16px;
    }

    .table-info {
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
    }

    table {
        font-size: 11px;
        min-width: 900px;
    }

    th, td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    th {
        font-size: 11px;
        position: sticky;
        left: 0;
    }

    .status-badge {
        font-size: 10px;
        padding: 4px 8px;
        min-width: 60px;
    }

    .notification {
        padding: 10px;
        font-size: 12px;
    }

    /* Jira section mobile */
    .jira-section {
        padding: 15px;
    }
}

/* Mobile pequeno - Smartphones pequenos */
@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }

    .header p {
        font-size: 11px;
    }

    .logo {
        min-width: 60px;
        height: 40px;
    }

    .logo img {
        max-height: 50px;
        max-width: 120px;
    }

    .metric-card {
        padding: 12px;
    }

    .metric-title {
        font-size: 12px;
    }

    .metric-value {
        font-size: 18px;
    }

    .metric-subtitle {
        font-size: 10px;
    }

    .status {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 24px;
    }

    table {
        font-size: 10px;
        min-width: 800px;
    }

    th, td {
        padding: 6px 4px;
    }

    .mode-btn {
        padding: 12px;
        font-size: 13px;
    }
}

/* Tooltips melhorados */
.tooltip-container {
    position: relative;
    cursor: help;
}

.tooltip-container::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-line;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tooltip-container:hover::after {
    opacity: 1;
}

/* Seta do tooltip */
.tooltip-container::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(1px);
    border: 6px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1001;
}

.tooltip-container:hover::before {
    opacity: 1;
}

/* Seletor de modo (simplificado para só GLPI) */
.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.mode-btn {
    padding: 12px 24px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    color: #6c757d;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.mode-btn:hover:not(.active) {
    border-color: #4CAF50;
    color: #4CAF50;
}

/* Indicadores de status de conexão */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    margin-left: 10px;
}

.status-dot-conn {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-connected { background: #4CAF50; }
.status-disconnected { background: #F44336; }
.status-loading { background: #FF9800; animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Tooltips mobile */
@media (max-width: 768px) {
    .tooltip-container::after {
        max-width: 200px;
        font-size: 11px;
        padding: 8px 12px;
    }

    .tooltip-container::before {
        border-width: 4px;
    }
}

/* Scroll suave para mobile */
@media (max-width: 768px) {
    .table-container::-webkit-scrollbar {
        height: 8px;
    }

    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .table-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

    .table-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

.jira-section {
    padding: 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Estilos responsivos para Jira Section */
.jira-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.jira-controls select,
.jira-controls button {
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    font-size: 14px;
}

.jira-sprint-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.sprint-chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: white;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    white-space: nowrap;
}

.sprint-chip:hover {
    border-color: #4CAF50;
}

.sprint-chip.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.jira-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.jira-stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.jira-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.jira-task-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-left: 4px solid #4CAF50;
    transition: transform 0.2s;
}

.jira-task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mobile responsivo para Jira */
@media (max-width: 768px) {
    .jira-section {
        padding: 15px;
    }

    .jira-controls {
        flex-direction: column;
        gap: 10px;
    }

    .jira-controls select,
    .jira-controls button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    .jira-sprint-selector {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .sprint-chip {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 14px;
    }

    .jira-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .jira-stat-card {
        padding: 15px;
    }

    .jira-tasks-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .jira-task-card {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .jira-stats-grid {
        grid-template-columns: 1fr;
    }

    .sprint-chip {
        font-size: 13px;
        padding: 8px 14px;
    }
}