:root {
    /* Color Palette */
    --bg-main: #0B0E14;
    --bg-surface: #141722;
    --bg-surface-hover: #1A1E2C;
    --bg-card: #151824;
    
    --primary: #5A67D8; /* Blue */
    --primary-hover: #4C51BF;
    --primary-light: rgba(90, 103, 216, 0.15);
    
    --accent-orange: #F6AD55;
    --accent-orange-bg: rgba(246, 173, 85, 0.15);
    
    --accent-cyan: #4FD1C5;
    --accent-cyan-bg: rgba(79, 209, 197, 0.15);
    
    --danger: #F56565;
    --danger-bg: rgba(245, 101, 101, 0.1);
    
    --text-main: #F7FAFC;
    --text-muted: #A0AEC0;
    --text-darker: #718096;
    
    --border-color: #2D3748;
    
    /* Metrics */
    --sidebar-width: 260px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.2s ease-in-out;

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);
    --card-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);

    /* Mural States */
    --mural-orange-bg: rgba(246, 173, 85, 0.05);
    --mural-orange-border: rgba(246, 173, 85, 0.2);
    --mural-orange-text: #F6AD55;
    
    --mural-cyan-bg: rgba(79, 209, 197, 0.05);
    --mural-cyan-border: rgba(79, 209, 197, 0.2);
    --mural-cyan-text: #4FD1C5;
}

/* Scrollbar Global Premium */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fadeIn {
    animation: fadeIn 0.2s ease-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'JetBrains Mono', sans-serif;
    text-transform: uppercase; /* Global Uppercase */
}

/* Exceção para o campo de senha (deve permanecer sensível e visualmente legível) */
input[type="password"] {
    text-transform: none !important;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.keyboard-focus {
    outline: 3px solid var(--primary) !important;
    outline-offset: 4px;
    box-shadow: 0 0 25px rgba(90, 103, 216, 0.5) !important;
    transform: translateY(-5px) scale(1.02) !important;
    z-index: 1000 !important;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==================
   SIDEBAR
   ================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    height: 100dvh; /* Suporte para viewport dinâmica em celulares */
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.logo {
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(90, 103, 216, 0.4);
}

.logo i {
    color: white;
    font-size: 24px;
}

.logo-text h2 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-text p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-title {
    display: block;
    padding: 0 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-darker);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    gap: 12px;
    transition: var(--transition);
    margin: 0 12px;
    border-radius: var(--border-radius-sm);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(13, 138, 188, 0.25) 0%, rgba(13, 138, 188, 0.05) 100%);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    font-weight: 600;
    box-shadow: inset 10px 0 20px -10px rgba(13, 138, 188, 0.3);
}

.nav-item.active i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(13, 138, 188, 0.6));
}

/* Scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px; /* Evita que o nome empurre o boto de sair */
}

.user-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.logout-btn {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.2);
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
}

.logout-btn span {
    font-size: 12px;
}

.logout-btn:hover {
    color: var(--text-main);
}


/* ==================
   MAIN CONTENT
   ================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Header */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    /* For glass effect if scrolling */
    background-color: rgba(11, 14, 20, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 20px;
    gap: 8px;
    width: 250px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: rgba(255,255,255,0.2);
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-main);
    outline: none;
    font-size: 14px;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-darker);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-main);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-main);
}

.current-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 10px;
    line-height: 1.1;
}

.current-time .time {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-base);
    letter-spacing: -0.02em;
}

.current-time .date {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.current-time .date {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}


/* Dashboard Layout */
.dashboard-grid {
    padding: 32px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.main-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.side-column {
    width: 300px;
}

/* Sections */
.section-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.section-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-text {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.link-text:hover {
    text-decoration: underline;
}

/* Cards Grid */
.status-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.status-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: var(--transition);
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.08);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.card-icon.blue-bg {
    background-color: var(--primary-light);
    color: var(--primary);
}

.card-icon.orange-bg {
    background-color: var(--accent-orange-bg);
    color: var(--accent-orange);
}

.card-icon.cyan-bg {
    background-color: var(--accent-cyan-bg);
    color: var(--accent-cyan);
}

.status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.status-badge.blue {
    background-color: var(--primary);
    color: white;
}

.status-badge.orange {
    background-color: var(--accent-orange);
    color: #fff;
}

.status-badge.cyan {
    background-color: var(--accent-cyan);
    color: #000;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.card-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.number {
    font-size: 52px; /* Aumentado de 36px/48px para 52px */
    font-weight: 800;
    line-height: 1;
    font-family: 'JetBrains Mono', 'Outfit', sans-serif;
}

.text-blue { color: var(--primary); }
.text-orange { color: var(--accent-orange); }
.text-cyan { color: var(--accent-cyan); }

.card-value .text {
    font-size: 14px;
    color: var(--text-darker);
}

/* Shortcuts */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.shortcut-btn {
    background-color: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.shortcut-btn i {
    font-size: 24px;
    color: var(--primary);
}

.shortcut-btn span {
    font-size: 14px;
    font-weight: 500;
}

.shortcut-btn:hover {
    background-color: var(--bg-surface-hover);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.shortcut-btn.danger:hover {
    border-color: var(--danger);
    background-color: var(--danger-bg);
}

.shortcut-btn.danger i {
    color: var(--danger);
}


/* Agenda */
.agenda-section {
    background-color: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: var(--border-radius-lg);
    padding: 24px;
}

.agenda-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.agenda-header i {
    font-size: 20px;
    color: var(--text-muted);
}

.agenda-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.agenda-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.agenda-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.agenda-date {
    background-color: var(--bg-main);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.agenda-date .time {
    font-size: 16px;
    font-weight: 700;
}

.agenda-date .min {
    font-size: 12px;
    color: var(--text-muted);
}

.agenda-details h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.agenda-details p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Mobile Menu Button */
.topbar-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none; /* Hidden on desktop */
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        flex-direction: column;
    }
    .side-column {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-menu-btn {
        display: block;
    }
    .topbar {
        padding: 16px 20px;
    }
    .search-box {
        display: none; /* Hide search on mobile header to save space, or make it an icon only */
    }
    .current-time .date {
        display: none; /* Hide date on mobile, show only time */
    }
    .current-time .time {
        font-size: 16px;
    }
    .dashboard-grid {
        padding: 20px;
        gap: 20px;
    }
    .status-cards {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }
}

@media (max-width: 768px) {
    .form-group.row {
        flex-direction: column;
        gap: 16px;
    }
    .form-group.row .input-wrapper.half,
    .form-group.row .form-group {
        width: 100% !important;
    }
    .modal-container {
        margin: 16px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    .modal-header {
        position: sticky;
        top: 0;
        background-color: var(--bg-card);
        z-index: 10;
    }
    .modal-footer {
        position: sticky;
        bottom: 0;
        background-color: var(--bg-card);
        z-index: 10;
        padding: 16px;
    }

    /* Webcam Responsiva */
    .camera-container div[id$="-wrapper"] {
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 4 / 3;
    }
    #webcam, #foto-preview {
        width: 100% !important;
        height: auto !important;
    }
    .shortcuts-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==================
   MODAL
   ================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 14, 20, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

/* Form Styles */
.custom-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.row {
    flex-direction: row;
    gap: 16px;
}

.input-wrapper.half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-form label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.custom-form input,
.custom-form select,
.custom-form textarea {
    background-color: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    width: 100%;
    font-family: inherit;
}

.custom-form input:focus,
.custom-form select:focus,
.custom-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.custom-form select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A0AEC0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary,
.btn-primary {
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* ==================
   CONTATOS MODULE
   ================== */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 32px;
}

.filters {
    display: flex;
    gap: 12px;
}

.filter-btn {
    background-color: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

.filter-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 0 32px 32px;
}

.contact-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.08);
}

.contact-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-size: 1.25rem; /* Aumentado de 16px para ~20px */
    font-weight: 800;    /* Mais negrito */
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.contact-role {
    font-size: 12px;
    color: var(--text-muted);
}

.contact-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.875rem; /* Aumentado de 10px para 14px */
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.contact-badge.morador {
    background: #007bff; /* Azul vibrante sólido */
    color: #ffffff;      /* Branco puro */
}

.contact-badge.funcionario {
    background-color: var(--accent-orange-bg);
    color: var(--accent-orange);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.detail-item i {
    color: var(--text-darker);
    font-size: 16px;
}

.contact-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--text-main);
    padding: 10px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.action-btn.whatsapp {
    background-color: rgba(37, 211, 102, 0.1);
    color: #25D366;
    border-color: rgba(37, 211, 102, 0.2);
}

.action-btn.whatsapp:hover {
    background-color: #25D366;
    color: white;
    border-color: #25D366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

@media (max-width: 768px) {
    .page-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 0 20px;
        margin-top: 20px !important;
    }
    .filters {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .filter-btn {
        white-space: nowrap;
    }
    .contacts-grid {
        padding: 0 20px 20px;
    }
}

/* Interfone Badges */
.interfone-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000 !important;
}

.interfone-badge.aguardar { background-color: #F56565 !important; }
.interfone-badge.dois-toques { background-color: #F6E05E !important; }
.interfone-badge.interfonar { background-color: #48BB78 !important; }
.interfone-badge.sobe-direto { background-color: #FFFFFF !important; border: 1px solid #CCC; }

/* Card Colors based on Interfone */
.contact-card.card-aguardar { background-color: #F56565 !important; border-color: #E53E3E !important; }
.contact-card.card-dois-toques { background-color: #F6E05E !important; border-color: #D69E2E !important; }
.contact-card.card-interfonar { background-color: #48BB78 !important; border-color: #38A169 !important; }
.contact-card.card-sobe-direto { background-color: #FFFFFF !important; border-color: #E2E8F0 !important; }

/* Enforcing Black Text for overall color cards */
.contact-card.card-aguardar *,
.contact-card.card-dois-toques *,
.contact-card.card-interfonar *,
.contact-card.card-sobe-direto * {
    color: #000 !important;
}

/* Adjust Action Buttons on Colored Cards */
.contact-card.card-aguardar .action-btn,
.contact-card.card-dois-toques .action-btn,
.contact-card.card-interfonar .action-btn,
.contact-card.card-sobe-direto .action-btn {
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Botões de Filtro (Pendentes/Histórico) */
.btn-filter {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-filter.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Botão de Baixa no Card */
.btn-baixa {
    background: var(--success);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-baixa:hover { opacity: 0.9; transform: translateY(-1px); }

/* Table Visualization */
.table-container {
    width: 100%;
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.custom-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.badge-conjunto {
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.8rem;
}

/* Ajustes de Impressão */
@media print {
    .sidebar, .topbar, .page-actions, .col-acoes, .close-modal, 
    .logout-btn, .mobile-menu-btn, .search-box, .btn-primary, 
    .btn-secondary, .contact-actions, .mural-pendencias-container {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
    }

    .app-container {
        background: white !important;
    }

    .table-container {
        border: 1px solid #eee !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .custom-table {
        color: #000 !important;
        font-size: 9pt !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .custom-table th {
        background: #f8f9fa !important;
        color: #000 !important;
        border-bottom: 2px solid #333 !important;
    }

    .custom-table td {
        border-bottom: 1px solid #eee !important;
        padding: 6px 8px !important;
    }

    /* Cards em modo Impressão (Grade -> Lista) */
    .contacts-grid {
        display: block !important;
        padding: 0 !important;
    }

    .contact-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 20px !important;
        padding: 10px !important;
        border: 1px solid #eee !important;
        margin-bottom: 10px !important;
        page-break-inside: avoid !important;
        background: white !important;
        box-shadow: none !important;
    }

    .contact-header { margin: 0 !important; flex: 1; }
    .contact-details { flex: 2; border: none !important; padding: 0 !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 15px !important; }

    body {
        background: white !important;
        color: black !important;
    }
}

.unit-badge {
    font-size: 20px !important;
    padding: 10px 18px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* ==========================================
   ESTÉTICA PREMIUM - COMPONENTES GLOBAIS
   ========================================== */

/* Mural de Pendências Padronizado */
.mural-pendencias-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
    animation: slideDown 0.4s ease-out;
}

.mural-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mural-title-wrapper i {
    font-size: 20px;
}

.mural-title-wrapper h3 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-main);
}

.mural-grid-standard {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Badge de Unidade Premium */
.unit-badge-premium {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.unit-badge-premium:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.unit-badge-premium i {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Variação Alerta (Laranja) */
.unit-badge-premium.alerta {
    color: var(--accent-orange);
    border-color: var(--mural-orange-border);
    background: var(--mural-orange-bg);
}
.unit-badge-premium.alerta:hover {
    background: rgba(246, 173, 85, 0.15);
    box-shadow: 0 8px 16px rgba(246, 173, 85, 0.1);
}

/* Variação Novo (Ciano) */
.unit-badge-premium.novo {
    color: var(--accent-cyan);
    border-color: var(--mural-cyan-border);
    background: var(--mural-cyan-bg);
}
.unit-badge-premium.novo:hover {
    background: rgba(79, 209, 197, 0.15);
    box-shadow: 0 8px 16px rgba(79, 209, 197, 0.1);
}

/* Animações */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-subtle {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-badge {
    animation: pulse-subtle 2s infinite ease-in-out;
}

/* Responsividade Mural */
@media (max-width: 768px) {
    .mural-pendencias-container {
        padding: 16px;
        margin: 0 20px 24px 20px;
    }
    .unit-badge-premium {
        padding: 8px 14px;
        font-size: 1rem;
    }
}

/* ==========================================
   DASHBOARD REFINADO - MISSION CONTROL
   ========================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: var(--card-shadow);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--card-accent, var(--primary));
    opacity: 0.8;
    box-shadow: 0 0 15px var(--card-accent, var(--primary));
}

/* Glass Shine Effect */
.glass-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: rotate(45deg);
    transition: 0.8s;
    pointer-events: none;
}

.glass-card:hover::after {
    left: 100%;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--card-accent-bg, var(--primary-light));
    color: var(--card-accent, var(--primary));
    transition: transform 0.3s ease;
}

.glass-card:hover .card-icon {
    transform: scale(1.1) rotate(-5deg);
}

.card-info .card-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
}

.card-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.card-value .number {
    font-size: 36px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    line-height: 1;
    text-shadow: 0 0 20px rgba(255,255,255,0.05);
}

.card-units {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Badge de Unidade Dashboard - Compact High-Density */
.unit-badge-dash {
    background: rgba(255, 255, 255, 0.05);
    color: var(--card-accent);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.unit-badge-dash:hover {
    background: var(--card-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb, 13, 138, 188), 0.3);
}

.glass-card.has-pending {
    border-color: rgba(var(--accent-rgb, 255, 255, 255), 0.4);
    animation: dashboard-pulse 3s infinite ease-in-out;
}

@keyframes dashboard-pulse {
    0% { box-shadow: 0 0 10px rgba(var(--accent-rgb, 255, 255, 255), 0.1); }
    50% { box-shadow: 0 0 30px rgba(var(--accent-rgb, 255, 255, 255), 0.3); }
    100% { box-shadow: 0 0 10px rgba(var(--accent-rgb, 255, 255, 255), 0.1); }
}

/* ==========================================
   PÁGINAS DE AUTENTICAÇÃO (LOGIN / CADASTRO)
   ========================================== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #1a202c, #0a0e14);
    margin: 0;
    overflow: hidden;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.15;
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.auth-container {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 48px;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(13, 138, 188, 0.4));
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 18px;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.auth-input-wrapper:focus-within {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(13, 138, 188, 0.15);
}

.auth-input-wrapper i {
    color: var(--text-muted);
    margin-right: 14px;
    font-size: 20px;
}

.auth-input-wrapper input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 15px;
    width: 100%;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.auth-error {
    color: #F56565;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    background: rgba(245, 101, 101, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(245, 101, 101, 0.2);
}

.auth-success {
    color: #4FD1C5;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    background: rgba(79, 209, 197, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(79, 209, 197, 0.2);
}

/* Pacientes do Dia: Cores por Interfone (Mais fortes com letras pretas) */
.row-interfone-yellow {
    background-color: #f1c40f !important;
    color: #000 !important;
}
.row-interfone-green {
    background-color: #2ecc71 !important;
    color: #000 !important;
}
.row-interfone-blue {
    background-color: #3498db !important;
    color: #000 !important;
}
.row-interfone-red {
    background-color: #e74c3c !important;
    color: #000 !important;
}

/* Garantindo que todo o texto e ícones na linha colorida fiquem pretos */
.row-interfone-yellow td, .row-interfone-yellow td *,
.row-interfone-green td, .row-interfone-green td *,
.row-interfone-blue td, .row-interfone-blue td *,
.row-interfone-red td, .row-interfone-red td * {
    color: #000 !important;
}

.row-interfone-yellow:hover { filter: brightness(0.9); }
.row-interfone-green:hover { filter: brightness(0.9); }
.row-interfone-blue:hover { filter: brightness(0.9); }
.row-interfone-red:hover { filter: brightness(0.9); }



/* ==================
   WINDOW CONTROLS (HOVER)
   ================== */
.window-controls {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, rgba(20, 23, 34, 0.95), rgba(11, 14, 20, 0.98));
    backdrop-filter: blur(10px);
    border-bottom-left-radius: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-100%);
}

.window-controls:hover, 
.window-controls.active {
    opacity: 1;
    transform: translateY(0);
}

/* Área de detecção invisível no topo direito */
.window-controls-trigger {
    position: fixed;
    top: 0;
    right: 0;
    width: 200px;
    height: 40px;
    z-index: 9999;
    background: transparent;
}

.window-controls-trigger:hover + .window-controls {
    opacity: 1;
    transform: translateY(0);
}

.win-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 18px;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.win-min { background: #F6AD55; } /* Orange */
.win-max { background: #4FD1C5; } /* Cyan */
.win-close { background: #F56565; } /* Red */

.win-btn:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
}

.win-btn:active {
    transform: scale(0.9);
}
