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

:root {
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Cores do Sistema (Estilo Dark Premium) */
    --bg-main: #090c15;
    --bg-card: #121829;
    --bg-card-hover: #162035;
    --bg-sidebar: #0e1220;
    --bg-header: rgba(14, 18, 32, 0.7);
    
    --border-color: #212d45;
    --border-hover: #32476d;
    
    /* Cores de Destaque */
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Badges de Status (HSL para opacidade flexível) */
    --status-novo-h: 217;
    --status-novo-s: 91%;
    --status-novo-l: 60%; /* #3b82f6 */
    
    --status-atendimento-h: 271;
    --status-atendimento-s: 91%;
    --status-atendimento-l: 65%; /* #a855f7 */
    
    --status-resolvido-h: 142;
    --status-resolvido-s: 71%;
    --status-resolvido-l: 45%; /* #22c55e */
    
    --status-fechado-h: 215;
    --status-fechado-s: 16%;
    --status-fechado-l: 47%; /* #64748b */

    /* Badges de Prioridade */
    --priority-baixa: #38bdf8;
    --priority-media: #f59e0b;
    --priority-alta: #f97316;
    --priority-urgente: #ef4444;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout Geral */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item a:hover {
    color: var(--text-primary);
    background-color: var(--bg-card-hover);
    transform: translateX(4px);
}

.nav-item a.active {
    color: white;
    background: linear-gradient(90deg, var(--accent), #4f46e5);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Main Content Area */
.main-wrapper,
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    .main-wrapper,
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
}

/* Header / Simulador de Papéis */
.app-header {
    height: 70px;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.user-simulator {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
}

.simulator-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.simulator-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 600;
    outline: none;
    cursor: pointer;
    padding-right: 0.5rem;
}

.simulator-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.role-tag.client { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.role-tag.agent { background-color: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.role-tag.admin { background-color: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

/* Main Page Container */
.content-body {
    padding: 2rem;
    flex: 1;
}

/* Glassmorphism Cards */
.card-glass {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s, transform 0.3s;
}

.card-glass:hover {
    border-color: var(--border-hover);
}

/* Dashboard Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 120px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: 1;
}

.metric-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.metric-value-container {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: auto;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-icon {
    font-size: 1.5rem;
    opacity: 0.4;
    color: var(--accent);
}

/* Dashboard Visual Charts */
.dashboard-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Custom SVG Chart / Bar representations */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding-top: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.chart-bar-wrapper {
    height: 150px;
    width: 32px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: flex-end;
    position: relative;
}

.chart-bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--accent), rgba(59, 130, 246, 0.3));
    transition: height 1s ease;
    cursor: pointer;
}

.chart-bar:hover {
    background: linear-gradient(180deg, var(--accent-hover), rgba(96, 165, 250, 0.5));
}

.chart-bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chart-tooltip {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.chart-bar-wrapper:hover .chart-tooltip {
    opacity: 1;
}

/* Priority Distribution Bars */
.priority-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.priority-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.priority-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
}

.priority-bar-track {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    overflow: hidden;
}

.priority-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

/* Badges styling */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status-novo {
    background-color: hsl(var(--status-novo-h), var(--status-novo-s), 10%);
    color: hsl(var(--status-novo-h), var(--status-novo-s), var(--status-novo-l));
    border: 1px solid hsla(var(--status-novo-h), var(--status-novo-s), var(--status-novo-l), 0.3);
}

.badge-status-ematendimento {
    background-color: hsl(var(--status-atendimento-h), var(--status-atendimento-s), 10%);
    color: hsl(var(--status-atendimento-h), var(--status-atendimento-s), var(--status-atendimento-l));
    border: 1px solid hsla(var(--status-atendimento-h), var(--status-atendimento-s), var(--status-atendimento-l), 0.3);
}

.badge-status-resolvido {
    background-color: hsl(var(--status-resolvido-h), var(--status-resolvido-s), 8%);
    color: hsl(var(--status-resolvido-h), var(--status-resolvido-s), var(--status-resolvido-l));
    border: 1px solid hsla(var(--status-resolvido-h), var(--status-resolvido-s), var(--status-resolvido-l), 0.3);
}

.badge-status-fechado {
    background-color: hsl(var(--status-fechado-h), var(--status-fechado-s), 10%);
    color: hsl(var(--status-fechado-h), var(--status-fechado-s), var(--status-fechado-l));
    border: 1px solid hsla(var(--status-fechado-h), var(--status-fechado-s), var(--status-fechado-l), 0.3);
}

.badge-priority {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
}
.badge-priority.baixa { background-color: rgba(56, 189, 248, 0.12); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-priority.media { background-color: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-priority.alta { background-color: rgba(249, 115, 22, 0.12); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-priority.urgente { background-color: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Buttons & Inputs */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3);
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.25rem;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    outline: none;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Select option theme overrides for dark mode readability */
select option {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

select {
    color-scheme: dark;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper .form-control {
    padding-left: 2.5rem;
}

.filter-select {
    min-width: 140px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-sans);
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--accent);
    color: var(--text-primary);
}

.tickets-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.ticket-row-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 100px 2fr 1fr 1fr 100px;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.ticket-row-card:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .ticket-row-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.ticket-id {
    font-family: monospace;
    font-weight: 700;
    color: var(--text-muted);
}

.ticket-info-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.ticket-info-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ticket-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.avatar-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Ticket Details Screen */
.details-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .details-layout {
        grid-template-columns: 1fr;
    }
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ticket-description-box {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 12px;
    line-height: 1.6;
    margin-top: 1rem;
    white-space: pre-wrap;
}

/* Timeline/Comments Flow */
.timeline-section {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline-wrapper {
    position: relative;
    padding-left: 2rem;
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), rgba(255, 255, 255, 0.05));
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #0f172a;
    border: 3px solid var(--border-color);
    box-shadow: 0 0 0 4px #0f172a;
    transition: all 0.2s ease-in-out;
}

.timeline-item:hover .timeline-dot {
    border-color: var(--accent);
    transform: scale(1.2);
}

.timeline-item.system .timeline-dot {
    border-color: #eab308;
    background-color: #0f172a;
}

.timeline-item.system:hover .timeline-dot {
    border-color: #facc15;
}

.timeline-content-card {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease-in-out;
}

.timeline-content-card:hover {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.timeline-item.system .timeline-content-card {
    background-color: rgba(234, 179, 8, 0.02);
    border-color: rgba(234, 179, 8, 0.08);
}

.timeline-item.system .timeline-content-card:hover {
    background-color: rgba(234, 179, 8, 0.03);
    border-color: rgba(234, 179, 8, 0.12);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.timeline-author {
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-date {
    color: var(--text-muted);
}

.timeline-body {
    font-size: 0.925rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.timeline-item.system .timeline-body {
    color: var(--text-primary);
    font-style: italic;
}

/* Sidebar action fields */
.sidebar-action-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.sidebar-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-value {
    font-weight: 500;
    font-size: 0.95rem;
}

/* General Layout utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-gap-2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.2;
}

/* Toast Notification Custom Styles */
.toast-container-custom {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    animation: slideInCustom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: #121829;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 320px;
    max-width: 450px;
}

.toast-notification-custom.toast-success {
    border-left: 4px solid #22c55e;
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.15);
}

.toast-notification-custom.toast-danger {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.15);
}

.toast-notification-custom.toast-warning {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.15);
}

.toast-notification-custom.toast-info {
    border-left: 4px solid #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.15);
}

.toast-body-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon-custom {
    font-size: 1.25rem;
}

.toast-message-custom {
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toast-close-custom {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close-custom:hover {
    color: var(--text-primary);
}

@keyframes slideInCustom {
    from {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Login Page Styles */
.login-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-main);
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    border-radius: 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.login-header {
    margin-bottom: 2rem;
    text-align: center;
}

/* Ticket Late Highlight */
.ticket-row-card.ticket-late {
    border-left: 4px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.03) !important;
}

.ticket-row-card.ticket-late:hover {
    border-color: #f87171 !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

/* Custom Confirmation Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: modalFadeIn 0.2s ease-out;
}

.modal-card {
    width: 90%;
    max-width: 450px;
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    z-index: 100001 !important;
    animation: modalScaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card-lg {
    width: 92%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 1.75rem;
    position: relative;
    z-index: 100001 !important;
    animation: modalScaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card .form-control, .modal-card-lg .form-control {
    background-color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #f87171;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Fase 1 - Melhorias de UI/UX
   ========================================================================== */

/* Suavização de interações */
.btn, button, input, select, textarea, a, .ticket-row-card {
    transition: all 0.2s ease-in-out !important;
}

/* Transições adicionais para cards de dashboard */
.kpi-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out !important;
}
.kpi-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent) !important;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3) !important;
}

/* Estilo para Área Drag & Drop */
.drag-drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.drag-drop-zone:hover {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.04);
}
.drag-drop-zone i {
    font-size: 2rem;
    color: var(--text-muted);
}
.drag-drop-zone:hover i {
    color: var(--accent);
}

/* Linha do Tempo (Timeline) Vertical Conectada */
.timeline-container {
    position: relative;
    padding-left: 2.5rem;
    margin-left: 0.5rem;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-badge {
    position: absolute;
    left: calc(-2.5rem - 1px);
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #1e293b;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-muted);
    transform: translateX(-50%);
    box-shadow: 0 0 0 4px #0f172a; /* Esconde a linha atrás do círculo */
    z-index: 2;
}

/* Cores dos badges da timeline */
.timeline-badge.badge-comentario {
    border-color: var(--accent);
    color: var(--accent);
}
.timeline-badge.badge-status {
    border-color: #eab308; /* Amarelo */
    color: #eab308;
}
.timeline-badge.badge-tecnico {
    border-color: #a855f7; /* Roxo */
    color: #a855f7;
}
.timeline-badge.badge-resolvido {
    border-color: #22c55e; /* Verde */
    color: #22c55e;
}
.timeline-badge.badge-cancelado {
    border-color: #ef4444; /* Vermelho */
    color: #ef4444;
}

.timeline-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 0.25rem;
}

/* Detector de Caps Lock e Visibilidade de Senha */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
    z-index: 10;
}
.password-toggle-btn:hover {
    color: var(--text-primary);
}
.caps-lock-warning {
    font-size: 0.75rem;
    color: #eab308;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}