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

:root {
    --app-vh: 100svh;
    --page-header-h: 64px;
}

/* Search utility class */
.search-hidden {
    display: none !important;
}

/* Mobile/Desktop visibility utilities */
.mobile-only {
    display: none !important;
}

@media (max-width: 1023px) {
    .mobile-only {
        display: block !important;
    }
    
    .mobile-hide {
        display: none !important;
    }
}

tbody tr.search-hidden {
    display: none !important;
}

.data-card.search-hidden {
    display: none !important;
}

.discurso-card.search-hidden {
    display: none !important;
}

.agendamento-externo-card.search-hidden {
    display: none !important;
}

.instalacao-card.search-hidden {
    display: none !important;
}

.congregacao-card.search-hidden {
    display: none !important;
}

.orador-card.search-hidden {
    display: none !important;
}

/* Filtros colapsáveis mobile */
.filtros-toggle-btn {
    display: none;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    gap: 4px;
}

.filtros-toggle-btn:hover {
    background: #5568d3;
}

.filtros-toggle-btn i.fa-filter {
    font-size: 14px;
}

.filtros-toggle-btn i.fa-chevron-down,
.filtros-toggle-btn i.fa-chevron-up {
    font-size: 12px;
}

.filtros-toggle-btn.active i.fa-chevron-down {
    display: none;
}

.filtros-toggle-btn.active i.fa-chevron-up {
    display: inline-block;
}

.filtros-toggle-btn i.fa-chevron-up {
    display: none;
}

@media (max-width: 768px) {
    .filtros-toggle-btn {
        display: inline-flex;
    }
    
    /* Esconder todo o card de filtros quando o conteúdo não está ativo */
    .filtros-card-container {
        display: none;
    }
    
    .filtros-card-container.active {
        display: block;
    }
    
    .filtros-collapsible {
        display: none;
    }
    
    .filtros-collapsible.active {
        display: block;
    }
    
    /* Esconder descrições em mobile */
    .card p.mobile-hide {
        display: none;
    }
    
    /* Botões apenas com ícones em mobile */
    .btn-mobile-icon-only .btn-text,
    .btn-mobile-icon-only small {
        display: none;
    }
    
    .btn-mobile-icon-only {
        padding: 8px 10px !important;
        font-size: 16px;
    }
    
    .btn-mobile-icon-only i {
        margin: 0;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html,
body {
    height: 100%;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1001;
    min-height: 64px;
    overflow: visible;
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    overflow: visible;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 20px;
    transition: background 0.2s, transform 0.2s;
}

.header-logo:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.header h1 {
    font-size: 18px;
    margin: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    overflow: visible;
    position: relative;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    opacity: 0.9;
}

/* User Avatar & Dropdown */
.user-profile-wrapper {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.user-avatar:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.user-avatar:active {
    transform: scale(0.95);
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 320px;
    z-index: 9999 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

/* Historico no modal de agendamentos */
.historico-box {
    background: #f8f9fa;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 10px;
    min-height: 60px;
    max-height: 220px;
    overflow-y: auto;
}

.historico-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.historico-item {
    border-left: 4px solid #ccc;
    background: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
}

.historico-item.ano-atual {
    border-left-color: #dc3545;
}

.historico-item.ano-passado {
    border-left-color: #fd7e14;
}

.historico-item.ano-antigo {
    border-left-color: #ffc107;
}

.historico-texto {
    line-height: 1.4;
}

.historico-empty,
.historico-loading {
    font-size: 13px;
    color: #666;
}

.historico-empty.historico-green {
    color: #28a745;
    border: 1px dashed #28a745;
    border-radius: 6px;
    padding: 8px;
    background: #f2fbf5;
}

.user-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    display: block !important;
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.user-dropdown-header {
    padding: 16px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.user-dropdown-name {
    font-weight: 700;
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.user-dropdown-role {
    font-size: 12px;
    color: #666;
    text-transform: capitalize;
}

.user-dropdown-section {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-section.user-dropdown-impersonate {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
}

.user-dropdown-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-dropdown-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.user-dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 0;
}

.user-dropdown-actions {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.user-dropdown-btn:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.user-dropdown-btn i {
    width: 16px;
    text-align: center;
}

.user-dropdown-btn-danger {
    background: #fff5f5;
    color: #dc3545;
}

.user-dropdown-btn-danger:hover {
    background: #ffe5e5;
}

.user-dropdown-btn-warning {
    background: #fff3cd;
    color: #856404;
}

.user-dropdown-btn-warning:hover {
    background: #ffe8a1;
}

.user-dropdown-btn-purple {
    background: #f3e5f5;
    color: #7b1fa2;
}

.user-dropdown-btn-purple:hover {
    background: #e1bee7;
}

/* Botão voltar no dropdown */
.user-dropdown-back-btn {
    background: none;
    border: none;
    color: #7b1fa2;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.user-dropdown-back-btn:hover {
    background: rgba(123, 31, 162, 0.1);
}

/* Search box inline */
.user-dropdown-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.user-dropdown-search:focus {
    outline: none;
    border-color: #9b59b6;
}

/* Lista de impersonação inline */
.impersonate-list-inline {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 8px 8px 8px;
}

.impersonate-group {
    margin-bottom: 12px;
}

.impersonate-group-header {
    background: #f1f3f5;
    padding: 8px 10px;
    font-weight: 600;
    font-size: 11px;
    color: #495057;
    border-left: 3px solid #9b59b6;
    margin-bottom: 4px;
    border-radius: 0 4px 4px 0;
}

.impersonate-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.impersonate-user-item:hover {
    background: #f8f9fa;
}

.impersonate-user-info {
    flex: 1;
    min-width: 0;
}

.impersonate-user-name {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.impersonate-user-meta {
    font-size: 11px;
    color: #868e96;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.impersonate-user-badge {
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
}

/* Desktop: Esconder avatar, mostrar menu completo */
.user-menu-desktop {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (min-width: 769px) {
    .user-profile-wrapper {
        display: none;
    }
    
    .user-menu-desktop {
        display: flex;
    }
}

/* Mobile: Mostrar apenas avatar, esconder menu desktop */
@media (max-width: 768px) {
    .user-profile-wrapper {
        display: block;
    }
    
    .user-menu-desktop {
        display: none !important;
    }
    
    .user-dropdown {
        right: -8px;
        min-width: 90vw;
        max-width: 90vw;
    }
    
    .user-dropdown::before {
        right: 16px;
    }
}

/* Sidebar - Estrutura base */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f5f5f5;
    color: #667eea;
}

.nav-item.active {
    background: #f0f0ff;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item span {
    font-size: 14px;
}

/* Menu Group e Submenu */
.nav-menu-group {
    position: relative;
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
    font-family: inherit;
}

.nav-toggle:hover {
    background: #f5f5f5;
    color: #667eea;
}

.nav-toggle:focus {
    outline: 2px solid #667eea;
}

.nav-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.nav-toggle i:last-child {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafafa;
}

.nav-submenu.active {
    max-height: 500px;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 50px;
    color: #555;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.nav-subitem:hover {
    background: #f0f0f0;
    color: #667eea;
}

.nav-subitem.active {
    background: #f0f0ff;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 600;
}

.nav-subitem i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* Menu Hambúrguer para Mobile */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    position: relative;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Overlay para menu mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: calc(100vh - 64px);
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Layout principal */
.main-wrapper {
    display: flex;
    flex: 1;
    margin-top: 64px; /* Altura do header */
    min-height: calc(100vh - 64px);
}

.content-area {
    flex: 1;
    overflow-x: hidden;
    min-width: 0;
    background: #f5f5f5;
    overflow-y: visible;
}

/* Desktop: Layout com sidebar integrado */
@media (min-width: 1024px) {
    .sidebar {
        position: relative;
        height: calc(100vh - 64px);
    }
    
    .hamburger {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-wrapper {
        display: flex;
    }
    
    .content-area {
        flex: 1;
        overflow-y: auto;
        overflow-x: visible;
        height: calc(100vh - 64px);
    }
    
    body {
        padding-top: 0;
    }
}

/* Mobile: Menu hambúrguer como overlay */
@media (max-width: 1023px) {
    .hamburger {
        display: flex !important;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-wrapper {
        display: block;
        margin-top: 64px; /* Começar abaixo do header */
    }
    
    .content-area {
        width: 100%;
        margin-top: 0;
        height: auto;
        min-height: calc(100vh - 64px);
    }
    
    .container {
        flex: unset;
        min-height: auto;
        height: auto;
        overflow-y: visible;
        overflow-x: hidden;
    }
    
    body {
        padding-top: 0;
    }
    
    /* Header em mobile: manter layout horizontal */
    .header-content {
        flex-wrap: nowrap;
    }
    
    .header-left {
        flex: 0 0 auto;
    }
    
    .user-menu {
        flex: 1;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

/* Container principal - encostado ao header, com padding lateral */
.container {
    flex: 1;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 15px;
    background: #f5f5f5;
}

@media (min-width: 1024px) {
    .container {
        overflow-y: auto;
    }
}

.card {
    background: white;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 12px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
    font-size: 18px;
}

/* Modal contact items (telefone/email) */
.modal-contact-item {
    margin-bottom: 6px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.modal-contact-item:hover {
    background: #e9ecef;
}

.modal-contact-item strong {
    display: block;
    margin-bottom: 4px;
}

.modal-contact-item .contact-value {
    font-size: 14px;
    color: #666;
}

.modal-contact-item .fa-phone {
    color: #28a745;
    font-size: 18px;
}

.modal-contact-item .fa-envelope {
    color: #667eea;
    font-size: 18px;
}

/* Page header with title and actions */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h2 {
    font-size: 18px;
    margin: 0;
    color: #333;
    font-weight: 600;
}

.page-header h2 i {
    color: #667eea;
    margin-right: 6px;
    font-size: 16px;
}

.page-header h2 small {
    font-size: 13px;
    font-weight: normal;
    color: #666;
}

/* Page description text */
.page-description {
    color: #666;
    margin-bottom: 12px;
    font-size: 13px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

/* Dashboard Card */
.dashboard-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    min-height: 160px;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.dashboard-card-header i {
    font-size: 16px;
}

.dashboard-card-value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    line-height: 1;
}

.dashboard-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.dashboard-card-stats .stat-active {
    color: #28a745;
}

.dashboard-card-stats .stat-active i {
    font-size: 8px;
    margin-right: 4px;
}

.dashboard-card-stats .stat-inactive {
    color: #6c757d;
}

.dashboard-card-stats .stat-inactive i {
    font-size: 8px;
    margin-right: 4px;
    opacity: 0.5;
}

.dashboard-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}

.dashboard-card-footer i {
    font-size: 10px;
    margin-right: 4px;
}

.dashboard-card-footer .badge-danger,
.dashboard-card-footer .badge-warning,
.dashboard-card-footer .badge-info {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
}

.dashboard-card-footer .badge-danger {
    background: #dc3545;
    color: white;
}

.dashboard-card-footer .badge-warning {
    background: #fd7e14;
    color: white;
}

.dashboard-card-footer .badge-info {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dashboard-card {
        min-height: 140px;
        padding: 12px;
    }
    
    .dashboard-card-header {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .dashboard-card-header i {
        font-size: 14px;
    }
    
    .dashboard-card-value {
        font-size: 32px;
        margin-bottom: 8px;
    }
    
    .dashboard-card-stats {
        font-size: 12px;
        gap: 8px;
    }
    
    .dashboard-card-footer {
        font-size: 11px;
        gap: 6px;
    }
}

@media (max-width: 768px) {
    .page-header {
        gap: 6px;
    }
    
    .page-header h2 {
        font-size: 15px;
    }
    
    .page-header h2 i {
        font-size: 14px;
        margin-right: 4px;
    }
}

/* Filtros card container */
.filtros-card-container {
    background: #f8f9fa;
    margin-bottom: 12px;
}

.filtros-card-container.no-margin {
    margin-bottom: 0;
}

/* ========================================
   Base Card Styles (GLOBAL)
   ======================================== */

.base-card {
    background: white;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 3px solid #667eea;
}

/* ========================================
   Specific Card Types (inherits base-card)
   ======================================== */

.data-card {
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Agendamento especial - destaque visual */
.data-card.agendamento-especial {
    background: linear-gradient(135deg, #FFF3CD 0%, #FFF9E6 100%);
    border-left: 4px solid #FFC107;
    position: relative;
}

.data-card.agendamento-especial::before {
    content: "⭐";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.6;
}

.data-card.agendamento-especial:hover {
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.3);
}

.discurso-card {
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.discurso-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.discurso-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.discurso-numero-titulo {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.discurso-numero {
    flex: 0 0 auto;
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    min-width: 50px;
    text-align: center;
}

.discurso-titulo {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
    padding-top: 2px;
}

.discurso-actions-desktop {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex: 0 0 auto;
}

.congregacao-card {
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.congregacao-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.instalacao-card {
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.instalacao-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.congregacao-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.congregacao-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.congregacao-actions a,
.congregacao-actions span {
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
}

.congregacao-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.congregacao-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.congregacao-actions-desktop {
    display: flex;
    gap: 8px;
    align-items: center;
}

.congregacao-nome-circuito {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
}

.congregacao-gps-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.congregacao-gps-icon a {
    color: #fd7e14 !important;
    font-size: 16px;
    text-decoration: none;
}

.congregacao-nome {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    line-height: 1.2;
}

.congregacao-circuito {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.congregacao-contacts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}

.contact-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

.contact-label {
    font-weight: 600;
    color: #333;
    min-width: 40px;
}

.contact-name {
    color: #666;
    flex: 1;
    min-width: 100px;
}

.contact-actions {
    display: flex;
    gap: 6px;
}

.congregacao-horarios {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #f0f7ff;
    border-left: 3px solid #764ba2;
    border-radius: 4px;
}

.horarios-title {
    font-weight: 600;
    color: #333;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.horarios-toggle-btn {
    background: none;
    border: none;
    color: #764ba2;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    transition: transform 0.2s ease;
    display: none;
}

.horarios-toggle-btn:hover {
    color: #5a3678;
}

.horarios-toggle-btn:active {
    transform: scale(0.95);
}

.horarios-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.horarios-content.horarios-collapsed {
    display: none;
}

.horarios-year {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 11px;
}

.year-label {
    font-weight: 600;
    color: #764ba2;
    min-width: 40px;
    padding-top: 2px;
}

.horarios-items {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.horario-item {
    display: flex;
    gap: 4px;
    background: white;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.horario-dia {
    color: #666;
    font-weight: 500;
}

.horario-hora {
    color: #333;
    font-weight: 600;
}

/* Oradores Card Styles */
.orador-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.orador-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.orador-nome-info {
    flex: 1;
    min-width: 0;
}

.orador-nome {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    line-height: 1.3;
}

.orador-congregacao {
    margin-top: 3px;
    font-size: 12px;
    color: #666;
}

.orador-actions-desktop {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.orador-actions-mobile {
    display: none;
    flex: 0 0 auto;
    gap: 8px;
    align-items: center;
}

.orador-agendamentos {
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 8px;
}

.orador-agendamentos .agendamentos-header {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.orador-agendamentos .agendamento-item {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.orador-agendamentos .agendamento-item.realizado {
    color: #28a745;
}

.orador-agendamentos .agendamento-item.passado {
    color: #999;
}

.orador-agendamentos .agendamento-item.pendente {
    color: #667eea;
}

.orador-agendamentos .agendamento-item i {
    font-size: 10px;
    flex-shrink: 0;
}

.orador-agendamentos .agendamento-item .data {
    font-weight: 500;
}

.orador-agendamentos .agendamento-item .discurso,
.orador-agendamentos .agendamento-item .congregacao {
    color: #666;
    font-size: 10px;
}

.orador-agendamentos .agendamentos-mais {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 4px;
}

/* Estilos para cards de Utilizadores */
.utilizador-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.utilizador-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.utilizador-nome-info {
    flex: 1;
    min-width: 0;
}

.utilizador-nome {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.utilizador-username {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.utilizador-congregacao {
    margin-top: 3px;
    font-size: 12px;
    color: #666;
}

.utilizador-actions-desktop {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.utilizador-details {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.agendamento-externo-card {
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding-left: 36px;
    border-left: none;
}

.agendamento-externo-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.agendamento-status-label {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: white;
    z-index: 5;
}

.agendamento-status-label span {
    display: block;
    white-space: normal;
    transform: rotate(-90deg);
    letter-spacing: 1px;
    line-height: 1;
    text-align: center;
}

.agendamento-externo-card.swipe-initialized {
    padding-left: 0;
}

.agendamento-externo-card .swipe-content {
    padding-left: 36px;
    background: transparent;
}

.agendamento-externo-card.confirmado {
    border-left-color: #17a2b8;
    background: #f4fbf6;
}

.agendamento-externo-card.nao-confirmado {
    background: #fff6f6;
}

.agendamento-externo-card.realizado {
    border-left-color: #28a745;
    background: #f8fff9;
}

/* Estilos para widgets do dashboard */
/* Discursos Locais - Widget */
div[style*="overflow-y: auto"] > div.confirmado {
    background: #f4fbf6 !important;
    border-left: 3px solid #17a2b8;
    padding-left: 9px !important;
}

div[style*="overflow-y: auto"] > div.nao-confirmado {
    background: #fff6f6 !important;
    border-left: 3px solid #dc3545;
    padding-left: 9px !important;
}

div[style*="overflow-y: auto"] > div.realizado {
    background: #f8fff9 !important;
    border-left: 3px solid #28a745;
    padding-left: 9px !important;
}

/* Hover states mais específicos */
div[style*="overflow-y: auto"] > div.confirmado[onmouseover] {
    transition: background 0.2s !important;
}

div[style*="overflow-y: auto"] > div.nao-confirmado[onmouseover] {
    transition: background 0.2s !important;
}

div[style*="overflow-y: auto"] > div.realizado[onmouseover] {
    transition: background 0.2s !important;
}

.agendamento-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    min-height: 85px; /* Altura fixa baseada na data */
}

.agendamento-info-main {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.agendamento-date {
    flex-shrink: 0;
    text-align: center;
    min-width: 68px;
    padding: 8px;
    border: 1px solid #eef1f6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
    background: #f9fafc;
}

.agendamento-date-day {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.agendamento-date-month {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agendamento-date-time {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.agendamento-speaker-discourse {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agendamento-orador {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.agendamento-orador i {
    color: #667eea;
    font-size: 14px;
}

.agendamento-orador small {
    font-size: 11px;
    color: #999;
    font-weight: 400;
}

.agendamento-discurso {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #555;
}

.agendamento-discurso i {
    color: #fd7e14;
    font-size: 13px;
}

.agendamento-actions-desktop {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.agendamento-observacoes {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.agendamento-observacoes i {
    color: #667eea;
    font-size: 12px;
    flex-shrink: 0;
}

/* Agendamento info */
.agendamento-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.info-row i {
    color: #667eea;
    width: 14px;
    font-size: 12px;
}

.info-row strong {
    font-weight: 600;
    color: #333;
}

.info-row span {
    color: #666;
}

/* Agendamento badges e actions */
.agendamento-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.agendamento-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Toggle buttons */
.toggle-btn {
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.toggle-btn i {
    font-size: 10px;
}

.toggle-btn.confirmado {
    background: #17a2b8;
    color: white;
}

.toggle-btn.not-confirmado {
    background: #e9ecef;
    color: #666;
}

.toggle-btn.not-confirmado:hover {
    background: #d3d6d9;
}

.toggle-btn.realizado {
    background: #28a745;
    color: white;
}

.toggle-btn.not-realizado {
    background: #e9ecef;
    color: #666;
}

.toggle-btn.not-realizado:hover {
    background: #d3d6d9;
}

/* Card elements for mobile */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.card-date {
    font-weight: 600;
    font-size: 13px;
}

.card-time {
    font-size: 11px;
    color: #666;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.card-info-row {
    display: flex;
    gap: 6px;
    font-size: 12px;
}

.card-info-row i {
    color: #667eea;
    width: 14px;
}

.card-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

/* Tables for agendamentos */
.table-agendamentos {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table-agendamentos thead {
    background: #667eea;
    color: white;
}

.table-agendamentos th {
    padding: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.table-agendamentos td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.table-agendamentos tr:hover {
    background: #f8f9fa;
}

.table-agendamentos tr.realizado {
    background: #f8fff9;
}

.table-agendamentos tr.passado {
    opacity: 0.6;
}

.table-agendamentos .empty-cell {
    color: #999;
    font-style: italic;
}

.table-actions {
    display: flex;
    gap: 4px;
}

.table-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
}

/* ========================================
   Form Modals
   ======================================== */

.form-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.form-modal-backdrop.active {
    display: flex;
}

.form-modal-backdrop .form-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.form-modal h3 {
    margin-top: 0;
    margin-bottom: 0;
}

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

/* Modal generic */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.app-modal.modal-content {
    padding: 0;
    overflow: hidden;
}

.modal-content h3 {
    margin: 0 0 20px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ========================================
   Login & Setup Pages
   ======================================== */

/* Login page */
.login-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
}

/* Login page refresh */
.login-page {
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100svh;
    min-height: 100dvh;
    background:
        radial-gradient(1200px 600px at 15% 10%, rgba(255, 255, 255, 0.16), transparent 60%),
        radial-gradient(900px 500px at 80% 20%, rgba(255, 255, 255, 0.12), transparent 55%),
        linear-gradient(135deg, #2c2b5e 0%, #1b2148 45%, #0f1f3d 100%);
}

.login-page .select-congregation-container {
    position: relative;
    min-height: 100svh;
    min-height: 100dvh;
    padding: calc(24px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
    overflow: hidden;
}

.login-page .select-congregation-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(400px 400px at 85% 80%, rgba(102, 126, 234, 0.25), transparent 65%);
    opacity: 0.9;
    pointer-events: none;
}

.login-page .select-congregation-card {
    position: relative;
    z-index: 1;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 25px 60px rgba(9, 16, 44, 0.45);
}

.login-page .select-congregation-card h1 {
    font-size: 30px;
    letter-spacing: -0.5px;
}

.login-page .select-congregation-card .subtitle {
    font-size: 13px;
    color: #4b4b68;
}

.login-page .form-group label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #5a5a72;
}

.login-page .form-group input {
    font-size: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border-color: #d8ddf4;
    background: #f7f8ff;
}

.login-page .form-group input:focus {
    border-color: #5b6fe8;
    box-shadow: 0 0 0 4px rgba(91, 111, 232, 0.15);
}

.login-page .submit-btn {
    border-radius: 12px;
    font-size: 16px;
    letter-spacing: 0.4px;
}

.login-page .app-footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
}

.login-page .footer-copyright {
    color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 480px) {
    .login-page .select-congregation-container {
        padding: 18px;
    }

    .login-page .select-congregation-card {
        padding: 28px 22px;
    }

    .login-page .select-congregation-card h1 {
        font-size: 26px;
    }
}

/* Selecionar congregação page */
.select-congregation-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.select-congregation-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    padding: 40px;
    max-width: 400px;
    width: 100%;
}

.select-congregation-card h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.select-congregation-card .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.search-select-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-select-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-select-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    pointer-events: none;
}

.search-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.search-select-dropdown.active {
    display: block;
}

.search-select-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.search-select-option:hover {
    background: #f8f9fa;
}

.search-select-option.selected {
    background: #f0f4ff;
    color: #667eea;
    font-weight: 600;
}

.search-select-option-number {
    font-weight: 600;
    color: #333;
}

.search-select-option-name {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.search-select-option-circuit {
    font-size: 11px;
    color: #999;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.user-info {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 13px;
    color: #666;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.menu-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: block;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Cards do dashboard clicáveis */
.dashboard-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.menu-card h3 {
    color: #667eea;
    margin-bottom: 6px;
    font-size: 16px;
}

.menu-card p {
    color: #666;
    font-size: 13px;
    margin: 0;
}

/* Cards de dados para mobile-first design */
.data-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 6px;
}

.data-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    flex: 1;
    min-width: 120px;
}

.data-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* Botões com ícones apenas */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

/* Botões de ação semânticos - apenas ícones coloridos sem background */
.action-icon {
    color: inherit;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 4px;
}

.action-icon:hover {
    background: rgba(0,0,0,0.05);
    transform: scale(1.1);
}

.action-icon.action-view {
    color: #17a2b8;
}

.action-icon.action-edit {
    color: #28a745;
}

.action-icon.action-toggle-active {
    color: #6c757d;
}

.action-icon.action-toggle-inactive {
    color: #28a745;
}

.action-icon.action-delete {
    color: #dc3545;
}

.action-icon.action-phone {
    color: #28a745;
}

.action-icon.action-email {
    color: #667eea;
}

.action-icon.action-navigate {
    color: #fd7e14;
}

.action-icon.action-schedule {
    color: #764ba2;
}

/* Swipe para cards mobile - propriedades já definidas acima */

.swipe-content {
    position: relative;
    background: white;
    transition: transform 0.3s ease;
    z-index: 1;
    width: 100%;
    pointer-events: auto;
    display: inherit;
    flex-direction: inherit;
    align-items: inherit;
    gap: inherit;
}

.data-card.swipe-initialized,
.discurso-card.swipe-initialized,
.congregacao-card.swipe-initialized,
.agendamento-externo-card.swipe-initialized {
    touch-action: pan-y;
}

.swipe-content.swipe-hidden {
    pointer-events: none;
}

.data-card.swiping .swipe-content,
.discurso-card.swiping .swipe-content,
.congregacao-card.swiping .swipe-content {
    transition: none;
}

.swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 10;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.swipe-actions.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.swipe-action {
    width: 60px;
    height: 100%;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    pointer-events: auto;
}

.swipe-action:hover {
    opacity: 0.9;
}

.swipe-action-edit {
    background: #667eea;
}

.swipe-action-toggle {
    background: #ffc107;
    color: #333;
}

.swipe-action-delete {
    background: #dc3545;
}

.swipe-action-impersonate {
    background: #17a2b8;
}

.data-card.swiping {
    user-select: none;
}

.data-card.long-press {
    background: #f0f0f0;
}

/* Desktop: ocultar swipe actions */
@media (min-width: 1024px) {
    .swipe-actions {
        display: none !important;
    }
}

.data-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.data-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    font-size: 13px;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-weight: 600;
    color: #666;
    min-width: 100px;
    max-width: 120px;
    font-size: 12px;
    flex-shrink: 0;
    padding-right: 8px;
}

.data-value {
    color: #333;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    line-height: 1.5;
}

.data-value .badge {
    display: inline-block;
    margin: 2px 0;
}

.data-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

/* Tabelas para desktop (ocultas em mobile por padrão) */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 13px;
    display: none; /* Oculto por padrão (mobile-first) */
}

th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

tr:hover {
    background: #f9f9f9;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn:hover {
    background: #5568d3;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select[multiple] {
    min-height: 120px;
    max-height: 150px;
}

/* Estilo para congregações nos dropdowns de oradores */
.form-group select option {
    padding: 5px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #666;
}

/* Grid inline para formulários */
.form-grid {
    display: grid;
    gap: 10px;
}

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

.form-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsivo para form-grid */
@media (max-width: 1023px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .form-grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: end;
}

.form-inline .form-group {
    flex: 1;
    margin-bottom: 0;
}

.alert {
    padding: 10px 12px;
    border-radius: 5px;
    margin-bottom: 12px;
    font-size: 13px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.alert-info {
    background: #eef;
    color: #33c;
    border: 1px solid #ccf;
}

.congregacoes-list {
    list-style: none;
    margin-top: 15px;
}

.congregacoes-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.congregacoes-list li:last-child {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-ativo {
    background: #28a745;
    color: white;
}

.badge-desativo {
    background: #dc3545;
    color: white;
}

.badge-reativado {
    background: #ffc107;
    color: #333;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

.impersonate-badge {
    background: #ffc107;
    color: #333;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.congregacao-badge {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.actions {
    display: flex;
    gap: 10px;
}

.calendario-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
    overflow: visible;
}

.semana-realizado {
    background: #e8f5e9;
    border-left: 4px solid #28a745;
}

.semana-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* Toasts */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success .toast-icon {
    background: #28a745;
    color: white;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error .toast-icon {
    background: #dc3545;
    color: white;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-warning .toast-icon {
    background: #ffc107;
    color: #333;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info .toast-icon {
    background: #17a2b8;
    color: white;
}

/* Modal de confirmação */
/* Modal de Formulário */
.app-modal-overlay,
.form-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
.app-modal-overlay.show,
    pointer-events: none;
}

.form-modal-overlay.show {
    opacity: 1;
.app-modal,
    pointer-events: auto;
}

.form-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    width: 90%;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);

.app-modal--sm {
    max-width: 420px;
    width: min(92vw, 420px);
}

.app-modal--md {
    max-width: 640px;
    width: min(92vw, 640px);
}

.app-modal--lg {
    max-width: 900px;
    width: min(92vw, 900px);
}

.app-modal--xl {
    max-width: 1100px;
    width: min(94vw, 1100px);
}
    transition: transform 0.3s ease;
    margin: 0 auto;
    max-width: 900px;
    width: min(94vw, 900px);
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
.app-modal-overlay.show .app-modal,
}

.form-modal-header h3 {
    margin: 0;
.app-modal-header,
    font-size: 18px;
    color: #333;
}

.form-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
.app-modal-header h3,
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
.app-modal-close,
    border-radius: 4px;
    transition: background 0.2s;
}

.app-modal-close:hover,
.form-modal-close:hover {
    background: #e0e0e0;
}

.app-modal-body,
.form-modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
}

.app-modal-footer,
.form-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    background: #f9f9f9;
    flex-shrink: 0;
}

.app-modal-footer .btn,
.form-modal-footer .btn {
    margin: 0;
}

.form-modal-footer button {
    white-space: nowrap;
}

/* Responsivo para form-modal em mobile */
@media (max-width: 640px) {
    .app-modal,
    .form-modal {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .app-modal-header,
    .form-modal-header {
        padding: 12px 15px;
        border-radius: 0;
    }
    
    .app-modal-header h3,
    .form-modal-header h3 {
        font-size: 16px;
    }
    
    .app-modal-body,
    .form-modal-body {
        padding: 15px;
    }
    
    .app-modal-body .form-group,
    .form-modal-body .form-group {
        margin-bottom: 12px;
    }
    
    .app-modal-footer,
    .form-modal-footer {
        padding: 10px 15px;
        gap: 8px;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    #viewModalBackdrop.form-modal-backdrop,
    #horariosModalBackdrop.form-modal-backdrop {
        align-items: stretch;
        padding: 0;
        height: var(--app-vh);
    }

    #viewModalBackdrop .form-modal,
    #horariosModalBackdrop .form-modal {
        position: fixed;
        top: calc(var(--page-header-h) + env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        height: calc(var(--app-vh) - var(--page-header-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: none;
    }

    #viewModalBackdrop .form-modal-header,
    #horariosModalBackdrop .form-modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    #viewModalBackdrop .form-modal-body,
    #horariosModalBackdrop .form-modal-body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .form-modal {
        width: 90%;
        max-width: 100%;
    }
    
    .form-modal-body {
        padding: 18px;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 500px;
    width: 80%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s;
    margin: 20px auto;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

/* Styles for new modal-dialog structure */
.modal-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.modal-footer .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.modal h3 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 18px;
}

.modal p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Custom Modal para RDP e outros conteúdos HTML */
.modal-overlay.custom-show {
    z-index: 10002;
    overscroll-behavior: contain;
    --modal-vh: 100svh;
    --page-header-h: 64px;
}

.app-modal-overlay {
    z-index: 10002;
    overscroll-behavior: contain;
    --modal-vh: 100svh;
    --page-header-h: 64px;
}

.modal.custom-modal {
    max-width: 400px;
    width: 90%;
    padding: 0;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.custom-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal.custom-modal .modal-header h3 {
    margin: 0;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.modal.custom-modal .modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.modal.custom-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.modal.custom-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

/* ========================================
   Unified App Modal Layout
   ======================================== */
:root {
    --app-modal-radius: 14px;
    --app-modal-shadow: 0 24px 60px rgba(12, 16, 44, 0.35);
    --app-modal-overlay: rgba(9, 14, 34, 0.55);
    --app-modal-border: #e6e9f2;
    --app-modal-header-bg: #f7f8fb;
    --app-modal-footer-bg: #f9fafc;
}

.app-modal-overlay,
.form-modal-backdrop,
.modal-overlay,
.form-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-modal-overlay);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 20px;
    overscroll-behavior: contain;
    --modal-vh: 100svh;
    --page-header-h: 64px;
}

.app-modal-overlay.show,
.modal-overlay.show,
.modal-overlay.custom-show,
.form-modal-overlay.show,
.form-modal-backdrop.active,
.form-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.form-modal-backdrop {
    display: none;
}

.form-modal-backdrop.active,
.form-modal-backdrop.show {
    display: flex;
}

.app-modal,
.form-modal,
.modal-dialog,
.modal-content,
.modal.custom-modal,
.modal {
    background: #fff;
    border-radius: var(--app-modal-radius);
    box-shadow: var(--app-modal-shadow);
    width: min(92vw, 900px);
    max-height: min(90vh, 900px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-modal--sm {
    max-width: 520px;
}

.app-modal--md {
    max-width: 760px;
}

.app-modal--lg {
    max-width: 980px;
}

.app-modal-header,
.form-modal-header,
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--app-modal-border);
    background: var(--app-modal-header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-modal-header h2,
.app-modal-header h3,
.form-modal-header h3,
.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #222;
}

.app-modal-close,
.form-modal-close,
.modal-close,
.btn-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #7a7a7a;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.app-modal-close:hover,
.form-modal-close:hover,
.modal-close:hover,
.btn-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

.app-modal-body,
.form-modal-body,
.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.app-modal-footer,
.form-modal-footer,
.modal-footer,
.modal-actions {
    padding: 12px 20px;
    border-top: 1px solid var(--app-modal-border);
    background: var(--app-modal-footer-bg);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 768px) {
    .app-modal-overlay,
    .form-modal-backdrop,
    .modal-overlay,
    .form-modal-overlay {
        align-items: stretch;
        padding: 0;
    }

    .app-modal,
    .form-modal,
    .modal-dialog,
    .modal-content,
    .modal.custom-modal,
    .modal {
        width: 100%;
        max-width: 100%;
        height: calc(var(--modal-vh) - var(--page-header-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: none;
        border-radius: 0;
    }

    .app-modal-header,
    .form-modal-header,
    .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .app-modal-body,
    .form-modal-body,
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile adjustments for custom modal */
@media (max-width: 768px) {
    .app-modal-overlay {
        align-items: stretch;
        padding: 0;
        height: var(--modal-vh);
    }

    .app-modal {
        position: fixed;
        top: calc(var(--page-header-h) + env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        width: auto;
        height: calc(var(--modal-vh) - var(--page-header-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: none;
    }

    .app-modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .app-modal-body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .modal-overlay.custom-show {
        align-items: stretch;
        padding: 0;
        height: var(--modal-vh);
    }

    .modal.custom-modal {
        position: fixed;
        top: calc(var(--page-header-h) + env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        width: auto;
        height: calc(var(--modal-vh) - var(--page-header-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: none;
    }
    
    .modal.custom-modal .modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        z-index: 2;
    }
    
    .modal.custom-modal .modal-header h3 {
        font-size: 18px;
    }

    .modal.custom-modal .modal-body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

body.modal-open {
    overflow: hidden;
}

/* Mobile-first responsive design */
/* Por padrão: mostrar cards em todas as resoluções */
.data-list {
    display: grid !important;
    visibility: visible !important;
}

.data-card {
    display: block !important;
    visibility: visible !important;
}

/* Mobile específico (até 768px) */
@media (max-width: 768px) {
    .header h1 {
        font-size: 14px;
    }
    
    .user-menu {
        font-size: 11px;
        gap: 4px;
    }
    
    .user-name, .user-role {
        font-size: 10px;
    }
    
    .header-logo {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    /* Agendamentos mobile */
    .table-agendamentos {
        display: none;
    }
    
    .agendamento-card-mobile {
        display: block; /* Apenas único comportamento mobile, herda resto de .base-card */
    }
    
    .agendamento-externo-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .agendamento-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .agendamento-info-main {
        flex-direction: column;
        gap: 10px;
    }
    
    .agendamento-date {
        text-align: left;
        display: flex;
        gap: 12px;
        align-items: flex-start;
        min-width: auto;
        border: none;
    }
    
    .agendamento-date-day {
        font-size: 16px;
    }
    
    .agendamento-badges {
        flex-direction: row;
    }
    
    .agendamento-actions {
        justify-content: flex-start;
    }
    
    .hamburger {
        width: 26px;
        height: 20px;
    }
    
    .user-name, .user-role {
        font-size: 11px;
    }
    
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 10px 12px;
        margin-bottom: 12px;
    }
    
    .card h2 {
        font-size: 16px;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }
    
    .semana-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .form-inline {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-inline .form-group {
        margin-bottom: 8px;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 15px;
    }
    
    .menu-card {
        padding: 12px;
    }
    
    .menu-card h3 {
        font-size: 15px;
    }
    
    .data-card {
        padding: 10px 12px;
    }
    
    .data-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .data-card-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .data-card-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .data-label {
        min-width: auto;
        max-width: none;
        font-size: 11px;
        width: 100%;
        margin-bottom: 4px;
        padding-right: 0;
        font-weight: 700;
    }
    
    .data-value {
        font-size: 12px;
        width: 100%;
        padding-left: 0;
    }
    
    .data-row {
        flex-direction: column;
        gap: 4px;
        padding: 8px 0;
        border-bottom: 1px solid #e8e8e8;
    }
    
    .data-row:last-child {
        border-bottom: none;
    }
    
    .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .btn-sm {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 5px 8px;
        font-size: 13px;
    }
    
    .form-group textarea {
        min-height: 50px;
    }
    
    .form-group select[multiple] {
        min-height: 80px;
        max-height: 120px;
        font-size: 12px;
    }
    
    .form-grid-2,
    .form-grid-4 {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .alert {
        padding: 8px 10px;
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        top: 10px;
    }
    
    .toast-content {
        padding: 12px 15px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    .actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .semana-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .impersonate-badge,
    .congregacao-badge {
        font-size: 11px;
        padding: 4px 8px;
        margin-right: 6px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 14px;
    }
    
    .card h2 {
        font-size: 15px;
    }
    
    .menu-card h3 {
        font-size: 14px;
    }
    
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 5px 6px;
    }
}

/* Barra de Pesquisa */
.search-bar-container {
    margin-bottom: 15px;
    width: 100%;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.search-bar:focus-within {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #999;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 45px 12px 40px;
    font-size: 14px;
    color: #333;
    background: transparent;
    width: 100%;
}

.search-input::placeholder {
    color: #999;
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.2s;
    z-index: 2;
}

.search-clear:hover {
    color: #667eea;
}

/* Mobile: Barra de pesquisa mais compacta */
@media (max-width: 768px) {
    .search-bar-container {
        margin-bottom: 12px;
    }
    
    .search-bar {
        border-radius: 6px;
    }
    
    .search-input {
        padding: 10px 40px 10px 35px;
        font-size: 16px;
    }
    
    .search-icon {
        left: 10px;
        font-size: 13px;
    }
    
    .search-clear {
        right: 6px;
        padding: 6px;
        font-size: 13px;
    }

    .search-select-input {
        font-size: 16px;
    }
}

/* Select Pesquisável */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-container {
    position: relative;
}

.searchable-select-input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: left !important;
    direction: ltr !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.searchable-select-clear {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 6px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
    transition: color 0.2s;
    border-radius: 4px;
}

.searchable-select-clear:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.searchable-select-clear:active {
    transform: translateY(-50%) scale(0.95);
}

.searchable-select-clear i {
    font-size: 12px;
}

/* Ajustar padding quando há botão de limpar visível */
.searchable-select-container.has-clear .searchable-select-input {
    padding-right: 60px;
}

.searchable-select-container::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    font-size: 12px;
}

.searchable-select-container.open::after {
    content: '\f077';
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 250px;
    min-height: 40px !important;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    margin-top: 4px;
}

.searchable-select-container.open .searchable-select-dropdown {
    display: block;
}

.searchable-select-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}

.searchable-select-item:last-child {
    border-bottom: none;
}

.searchable-select-item:hover,
.searchable-select-item.highlighted {
    background: #f5f5f5;
}

.searchable-select-item.selected {
    background: #f0f0ff;
    color: #667eea;
    font-weight: 600;
}

.searchable-select-no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 12px;
}

/* Agendamento realizado info */
.agendamento-realizado-info {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 8px;
}

/* Mobile: Select pesquisável */
@media (max-width: 768px) {
    .searchable-select-dropdown {
        max-height: 200px;
    }
    
    .searchable-select-item {
        padding: 12px;
        font-size: 14px;
    }
    
    .searchable-select-clear {
        right: 35px;
        padding: 5px 7px;
        font-size: 13px;
    }
    
    .searchable-select-clear i {
        font-size: 13px;
    }
    
    /* Ajustar padding no mobile quando há botão de limpar */
    .searchable-select-container.has-clear .searchable-select-input {
        padding-right: 70px;
    }
}



@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* ============================================
   PÁGINA DE IMPORTAÇÃO DE PLATAFORMAS
   ============================================ */

.import-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.import-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.import-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.import-card-featured {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid #667eea;
}

.import-card-featured:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.import-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px;
}

.import-card-header i {
    font-size: 28px;
}

.import-card-header h3 {
    font-size: 18px;
    margin: 0;
}

.import-card-body {
    padding: 20px;
}

.import-card-body > p {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

.format-info {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.format-info strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 12px;
}

.code-sample {
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #667eea;
    margin: 4px 0;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
}

.compact-list {
    list-style: disc;
    margin: 8px 0 0 18px;
    padding: 0;
}

.compact-list li {
    margin: 4px 0;
    font-size: 12px;
    color: #666;
}

.import-form .form-group {
    margin-bottom: 16px;
}

.import-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.import-form input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed #667eea;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s;
}

.import-form input[type="file"]:hover {
    background: #f0f0ff;
}

.import-form input[type="file"]:focus {
    outline: none;
    border-color: #764ba2;
}

.import-form small {
    display: block;
    margin-top: 6px;
    color: #999;
    font-size: 12px;
}

.import-form .btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.import-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.import-form .btn:active {
    transform: translateY(0);
}

/* Help Section */
.help-section {
    margin-top: 40px;
}

.help-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.help-card h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.help-card h3 i {
    font-size: 20px;
}

.help-content {
    padding: 24px;
}

.help-content h4 {
    color: #333;
    font-size: 14px;
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.help-content h4:first-child {
    margin-top: 0;
}

.help-content ol,
.help-content ul {
    margin: 8px 0 12px 20px;
    color: #666;
    font-size: 13px;
    line-height: 1.8;
}

.help-content li {
    margin-bottom: 6px;
}

.help-content p {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin: 8px 0;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-danger {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.alert-dismissible {
    position: relative;
}

.btn-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-close:hover {
    opacity: 1;
}

/* Page Container */
.page-container {
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .import-sections {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .import-card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .import-card-header h3 {
        font-size: 16px;
    }
    
    .help-content {
        padding: 16px;
    }
}

/* ============================================
   RESUMO DE IMPORTAÇÃO
   ============================================ */

.import-summary-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 40px;
    animation: slideIn 0.3s ease;
}

.summary-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
}

.summary-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-timestamp {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

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

.stat-icon.orador {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.stat-icon.avisos {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.summary-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
    padding: 0 16px;
}

.tab-button {
    background: none;
    border: none;
    padding: 16px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-button:hover {
    color: #333;
    background: #f0f0f0;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.summary-content {
    padding: 20px;
}

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

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

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

.list-container {
    max-height: 500px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fafafa;
    transition: background 0.2s;
}

.list-item:hover {
    background: #f0f0f0;
}

.list-item.avisoitem {
    border-left: 4px solid #ff9800;
    background: #fff9f5;
}

.list-item.agendamento-pendente {
    border-left: 4px solid #ff9800;
    background: #fff8e1;
}

.list-item.agendamento-pendente:hover {
    background: #ffe0b2;
}

.item-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.item-badge.novo {
    background: #c8e6c9;
    color: #2e7d32;
}

.item-badge.atualizado {
    background: #bbdefb;
    color: #1565c0;
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.item-subtitle {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    color: #4caf50;
    display: block;
    margin-bottom: 12px;
}

.empty-state p {
    margin: 0;
}

.summary-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    justify-content: flex-end;
}

.summary-actions .btn {
    padding: 10px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .summary-tabs {
        overflow-x: auto;
        padding: 0;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .list-container {
        max-height: 400px;
    }
    
    .summary-actions {
        flex-direction: column;
        justify-content: stretch;
    }
    
    .summary-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Discursos Cards (estilo similar aos agendamentos)
   ======================================== */

.discurso-numero {
    flex-shrink: 0;
    padding-right: 12px;
    border-right: 1px solid #e9ecef;
    text-align: center;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.numero-display {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.estado-indicator {
    font-size: 8px;
}

.estado-indicator.ativo {
    color: #28a745;
}

.estado-indicator.inativo {
    color: #999;
    opacity: 0.4;
}



.discurso-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.discurso-congregacao {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.discurso-congregacao i {
    color: #999;
    font-size: 10px;
}

.discurso-congregacao span {
    color: #999;
}

.discurso-agendamentos {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.agendamentos-header {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

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

.agendamento-item {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.agendamento-item i {
    font-size: 10px;
    flex-shrink: 0;
}

.agendamento-item.realizado {
    color: #28a745;
}

.agendamento-item.realizado i {
    color: #28a745;
}

.agendamento-item.passado {
    color: #999;
}

.agendamento-item.passado i {
    color: #999;
}

.agendamento-item.pendente {
    color: #667eea;
}

.agendamento-item.pendente i {
    color: #667eea;
}

.agendamento-item .data {
    font-weight: 500;
}

.agendamento-item .orador {
    font-weight: 500;
}

.agendamento-item .congregacao {
    color: #999;
    font-size: 10px;
}

.agendamentos-mais {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 4px;
}

.discurso-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Ajustes para mobile */
@media (max-width: 768px) {
    .discurso-header {
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }
    
    .discurso-numero-titulo {
        gap: 8px;
        flex: 1;
    }
    
    .discurso-numero {
        font-size: 16px;
        min-width: 35px;
    }
    
    .discurso-titulo {
        font-size: 12px;
        line-height: 1.2;
    }
    
    .discurso-info {
        gap: 6px;
    }
    
    .congregacao-card {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    
    .congregacao-info {
        gap: 8px;
    }
    
    .congregacao-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 8px;
        align-items: flex-start;
    }
    
    .agendamento-externo-card {
        flex-direction: column;
        gap: 6px;
        padding-left: 28px;
    }
    
    .agendamento-status-label {
        width: 24px;
        font-size: 8px;
    }
    
    .agendamento-status-label span {
        letter-spacing: 0.5px;
    }

    .agendamento-externo-card.swipe-initialized {
        padding-left: 0;
    }
    
    .agendamento-externo-card .swipe-content {
        padding-left: 28px;
        background: transparent;
    }
    
    .agendamento-header {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .agendamento-info-main {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .agendamento-date {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 56px;
        padding: 4px 6px;
        border: 1px solid #eef1f6;
        border-radius: 6px;
        background: #f9fafc;
    }
    
    .agendamento-date-day {
        font-size: 14px;
    }
    
    .agendamento-date-month {
        font-size: 9px;
    }
    
    .agendamento-date-time {
        font-size: 10px;
    }
    
    .agendamento-speaker-discourse {
        gap: 4px;
        flex: 1;
    }
    
    .agendamento-orador {
        font-size: 12px;
        gap: 6px;
    }
    
    .agendamento-orador i {
        font-size: 12px;
    }
    
    .agendamento-discurso {
        font-size: 11px;
        gap: 6px;
    }
    
    .agendamento-discurso i {
        font-size: 12px;
    }
    
    .congregacao-gps-icon {
        align-self: flex-start;
        padding-top: 0 !important;
    }
    
    .congregacao-contacts {
        padding: 6px;
        gap: 4px;
    }
    
    .contact-line {
        gap: 6px;
        font-size: 11px;
    }
    
    .contact-label {
        min-width: 35px;
    }
    
    .contact-name {
        min-width: 80px;
    }
    
    .contact-actions {
        gap: 4px;
    }
    
    .action-icon {
        padding: 5px !important;
        font-size: 14px !important;
    }
    
    .congregacao-horarios {
        padding: 6px;
        gap: 6px;
    }
    
    .horarios-title {
        font-size: 11px;
    }
    
    .horarios-toggle-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    
    /* Em mobile, horários começam escondidos */
    .horarios-content {
        display: flex;
    }
    
    .horarios-content.horarios-collapsed {
        display: none !important;
    }
    
    .horarios-year {
        gap: 6px;
        font-size: 10px;
    }
    
    .horario-item {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .congregacao-actions,
    .congregacao-actions-desktop,
    .orador-actions-desktop,
    .utilizador-actions-desktop,
    .discurso-actions-desktop,
    .agendamento-actions-desktop {
        display: none !important;
    }
    
    .orador-actions-mobile {
        display: flex !important;
    }
    
    .desktop-action {
        display: none !important;
    }
}

/* ============================================
   APP FOOTER
   ============================================ */
.app-footer {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 12px 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

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

/* Mobile: centrado no footer */
@media (max-width: 768px) {
    .footer-content {
        justify-content: center;
    }
}

.footer-copyright {
    font-size: 11px;
    color: #666;
    padding-left: max(12px, env(safe-area-inset-left));
}

.footer-version {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    background: #e9ecef;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    padding-right: max(12px, env(safe-area-inset-right));
}

/* Adicionar padding ao body para compensar o footer fixo */
body {
    padding-bottom: 50px;
}

/* Mobile ajustes */
@media (max-width: 768px) {
    .app-footer {
        padding: 10px 15px;
    }
    
    .footer-copyright {
        font-size: 10px;
        text-align: center;
        padding-left: 0;
    }
    
    .footer-version {
        font-size: 9px;
        padding: 2px 6px;
        display: none;
    }
    
    body {
        padding-bottom: 45px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        gap: 10px;
    }
    
    .footer-copyright {
        font-size: 9px;
    }
    
    .footer-version {
        font-size: 8px;
    }
}

/* ========================================
   Logs de Mensagens - Timeline & Modal
   ======================================== */

/* Ícone de mensagens com badge */
.action-messages {
    position: relative;
    background-color: #667eea !important;
    color: white !important;
}

.action-messages:hover {
    background-color: #5568d3 !important;
}

.action-messages .badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Quick Actions Mobile (dentro da área de observações) */
.agendamento-observacoes-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.agendamento-observacoes {
    flex: 0 0 80%;
    font-size: 13px;
    color: #666;
}

.agendamento-quick-actions-mobile {
    display: none; /* Esconde em desktop */
    flex: 0 0 20%;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Mobile only wrapper: esconde em desktop */
.agendamento-observacoes-wrapper.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .agendamento-observacoes-wrapper {
        flex-direction: row;
        align-items: center;
    }
    
    .agendamento-observacoes {
        flex: 0 0 80%;
        font-size: 12px;
    }
    
    .agendamento-quick-actions-mobile {
        display: flex;
        flex: 0 0 20%;
        justify-content: flex-end;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .agendamento-observacoes-wrapper.mobile-only {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .btn-quick-action {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .agendamento-actions-desktop {
        display: none !important; /* Esconde botões desktop em mobile */
    }
}

.btn-quick-action {
    padding: 0;
    border: none;
    background: none;
    color: #667eea;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-quick-action:active {
    transform: scale(0.9);
    color: #5568d3;
}

.btn-quick-action .badge-mini {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #e74c3c;
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    min-width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1.5px solid white;
}

/* Header do log */
.log-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.log-header h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-header p {
    margin: 4px 0;
    font-size: 13px;
}

.log-header strong {
    font-weight: 600;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #667eea 0%, #e9ecef 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    animation: slideInTimeline 0.4s ease-out forwards;
    opacity: 0;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(n+5) { animation-delay: 0.5s; }

@keyframes slideInTimeline {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-marker {
    position: absolute;
    left: -27px;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: white;
    border: 2.5px solid #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 13px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.timeline-item.success .timeline-marker {
    border-color: #27ae60;
    color: #27ae60;
}

.timeline-item.error .timeline-marker {
    border-color: #e74c3c;
    color: #e74c3c;
}

.timeline-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
    transform: translateY(-1px);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}

.evento-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
}

.tipo-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.tipo-badge.telegram {
    background: #0088cc;
    color: white;
}

.tipo-badge.sms {
    background: #27ae60;
    color: white;
}

.timeline-body {
    margin: 10px 0;
}

.destinatario {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 8px;
}

.mensagem-preview {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border-left: 2.5px solid #667eea;
    font-size: 12px;
    line-height: 1.5;
    color: #495057;
    max-height: 120px;
    overflow-y: auto;
}

.timeline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    font-size: 11px;
}

.timeline-footer .data {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-footer .status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
}

.timeline-footer .status.status-success {
    background: #d4edda;
    color: #155724;
}

.timeline-footer .status.status-error {
    background: #f8d7da;
    color: #721c24;
}

.confirmacao-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.no-logs {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-logs p {
    margin-top: 15px;
    font-size: 16px;
}

/* Responsividade */
@media (max-width: 768px) {
    .timeline {
        padding-left: 30px;
    }
    
    .timeline::before {
        left: 15px;
    }
    
    .timeline-marker {
        left: -25px;
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .log-header {
        padding: 15px;
    }
    
    .log-header h3 {
        font-size: 16px;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

