:root {
    --primary-color: #1e3a5f;
    --accent-color: #c9a227;
}

body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.has-sidebar {
    overflow-x: hidden;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 3px;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.3;
    text-align: left;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 1rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.92rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    padding: 0 0.5rem;
}

.sidebar-user i {
    font-size: 1.25rem;
}

.sidebar-logout {
    margin-top: 4px;
}

.app-content {
    flex: 1;
    margin-left: 260px;
    min-width: 0;
}

.main-content {
    padding: 1.5rem;
}

.sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1050;
    padding: 0.4rem 0.65rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
}

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

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .app-content {
        margin-left: 0;
        padding-top: 52px;
    }

    .main-content {
        padding: 1rem;
    }
}

.dashboard-top {
    text-align: left;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.dashboard-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 4px;
}

.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

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

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 50%, #1e3a5f 100%);
}

.login-card {
    max-width: 460px;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    background: var(--primary-color);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 2rem;
    text-align: center;
}

.badge-status-active { background-color: #198754; }
.badge-status-completed { background-color: #0d6efd; }
.badge-status-transferred { background-color: #fd7e14; }
.badge-status-discontinued { background-color: #dc3545; }

@media print {
    .no-print { display: none !important; }
    body { background: white; }
    .certificate-page { box-shadow: none !important; margin: 0 !important; }
}
