/* Reset e Configurações Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Telas */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Tela de Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2em;
}

.login-box h2 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.2em;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* CORRIGIDO v2: Botões normais sem margens negativas */
.modal form .form-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 2px solid #e0e0e0 !important;
    flex-shrink: 0 !important;
}

/* Específico para modal de conferência */
#conferenceForm .form-actions {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Botões - Design Premium */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 10px;
    font-weight: 600;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(81, 207, 102, 0.4);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(81, 207, 102, 0.5);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.4);
}

.btn-info:hover {
    box-shadow: 0 6px 20px rgba(77, 171, 247, 0.5);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
    color: #212529;
    box-shadow: 0 4px 12px rgba(250, 176, 5, 0.4);
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(250, 176, 5, 0.5);
    transform: translateY(-2px);
}

/* Botão de Logout Premium */
.btn-logout {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(238, 90, 111, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #ee5a6f 0%, #c44569 100%);
    box-shadow: 0 6px 20px rgba(238, 90, 111, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-logout:active {
    transform: translateY(0) scale(0.98);
}

.btn-logout .btn-icon {
    font-size: 16px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.btn-logout .btn-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Header */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 18px 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.header h1 {
    font-size: 1.6em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right #userName {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    padding: 10px 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* Cronômetro de Sessão - Design Premium */
.session-timer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: default;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.session-timer::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;
}

.session-timer:hover::before {
    left: 100%;
}

.session-timer:hover {
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.session-timer.warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #c44569 100%);
    box-shadow: 0 4px 16px rgba(238, 90, 111, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: pulse 2s infinite;
}

.session-timer.expired {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: shake 0.5s;
}

.timer-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: tick 1s ease-in-out infinite;
}

.timer-text {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    letter-spacing: 2px;
    min-width: 65px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.timer-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 0 0 14px 14px;
    transition: width 1s linear;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px) rotate(-1deg); }
    20%, 40%, 60%, 80% { transform: translateX(4px) rotate(1deg); }
}

@keyframes tick {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.15) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(0deg);
    }
    75% {
        transform: scale(1.15) rotate(5deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Sidebar - Design Artístico Premium */
.sidebar {
    background: linear-gradient(180deg, #1a1f35 0%, #2c3e50 50%, #1a1f35 100%);
    width: 280px;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    padding: 0;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(102, 126, 234, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Logo da Sidebar */
.sidebar-logo {
    padding: 30px 20px 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.sidebar-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-image-animated {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 6px 20px rgba(102, 126, 234, 0.5));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    border-radius: 12px;
}

.logo-image-animated:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.7));
}

.logo-tagline {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(236, 240, 241, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.5) 50%, transparent 100%);
    margin: 0 20px 20px;
}

/* Menu Items - Design Artístico */
.menu {
    list-style: none;
    padding: 10px 0;
}

.menu li {
    margin: 8px 15px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: transparent;
    border: 1px solid transparent;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.menu-item:hover::before {
    transform: scaleY(1);
}

.menu-icon {
    font-size: 20px;
    margin-right: 12px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.menu-text {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
}

.menu-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    font-size: 18px;
    color: #667eea;
}

.menu-item:hover {
    background: rgba(52, 73, 94, 0.6);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-item:hover .menu-icon {
    transform: scale(1.2) rotate(5deg);
}

.menu-item:hover .menu-arrow {
    opacity: 1;
    transform: translateX(0);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.menu-item.active::before {
    transform: scaleY(1);
}

.menu-item.active .menu-icon {
    transform: scale(1.15);
}

.menu-item.active .menu-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Footer da Sidebar */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 31, 53, 0.8) 100%);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    pointer-events: none;  /* [BUG FIX #4] Não bloquear cliques nos menus acima */
}

.version-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(52, 73, 94, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    pointer-events: none;  /* [BUG FIX #4.1] Herdar pointer-events do pai */
}

.version-icon {
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    pointer-events: none;  /* [BUG FIX #4.1] Herdar pointer-events do pai */
}

.version-text {
    font-size: 12px;
    font-weight: 600;
    color: rgba(236, 240, 241, 0.7);
    letter-spacing: 1px;
    pointer-events: none;  /* [BUG FIX #4.1] Herdar pointer-events do pai */
}

/* Content Area */
.content {
    margin-left: 280px;
    margin-top: 70px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    min-height: calc(100vh - 70px);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section h2 {
    color: #333;
    font-size: 1.8em;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: gradientSlide 3s ease infinite;
}

@keyframes gradientSlide {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(102, 126, 234, 0.3);
}

.stat-card h3 {
    color: #5a6c7d;
    font-size: 0.85em;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 2.2em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-subtitle {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 8px;
}

/* Stat Card Color Variations */
.stat-card.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.stat-card.blue h3,
.stat-card.blue .stat-subtitle {
    color: rgba(255, 255, 255, 0.95);
}
.stat-card.blue .stat-value {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card.blue::before {
    background: rgba(255, 255, 255, 0.2);
}

.stat-card.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.stat-card.green h3,
.stat-card.green .stat-subtitle {
    color: rgba(255, 255, 255, 0.95);
}
.stat-card.green .stat-value {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card.green::before {
    background: rgba(255, 255, 255, 0.2);
}

.stat-card.purple {
    background: linear-gradient(135deg, #9D50BB 0%, #6E48AA 100%);
}
.stat-card.purple h3,
.stat-card.purple .stat-subtitle {
    color: rgba(255, 255, 255, 0.95);
}
.stat-card.purple .stat-value {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card.purple::before {
    background: rgba(255, 255, 255, 0.2);
}

.stat-card.teal {
    background: linear-gradient(135deg, #1CB5E0 0%, #000851 100%);
}
.stat-card.teal h3,
.stat-card.teal .stat-subtitle {
    color: rgba(255, 255, 255, 0.95);
}
.stat-card.teal .stat-value {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card.teal::before {
    background: rgba(255, 255, 255, 0.2);
}

.stat-card.yellow-pink {
    background: linear-gradient(135deg, #F7971E 0%, #FFD200 100%);
}
.stat-card.yellow-pink h3,
.stat-card.yellow-pink .stat-subtitle {
    color: rgba(0, 0, 0, 0.85);
}
.stat-card.yellow-pink .stat-value {
    background: linear-gradient(135deg, #d35400 0%, #c0392b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card.yellow-pink::before {
    background: rgba(0, 0, 0, 0.1);
}

.stat-card.pink {
    background: linear-gradient(135deg, #FF6B9D 0%, #C06C84 100%);
}
.stat-card.pink h3,
.stat-card.pink .stat-subtitle {
    color: rgba(255, 255, 255, 0.95);
}
.stat-card.pink .stat-value {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card.pink::before {
    background: rgba(255, 255, 255, 0.2);
}

.stat-card.orange {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
}
.stat-card.orange h3,
.stat-card.orange .stat-subtitle {
    color: rgba(255, 255, 255, 0.95);
}
.stat-card.orange .stat-value {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card.orange::before {
    background: rgba(255, 255, 255, 0.2);
}

.stat-card.red {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
}
.stat-card.red h3,
.stat-card.red .stat-subtitle {
    color: rgba(255, 255, 255, 0.95);
}
.stat-card.red .stat-value {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card.red::before {
    background: rgba(255, 255, 255, 0.2);
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* CORRIGIDO: Força larguras fixas */
}

.data-table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333; /* CORRIGIDO: Texto mais escuro para melhor contraste */
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap; /* Evita quebra de linha no cabeçalho */
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table td {
    padding: 8px; /* REDUZIDO de 12px para 8px - espaçamento vertical menor */
    border-bottom: 1px solid #dee2e6;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3; /* Reduzido para compactar mais */
}

/* CORRIGIDO: Larguras ajustadas para 15 colunas (incluindo OC) */
.data-table th:nth-child(1),  /* Número */
.data-table td:nth-child(1) { width: 3.5%; }

.data-table th:nth-child(2),  /* OC - NOVA COLUNA */
.data-table td:nth-child(2) { width: 3.5%; font-size: 12px; }

.data-table th:nth-child(3),  /* Data */
.data-table td:nth-child(3) { width: 5%; }

.data-table th:nth-child(4),  /* Comprador */
.data-table td:nth-child(4) { width: 7%; }

.data-table th:nth-child(5),  /* Cliente */
.data-table td:nth-child(5) { width: 7%; }

.data-table th:nth-child(6),  /* Vendedor */
.data-table td:nth-child(6) { width: 7%; }

.data-table th:nth-child(7),  /* Produto */
.data-table td:nth-child(7) { width: 5%; }

.data-table th:nth-child(8),  /* Sacas NF */
.data-table td:nth-child(8) { width: 4%; }

.data-table th:nth-child(9),  /* Peso */
.data-table td:nth-child(9) { width: 5%; }

.data-table th:nth-child(10), /* Valor Unitário */
.data-table td:nth-child(10) { width: 5%; }

.data-table th:nth-child(11), /* Valor Total */
.data-table td:nth-child(11) { width: 5%; }

.data-table th:nth-child(12), /* Saldo Dev. */
.data-table td:nth-child(12) { width: 5%; }

.data-table th:nth-child(13), /* Status */
.data-table td:nth-child(13) { width: 6%; }

.data-table th:nth-child(14), /* Entrega */
.data-table td:nth-child(14) {
    width: 8%;
    white-space: normal; /* Permite quebra de linha */
}

.data-table th:nth-child(15), /* Ações - AGORA É A 15ª COLUNA */
.data-table td:nth-child(15) { width: 24%; /* Aumentado para caber os botões */ }

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Destaque para coluna Cliente (Dono do Café) */
.cliente-destaque {
    font-weight: bold;
    color: #2563eb;
    background-color: #eff6ff;
    border-left: 3px solid #2563eb;
    padding-left: 15px !important;
}

/* Filters */
.filters {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

.filters select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Centralização FORTE para modal de margem */
#modalMargem.active {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    justify-content: center !important;
    align-items: center !important;
    align-content: center !important;
    z-index: 10000 !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    background-color: rgba(0,0,0,0.6) !important;
    backdrop-filter: blur(5px);
}

/* Força centralização do conteúdo do modal de margem */
#modalMargem.active .modal-content {
    margin: 0 auto !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: translate(0, 0) !important;
    float: none !important;
}

/* Centralização específica e FORTE para modal de contrato */
#contractModal.active {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    justify-content: center !important;
    align-items: center !important;
    align-content: center !important;
    z-index: 1000 !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

/* Força centralização do conteúdo do modal */
.modal.active .modal-content {
    margin: 0 auto !important;
}

#contractModal.active .modal-content,
#contractModal.active .modal-content.modal-large {
    margin: 0 auto !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: translate(0, 0) !important;
    float: none !important;
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Remover scroll daqui */
}

.modal-large {
    max-width: 1300px !important;
    width: 95% !important;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal form {
    padding: 20px;
    padding-bottom: 20px; /* CORRIGIDO: Espaço normal (os botões não são mais sticky) */
    flex: 1;
    overflow-y: auto; /* Mover scroll para cá */
    display: flex;
    flex-direction: column;
}

/* Status Badge - CORRIGIDO para melhor contraste */
.status-badge {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    min-width: 100px;
    text-align: center;
    border: 1px solid transparent;
}

.status-contrato_pronto {
    background-color: #28a745; /* CORRIGIDO: Verde mais escuro */
    color: #ffffff; /* Texto branco para melhor contraste */
    border-color: #1e7e34;
}

.status-fase_entrega {
    background-color: #007bff; /* CORRIGIDO: Azul mais forte */
    color: #ffffff;
    border-color: #0056b3;
}

.status-aguardando_conferencia {
    background-color: #ffc107; /* CORRIGIDO: Amarelo mais intenso */
    color: #000000; /* Texto preto para melhor contraste */
    border-color: #e0a800;
}

.status-divergencia {
    background-color: #dc3545; /* CORRIGIDO: Vermelho mais forte */
    color: #ffffff;
    border: 2px solid #bd2130;
    font-weight: bold;
    animation: pulse-divergencia 2s ease-in-out infinite;
}

@keyframes pulse-divergencia {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 8px 4px rgba(220, 53, 69, 0.2);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.status-saldo_a_receber {
    background-color: #28a745; /* CORRIGIDO: Verde escuro */
    color: #ffffff;
    border-color: #1e7e34;
}

.status-pago {
    background-color: #218838; /* CORRIGIDO: Verde ainda mais escuro */
    color: #ffffff;
    font-weight: bold;
    border-color: #1e7e34;
}

.status-atrasado {
    background-color: #dc3545; /* CORRIGIDO: Vermelho forte */
    color: #ffffff;
    border-color: #bd2130;
    font-weight: bold;
}

.status-finalizado {
    background-color: #17a2b8; /* CORRIGIDO: Azul ciano mais escuro */
    color: #ffffff;
    border-color: #117a8b;
}

.status-cancelado {
    background-color: #6c757d; /* CORRIGIDO: Cinza médio */
    color: #ffffff;
    border-color: #545b62;
}

/* Calculation Preview */
.calculation-preview {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.calculation-preview h3 {
    margin-bottom: 10px;
    color: #666;
}

.calculation-preview p {
    margin: 5px 0;
    font-size: 14px;
}

/* Estilos para Extrato do Contrato */
.contract-header {
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

/* NOVO DESIGN MELHORADO DO EXTRATO */
.contract-header-enhanced {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-top h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
}

.contract-number-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.header-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-card-icon {
    font-size: 24px;
}

.info-card-content {
    display: flex;
    flex-direction: column;
}

.info-card-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.info-card-value {
    font-size: 16px;
    font-weight: bold;
}

.status-badge-enhanced {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.section-title-enhanced {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.section-title-enhanced.gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    border: none;
    margin-top: 30px;
}

.section-icon {
    font-size: 24px;
}

.section-title-enhanced h3 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.section-title-enhanced.gradient h3 {
    color: white;
}

.section-subtitle {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.parties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.party-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.party-type {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.party-name {
    font-size: 16px;
    color: #2c3e50;
    font-weight: bold;
}

.product-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.product-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.product-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.product-label {
    color: #666;
    font-weight: 600;
}

.product-value {
    color: #2c3e50;
    font-weight: bold;
}

.product-value.highlight {
    color: #667eea;
    font-size: 18px;
}

.values-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
}

.value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.value-row:last-child {
    border-bottom: none;
}

.value-row.total {
    padding: 15px 0;
    margin-top: 10px;
    border-top: 2px solid #667eea;
    border-bottom: 2px solid #667eea;
}

.value-row.saldo {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.value-label {
    color: #666;
    font-weight: 600;
    font-size: 14px;
}

.value-amount {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.value-amount.negative {
    color: #dc3545;
}

.value-amount.positive {
    color: #28a745;
}

.value-amount.total {
    color: #667eea;
    font-size: 20px;
}

.value-amount.saldo {
    color: #856404;
    font-size: 20px;
}

.acrescimos-section {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #b8daff;
}

.acrescimos-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #b8daff;
}

.acrescimo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #d1ecf1;
}

.acrescimo-item:last-child {
    border-bottom: none;
}

.acrescimo-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.acrescimo-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: #28a745;
    color: white;
}

.acrescimo-status.pendente {
    background: #ffc107;
}

.acrescimo-value {
    text-align: right;
}

.acrescimo-value strong {
    display: block;
    color: #004085;
    font-size: 18px;
}

/* Estilos antigos mantidos para compatibilidade */
.contract-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.info-label {
    font-weight: bold;
    color: #666;
}

.payment-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.payment-table th {
    background-color: #2c3e50;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.payment-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
}

.payment-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.payment-table tr:hover {
    background-color: #e9ecef;
}

.total-row {
    font-weight: bold;
    background-color: #e8f4f8 !important;
    border-top: 2px solid #2c3e50;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
}

@media print {
    .modal-footer,
    .modal-header .close {
        display: none;
    }

    .modal,
    .modal-content {
        position: static;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
    }
}

.calculation-preview span {
    font-weight: bold;
    color: #667eea;
}

/* Error Message */
.error-msg {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: none; /* Escondido por padrão */
    animation: slideDown 0.3s ease-out;
}

.error-msg:not(:empty) {
    display: block; /* Mostrar quando tiver conteúdo */
}

.error-msg::before {
    content: "⚠️ ";
    margin-right: 6px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success Message */
.success-msg {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: none; /* Escondido por padrão */
    animation: slideDown 0.3s ease-out;
}

.success-msg:not(:empty) {
    display: block; /* Mostrar quando tiver conteúdo */
}

.success-msg::before {
    content: "✅ ";
    margin-right: 6px;
}

/* ========================================
   MODAL PAGAMENTOS RECEBIDOS - DESIGN MODERNO
   ======================================== */

/* Modal Container */
.pagamentos-modal {
    max-width: 1200px;
    width: 95%;
}

/* Header */
.pagamentos-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

.pagamentos-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.pagamentos-icon {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
}

.pagamentos-subtitle {
    margin: 8px 0 0 40px;
    font-size: 14px;
    opacity: 0.95;
    font-weight: 400;
}

.close-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 120ms ease;
    color: white;
    backdrop-filter: blur(10px);
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.close-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Body */
.pagamentos-body {
    padding: 32px;
    background: #f8f9fa;
}

/* Grid de Cards */
.pagamentos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

/* Cards de Totalizadores */
.pagamento-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 200ms ease;
    position: relative;
    overflow: hidden;
}

.pagamento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 200ms ease;
}

.pagamento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.pagamento-card:hover::before {
    opacity: 1;
}

/* Ícones dos Cards */
.pagamento-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: transform 200ms ease;
}

.pagamento-card:hover .pagamento-card-icon {
    transform: scale(1.1);
}

.pagamento-icon-total {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    color: #667eea;
}

.pagamento-icon-success {
    background: linear-gradient(135deg, #10b98120 0%, #059e6920 100%);
    color: #059e69;
}

.pagamento-icon-warning {
    background: linear-gradient(135deg, #ff980020 0%, #ff6b0020 100%);
    color: #ff6b00;
}

.pagamento-icon-info {
    background: linear-gradient(135deg, #3b82f620 0%, #1e40af20 100%);
    color: #1e40af;
}

/* Conteúdo dos Cards */
.pagamento-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pagamento-card-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.pagamento-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.pagamento-value-success {
    color: #059e69;
}

.pagamento-value-warning {
    color: #ff6b00;
}

/* Seção da Tabela */
.pagamentos-table-section {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.pagamentos-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.pagamentos-table-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagamentos-table-title svg {
    color: #667eea;
}

/* Wrapper da Tabela */
.pagamentos-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
}

/* Tabela */
.pagamentos-table {
    width: 100%;
    border-collapse: collapse;
}

.pagamentos-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e2e8f0;
}

.pagamentos-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.pagamentos-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 120ms ease;
}

.pagamentos-table tbody tr:nth-child(even) {
    background: #f8f9fa40;
}

.pagamentos-table tbody tr:hover {
    background: #f1f5f9;
}

.pagamentos-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: #334155;
    vertical-align: middle;
}

.pagamentos-table td:nth-child(2) {
    font-weight: 600;
    color: #059e69;
    font-size: 15px;
}

/* Badge de Status */
.pagamento-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.pagamento-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.pagamento-badge-warning {
    background: #fed7aa;
    color: #92400e;
}

.pagamento-badge-pending {
    background: #e0e7ff;
    color: #3730a3;
}

/* Empty State */
.pagamentos-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.pagamentos-empty svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

.pagamentos-empty p {
    font-size: 16px;
    margin: 0;
}

/* Footer */
.pagamentos-footer {
    padding: 20px 32px;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    border-radius: 0 0 10px 10px;
}

.btn-close-pagamentos {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 120ms ease;
}

.btn-close-pagamentos:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-close-pagamentos:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.3);
}

.btn-close-pagamentos:active {
    transform: translateY(0);
}

/* Animações de Entrada */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagamentos-modal.active .pagamento-card {
    animation: slideInUp 300ms ease forwards;
}

.pagamentos-modal.active .pagamento-card:nth-child(1) {
    animation-delay: 0ms;
}

.pagamentos-modal.active .pagamento-card:nth-child(2) {
    animation-delay: 50ms;
}

.pagamentos-modal.active .pagamento-card:nth-child(3) {
    animation-delay: 100ms;
}

.pagamentos-modal.active .pagamento-card:nth-child(4) {
    animation-delay: 150ms;
}

/* Responsive - Tablets */
@media (max-width: 1024px) {
    .pagamentos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pagamentos-modal {
        width: 98%;
    }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
    .pagamentos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pagamentos-header {
        padding: 20px;
    }

    .pagamentos-title {
        font-size: 20px;
    }

    .pagamentos-subtitle {
        margin-left: 0;
        font-size: 13px;
    }

    .pagamentos-body {
        padding: 20px;
    }

    .pagamento-card {
        padding: 20px;
    }

    .pagamento-card-value {
        font-size: 24px;
    }

    .pagamentos-table-wrapper {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .pagamentos-table {
        min-width: 800px;
    }

    .pagamentos-footer {
        padding: 16px 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .content {
        margin-left: 200px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
    }
}

/* Autocomplete Styles */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 2px;
}

.suggestion-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f8f9fa;
}

.suggestion-item .suggestion-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.suggestion-item .suggestion-details {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 10px;
}

.suggestion-item .suggestion-bank {
    color: #007bff;
}

.suggestion-item .suggestion-frequency {
    color: #28a745;
    font-weight: 500;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.no-suggestions {
    padding: 12px;
    text-align: center;
    color: #999;
    font-style: italic;
}
