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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dashboard-active {
    background: #f5f5f5;
    display: block;
    align-items: initial;
    justify-content: initial;
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-sizing: border-box;
}

/* Container para dashboards */
.dashboard-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.main-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.login-container, .register-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    animation: slideUp 0.5s ease-out;
}

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

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.logo p {
    color: #666;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.register-link,
.login-link {
    text-align: center;
    margin-top: 20px;
}

.register-link p,
.login-link p {
    color: #666;
    font-size: 0.9rem;
}

.register-link a,
.login-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover,
.login-link a:hover {
    text-decoration: underline;
}

/* Estilos para as páginas internas */
.dashboard {
    display: block;
    background: #f5f5f5;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.header h1 {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Estilos específicos do Cliente */
.client-dashboard {
    display: grid;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.status-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.status-title {
    font-size: 1.5rem;
    color: #333;
}

.status-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-waiting {
    background: #fff3cd;
    color: #856404;
}

.status-progress {
    background: #cce5ff;
    color: #004085;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.request-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.request-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Estilos específicos do Segurança */
.security-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chat-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: 500px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.message {
    margin-bottom: 1rem;
    padding: 10px;
    border-radius: 8px;
}

.message.client {
    background: #e3f2fd;
    text-align: left;
}

.message.security {
    background: #f3e5f5;
    text-align: right;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
}

.chat-input button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.queue-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.queue-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.queue-item.active {
    background: #e3f2fd;
    border-color: #2196f3;
}

.btn-accept {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-complete {
    background: #ffc107;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

/* Estilos específicos do Admin */
.admin-dashboard {
    display: grid;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.admin-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.admin-card .number {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.config-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.config-section {
    margin-bottom: 2rem;
}

.config-section h3 {
    color: #333;
    margin-bottom: 1rem;
}

.user-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.btn-edit, .btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-approve {
    background: #28a745;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
}

.btn-reject {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
}

.btn-edit:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.report-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.report-buttons button {
    flex: 1;
    min-width: 150px;
}

.btn-complete {
    background: #ffc107;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-complete:hover {
    background: #e0a800;
}

/* Estilos dos Modais */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

.gps-modal .modal-content {
    max-width: 800px;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    background: #f8f9fa;
    padding: 20px 30px;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

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

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .security-dashboard {
        grid-template-columns: 1fr;
    }
    
    .admin-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .gps-modal .modal-content {
        max-width: 95%;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .admin-dashboard {
        padding: 1rem;
    }
    
    .config-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .user-item div {
        width: 100%;
    }
    
    .user-item div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .user-item button {
        flex: 1;
        min-width: 80px;
        font-size: 0.85rem;
        padding: 5px 10px;
    }
    
    .report-buttons {
        flex-direction: column;
    }
    
    .report-buttons button {
        width: 100%;
    }
    
    .status-card {
        margin-bottom: 1rem;
    }
    
    .client-dashboard {
        padding: 1rem;
    }
    
    .queue-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .queue-item button {
        width: 100%;
        align-self: stretch;
    }
    
    .chat-messages {
        height: 200px;
    }
    
    .chat-input {
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-input input {
        width: 100%;
    }
    
    .chat-input button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-cards {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 98%;
        margin: 1% auto;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-logout {
        width: 100%;
    }
    
    .login-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px;
        font-size: 1rem;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 320px) {
    .container {
        padding: 0.5rem;
    }
    
    .admin-dashboard,
    .client-dashboard,
    .security-dashboard {
        padding: 0.5rem;
    }
    
    .status-card {
        padding: 1rem;
    }
    
    .config-section {
        padding: 1rem;
    }
    
    .user-item {
        padding: 0.5rem;
    }
    
    .queue-item {
        padding: 0.5rem;
    }
}

/* Ajustes para evitar overflow */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

.main-content {
    max-width: 100%;
    overflow-x: hidden;
}

.admin-dashboard,
.client-dashboard,
.security-dashboard {
    max-width: 100%;
    overflow-x: hidden;
}

.config-container {
    max-width: 100%;
    overflow-x: hidden;
}

.user-list,
#recentRequests {
    max-width: 100%;
    overflow-x: auto;
}

/* Ajustes para modais em mobile */
@media (max-height: 600px) {
    .modal-content {
        margin: 1% auto;
        max-height: 95vh;
    }
    
    .gps-modal .modal-content {
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    #mapContainer {
        height: 250px !important;
    }
}

/* Ajustes para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .admin-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .config-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-content {
        width: 85%;
        max-width: 700px;
    }
}

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

/* Ajustes para modo paisagem em mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        margin: 1% auto;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    #mapContainer {
        height: 200px !important;
    }
}

/* Notificação de Sincronização */
.sync-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.sync-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

.sync-content h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.3rem;
    text-align: center;
}

.sync-content p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
}

.sync-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.sync-option {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
}

.sync-option:nth-child(2) {
    border-left-color: #ffc107;
}

.sync-option:nth-child(3) {
    border-left-color: #dc3545;
}

.sync-option strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.sync-option p {
    margin: 0 0 10px 0;
    font-weight: 500;
}

.sync-option ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.sync-option li {
    margin-bottom: 5px;
}

.sync-content button {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.sync-content button:hover {
    transform: translateY(-2px);
}

/* Responsividade da notificação */
@media (max-width: 768px) {
    .sync-content {
        margin: 10px;
        padding: 20px;
        max-width: 95%;
    }
    
    .sync-options {
        gap: 15px;
    }
    
    .sync-option {
        padding: 12px;
    }
    
    .sync-content h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .sync-content {
        margin: 5px;
        padding: 15px;
    }
    
    .sync-options {
        gap: 10px;
    }
    
    .sync-option {
        padding: 10px;
    }
    
    .sync-content h4 {
        font-size: 1rem;
    }
}

/* Notificações de Sincronização */
.offline-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff6b6b;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    max-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

.offline-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.offline-icon {
    font-size: 1.5rem;
}

.offline-text strong {
    display: block;
    margin-bottom: 5px;
}

.offline-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.offline-notification button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 10px;
}

.offline-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    z-index: 9999;
    animation: pulse 2s infinite;
}

.offline-dot {
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    animation: blink 1s infinite;
}

.sync-notification-mini {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideInUp 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-mini-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-icon {
    font-size: 1.2rem;
    animation: spin 2s linear infinite;
}

.sync-message {
    font-size: 0.9rem;
    font-weight: 500;
}

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

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}

/* Botão de sincronização manual */
.sync-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    z-index: 9998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.sync-button:active {
    transform: translateY(0);
}

/* Status de conexão */
.connection-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 10002;
    transition: background 0.3s ease;
}

.connection-status.online {
    background: #28a745;
}

.connection-status.offline {
    background: #dc3545;
}

.connection-status.syncing {
    background: #ffc107;
    animation: pulse 1s infinite;
}

/* Responsividade das notificações */
@media (max-width: 768px) {
    .offline-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .offline-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .sync-notification-mini {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .sync-mini-content {
        justify-content: center;
    }
    
    .offline-indicator {
        top: 10px;
        left: 10px;
        font-size: 0.8rem;
    }
    
    .sync-button {
        bottom: 10px;
        left: 10px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

/* Estilos do Chat Melhorados */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1rem;
    background: #fafafa;
    min-height: 200px;
    max-height: 300px;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    animation: slideInMessage 0.3s ease-out;
}

.message.self {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: 2rem;
    text-align: right;
}

.message.other {
    background: #f1f3f4;
    color: #333;
    margin-right: 2rem;
}

.message.system {
    background: #e3f2fd;
    color: #1976d2;
    text-align: center;
    margin: 0.5rem 0;
    font-style: italic;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.no-messages {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

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

/* Chat Input Melhorado */
.chat-input {
    display: flex;
    gap: 10px;
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

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

.chat-input input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.chat-input button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chat-input button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chat-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Responsividade do Chat */
@media (max-width: 768px) {
    .chat-messages {
        min-height: 150px;
        max-height: 200px;
    }
    
    .message.self {
        margin-left: 1rem;
    }
    
    .message.other {
        margin-right: 1rem;
    }
    
    .chat-input {
        flex-direction: column;
        gap: 8px;
    }
    
    .chat-input input {
        width: 100%;
    }
    
    .chat-input button {
        width: 100%;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .chat-messages {
        min-height: 120px;
        max-height: 150px;
        padding: 0.75rem;
    }
    
    .message {
        margin-bottom: 0.75rem;
        padding: 0.5rem;
    }
    
    .message.self {
        margin-left: 0.5rem;
    }
    
    .message.other {
        margin-right: 0.5rem;
    }
}

/* Notificações de Nuvem */
.cloud-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    max-width: 350px;
    animation: slideInRight 0.3s ease-out;
}

.cloud-notification.offline {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.cloud-notification.fallback {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #333;
}

.cloud-notification.sync {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.cloud-notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cloud-icon {
    font-size: 1.3rem;
}

.cloud-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.cloud-notification button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 8px;
}

.cloud-notification.offline button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cloud-notification.fallback button:hover {
    background: rgba(0, 0, 0, 0.1);
}

.cloud-notification.sync button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Botão de sincronização de nuvem */
.cloud-sync-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
    z-index: 9998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cloud-sync-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.cloud-sync-button:active {
    transform: translateY(0);
}

.cloud-sync-button.syncing {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    animation: pulse 1s infinite;
}

.cloud-sync-button.syncing .sync-icon {
    animation: spin 1s linear infinite;
}

.sync-icon {
    font-size: 1rem;
}

/* Status de conexão com nuvem */
.cloud-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 10002;
    transition: background 0.3s ease;
}

.cloud-status.online {
    background: linear-gradient(90deg, #28a745, #20c997, #28a745);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

.cloud-status.offline {
    background: #dc3545;
}

.cloud-status.syncing {
    background: linear-gradient(90deg, #ffc107, #ffb300, #ffc107);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Responsividade das notificações de nuvem */
@media (max-width: 768px) {
    .cloud-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .cloud-notification-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .cloud-notification button {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .cloud-sync-button {
        bottom: 10px;
        left: 10px;
        font-size: 0.8rem;
        padding: 10px 15px;
    }
    
    .cloud-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .cloud-notification {
        padding: 12px 15px;
    }
    
    .cloud-text {
        font-size: 0.85rem;
    }
    
    .cloud-sync-button {
        bottom: 8px;
        left: 8px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

/* Notificações de Sincronização Real */
.real-sync-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    max-width: 350px;
    animation: slideInRight 0.3s ease-out;
}

.real-sync-notification.offline {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.real-sync-notification.fallback {
    background: linear-gradient(135deg, #fd7e14 0%, #e67e22 100%);
    color: white;
}

.real-sync-notification.sync {
    background: linear-gradient(135deg, #198754 0%, #1e7e34 100%);
    color: white;
}

.real-sync-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.real-sync-icon {
    font-size: 1.3rem;
}

.real-sync-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.real-sync-notification button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 8px;
}

.real-sync-notification button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Botão de sincronização real */
.real-sync-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #198754 0%, #1e7e34 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
    z-index: 9998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.real-sync-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
}

.real-sync-button:active {
    transform: translateY(0);
}

.real-sync-button.syncing {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    animation: pulse 1s infinite;
}

.real-sync-button.syncing .sync-icon {
    animation: spin 1s linear infinite;
}

/* Status de conexão real */
.real-sync-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 10002;
    transition: background 0.3s ease;
}

.real-sync-status.online {
    background: linear-gradient(90deg, #198754, #1e7e34, #198754);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

.real-sync-status.offline {
    background: #dc3545;
}

.real-sync-status.syncing {
    background: linear-gradient(90deg, #ffc107, #ffb300, #ffc107);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

/* Indicador de dispositivos conectados */
.connected-devices {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(25, 135, 84, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connected-devices .device-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.connected-devices .device-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Responsividade das notificações reais */
@media (max-width: 768px) {
    .real-sync-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .real-sync-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .real-sync-notification button {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .real-sync-button {
        bottom: 10px;
        left: 10px;
        font-size: 0.8rem;
        padding: 10px 15px;
    }
    
    .connected-devices {
        top: 5px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .real-sync-notification {
        padding: 12px 15px;
    }
    
    .real-sync-text {
        font-size: 0.85rem;
    }
    
    .real-sync-button {
        bottom: 8px;
        left: 8px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }
    
    .connected-devices {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

/* Notificações de Sincronização Local */
.local-sync-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    max-width: 350px;
    animation: slideInRight 0.3s ease-out;
}

.local-sync-notification.sync {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
}

.local-sync-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.local-sync-icon {
    font-size: 1.3rem;
}

.local-sync-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.local-sync-notification button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 8px;
}

.local-sync-notification button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Indicador de modo local */
.local-mode-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(111, 66, 193, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.local-mode-indicator .mode-dot {
    width: 8px;
    height: 8px;
    background: #ffc107;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.local-mode-indicator .mode-text {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Responsividade das notificações locais */
@media (max-width: 768px) {
    .local-sync-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .local-sync-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .local-sync-notification button {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .local-mode-indicator {
        top: 5px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .local-sync-notification {
        padding: 12px 15px;
    }
    
    .local-sync-text {
        font-size: 0.85rem;
    }
    
    .local-mode-indicator {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}
