:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --info: #2196F3;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid var(--success);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    color: #999;
    font-size: 12px;
    margin: 5px 0;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark) 0%, #1a252f 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.version {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left-color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-info i {
    font-size: 32px;
    color: var(--primary);
}

.admin-info strong {
    display: block;
    font-size: 14px;
}

.admin-info small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-left h1 {
    font-size: 24px;
    color: var(--dark);
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* Content */
.content {
    flex: 1;
    padding: 30px;
}

.footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 20px 30px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Dashboard */
.dashboard-container {
    max-width: 1400px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.card-green .stat-icon { background: var(--success); }
.card-blue .stat-icon { background: var(--info); }
.card-orange .stat-icon { background: var(--warning); }
.card-red .stat-icon { background: var(--danger); }

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

/* Panels */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
}

.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.panel-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-body {
    padding: 25px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell i {
    font-size: 24px;
    color: var(--primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-file_access { background: #e3f2fd; color: #1976d2; }
.badge-website_visit { background: #f3e5f5; color: #7b1fa2; }
.badge-app_usage { background: #fff3e0; color: #f57c00; }
.badge-email { background: #e8f5e9; color: #388e3c; }
.badge-success { background: var(--success); color: white; }
.badge-secondary { background: #9e9e9e; color: white; }
.badge-low { background: #e3f2fd; color: #1976d2; }
.badge-medium { background: #fff3e0; color: #f57c00; }
.badge-high { background: #ffebee; color: #c62828; }
.badge-critical { background: var(--danger); color: white; }
.badge-warning {
    background: #FF9800;
    color: white;
}

.badge-info {
    background: #2196F3;
    color: white;
}

/* Alerts */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.alert-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-item.severity-low {
    background: #e3f2fd;
    border-color: var(--info);
}

.alert-item.severity-medium {
    background: #fff3e0;
    border-color: var(--warning);
}

.alert-item.severity-high {
    background: #ffebee;
    border-color: var(--danger);
}

.alert-item.severity-critical {
    background: #ffcdd2;
    border-color: #b71c1c;
}

.alert-icon {
    font-size: 24px;
}

.alert-content {
    flex: 1;
}

.alert-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.alert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
}

/* Page Container */
.page-container {
    max-width: 1400px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Button Icons */
.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    border-radius: 4px;
}

.btn-icon:hover {
    background: #f0f0f0;
    color: var(--primary);
}

/* Filter Form */
.filter-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.mb-20 {
    margin-bottom: 20px !important;
}

.mt-20 {
    margin-top: 20px !important;
}

select.form-control,
input[type="date"].form-control {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
    }
}
.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    color: var(--danger);
}

.btn-danger:hover {
    background: #ffebee;
}

/* Code blocks */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
}
