:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: rgba(255, 255, 255, 0.1);
    
    --grad-1: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    --grad-2: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-3: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-4: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transition: all 0.3s ease;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--grad-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    color: #3b82f6;
    -webkit-text-fill-color: initial;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    transform: translateX(5px);
}

.nav-item.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* Social Links */
.social-icon {
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.03);
    text-decoration: none;
}

.social-icon:hover {
    color: white;
    transform: translateY(-3px) scale(1.1);
    background-color: rgba(255, 255, 255, 0.1);
}

.social-icon:hover .fa-whatsapp { color: #25D366; }
.social-icon:hover .fa-instagram { color: #E1306C; }
.social-icon:hover .fa-facebook { color: #1877F2; }
.social-icon:hover .fa-linkedin { color: #0A66C2; }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.top-header {
    height: 80px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-tertiary);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    width: 400px;
    gap: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-size: 0.95rem;
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-icon {
    position: relative;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.notification-icon:hover {
    color: var(--text-primary);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    cursor: pointer;
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
    flex: 1;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.card:hover::after {
    opacity: 1;
}

.gradient-1 { background: var(--grad-1); box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3); }
.gradient-2 { background: var(--grad-2); box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3); }
.gradient-3 { background: var(--grad-3); box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3); }
.gradient-4 { background: var(--grad-4); box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3); }

.card-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: white;
    backdrop-filter: blur(5px);
}

.card-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.card-info p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Middle Section */
.middle-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.charts-section, .admin-section {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.charts-section h3, .admin-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Admin Cards */
.admin-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-card {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background-color: var(--bg-tertiary);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.admin-card:hover {
    background-color: var(--accent-color);
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.admin-icon {
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: white;
    margin-right: 1rem;
}

.admin-card h4 {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: white;
}

.arrow {
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.admin-card:hover .arrow {
    color: white;
    transform: translateX(5px);
}

/* Notifications */
.notification-icon {
    position: relative;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.notif-dropdown.open {
    display: block;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.notif-header span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.notif-header button {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--accent-color);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    padding: 0;
    transition: opacity 0.2s;
}

.notif-header button:hover {
    opacity: 0.7;
}

.notif-list {
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

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

.notif-item:hover {
    background: rgba(255,255,255,0.04);
}

.notif-item.unread {
    background: rgba(59, 130, 246, 0.06);
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
    margin-top: 5px;
    flex-shrink: 0;
}

.notif-item.read .notif-dot {
    background: transparent;
}

.notif-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notif-icon-wrap.chamado  { background: rgba(59,130,246,0.15); color: #3b82f6; }
.notif-icon-wrap.alerta   { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.notif-icon-wrap.sistema  { background: rgba(16,185,129,0.15);  color: #10b981; }

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-body strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-body p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-time {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.notif-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.notif-empty i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Visitor Tracker */
.visitor-tracker {
    cursor: default;
    pointer-events: none;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.visitor-icon {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
}

.visitor-info {
    flex: 1;
}

.visitor-info h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.visitor-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .middle-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
        z-index: 100;
    }
    
    .search-bar {
        width: 100%;
        max-width: 300px;
    }
}
