:root {
    --sidebar-width: 260px;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
}

* { font-family: 'Inter', sans-serif; }

body {
    background: var(--gray-50);
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--dark) 100%) !important;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    overflow-y: auto;
}

#sidebar .nav-link {
    border-radius: 8px;
    margin-bottom: 2px;
    padding: 10px 15px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
}

#sidebar .nav-link.active {
    background: var(--primary);
    font-weight: 500;
}

#page-content-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

/* Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
    height: 100%;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Entity card */
.entity-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 1.25rem;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.entity-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    color: inherit;
}

/* Employee card */
.employee-card {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    padding: 1rem;
    transition: all 0.2s;
}

.employee-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Document category card */
.doc-category-card {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    padding: 1.25rem;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.doc-category-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: var(--primary);
    color: inherit;
}

/* Task card */
.task-row {
    transition: background 0.2s;
}

.task-row:hover {
    background: var(--gray-50) !important;
}

.task-overdue { border-left: 4px solid var(--danger) !important; }
.task-warning { border-left: 4px solid var(--warning) !important; }
.task-ok { border-left: 4px solid var(--success) !important; }

/* Progress circle */
.progress-circle {
    position: relative;
    width: 60px;
    height: 60px;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Mini compliance progress */
.mini-progress {
    width: 50px;
    height: 50px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mini-progress canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.mini-progress .mini-value {
    font-size: 0.65rem;
    font-weight: 700;
    z-index: 1;
}

/* Table */
.table-custom {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.table-custom thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: 0.75rem 1rem;
}

.table-custom tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Breadcrumb */
.custom-breadcrumb {
    background: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

/* Page header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h4 {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Filter bar */
.filter-bar {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--dark) 50%, var(--primary-dark) 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h3 {
    font-weight: 700;
    color: var(--gray-900);
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    #sidebar.toggled {
        margin-left: 0;
    }

    #page-content-wrapper {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* Chart container */
.chart-container {
    position: relative;
    height: 250px;
}

/* File upload area */
.upload-area {
    border: 2px dashed var(--gray-200);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-50);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-area i {
    font-size: 2.5rem;
    color: var(--gray-500);
}

/* Badge styles */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.75em;
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar */
#sidebar::-webkit-scrollbar {
    width: 4px;
}
#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* Print */
@media print {
    #sidebar, .navbar, .btn, .filter-bar { display: none !important; }
    #page-content-wrapper { margin-left: 0 !important; }
}
