/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ffd700;
}

.loading-spinner p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.login-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-login i {
    margin-right: 0.5rem;
}

/* Main Application */
.main-app {
    min-height: 100vh;
    background: #f8fafc;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left i {
    font-size: 2rem;
    color: #ffd700;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-right {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #ffd700;
    color: #333;
}

.btn-primary:hover {
    background: #ffed4e;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Navigation */
.app-nav {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 0 2rem;
}

.nav-tabs {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
}

.nav-tab {
    padding: 1rem 0;
    background: none;
    border: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    color: #667eea;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Content Area */
.app-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.tab-content {
    display: none;
}

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

/* Dashboard */
.dashboard-grid {
    display: grid;
    gap: 2rem;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.metric-card.total .metric-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.metric-card.recent .metric-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.metric-card.overdue .metric-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.metric-card.completed .metric-icon {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.metric-card.priority .metric-icon {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.metric-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.metric-content p {
    color: #666;
    font-weight: 500;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.chart-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-card h4 i {
    color: #667eea;
}

.recent-tickets-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.recent-tickets-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recent-tickets-card h4 i {
    color: #667eea;
}

.recent-tickets-list {
    display: grid;
    gap: 1rem;
}

.recent-ticket-item {
    padding: 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.recent-ticket-item:hover {
    border-color: #667eea;
    background: #f8fafc;
}

.ticket-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ticket-title {
    font-weight: 600;
    color: #333;
}

.ticket-protocol {
    font-size: 0.875rem;
    color: #666;
}

.ticket-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

/* Pipeline */
.pipeline-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pipeline-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.pipeline-column {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 400px;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e1e5e9;
}

.column-title {
    font-weight: 600;
    color: #333;
}

.column-count {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.pipeline-tickets {
    display: grid;
    gap: 1rem;
}

.pipeline-ticket {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.3s ease;
}

.pipeline-ticket:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.pipeline-ticket.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Tickets List */
.tickets-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tickets-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tickets-header h3 i {
    color: #667eea;
}

.tickets-list {
    display: grid;
    gap: 1rem;
}

.ticket-card {
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.ticket-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ticket-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.ticket-card-subtitle {
    color: #666;
    font-size: 0.9rem;
}

.ticket-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-priority-alta {
    background: #fee2e2;
    color: #dc2626;
}

.badge-priority-media {
    background: #fef3c7;
    color: #d97706;
}

.badge-priority-baixa {
    background: #dcfce7;
    color: #16a34a;
}

.badge-status {
    background: #e0e7ff;
    color: #3730a3;
}

.ticket-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.ticket-info-group {
    font-size: 0.875rem;
}

.ticket-info-label {
    color: #666;
    font-weight: 500;
}

.ticket-info-value {
    color: #333;
    font-weight: 600;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: #667eea;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #333;
}

.ticket-form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e1e5e9;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

.btn-secondary {
    background: #f3f4f6;
    color: #666;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .header-left h1 {
        font-size: 1.2rem;
    }

    .app-content {
        padding: 1rem;
    }

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

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

    .ticket-card-body {
        grid-template-columns: 1fr;
    }

    .pipeline-columns {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    animation: fadeIn 0.3s ease;
}

.metric-card {
    animation: fadeIn 0.3s ease;
}

.chart-card {
    animation: fadeIn 0.3s ease;
}

/* Drag and Drop */
.pipeline-column.drag-over {
    background: #e0e7ff;
    border: 2px dashed #667eea;
}

.pipeline-ticket.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Status Colors */
.status-novo { background: #dbeafe; color: #1e40af; }
.status-engenharia { background: #fef3c7; color: #d97706; }
.status-agendada { background: #e0e7ff; color: #3730a3; }
.status-realizada { background: #ecfdf5; color: #059669; }
.status-procedente { background: #dcfce7; color: #16a34a; }
.status-nao-procedente { background: #fee2e2; color: #dc2626; }
.status-reparo-agendado { background: #fef3c7; color: #d97706; }
.status-em-reparo { background: #fbbf24; color: #92400e; }
.status-finalizado { background: #dcfce7; color: #16a34a; }
.status-descartado { background: #f3f4f6; color: #6b7280; }

