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

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 250px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f4f6f9;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 40px;
}

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

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 24px;
}

.login-header p {
    color: var(--secondary-color);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--secondary-color);
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: 60px; /* Espaço para topbar */
}

/* Top Bar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1001;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--dark-color);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: var(--light-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary-color);
    font-size: 14px;
}

.breadcrumb i {
    color: var(--primary-color);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-item {
    position: relative;
}

.topbar-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-color);
    font-size: 16px;
    transition: background 0.3s;
}

.topbar-btn:hover {
    background: var(--light-color);
}

.topbar-btn i {
    font-size: 18px;
}

.badge-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* Avatar */
.avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--light-color);
}

.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.avatar-img-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.perfil-btn {
    padding: 4px 12px;
}

/* Dropdown Menus */
.dropdown.active .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 280px;
    z-index: 1002;
}

.dropdown-menu-notifications {
    min-width: 350px;
    max-height: 450px;
    overflow-y: auto;
}

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

.dropdown-header h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-color);
}

.mark-all-read {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
}

.mark-all-read:hover {
    text-decoration: underline;
}

.dropdown-body {
    padding: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f3f5;
}

.dropdown-item:hover {
    background: var(--light-color);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--secondary-color);
}

.dropdown-item.logout {
    color: var(--danger-color);
    border-top: 1px solid #e9ecef;
}

.dropdown-item.logout i {
    color: var(--danger-color);
}

.dropdown-footer {
    padding: 0;
    border-top: 1px solid #e9ecef;
}

.dropdown-footer a {
    display: block;
    padding: 12px 20px;
    text-align: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.dropdown-footer a:hover {
    background: var(--light-color);
}

/* User Info Dropdown */
.user-info-dropdown {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info-dropdown h6 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.user-info-dropdown p {
    margin: 0;
    font-size: 12px;
    color: var(--secondary-color);
}

.badge-perfil {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--primary-color);
    color: white;
    margin-top: 5px;
}

.badge-small {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    background: var(--danger-color);
    color: white;
    margin-left: auto;
}

/* Notification Items */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f5;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--light-color);
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-item i {
    font-size: 20px;
    color: var(--primary-color);
    margin-top: 2px;
}

.notification-content {
    flex: 1;
}

.notification-content h6 {
    margin: 0 0 5px 0;
    font-size: 13px;
    font-weight: 600;
}

.notification-content p {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: var(--secondary-color);
    line-height: 1.4;
}

.notification-content .time {
    font-size: 11px;
    color: #adb5bd;
}

.no-notifications,
.loading,
.error {
    padding: 30px 20px;
    text-align: center;
    color: var(--secondary-color);
    font-size: 13px;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #2c3e50;
    color: white;
    position: fixed;
    top: 60px; /* Abaixo da topbar */
    left: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    background: #1a252f;
    border-bottom: 1px solid #34495e;
}

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

.user-info {
    font-size: 12px;
    color: #ecf0f1;
}

.user-info .badge {
    background: var(--primary-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 5px;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    border-bottom: 1px solid #34495e;
}

.nav-menu li a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-menu li a:hover {
    background: #34495e;
    padding-left: 25px;
}

.nav-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-section {
    padding: 15px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #95a5a6;
    font-weight: bold;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 0;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
    width: 100%;
}

.container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.page-header h1 {
    font-size: 28px;
    color: var(--dark-color);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--info-color);
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
}

.col-md-2 { flex: 0 0 16.666%; }
.col-md-3 { flex: 0 0 25%; }
.col-md-4 { flex: 0 0 33.333%; }
.col-md-5 { flex: 0 0 41.666%; }
.col-md-6 { flex: 0 0 50%; }
.col-md-8 { flex: 0 0 66.666%; }
.col-md-12 { flex: 0 0 100%; }

.form-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h2 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

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

/* Tables */
.table-responsive {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--light-color);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

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

.data-table .actions {
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

/* Filters */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-form input,
.filter-form select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
}

.filter-form input[type="text"] {
    flex: 1;
    min-width: 200px;
}

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-right: 20px;
}

.stat-info h3 {
    font-size: 28px;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.stat-info p {
    color: var(--secondary-color);
    font-size: 13px;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.dashboard-card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--light-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark-color);
    transition: all 0.3s;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.quick-action-btn i {
    font-size: 32px;
    margin-bottom: 10px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .topbar-left .breadcrumb {
        display: none;
    }
    
    .user-name {
        display: none;
    }
    
    .dropdown-menu {
        right: -10px;
        min-width: 260px;
    }
    
    .dropdown-menu-notifications {
        min-width: 300px;
    }
    
    .sidebar {
        width: 200px;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .topbar {
        padding: 0 10px;
    }
    
    .topbar-right {
        gap: 5px;
    }
    
    .topbar-btn {
        padding: 6px 8px;
    }
    
    .dropdown-menu {
        left: 0;
        right: 0;
        margin: 0 10px;
        width: calc(100% - 20px);
    }
    
    .sidebar {
        width: 100%;
        position: fixed;
        transform: translateX(-100%);
        z-index: 1100;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .container {
        padding: 15px;
    }
}
