/* ============================================
   SEERVUS - Sistema de Gestão de Voluntários
   Tema Escuro com detalhes em Laranja
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), #ea580c);
    border-radius: 10px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #fb923c, var(--accent));
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-primary);
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-light: rgba(249, 115, 22, 0.2);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --border: #334155;
    --border-light: #475569;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ============================================
   LAYOUT
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
}

.sidebar-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f97316, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.sidebar-user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--accent);
    font-size: 1.1rem;
}

.sidebar-user-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-user-info span {
    font-size: 0.75rem;
    color: var(--accent);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-section {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.75rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: 10px;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* ============================================
   COMPONENTES
   ============================================ */

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge-warning {
    background: rgba(234, 179, 8, 0.2);
    color: var(--warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-card-icon.orange {
    background: var(--accent-light);
    color: var(--accent);
}

.stat-card-icon.green {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.stat-card-icon.blue {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.stat-card-icon.purple {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple);
}

.stat-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Ministry Cards Grid */
.ministry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ministry-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.ministry-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.ministry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ministry-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.ministry-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ministry-card-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ministry-card-actions {
    display: flex;
    gap: 0.5rem;
}

.ministry-card-actions button {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.ministry-card-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: var(--warning);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 1rem;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f97316, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-card p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    padding: 0 1rem;
}

/* ============================================
   GRID HELPERS
   ============================================ */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 1rem 0.5rem;
    }
    
    .sidebar-logo h1,
    .sidebar-user-info,
    .sidebar-nav-section,
    .sidebar-nav span {
        display: none;
    }
    
    .sidebar-nav a {
        justify-content: center;
        padding: 0.75rem;
    }
    
    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Cards de eventos - mobile */
    .card {
        padding: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    /* Lista de eventos - espaçamento mobile */
    .event-item,
    [style*="display: flex"][style*="gap: 1rem"] {
        flex-wrap: wrap;
        gap: 0.75rem !important;
    }
    
    /* Títulos e textos mais legíveis no mobile */
    .card-title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    /* Badges e botões não quebrem linha */
    .badge {
        white-space: nowrap;
        font-size: 0.7rem;
    }
    
    /* Botões de ação em eventos */
    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Responsivo extra para telas pequenas */
@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
    }
    
    /* Próximos eventos no dashboard */
    .upcoming-event {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    /* Card de evento inline */
    [style*="display: flex"][style*="align-items: center"] > div:first-child {
        min-width: 50px !important;
        width: 50px !important;
        height: 50px !important;
    }
    
    /* Conteúdo do evento */
    [style*="flex: 1"] h4,
    [style*="flex: 1"] h3 {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        word-break: break-word;
    }
    
    [style*="flex: 1"] p {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }
    
    /* Badges menores */
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Tabelas responsivas */
    .table-container {
        overflow-x: auto;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Page header compacto */
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    .page-header p {
        font-size: 0.8rem;
    }
    
    /* Modal mais compacto */
    .modal-overlay {
        padding: 0;
        padding-top: 0.25rem;
        padding-bottom: 80px; /* Espaço para a nav inferior */
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .modal {
        width: 95% !important;
        max-width: 95% !important;
        margin: 0.5rem auto;
        max-height: none;
        overflow: visible;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Stats grid 1 coluna em telas muito pequenas */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Botões de ação em linha */
    [style*="display: flex"][style*="gap: 0.5rem"] {
        flex-wrap: wrap;
    }
}

/* Mobile Bottom Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.5rem 1rem 1rem;
}

.mobile-nav-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.75rem 0.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    transition: all 0.2s;
    min-width: 50px;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active {
    color: var(--accent);
    background: var(--accent-light);
}

.mobile-nav-item:hover {
    color: var(--accent);
}

.mobile-nav-more {
    position: relative;
}

.mobile-nav-popup {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 1rem;
    right: 1rem;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.mobile-nav-popup.show {
    display: block;
    animation: slideUp 0.25s ease-out;
}

.mobile-nav-popup-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.mobile-nav-popup-item:hover,
.mobile-nav-popup-item:active {
    background: var(--bg-hover);
}

.mobile-nav-popup-item i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--accent);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsivo */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding-bottom: 100px;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .ministry-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .app-container {
        padding-top: 0;
    }
}

/* Color Picker */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    height: 45px;
    cursor: pointer;
    border-radius: 10px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 10px;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.avatar-orange {
    background: var(--accent-light);
    color: var(--accent);
}

.avatar-purple {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple);
}

.avatar-green {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.avatar-blue {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

/* ============================================
   MOBILE RESPONSIVO - CARROSSEL E AJUSTES
   ============================================ */

/* Carrossel horizontal para cards no mobile */
.mobile-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    scrollbar-width: none;
}

.mobile-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-scroll > * {
    scroll-snap-align: start;
    flex-shrink: 0;
    min-width: 280px;
    max-width: 85vw;
}

@media (max-width: 768px) {
    /* Dashboard escalas - carrossel */
    .escalas-container,
    .eventos-container,
    .cards-horizontal {
        display: flex;
        gap: 1rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        scrollbar-width: none;
    }
    
    .escalas-container::-webkit-scrollbar,
    .eventos-container::-webkit-scrollbar,
    .cards-horizontal::-webkit-scrollbar {
        display: none;
    }
    
    .escalas-container > .card,
    .eventos-container > .card,
    .cards-horizontal > .card {
        scroll-snap-align: start;
        flex-shrink: 0;
        min-width: 280px;
        max-width: 85vw;
    }
    
    /* Chat responsivo */
    .chat-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 200px);
    }
    
    .chat-sidebar {
        width: 100%;
        max-height: 200px;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .chat-sidebar .channel-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .chat-sidebar .channel-item {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        background: var(--bg-hover);
    }
    
    .chat-sidebar .channel-item.active {
        background: var(--accent);
        color: white;
    }
    
    .chat-main {
        flex: 1;
        min-height: 300px;
    }
    
    .chat-messages {
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .chat-input-container {
        position: sticky;
        bottom: 0;
        background: var(--bg-secondary);
        padding: 1rem;
        border-top: 1px solid var(--border);
    }
    
    .chat-input-container input {
        width: calc(100% - 50px);
    }
    
    /* Calendário - melhorias */
    .calendar-day {
        min-height: 60px;
        cursor: pointer;
        transition: background 0.2s;
    }
    
    .calendar-day:hover {
        background: var(--bg-hover);
    }
    
    .calendar-day.has-event {
        position: relative;
    }
    
    .calendar-day.has-event::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: 6px;
        height: 6px;
        background: var(--accent);
        border-radius: 50%;
    }
}

/* Popup de evento no calendário */
.event-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    min-width: 300px;
    max-width: 90vw;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.event-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.event-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.event-popup-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.event-popup-close:hover {
    color: var(--text-primary);
}
