/* assets/css/style.css */
/* Estilos principais para o Swipe Files Tracker - VERSÃO RESPONSIVA COMPLETA */

/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Variáveis CSS */
:root {
    --primary-color: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #a5b4fc;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    --gradient-success: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

/* Utilitários modernos */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Layout principal moderno */
.wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--light-color);
}

/* Sidebar moderna */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--dark-color) 0%, #0f172a 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: var(--shadow-xl);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.sidebar-header h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0 25px 25px 0;
    margin-right: 1rem;
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.sidebar-menu a:hover::before,
.sidebar-menu a.active::before {
    left: 0;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.sidebar-menu i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Conteúdo principal moderno */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--light-color);
}

.topbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.content {
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

/* Cards modernos */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--light-color) 0%, #f1f5f9 100%);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 2rem;
}

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

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card.success::before {
    background: var(--gradient-success);
}

.stat-card.warning::before {
    background: var(--gradient-warning);
}

.stat-card.info::before {
    background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--secondary-color);
    font-size: 1rem;
    font-weight: 500;
}

/* Formulários modernos */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--danger-color);
    font-weight: 500;
}

/* Botões modernos */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #475569 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(100, 116, 139, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    border-radius: 8px;
}

/* Tabelas modernas */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--shadow);
    background: white;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.table th {
    background: linear-gradient(135deg, var(--dark-color) 0%, #0f172a 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-size: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.table th:first-child {
    border-top-left-radius: 12px;
}

.table th:last-child {
    border-top-right-radius: 12px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: white;
    transition: all 0.3s ease;
}

.table tr:hover td {
    background: rgba(79, 70, 229, 0.05);
    transform: scale(1.01);
}

.table tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.table tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Badges modernos */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--gradient-primary);
    color: white;
}

.badge-success {
    background: var(--gradient-success);
    color: white;
}

.badge-warning {
    background: var(--gradient-warning);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

/* Alertas modernos */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    border-color: var(--warning-color);
    color: #92400e;
}

/* Menu toggle moderno */
.menu-toggle {
    display: none;
    background: var(--gradient-primary);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: white;
    padding: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

/* Overlay moderno */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    transition: all 0.3s ease;
}

/* Filtros modernos */
.filters {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

/* Destaque para campanhas em escala */
.escala-destaque {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%) !important;
    border-left: 4px solid var(--warning-color) !important;
}

.escala-badge {
    background: var(--gradient-warning);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* RESPONSIVIDADE MOBILE COMPLETA */

/* Tablets */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content {
        padding: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body {
        background: var(--light-color);
    }
    
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        z-index: 1001;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .topbar {
        padding: 1rem;
    }
    
    .topbar-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .topbar {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .content {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .form-control {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .form-control,
    .sidebar-menu a {
        min-height: 48px;
    }
    
    .menu-toggle {
        min-height: 48px;
        min-width: 48px;
    }
    
    .table td,
    .table th {
        padding: 1rem 0.75rem;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 280px;
    }
    
    .topbar {
        padding: 0.75rem 1rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animações e transições */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.card {
    animation: slideInUp 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading states */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #1e293b;
        --dark-color: #f1f5f9;
        --border-color: #334155;
    }
    
    body {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        color: var(--dark-color);
    }
    
    .card {
        background: #334155;
        border-color: #475569;
    }
    
    .form-control {
        background: #475569;
        border-color: #64748b;
        color: var(--dark-color);
    }
    
    .topbar {
        background: rgba(51, 65, 85, 0.95);
        border-bottom-color: #475569;
    }
}

/* Impressão */
@media print {
    .sidebar,
    .topbar,
    .menu-toggle,
    .sidebar-overlay,
    .btn,
    .filters {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
}

/* Utilitários */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Layout principal */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--dark-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.sidebar-header small {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-color);
    color: white;
}

.sidebar-menu i {
    margin-right: 0.5rem;
    width: 20px;
}

/* Conteúdo principal */
.main-content {
    flex: 1;
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

.topbar {
    background: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

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

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content {
    padding: 2rem 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
    border-radius: 0.5rem 0.5rem 0 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

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

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

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

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Formulários */
.form-group {
    margin-bottom: 1rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}

/* Botões */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.table {
    width: 100%;
    margin-bottom: 1rem;
    background: transparent;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid var(--border-color);
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
    background: var(--light-color);
    font-weight: 600;
}

.table tbody tr:hover {
    background: rgba(0, 0, 0, 0.025);
}

/* Alertas */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-success {
    color: #155724;
    background: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background: #d1ecf1;
    border-color: #bee5eb;
}

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

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

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

.login-header h1 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: var(--dark-color);
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

/* Imagens */
.img-thumbnail {
    max-width: 100px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 1rem 0;
}

.pagination li {
    margin: 0 0.25rem;
}

.pagination a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
}

.pagination a:hover,
.pagination .active a {
    background: var(--primary-color);
    color: white;
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .topbar-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Menu toggle para mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

/* Overlay para mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .sidebar-overlay.show {
        display: block;
    }
}

/* Chart container */
.chart-container {
    position: relative;
    height: 400px;
    margin: 1rem 0;
}

/* Filtros */
.filters {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.filters-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Destaque para campanhas em escala */
.escala-destaque {
    background: linear-gradient(45deg, #fff3cd, #ffeaa7) !important;
    border-left: 4px solid var(--warning-color) !important;
}

.escala-badge {
    background: var(--warning-color);
    color: var(--dark-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* ===== MELHORIAS DE RESPONSIVIDADE MOBILE ===== */

/* Configurações gerais para mobile */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    /* Header mobile */
    .header {
        padding: 0.5rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        border-bottom: 1px solid var(--border-color);
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    /* Sidebar mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 1001;
        background: white;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem 0.5rem;
    }
    
    /* Cards mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .stat-card p {
        font-size: 0.8rem;
    }
    
    /* Tabelas mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    /* Formulários mobile */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 16px; /* Evita zoom no iOS */
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Gráficos mobile */
    .chart-container {
        height: 300px;
        margin: 0.5rem 0;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Navegação mobile */
    .nav-tabs {
        flex-wrap: wrap;
        border-bottom: none;
    }
    
    .nav-tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
        font-size: 0.85rem;
        padding: 0.5rem 0.25rem;
    }
    
    /* Modal mobile */
    .modal-content {
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Alertas mobile */
    .alert {
        margin: 0.5rem 0;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Badges mobile */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
    
    /* Paginação mobile */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Configurações para telas muito pequenas */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        text-align: center;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .form-control {
        font-size: 14px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .nav-tab {
        font-size: 0.75rem;
        padding: 0.4rem 0.2rem;
    }
}

/* Configurações para landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 250px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Touch targets para mobile */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-tab,
    .table-action,
    .sidebar-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
    }
}

/* Melhorias de acessibilidade mobile */
@media (prefers-reduced-motion: reduce) {
    .sidebar {
        transition: none;
    }
    
    .spinner {
        animation: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support para mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .sidebar {
        background: #2d2d2d;
        border-right-color: #404040;
    }
    
    .header {
        background: #2d2d2d;
        border-bottom-color: #404040;
    }
    
    .card {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .form-control {
        background: #3d3d3d;
        border-color: #505050;
        color: #e0e0e0;
    }
    
    .table {
        color: #e0e0e0;
    }
    
    .table th {
        background: #3d3d3d;
        border-color: #505050;
    }
    
    .table td {
        border-color: #505050;
    }
}

/* Otimizações de performance para mobile */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .chart-container canvas {
        max-width: 100%;
        height: auto !important;
    }
    
    .table-responsive {
        scrollbar-width: thin;
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: var(--light-color);
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--secondary-color);
        border-radius: 2px;
    }
}


/* ===== MELHORIAS ADICIONAIS DE RESPONSIVIDADE MOBILE ===== */

/* Configurações específicas para telas muito pequenas */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .topbar {
        padding: 0.75rem 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .filters-row {
        gap: 0.5rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Melhorias para tablets em modo portrait */
@media (min-width: 481px) and (max-width: 768px) {
    .sidebar {
        width: 280px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Melhorias para tablets em modo landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .filters-row {
        flex-wrap: wrap;
    }
}

/* Configurações específicas para touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .form-control,
    .sidebar-menu a {
        min-height: 44px;
        min-width: 44px;
    }
    
    .sidebar-menu a {
        padding: 1rem 1.5rem;
    }
    
    .table td,
    .table th {
        padding: 0.75rem 0.5rem;
    }
    
    .pagination a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Melhorias para orientação landscape em mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 250px;
    }
    
    .topbar {
        padding: 0.5rem 1rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Configurações para telas de alta densidade (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sidebar-header h3 {
        font-weight: 500;
    }
    
    .stat-number {
        font-weight: 700;
    }
    
    .btn {
        font-weight: 500;
    }
}

/* Melhorias de performance para animações em mobile */
@media (max-width: 768px) {
    .sidebar {
        will-change: transform;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .sidebar-overlay {
        will-change: opacity;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .sidebar-menu a:active {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Configurações específicas para iOS Safari */
@supports (-webkit-touch-callout: none) {
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    .form-control {
        -webkit-appearance: none;
        border-radius: 0.375rem;
    }
    
    .btn {
        -webkit-appearance: none;
    }
}

/* Melhorias finais para garantir responsividade total */
@media (max-width: 768px) {
    /* Garantir que todos os elementos sejam responsivos */
    * {
        max-width: 100%;
        word-wrap: break-word;
    }
    
    /* Melhorar espaçamento em mobile */
    .card + .card {
        margin-top: 1rem;
    }
    
    /* Otimizar formulários para mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Melhorar tabelas em mobile */
    .table-responsive {
        border: 1px solid var(--border-color);
        border-radius: 0.375rem;
    }
    
    .table {
        margin-bottom: 0;
    }
    
    /* Otimizar botões para mobile */
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0;
    }
    
    /* Melhorar alertas em mobile */
    .alert {
        margin-bottom: 1rem;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Otimizar badges em mobile */
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Melhorar paginação em mobile */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination li {
        margin: 0.125rem;
    }
    
    .pagination a {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

