@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Reset e Configurações Gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --dark: #0f172a;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 12px;

    /* Aliases para compatibilidade */
    --primary-color: var(--primary);
    --secondary-color: var(--secondary);
    --success-color: var(--success);
    --warning-color: var(--warning);
    --error-color: var(--error);
    --info-color: var(--info);
    --dark-color: var(--dark);
    --border-color: var(--border);
    --text-color: var(--text);
    --light-color: #f1f5f9;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Página de Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #2d3436 0%, #000000 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 20%);
    opacity: 0.1;
    animation: pulse 20s infinite linear;
}

@keyframes pulse {
    0% {
        transform: translate(-25%, -25%) rotate(0deg);
    }

    100% {
        transform: translate(-25%, -25%) rotate(360deg);
    }
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    z-index: 10;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 48px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--dark);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Navbar */
.navbar {
    background: #ffffff;
    border-bottom: 2px solid var(--border);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    margin-left: 20px;
}

.navbar-brand a {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    max-height: 40px;
}

.navbar-brand i {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 12px;
}

.navbar-menu li {
    position: relative;
}

.navbar-menu li a {
    padding: 10px 18px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-menu li a i {
    font-size: 16px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.navbar-menu li a:hover {
    background: #ffffff;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.navbar-menu li a:hover i {
    color: var(--primary);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 8px;
    min-width: 200px;
    display: none;
    z-index: 1001;
    list-style: none;
    margin-top: 10px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Ponte para o hover não fechar ao mover o mouse para o menu */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
}

.dropdown-menu li a:hover {
    background: #f1f5f9;
    transform: none;
    box-shadow: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f1f5f9;
    padding: 6px 6px 6px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

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

.user-info i {
    font-size: 20px;
    color: var(--primary);
}

.navbar-user span {
    color: var(--dark);
    font-weight: 700;
    font-size: 14px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: #dc2626;
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
}

/* Responsividade Geral */
@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
        flex-direction: column;
        height: auto;
        align-items: flex-start;
    }

    .navbar-brand {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 72px;
    }

    .mobile-toggle {
        display: block;
    }

    .navbar-container {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        padding-bottom: 20px;
        gap: 20px;
    }

    .navbar-container.active {
        display: flex;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .navbar-menu li a {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: #f8fafc;
        margin-top: 5px;
        width: 100%;
        padding-left: 20px;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .navbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .container {
        padding: 20px;
    }

    .row {
        flex-direction: column;
    }

    .col-4,
    .col-6,
    .col-8,
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100% !important;
    }

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

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .table-responsive {
        border: 0;
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    min-height: calc(100vh - 144px);
}

/* Títulos */
h1 {
    font-size: 32px;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.card-body {
    padding: 32px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary);
}

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

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

.stat-card.stat-error {
    border-left-color: var(--error-color);
}

.stat-card.stat-info {
    border-left-color: var(--info-color);
}

.stat-icon {
    font-size: 32px;
    background: #f1f5f9;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.stat-info h3 {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control-sm {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: all 0.3s;
}

.form-control-sm:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Botões */
.btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background: #f1f5f9;
    color: var(--text);
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

/* Variantes de Cores dos Botões - Reforçadas */
.btn-primary {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

.btn-secondary {
    background-color: #64748b !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: none;
}

.btn-warning {
    background-color: #f59e0b !important;
    color: #ffffff !important;
    border: none;
}

.btn-info {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border: none;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    border: none;
}

.btn-info {
    background: var(--info-color);
    color: white;
    border: none;
}

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

.btn-block {
    width: 100%;
    text-align: center;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
}

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

.table thead th {
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #475569;
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table tbody td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f1f5f9;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-baixa {
    background: #dbeafe;
    color: #1e40af;
}

.badge-media {
    background: #fef3c7;
    color: #92400e;
}

.badge-alta {
    background: #fed7aa;
    color: #9a3412;
}

.badge-urgente {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-aberto {
    background: #dcfce7;
    color: #15803d;
}

.badge-status-em_andamento {
    background: #fef9c3;
    color: #a16207;
}

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

.badge-status-resolvido {
    background: #d1fae5;
    color: #065f46;
}

.badge-status-fechado {
    background: #f3f4f6;
    color: #374151;
}

.badge-usuario {
    background: #dbeafe;
    color: #1e40af;
}

.badge-tecnico {
    background: #fef3c7;
    color: #92400e;
}

.badge-admin {
    background: #fee2e2;
    color: #991b1b;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Alerts */
.alert {
    padding: 16px 24px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
    animation: slideDown 0.4s ease-out;
    border: 1px solid transparent;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-persistent {
    position: sticky;
    top: 88px;
    z-index: 90;
    box-shadow: var(--shadow-md);
    background: white !important;
    border: 2px solid var(--primary) !important;
    color: var(--dark) !important;
}

.btn-close-notify:hover {
    transform: scale(1.2);
    opacity: 0.7;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fee2e2;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fef3c7;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 4px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 17px;
    bottom: -30px;
    width: 2px;
    background: var(--border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-content {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-left: 10px;
    box-shadow: var(--shadow-sm);
}

.timeline-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

/* Grid Layout */
.row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.col-4 {
    flex: 0 0 33.333%;
}

.col-6 {
    flex: 0 0 50%;
}

.col-8 {
    flex: 0 0 66.666%;
}

/* Grid Helpers Adicionais */
.col-1 {
    flex: 0 0 8.333%;
}

.col-2 {
    flex: 0 0 16.666%;
}

.col-3 {
    flex: 0 0 25%;
}

.col-4 {
    flex: 0 0 33.333%;
}

.col-5 {
    flex: 0 0 41.666%;
}

.col-9 {
    flex: 0 0 75%;
}

.col-10 {
    flex: 0 0 83.333%;
}

.col-11 {
    flex: 0 0 91.666%;
}

.col-12 {
    flex: 0 0 100%;
}

@media (min-width: 769px) {
    .col-md-1 {
        flex: 0 0 8.333%;
    }

    .col-md-2 {
        flex: 0 0 16.666%;
    }

    .col-md-3 {
        flex: 0 0 25%;
    }

    .col-md-4 {
        flex: 0 0 33.333%;
    }

    .col-md-5 {
        flex: 0 0 41.666%;
    }

    .col-md-6 {
        flex: 0 0 50%;
    }

    .col-md-7 {
        flex: 0 0 58.333%;
    }

    .col-md-8 {
        flex: 0 0 66.666%;
    }

    .col-md-9 {
        flex: 0 0 75%;
    }

    .col-md-10 {
        flex: 0 0 83.333%;
    }

    .col-md-11 {
        flex: 0 0 91.666%;
    }

    .col-md-12 {
        flex: 0 0 100%;
    }
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-end {
    align-items: flex-end !important;
}

.ml-2 {
    margin-left: 8px !important;
}

.mr-2 {
    margin-right: 8px !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    height: 24px;
    background: var(--light-color);
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-color);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Utilitários */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* Utilitários Extras */
.mb-4 {
    margin-bottom: 24px !important;
}

.mt-3 {
    margin-top: 16px !important;
}

/* Dashboard Notice Mural */
.mural-avisos .alert {
    border-left: 8px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    background: white;
    box-shadow: var(--shadow);
}

.mural-avisos h4 {
    font-size: 20px;
    margin-bottom: 12px;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 24px;
    }

    .navbar {
        padding: 0 20px;
    }

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

    .navbar {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        margin: 10px 0;
    }

    .row {
        flex-direction: column;
    }

    .col-4,
    .col-6,
    .col-8 {
        flex: 0 0 100%;
    }

    .form-row {
        flex-direction: column;
    }
}

/* Estilos para Anexos */
.anexos-list {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.anexos-list ul {
    list-style: none;
    padding: 0;
}

.anexos-list li {
    margin-bottom: 5px;
}

.anexos-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.anexo-item {
    display: inline-block;
    background: var(--light-color);
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.anexo-item:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}